diff options
author | dizzy <diosmosis@users.noreply.github.com> | 2022-02-11 03:18:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-11 03:18:49 +0300 |
commit | a2864951ef9042608d2c3c17b5a1a71fcb969aef (patch) | |
tree | 006871a0a97ca5caa0a912c902ba331eea1b4062 /plugins/UsersManager | |
parent | f82326bcad877763b0151df6ccb23a9deaf34494 (diff) |
[Vue] migrate paged users list component to vue (#18582)
* rebuild vue
* now that format_metrics checkbox works, need to check it
* small delay before processing first popover
* fix dropdown class/directive name
* fix overlay test
* remove unintended changes
* remove unintended changes
* migrate archiving controller
* do not do a passthrough transpile of vue typescript, and fix many typescript errors in existing code
* more typescript fixes
* even more fixes
* workarounds to fix recursive typing issues
* get corehome to build w/ full typescript build and output type definitions to local dir
* get outputted typings to be used when compiling other plugins and fix typescript issues in CorePluginsAdmin
* readd corehome umd
* fix typescript errors in ExampleVue plugin
* fix feedback typescript errors
* rebuild
* migrate branding controller and get to build
* fix issues and get to work
* rebuild
* fix notification scroll
* migrate smtp settings controller in coreadminhome
* get to work
* migrate js tracking code generator and get to build
* migrate image tracking code generator and get to build
* get to work in UI
* get UI tests to pass locally
* forgot to add files + rebuild vue
* update screenshots
* Show a summary of new features (#18065)
* Added "What is new" notification display, populated by a new event
* Removed test example event hook
* Added support for applying a link attribute to menu items, fixes layout issue for mobile with html menu items
* Updated UI test screenshots
* Revert accidental edit
* Hide the "What's new" icon if there are no new features to show
* Changed to use changes.json, track user last viewed, added ui test
* Fix UserManager unit tests broken by new ts_changes_viewed user field
* Moved getChanges to separate helper class, added unit test, added user view access check
* Updated to add new changes table and populate only on plugin update/install
* Added missing fixture class, updated UI screenshots
* Updated matomo font to add ringing bell and new releases icons
* Fix for integration test
* Reworked class structure, removed unnecessary angular directive, merged templates, other tidy ups
* built vue files
* built vue files
* Added null user check, missing table exception handling, show plugin name in change title, better handling of missing change fields
* Added sample changes file, moved UserChanges db code to changes model, added return type hints, better db error code handling, various other improvements
* Revert accidental UI screenshot commit
* Fix for incorrect link name parameter in sample changes, switched back to using $db->query for INSERT IGNORE
* Integration test fix, UI screenshot updates
* Test fix
* Added link styling, show CoreHome changes without plugin prefix in title
* Update UI test screenshot
* Added styles to the popover, added event for filtering changes
* Test fix
* UI test screenshot updates
Co-authored-by: sgiehl <stefan@matomo.org>
Co-authored-by: bx80 <bx80@users.noreply.github.com>
* Update test translation (#18531)
update a test failed XML
* updates all submodules (#18541)
Co-authored-by: diosmosis <diosmosis@users.noreply.github.com>
* Translations update from Hosted Weblate (#18529)
* Translated using Weblate (Greek)
Currently translated at 100.0% (162 of 162 strings)
Translation: Matomo/Plugin CoreAdminHome
Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/el/
[ci skip]
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Vasilis Lourdas <dev@lourdas.eu>
* Translated using Weblate (Chinese (Simplified))
Currently translated at 83.9% (136 of 162 strings)
Translation: Matomo/Plugin CoreAdminHome
Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/zh_Hans/
[ci skip]
Translated using Weblate (Chinese (Simplified))
Currently translated at 99.6% (620 of 622 strings)
Translation: Matomo/Matomo Base
Translate-URL: https://hosted.weblate.org/projects/matomo/matomo-base/zh_Hans/
[ci skip]
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: 刘韬 <lyuutau@outlook.com>
* Update translation files
Updated by "Squash Git commits" hook in Weblate.
Translation: Matomo/Plugin CoreAdminHome
Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/
[ci skip]
Co-authored-by: Vasilis Lourdas <dev@lourdas.eu>
Co-authored-by: 刘韬 <lyuutau@outlook.com>
* [Vue] migrate report export directive and popover (#18440)
* update files
* sidenav start
* make getRef a utility method
* tweak
* add return type
* finish converting side-nav directive
* starting on reporting menu conversion
* remove unused properties
* convert reporting pages service
* migrate report metadata store
* remove angularjs files
* migrating reporting pages store
* make store adapters more immutable
* get service adapters to work
* fix a UI test
* another html fix
* migrate most of reporting menu directive and model
* Use themed font family for input forms to override materialize.css styling
* rebuild vue
* add a missing div
* ui test fixes
* update styling
* get to build
* get to load in the UI w/o error
* clone result of functions
* fix compile issue
* migrate widget loader and get to load in UI
* rebuild vue
* migrate widgetcontainer
* migrate widget bydimension container
* migrate widget + add tooltips directive
* quick fix
* Updating version to 4.6.0
* loading in page
* update expected screenshot
* add wait just in case travis is slow
* fix ordering bug
* add another wait
* rebuild vue
* css tweak
* fix some bugs and tests
* undo screenshot changes
* Menus test passing locally
* [Vue] date picker viewDate property is not kept up to date (#18385)
* viewDate ref is not kept up to date
* rebuild corehome
* reporting menu subcategory items are meant to be normal links
* update some screenshots
* use innerText instead of text() since angularjs maintains newlines in HTML that vue does not add
* trigger angularjs digest after ajaxhelper request
* rebuild vue
* update screenshots, fix bug in link generation in reporting menu and allow syncing multiple screenshot regexes at a time
* undo box-shadow change for UI tests
* fix more issues & update more tests
* update some screenshots
* fix some tests
* rebuild CoreHome
* quick fix
* built vue files
* fix angularjs issue
* add comment
* update umd files
* 4.6.1-rc1
* 4.6.1
* fix field array title
* apply some pr feedback
* apply more pr feedback
* another fix
* tweak
* fix ng-change not executed before ng-model
* fix another set of issues
* fix another issue
* rebuild vue
* better ng-change/ng-model fix
* update some screenshots
* rebuild vue
* remove some TODOs
* initiate initial ng-change ONLY for site selectors where this behavior applies
* emit/broadcast on correct scope in wrapper
* rebuild vue
* fix some issues
* couple more fixes
* fix another title issue
* rebuild vue
* do not report on ajax errors in notifications if not logged in
* migrate reporting page and model
* rebuild vue
* create sites selector model adapter
* fix siteselector vue bug, initial site is only set if there is just one site available
* rebuild vue
* migrate plugin settings directive
* remove TODO
* migrate plugin filter directive
* migrate two more plugins directives
* migrate save button
* fix a bunch of bugs
* fix another widget bug
* allow change event name between angularjs and vue
* rebuild vue
* migrate plugin form directive
* get to work
* migrate select-on-focus directive and start migrating report-export directive
* finish migrating report export directive & popover component + create reusable function to create vue app and add globals to it
* rebuild vue
* remove angularjs files and move less contents to vue dir
* built vue files
* fix function signature
* fix vue warning
* fix ajax request race condition
* rebuild vue
* add new notification type "help" so the help notification is not cleared when clearing transient notifications
* fix some bugs and tests
* update screenshot
* update screenshot & fix a test
* allow using unminified jquery ui + fix bug in last fix
* fix error when enrichedheadline is used in modal
* add polyfill min.js
* remove two todos
* fix widget url logic
* update some screenshots and fix sanitization/escape issue
* update screenshots
* rebuild vue
* fix url location updating regression in MatomoUrl.updateLocation use
* submodule
* update screenshots and fix possible error in json parse
* built vue files
* Merge branch 'vue-period-selector-regression' into vue-reporting-menu
* rebuild vue
* use correct variable
* rebuild vue
* fix widget url logic
* segment parameter can be undefined now for some reason
* fix ngmodel binding in siteselector adapter (for last time hopefully)
* the original site selector only set the first site to the first site in the initial sites query if there was only one site in the entire matomo instance
* fix sitesmanager ui test failure
* fix usersettings test failure
* rebuild vue
* more siteselector tweaks.
* build CoreHome
* more siteselector tweaks.
* another siteselector issue
* update screenshots
* update screenshot and try to fix random failure
* fix some issues in widget.vue when containerid is specified
* fix couple tests
* fix several test failures
* fix string concat
* fix test failure
* extra change
* fix last change and random failure
* styling fix
* fix last fix
* real fix this time
* fix stray request
* proper fix
* update build files
* try to fix random failure
* do not submit form
* check for api errors in promise chain in ajaxhelper.ts
* force a digest after a location change
* use proper abortcontroller method instead of promise hack, have to add new polyfill + try to fix random test failure
* some UI test fixes
* fix some report export issues
* several save button fixes + make replace approximation in createAngularJsAdapter better
* apply after manual click triggering in savebutton
* add names to divs so they can still be queried as they were in angularjs
* rebuild vue
* now that format_metrics checkbox works, need to check it
* fix unintended changes
* updated expected screenshots
* update two more
* go back to previous format_metrics behavior in popover
Co-authored-by: Justin Velluppillai <justin@innocraft.com>
Co-authored-by: justinvelluppillai <justinvelluppillai@users.noreply.github.com>
Co-authored-by: Matthieu Aubry <mattab@users.noreply.github.com>
* [Vue] remove support in vue for FormField.allSettings (#18542)
* deprecate support in vue for FormField.allSettings since deep watching the property doesnt quite work
* built vue files
* update screenshots
* update screenshot
* Show a summary of new features (#18065)
* Added "What is new" notification display, populated by a new event
* Removed test example event hook
* Added support for applying a link attribute to menu items, fixes layout issue for mobile with html menu items
* Updated UI test screenshots
* Revert accidental edit
* Hide the "What's new" icon if there are no new features to show
* Changed to use changes.json, track user last viewed, added ui test
* Fix UserManager unit tests broken by new ts_changes_viewed user field
* Moved getChanges to separate helper class, added unit test, added user view access check
* Updated to add new changes table and populate only on plugin update/install
* Added missing fixture class, updated UI screenshots
* Updated matomo font to add ringing bell and new releases icons
* Fix for integration test
* Reworked class structure, removed unnecessary angular directive, merged templates, other tidy ups
* built vue files
* built vue files
* Added null user check, missing table exception handling, show plugin name in change title, better handling of missing change fields
* Added sample changes file, moved UserChanges db code to changes model, added return type hints, better db error code handling, various other improvements
* Revert accidental UI screenshot commit
* Fix for incorrect link name parameter in sample changes, switched back to using $db->query for INSERT IGNORE
* Integration test fix, UI screenshot updates
* Test fix
* Added link styling, show CoreHome changes without plugin prefix in title
* Update UI test screenshot
* Added styles to the popover, added event for filtering changes
* Test fix
* UI test screenshot updates
Co-authored-by: sgiehl <stefan@matomo.org>
Co-authored-by: bx80 <bx80@users.noreply.github.com>
* Update test translation (#18531)
update a test failed XML
* updates all submodules (#18541)
Co-authored-by: diosmosis <diosmosis@users.noreply.github.com>
* Translations update from Hosted Weblate (#18529)
* Translated using Weblate (Greek)
Currently translated at 100.0% (162 of 162 strings)
Translation: Matomo/Plugin CoreAdminHome
Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/el/
[ci skip]
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: Vasilis Lourdas <dev@lourdas.eu>
* Translated using Weblate (Chinese (Simplified))
Currently translated at 83.9% (136 of 162 strings)
Translation: Matomo/Plugin CoreAdminHome
Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/zh_Hans/
[ci skip]
Translated using Weblate (Chinese (Simplified))
Currently translated at 99.6% (620 of 622 strings)
Translation: Matomo/Matomo Base
Translate-URL: https://hosted.weblate.org/projects/matomo/matomo-base/zh_Hans/
[ci skip]
Co-authored-by: Hosted Weblate <hosted@weblate.org>
Co-authored-by: 刘韬 <lyuutau@outlook.com>
* Update translation files
Updated by "Squash Git commits" hook in Weblate.
Translation: Matomo/Plugin CoreAdminHome
Translate-URL: https://hosted.weblate.org/projects/matomo/plugin-coreadminhome/
[ci skip]
Co-authored-by: Vasilis Lourdas <dev@lourdas.eu>
Co-authored-by: 刘韬 <lyuutau@outlook.com>
* [Vue] migrate report export directive and popover (#18440)
* update files
* sidenav start
* make getRef a utility method
* tweak
* add return type
* finish converting side-nav directive
* starting on reporting menu conversion
* remove unused properties
* convert reporting pages service
* migrate report metadata store
* remove angularjs files
* migrating reporting pages store
* make store adapters more immutable
* get service adapters to work
* fix a UI test
* another html fix
* migrate most of reporting menu directive and model
* Use themed font family for input forms to override materialize.css styling
* rebuild vue
* add a missing div
* ui test fixes
* update styling
* get to build
* get to load in the UI w/o error
* clone result of functions
* fix compile issue
* migrate widget loader and get to load in UI
* rebuild vue
* migrate widgetcontainer
* migrate widget bydimension container
* migrate widget + add tooltips directive
* quick fix
* Updating version to 4.6.0
* loading in page
* update expected screenshot
* add wait just in case travis is slow
* fix ordering bug
* add another wait
* rebuild vue
* css tweak
* fix some bugs and tests
* undo screenshot changes
* Menus test passing locally
* [Vue] date picker viewDate property is not kept up to date (#18385)
* viewDate ref is not kept up to date
* rebuild corehome
* reporting menu subcategory items are meant to be normal links
* update some screenshots
* use innerText instead of text() since angularjs maintains newlines in HTML that vue does not add
* trigger angularjs digest after ajaxhelper request
* rebuild vue
* update screenshots, fix bug in link generation in reporting menu and allow syncing multiple screenshot regexes at a time
* undo box-shadow change for UI tests
* fix more issues & update more tests
* update some screenshots
* fix some tests
* rebuild CoreHome
* quick fix
* built vue files
* fix angularjs issue
* add comment
* update umd files
* 4.6.1-rc1
* 4.6.1
* fix field array title
* apply some pr feedback
* apply more pr feedback
* another fix
* tweak
* fix ng-change not executed before ng-model
* fix another set of issues
* fix another issue
* rebuild vue
* better ng-change/ng-model fix
* update some screenshots
* rebuild vue
* remove some TODOs
* initiate initial ng-change ONLY for site selectors where this behavior applies
* emit/broadcast on correct scope in wrapper
* rebuild vue
* fix some issues
* couple more fixes
* fix another title issue
* rebuild vue
* do not report on ajax errors in notifications if not logged in
* migrate reporting page and model
* rebuild vue
* create sites selector model adapter
* fix siteselector vue bug, initial site is only set if there is just one site available
* rebuild vue
* migrate plugin settings directive
* remove TODO
* migrate plugin filter directive
* migrate two more plugins directives
* migrate save button
* fix a bunch of bugs
* fix another widget bug
* allow change event name between angularjs and vue
* rebuild vue
* migrate plugin form directive
* get to work
* migrate select-on-focus directive and start migrating report-export directive
* finish migrating report export directive & popover component + create reusable function to create vue app and add globals to it
* rebuild vue
* remove angularjs files and move less contents to vue dir
* built vue files
* fix function signature
* fix vue warning
* fix ajax request race condition
* rebuild vue
* add new notification type "help" so the help notification is not cleared when clearing transient notifications
* fix some bugs and tests
* update screenshot
* update screenshot & fix a test
* allow using unminified jquery ui + fix bug in last fix
* fix error when enrichedheadline is used in modal
* add polyfill min.js
* remove two todos
* fix widget url logic
* update some screenshots and fix sanitization/escape issue
* update screenshots
* rebuild vue
* fix url location updating regression in MatomoUrl.updateLocation use
* submodule
* update screenshots and fix possible error in json parse
* built vue files
* Merge branch 'vue-period-selector-regression' into vue-reporting-menu
* rebuild vue
* use correct variable
* rebuild vue
* fix widget url logic
* segment parameter can be undefined now for some reason
* fix ngmodel binding in siteselector adapter (for last time hopefully)
* the original site selector only set the first site to the first site in the initial sites query if there was only one site in the entire matomo instance
* fix sitesmanager ui test failure
* fix usersettings test failure
* rebuild vue
* more siteselector tweaks.
* build CoreHome
* more siteselector tweaks.
* another siteselector issue
* update screenshots
* update screenshot and try to fix random failure
* fix some issues in widget.vue when containerid is specified
* fix couple tests
* fix several test failures
* fix string concat
* fix test failure
* extra change
* fix last change and random failure
* styling fix
* fix last fix
* real fix this time
* fix stray request
* proper fix
* update build files
* try to fix random failure
* do not submit form
* check for api errors in promise chain in ajaxhelper.ts
* force a digest after a location change
* use proper abortcontroller method instead of promise hack, have to add new polyfill + try to fix random test failure
* some UI test fixes
* fix some report export issues
* several save button fixes + make replace approximation in createAngularJsAdapter better
* apply after manual click triggering in savebutton
* add names to divs so they can still be queried as they were in angularjs
* rebuild vue
* now that format_metrics checkbox works, need to check it
* fix unintended changes
* updated expected screenshots
* update two more
* go back to previous format_metrics behavior in popover
Co-authored-by: Justin Velluppillai <justin@innocraft.com>
Co-authored-by: justinvelluppillai <justinvelluppillai@users.noreply.github.com>
Co-authored-by: Matthieu Aubry <mattab@users.noreply.github.com>
* [Vue] remove support in vue for FormField.allSettings (#18542)
* deprecate support in vue for FormField.allSettings since deep watching the property doesnt quite work
* built vue files
* update screenshots
* update screenshot
* fix tests
* rebuild
* rebuild
* order plugins by dependencies in vue:build and fix warning in corehome build
* built vue files
* built vue files
* remove unused imports
* built vue files
* remove multilinefield component, fieldtextareaarray does the same thing
* edit-trigger is not used anywhere
* migrate sitetypes model to store
* do not load nonexistant files
* remove reference nonexistant files
* start converting sitefields component
* more work on sitefields component
* undo submodule change
* rebuild
* get sitesmanager to build
* get SiteFields component to work in UI
* datepicker does not format times
* export other stores
* fix some typing issues and rebuild
* start on site management conversion
* add more comma delimited props to list + remove controller JS
* rebuild
* convert sites manager controller to sitesmanagement component
* remove TODOs
* finish migrating sitesmanager
* remove some TODO
* get to build
* fixes from testing
* rebuild
* rebuild and fix issue w/ globalsettings hash detection
* migrate capabilities-edit component.
* some fixes and get to build
* get to work
* built vue files
* get to work and rebuild
* migrate user edit form component
* some fixes
* fixes
* another fix
* more fixes
* update file
* more fixes
* fix ref
* rebuild vue
* couple more fixes
* migrate paged users list and get to build
* fixing issues
* workaround vue issue w/ directives that modify css classes on elements that also bind to :class
* dropdownmenu directive should be aware of data-target parameter that is required by materialize
* handle disabled options in fieldselect
* fix issues and rebuild vue
* fix bug and rebuild
* fix bug and rebuild
* fix issue
* fix issues and rebuild
* fix ui test
* fix UI test failure
* fixing some issues
* complete fixes
* fix some more issues
* fix ui test failures
* another fix
* several more fixes
* fix delete dialog
* more fixes
* fix styling issue
* more fixes
* fix another ui test + update other UI tests
* fixing edisiteid handling
* update screenshots
* fix UI tests somre more
* fix random failure
* fixes
* reference css class not attribute (since that is what is added in vue)
* fixing more ui tests
* try to fix vue css class in directive issue
* tweak
* in groupedsetting handle templateFile property for angularjs BC
* rebuild vue
* fix view tracking code link
* fixing UI tests
* fix selector in test for this branch only
* Update screenshot.
* update screenshot
* update screenshots
* style fix
* fix selectors and update screenshot
* built vue files
* Update screenshot + fix title and spacing.
* fix password changing
* fixing tests
* fix more issues
* fix styling
* built vue files
* more fixes
* more styling fixes
* more fixes
* Fix tests locally.
* disable inputs while confirm user password modal is displayed for autofill browser features/extensions
* update screenshots
* fix test
* update screenshot
Co-authored-by: Ben Burgess <88810029+bx80@users.noreply.github.com>
Co-authored-by: sgiehl <stefan@matomo.org>
Co-authored-by: bx80 <bx80@users.noreply.github.com>
Co-authored-by: Peter Zhang <peter@innocraft.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Weblate (bot) <hosted@weblate.org>
Co-authored-by: Vasilis Lourdas <dev@lourdas.eu>
Co-authored-by: 刘韬 <lyuutau@outlook.com>
Co-authored-by: Justin Velluppillai <justin@innocraft.com>
Co-authored-by: justinvelluppillai <justinvelluppillai@users.noreply.github.com>
Co-authored-by: Matthieu Aubry <mattab@users.noreply.github.com>
Diffstat (limited to 'plugins/UsersManager')
37 files changed, 1651 insertions, 546 deletions
diff --git a/plugins/UsersManager/Controller.php b/plugins/UsersManager/Controller.php index 0b903ee711..c67e9b9e1b 100644 --- a/plugins/UsersManager/Controller.php +++ b/plugins/UsersManager/Controller.php @@ -110,7 +110,7 @@ class Controller extends ControllerAdmin ['key' => 'superuser', 'value' => Piwik::translate('Installation_SuperUser'), 'disabled' => true], ]; $view->filterAccessLevels = [ - ['key' => '', 'value' => Piwik::translate('UsersManager_ShowAll')], + ['key' => '', 'value' => ''], // show all ['key' => 'noaccess', 'value' => Piwik::translate('UsersManager_PrivNone')], ['key' => 'some', 'value' => Piwik::translate('UsersManager_AtLeastView')], ['key' => 'view', 'value' => Piwik::translate('UsersManager_PrivView')], diff --git a/plugins/UsersManager/UsersManager.php b/plugins/UsersManager/UsersManager.php index 9f4d4857d4..bc218a7158 100644 --- a/plugins/UsersManager/UsersManager.php +++ b/plugins/UsersManager/UsersManager.php @@ -129,7 +129,6 @@ class UsersManager extends \Piwik\Plugin public function getJsFiles(&$jsFiles) { $jsFiles[] = "plugins/UsersManager/angularjs/users-manager/users-manager.component.js"; - $jsFiles[] = "plugins/UsersManager/angularjs/paged-users-list/paged-users-list.component.js"; $jsFiles[] = "plugins/UsersManager/angularjs/personal-settings/personal-settings.controller.js"; $jsFiles[] = "plugins/UsersManager/angularjs/personal-settings/anonymous-settings.controller.js"; } @@ -142,7 +141,7 @@ class UsersManager extends \Piwik\Plugin $stylesheets[] = "plugins/UsersManager/stylesheets/usersManager.less"; $stylesheets[] = "plugins/UsersManager/angularjs/users-manager/users-manager.component.less"; - $stylesheets[] = "plugins/UsersManager/angularjs/paged-users-list/paged-users-list.component.less"; + $stylesheets[] = "plugins/UsersManager/vue/src/PagedUsersList/PagedUsersList.less"; $stylesheets[] = "plugins/UsersManager/vue/src/UserEditForm/UserEditForm.less"; $stylesheets[] = "plugins/UsersManager/vue/src/UserPermissionsEdit/UserPermissionsEdit.less"; $stylesheets[] = "plugins/UsersManager/vue/src/CapabilitiesEdit/CapabilitiesEdit.less"; diff --git a/plugins/UsersManager/angularjs/paged-users-list/paged-users-list.component.html b/plugins/UsersManager/angularjs/paged-users-list/paged-users-list.component.html deleted file mode 100644 index 2bfec5deea..0000000000 --- a/plugins/UsersManager/angularjs/paged-users-list/paged-users-list.component.html +++ /dev/null @@ -1,211 +0,0 @@ -<div class="pagedUsersList" ng-class="{loading: $ctrl.isLoadingUsers}"> - <div class="userListFilters row"> - <div class="col s12 m12 l6"> - <div class="input-field col s12 m4 l4"> - <a - class='dropdown-trigger btn bulk-actions' - href='' - data-target='user-list-bulk-actions' - piwik-dropdown-menu - ng-class="{ disabled: $ctrl.isBulkActionsDisabled }" - > - {{:: 'UsersManager_BulkActions'|translate }} - </a> - <ul id='user-list-bulk-actions' class='dropdown-content'> - <li> - <a - class='dropdown-trigger' - data-target="bulk-set-access" - piwik-dropdown-menu - > - {{:: 'UsersManager_SetPermission'|translate }} - </a> - <ul id="bulk-set-access" class="dropdown-content"> - <li ng-repeat="access in $ctrl.bulkActionAccessLevels"> - <a - href="" - ng-click="$ctrl.userToChange = null; $ctrl.roleToChangeTo = access.key; $ctrl.showAccessChangeConfirm();" - > - {{ access.value }} - </a> - </li> - </ul> - </li> - <li> - <a - href="" - ng-click="$ctrl.userToChange = null; $ctrl.roleToChangeTo = 'noaccess'; $ctrl.showAccessChangeConfirm();" - > - {{:: 'UsersManager_RemovePermissions'|translate }} - </a> - </li> - <li ng-if="$ctrl.currentUserRole == 'superuser'"> - <a href="" ng-click="$ctrl.showDeleteConfirm()">{{:: 'UsersManager_DeleteUsers'|translate }}</a> - </li> - </ul> - </div> - <div class="input-field col s12 m4 l4"> - <div - piwik-field - name="user-text-filter" - class="permissions-for-selector" - uicontrol="text" - ng-model="$ctrl.userTextFilter" - ng-model-options="{debounce: 300}" - placeholder="{{:: 'UsersManager_UserSearch'|translate }}" - full-width="true" - ng-change="$ctrl.changeSearch({ filter_search: $ctrl.userTextFilter, offset: 0 })" - ></div> - </div> - <div class="input-field col s12 m4 l4"> - <div - piwik-field - name="access-level-filter" - uicontrol="select" - ng-model="$ctrl.accessLevelFilter" - placeholder="{{:: 'UsersManager_FilterByAccess'|translate }}" - options="$ctrl.filterAccessLevels" - full-width="true" - ng-change="$ctrl.changeSearch({ filter_access: $ctrl.accessLevelFilter, offset: 0 })" - ></div> - </div> - </div> - <div class="input-field col s12 m12 l6 users-list-pagination-container" ng-if="$ctrl.totalEntries > $ctrl.searchParams.limit"> - <div class="usersListPagination"> - <a class="btn prev" ng-class="{ disabled: $ctrl.searchParams.offset <= 0 }" ng-click="$ctrl.gotoPreviousPage()"> - <span class="pointer">« {{:: 'General_Previous'|translate }}</span> - </a> - - <div class="counter"> - <span> - {{ 'General_Pagination'|translate:$ctrl.getPaginationLowerBound():$ctrl.getPaginationUpperBound():$ctrl.totalEntries }} - </span> - <div piwik-activity-indicator ng-if="$ctrl.isLoadingUsers" loading="$ctrl.isLoadingUsers"></div> - </div> - - <a class="btn next" ng-class="{ disabled: $ctrl.searchParams.offset + $ctrl.searchParams.limit >= $ctrl.totalEntries }" ng-click="$ctrl.gotoNextPage()"> - <span class="pointer">{{:: 'General_Next'|translate }} »</span> - </a> - </div> - </div> - </div> - - <div piwik-notification context="info" type="persistent" noclear="true" ng-if="$ctrl.isRoleHelpToggled" class="roles-help-notification"> - <span piwik-translate="UsersManager_RolesHelp"><a href='https://matomo.org/faq/general/faq_70/' target='_blank' rel='noreferrer noopener'>::</a>::<a href='https://matomo.org/faq/general/faq_69/' target='_blank' rel='noreferrer noopener'>::</a></span> - </div> - - <div piwik-content-block> - <table piwik-content-table id="manageUsersTable" ng-class="{ loading: $ctrl.isLoadingUsers }"> - <thead> - <tr> - <th class="select-cell"> - <span class="checkbox-container"> - <label> - <input type="checkbox" id="paged_users_select_all" checked="checked" ng-model="$ctrl.isAllCheckboxSelected" ng-change="$ctrl.onAllCheckboxChange()" /> - <span></span> - </label> - </span> - </th> - <th class='first'>{{:: 'UsersManager_Username'|translate }}</th> - <th class="role_header"> - <span>{{:: 'UsersManager_RoleFor'|translate }}</span> - <a href="" class="helpIcon" ng-click="$ctrl.isRoleHelpToggled = !$ctrl.isRoleHelpToggled" ng-class="{ sticky: $ctrl.isRoleHelpToggled }"> - <span class="icon-help"></span> - </a> - - <div - piwik-field - class="permissions-for-selector" - uicontrol="site" - ng-model="$ctrl.permissionsForSite" - ng-change="$ctrl.changeSearch({ idSite: $ctrl.permissionsForSite.id })" - ui-control-attributes="{ onlySitesWithAdminAccess: $ctrl.currentUserRole !== 'superuser' }" - ></div> - </th> - <th ng-if="$ctrl.currentUserRole == 'superuser'">{{:: 'UsersManager_Email'|translate }}</th> - <th ng-if="$ctrl.currentUserRole == 'superuser'" title="{{'UsersManager_UsesTwoFactorAuthentication'|translate}}">{{:: 'UsersManager_2FA'|translate }}</th> - <th ng-if="$ctrl.currentUserRole == 'superuser'">{{:: 'UsersManager_LastSeen'|translate }}</th> - <th class="actions-cell-header"><div>{{:: 'General_Actions'|translate }}</div></th> - </tr> - </thead> - - <tbody> - <tr class="select-all-row" ng-if="$ctrl.isAllCheckboxSelected && $ctrl.users.length && $ctrl.users.length < $ctrl.totalEntries"> - <td colspan="8"> - <div ng-if="!$ctrl.areAllResultsSelected"> - <span piwik-translate="UsersManager_TheDisplayedUsersAreSelected"><strong>{{ $ctrl.users.length }}</strong></span> - <a class="toggle-select-all-in-search" href="#" ng-click="$ctrl.areAllResultsSelected = !$ctrl.areAllResultsSelected" piwik-translate="UsersManager_ClickToSelectAll"><strong>{{ $ctrl.totalEntries }}</strong></a> - </div> - - <div ng-if="$ctrl.areAllResultsSelected"> - <span piwik-translate="UsersManager_AllUsersAreSelected"><strong>{{ $ctrl.totalEntries }}</strong></span> - <a class="toggle-select-all-in-search" href="#" ng-click="$ctrl.areAllResultsSelected = !$ctrl.areAllResultsSelected" piwik-translate="UsersManager_ClickToSelectDisplayedUsers"><strong>{{ $ctrl.users.length }}</strong></a> - </div> - </td> - </tr> - - <tr ng-repeat="user in $ctrl.users" ng-attr-id="row{{ $index }}"> - <td class="select-cell"> - <span class="checkbox-container"> - <label> - <input type="checkbox" ng-attr-id="paged_users_select_row{{ $index }}" checked="checked" ng-model="$ctrl.selectedRows[$index]" ng-click="$ctrl.onRowSelected()" /> - <span></span> - </label> - </span> - </td> - <td id="userLogin">{{ user.login }}</td> - <td class="access-cell"> - <div - piwik-field - uicontrol="select" - ng-model="user.role" - options="user.login != 'anonymous' ? $ctrl.accessLevels : $ctrl.anonymousAccessLevels" - ng-change="$ctrl.userToChange = user; $ctrl.roleToChangeTo = user.role; $ctrl.previousRole = '{{ user.role }}'; $ctrl.showAccessChangeConfirm();" - data-disabled="user.role == 'superuser'" - ></div> - </td> - <td id="email" ng-if="$ctrl.currentUserRole == 'superuser'">{{ user.email }}</td> - <td id="twofa" ng-if="$ctrl.currentUserRole == 'superuser'"> - <span class="icon-ok" ng-if="user.uses_2fa"></span> - <span class="icon-close" ng-if="!user.uses_2fa"></span> - </td> - <td id="last_seen" ng-if="$ctrl.currentUserRole == 'superuser'"> - {{ user.last_seen ? (user.last_seen + ' ago') : '-' }} - </td> - <td class="center actions-cell"> - <button class="edituser table-action" title="Edit" ng-click="$ctrl.onEditUser({ user: user })" ng-if="user.login != 'anonymous'"> - <span class="icon-edit"></span> - </button> - <button class="deleteuser table-action" title="Delete" ng-click="$ctrl.userToChange = user; $ctrl.showDeleteConfirm()" ng-if="$ctrl.currentUserRole == 'superuser' && user.login != 'anonymous'"> - <span class="icon-delete"></span> - </button> - </td> - </tr> - - </tbody> - </table> - </div> - - <div class="delete-user-confirm-modal modal"> - <div class="modal-content"> - <h3 ng-if="$ctrl.userToChange" piwik-translate="UsersManager_DeleteUserConfirmSingle"><strong>{{ $ctrl.userToChange.login }}</strong></h3> - <p ng-if="!$ctrl.userToChange" piwik-translate="UsersManager_DeleteUserConfirmMultiple"><strong>{{ $ctrl.getAffectedUsersCount() }}</strong></p> - </div> - <div class="modal-footer"> - <a href="" class="modal-action modal-close btn" ng-click="$ctrl.deleteRequestedUsers()">{{:: 'General_Yes'|translate }}</a> - <a href="" class="modal-action modal-close modal-no" ng-click="$ctrl.userToChange = null; $ctrl.roleToChangeTo = null;">{{:: 'General_No'|translate }}</a> - </div> - </div> - - <div class="change-user-role-confirm-modal modal"> - <div class="modal-content"> - <h3 ng-if="$ctrl.userToChange" piwik-translate="UsersManager_DeleteUserPermConfirmSingle"><strong>{{ $ctrl.userToChange.login }}</strong>::<strong>{{ $ctrl.getRoleDisplay($ctrl.roleToChangeTo) }}</strong>::<strong>{{ $ctrl.permissionsForSite.name }}</strong></h3> - <h3 ng-if="$ctrl.userToChange && $ctrl.userToChange.login == 'anonymous' && $ctrl.roleToChangeTo == 'view'"><em>{{ 'General_Note'|translate }}: <span piwik-translate="UsersManager_AnonymousUserRoleChangeWarning">anonymous::{{ $ctrl.getRoleDisplay($ctrl.roleToChangeTo) }}</span></em></h3> - <p ng-if="!$ctrl.userToChange" piwik-translate="UsersManager_DeleteUserPermConfirmMultiple"><strong>{{ $ctrl.getAffectedUsersCount() }}</strong>::<strong>{{ $ctrl.getRoleDisplay($ctrl.roleToChangeTo) }}</strong>::<strong>{{ $ctrl.permissionsForSite.name }}</strong></p> - </div> - <div class="modal-footer"> - <a href="" class="modal-action modal-close btn" ng-click="$ctrl.changeUserRole()">{{:: 'General_Yes'|translate }}</a> - <a href="" class="modal-action modal-close modal-no" ng-click="$ctrl.userToChange.role = $ctrl.previousRole; $ctrl.userToChange = null; $ctrl.roleToChangeTo = null;">{{:: 'General_No'|translate }}</a> - </div> - </div> -</div> diff --git a/plugins/UsersManager/angularjs/paged-users-list/paged-users-list.component.js b/plugins/UsersManager/angularjs/paged-users-list/paged-users-list.component.js deleted file mode 100644 index 2b5ecc7b8b..0000000000 --- a/plugins/UsersManager/angularjs/paged-users-list/paged-users-list.component.js +++ /dev/null @@ -1,226 +0,0 @@ -/*! - * Matomo - free/libre analytics platform - * - * @link https://matomo.org - * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */ - -/** - * Usage: - * <piwik-paged-users-list> - */ -(function () { - angular.module('piwikApp').component('piwikPagedUsersList', { - templateUrl: 'plugins/UsersManager/angularjs/paged-users-list/paged-users-list.component.html?cb=' + piwik.cacheBuster, - bindings: { - onEditUser: '&', - onChangeUserRole: '&', - onDeleteUser: '&', - onSearchChange: '&', - initialSiteId: '<', - initialSiteName: '<', - currentUserRole: '<', - isLoadingUsers: '<', - accessLevels: '<', - filterAccessLevels: '<', - totalEntries: '<', - users: '<', - searchParams: '<' - }, - controller: PagedUsersListController - }); - - PagedUsersListController.$inject = ['$element', '$timeout']; - - function PagedUsersListController($element, $timeout) { - var vm = this; - - // options for selects - vm.bulkActionAccessLevels = null; - - // selection state - vm.areAllResultsSelected = false; - vm.selectedRows = {}; - vm.isAllCheckboxSelected = false; - - // intermediate state - vm.isBulkActionsDisabled = true; - vm.userToChange = null; - vm.roleToChangeTo = null; - vm.previousRole = null; - vm.accessLevelFilter = null; - - // other state - vm.isRoleHelpToggled = false; - - vm.$onInit = $onInit; - vm.$onChanges = $onChanges; - vm.onAllCheckboxChange = onAllCheckboxChange; - vm.changeUserRole = changeUserRole; - vm.onRowSelected = onRowSelected; - vm.deleteRequestedUsers = deleteRequestedUsers; - vm.getPaginationLowerBound = getPaginationLowerBound; - vm.getPaginationUpperBound = getPaginationUpperBound; - vm.showDeleteConfirm = showDeleteConfirm; - vm.getAffectedUsersCount = getAffectedUsersCount; - vm.showAccessChangeConfirm = showAccessChangeConfirm; - vm.getRoleDisplay = getRoleDisplay; - vm.changeSearch = changeSearch; - vm.gotoPreviousPage = gotoPreviousPage; - vm.gotoNextPage = gotoNextPage; - - function changeSearch(changes) { - var newParams = $.extend({}, vm.searchParams, changes); - vm.onSearchChange({ params: newParams }); - } - - function $onInit() { - vm.permissionsForSite = { - id: vm.initialSiteId, - name: vm.initialSiteName - }; - - vm.bulkActionAccessLevels = []; - vm.anonymousAccessLevels = []; - vm.accessLevels.forEach(function (entry) { - if (entry.key !== 'noaccess' && entry.key !== 'superuser') { - vm.bulkActionAccessLevels.push(entry); - } - - if (entry.key === 'noaccess' || entry.key === 'view') { - vm.anonymousAccessLevels.push(entry); - } - }); - } - - function $onChanges(changes) { - if (changes.users) { - clearSelection(); - } - } - - function onAllCheckboxChange() { - if (!vm.isAllCheckboxSelected) { - clearSelection(); - } else { - for (var i = 0; i !== vm.users.length; ++i) { - vm.selectedRows[i] = true; - } - vm.isBulkActionsDisabled = false; - } - } - - function clearSelection() { - vm.selectedRows = {}; - vm.areAllResultsSelected = false; - vm.isBulkActionsDisabled = true; - vm.isAllCheckboxSelected = false; - vm.userToChange = null; - } - - function changeUserRole() { - vm.onChangeUserRole({ - users: getUserOperationSubject(), - role: vm.roleToChangeTo - }); - } - - function deleteRequestedUsers() { - vm.onDeleteUser({ - users: getUserOperationSubject(), - }); - } - - function getUserOperationSubject() { - if (vm.userToChange) { - return [vm.userToChange]; - } else if (vm.areAllResultsSelected) { - return 'all'; - } else { - return getSelectedUsers(); - } - } - - function showAccessChangeConfirm() { - $element.find('.change-user-role-confirm-modal').modal({ dismissible: false }).modal('open'); - } - - function getAffectedUsersCount() { - if (vm.areAllResultsSelected) { - return vm.totalEntries; - } - - return getSelectedCount(); - } - - function onRowSelected() { - // use a timeout since the method is called after the model is updated - $timeout(function () { - var selectedRowKeyCount = getSelectedCount(); - vm.isBulkActionsDisabled = selectedRowKeyCount === 0; - vm.isAllCheckboxSelected = selectedRowKeyCount === vm.users.length; - }); - } - - function getSelectedCount() { - var selectedRowKeyCount = 0; - Object.keys(vm.selectedRows).forEach(function (key) { - if (vm.selectedRows[key]) { - ++selectedRowKeyCount; - } - }); - return selectedRowKeyCount; - } - - function getSelectedUsers() { - var result = []; - Object.keys(vm.selectedRows).forEach(function (index) { - if (vm.selectedRows[index] - && vm.users[index] // sanity check - ) { - result.push(vm.users[index]); - } - }); - return result; - } - - function getPaginationLowerBound() { - return vm.searchParams.offset + 1; - } - - function getPaginationUpperBound() { - return Math.min(vm.searchParams.offset + vm.searchParams.limit, vm.totalEntries); - } - - function showDeleteConfirm() { - $element.find('.delete-user-confirm-modal').modal({ dismissible: false }).modal('open'); - } - - function getRoleDisplay(role) { - var result = null; - vm.accessLevels.forEach(function (entry) { - if (entry.key === role) { - result = entry.value; - } - }); - return result; - } - - function gotoPreviousPage() { - changeSearch({ - offset: Math.max(0, vm.searchParams.offset - vm.searchParams.limit) - }); - } - - function gotoNextPage() { - var newOffset = vm.searchParams.offset + vm.searchParams.limit; - if (newOffset >= vm.totalEntries) { - return; - } - - changeSearch({ - offset: newOffset, - }); - } - } -})(); diff --git a/plugins/UsersManager/tests/UI/UsersManager_spec.js b/plugins/UsersManager/tests/UI/UsersManager_spec.js index 0fd1ff813a..b9f2c51921 100644 --- a/plugins/UsersManager/tests/UI/UsersManager_spec.js +++ b/plugins/UsersManager/tests/UI/UsersManager_spec.js @@ -112,8 +112,13 @@ describe("UsersManager", function () { await page.evaluate(function () { $('select[name=access-level-filter]').val('string:').change(); }); + await page.waitForNetworkIdle(); + + await page.click('th.select-cell input + span'); + await page.waitForTimeout(100); await page.click('.toggle-select-all-in-search'); // reselect all in search + await page.waitForTimeout(100); await page.click('.bulk-actions.btn'); await (await page.jQuery('a[data-target=user-list-bulk-actions]')).hover(); diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_add_user_by_email.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_add_user_by_email.png index 0d7398b3b0..9b7294a945 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_add_user_by_email.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_add_user_by_email.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:afb463e2d4e7c13becb781bf3e6f6f008ed94df157b9cb6f05e689700c01c14c +oid sha256:322e4af33f14372e3cdeee30ff3a894b4d79c31b0e5191a6b44e82b8840c3d1b size 43087 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_add_user_by_login.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_add_user_by_login.png index a25e02b4a6..df66b655bf 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_add_user_by_login.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_add_user_by_login.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8317f94199b6b470c972d733d15d311fd8723af682e823cc5a6ffd2bac80c05d +oid sha256:c29ed387022c7048504661dfb838a51e8c70b68f637bb6dbadc84ed47d7ebfce size 41205 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_edit_permissions.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_edit_permissions.png index 5a134db55c..7bc05d89a9 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_edit_permissions.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_edit_permissions.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3346b885e52e6a1eba7713264051248faaaaf3f3f45d99ed3e1fa73a35128f92 -size 81607 +oid sha256:45276a3124f0556c74ec32874e1280914085d0bcad4044384d4f3754f90294ab +size 81345 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_load.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_load.png index dd85882018..55e399c6cd 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_load.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_admin_view_admin_load.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ef307406aedeeea5fdcc18c3ce79b07f6e1f630f8ac27c06a98906d3f3dc6160 -size 106425 +oid sha256:31fdb55a0a1f1894a8bb5dc898a753ae87a088c07a5ac1232be5be4efe2ecc4a +size 106427 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_deselected.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_deselected.png index cec5889077..c3ac577883 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_deselected.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_deselected.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:79fb7a026f74024f093b45c20fcc1121c7cb012600a6a511f928a6775321b6e1 -size 171992 +oid sha256:2278d11603b945156171671c08900107017b18110e75dba9d860ffc0b402b097 +size 172592 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_in_search.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_in_search.png index 9556fc8208..03cf79dd74 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_in_search.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_in_search.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:921f4d612800aaff3de3c39c51decf7886bcfb3afe6a20358bee596cc8a809cf -size 172594 +oid sha256:dc9eba3d52c65e5174b5c5e7424a8fa638122eb4b81febdfe95686ea27bfa461 +size 172927 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_selected.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_selected.png index cec5889077..c3ac577883 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_selected.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_all_rows_selected.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:79fb7a026f74024f093b45c20fcc1121c7cb012600a6a511f928a6775321b6e1 -size 171992 +oid sha256:2278d11603b945156171671c08900107017b18110e75dba9d860ffc0b402b097 +size 172592 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_remove_access.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_remove_access.png index 9e7a451b6c..d78af25f10 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_remove_access.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_remove_access.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8411f6d8d8583e7a6a4a42dbdade85f9eb3559dfee53e22abfd20b148ae1deb2 -size 163455 +oid sha256:5393553727b39968dd056d0e6ba7715cbc6513ffe5dbd8632a94e8aa3d6c3590 +size 163620 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_set_access.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_set_access.png index 19da631afc..37bc9b966e 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_set_access.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_set_access.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fa7751b49e08e91c3952895c35408775138ba16a60252e15a5c3256b1087433d -size 153913 +oid sha256:dac3868e8f8df0d3d0cb5b0f7d76b66e2e4f28a9acae7eabaa301bda15744152 +size 154089 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_set_access_confirm.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_set_access_confirm.png index 12d610f69d..3f1b3f2a6e 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_set_access_confirm.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_bulk_set_access_confirm.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a304bb1bf2f8986559bf838d0c62fd360e714d1cb7cbb74cc3734423ae768d39 -size 9498 +oid sha256:8dee931a2d45ba3c327b93c438b1fcaf67f57d74bc3f0f6681bd8a600cbb78c5 +size 9506 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_delete_bulk_access.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_delete_bulk_access.png index 413f405e41..939bce6f5a 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_delete_bulk_access.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_delete_bulk_access.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b4dc075ae38524dc9e07ac31dac6bc7410f39568d084ea5b64cfbe9927e10bba -size 147907 +oid sha256:e9398789987b0fb2accb8729c901618c82e1cff64bbccf946f13f252f7dd3203 +size 148014 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_delete_single.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_delete_single.png index ba280e0d26..775bae0e69 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_delete_single.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_delete_single.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ecdcc581fe6bb3cffbb83d4a83a21acdb2a7e7198092fcd3c7a5afd7f7c46ab5 -size 148771 +oid sha256:0a2119e9646b88e13f41b479e8341c61c12ae4bd64331f0068a8d4dd4e06c718 +size 148903 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_filters.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_filters.png index 443380e45c..db83466332 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_filters.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_filters.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:93c9ae24d02a6b27c3924cf13f049c0d62be3c7425ec719c6387c7343cb11476 -size 138309 +oid sha256:5d1cfb48ff28b9bb08963399c912d242d0eea4fc830c43e73fac795cbe580100 +size 138285 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_load.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_load.png index 34a32814bf..4e080ebde2 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_load.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_load.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:27e9811719c41949f6524c3c243e63b2ee145e510e9a533d98d262ccdb4febc3 -size 147510 +oid sha256:cf3bb0ed718e1fa2d96bb303f20109e00926fc0efd3abde6ae92a8c9900d3568 +size 147506 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_manage_users_back.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_manage_users_back.png index 2185559531..dbf02462ec 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_manage_users_back.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_manage_users_back.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8680a76e64b3eae4d621d58a96490d034845e836e30f22543793a85cd4353059 -size 157801 +oid sha256:eac304f75f10c95f33e0d2cbb13d69dd4a47950cc934138a1dc8aed0b52fc65d +size 157331 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_next_click.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_next_click.png index 4837b051fe..cb50c918be 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_next_click.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_next_click.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a2a7d5477c00fd756ca07d14172d6d00203ad80065d2b8062c733b3c8c43221f -size 150908 +oid sha256:8088974fcade2bb0d45aadaef82b4b5ab798dd43cdfa68b9014e995135987387 +size 150930 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_all_rows_in_search.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_all_rows_in_search.png index da6f81d0cd..767c75c058 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_all_rows_in_search.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_all_rows_in_search.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ccdd00490fc3007eba85e4885878c055adbb780e498818738325abda97ab401b -size 93431 +oid sha256:fa17fc97e34dfa07c7d02825908ccd4dc062ca44a6c27f9de238c1b565fd0f26 +size 93232 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_all_sites_access.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_all_sites_access.png index 814cc1bfdf..c2bd904193 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_all_sites_access.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_all_sites_access.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d5dab1176dddeb53bcc1240c1fd0be6b4e5adf346044b54ce9954e0e4c8d1dab -size 100457 +oid sha256:8f06973c0c06d3d7c5c98f43069b1f5eb16050f297497ea70d43b8b91240ad13 +size 100183 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_edit.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_edit.png index 8a5d1d2fff..48ed04626a 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_edit.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_edit.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a22f31407a292e25abd22086b520440e44c4ab49b283a150ac5eae8ef2233d9 -size 82154 +oid sha256:e0819a7a15ce0e39968d48893ddb7e0285067ca88016874a447a766327b0982b +size 81858 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_next.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_next.png index c2328e9c47..29245825ef 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_next.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_next.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:908f27b2e116530f1ef60b305bc9e4417c7f5a0999eff4ec9ba9923cb1fe3e04 -size 92304 +oid sha256:ba25d6950318293dc07b940679a836b4c7f719f895001b39a4c7d2afe2966dac +size 92057 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_remove_single.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_remove_single.png index eec6d9c49d..893d827156 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_remove_single.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_remove_single.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cf8b4d58b4d51af043a6c9e6bd71e58921d22b56e6b35f7e0986452527c5392b -size 90402 +oid sha256:416d9c3c506aa0270bf47af7b24a7335fb6f5f0d379213f206accd843f76f424 +size 90142 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_select_multiple.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_select_multiple.png index d5a3219e39..ff48defef2 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_select_multiple.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_permissions_select_multiple.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:02de73538753bf94f25be31031defbe8a096b3cbd266b28902fab4535bde38aa -size 92435 +oid sha256:66f6b4766e3d5206f516c65b0722066483916f6599fe9f457f2545a639c178e2 +size 92226 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_previous.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_previous.png index 5a189ef796..d052501336 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_previous.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_previous.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:073e23c1f98997a8e793c6cc3201a9d46d763bfb2b20be59d765e4a4b5124486 -size 149097 +oid sha256:608dab4fe7aaed22c53a04d1cd8ea820c93467c6f20c9ee02fb7431d9cebdb16 +size 149252 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_role_for.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_role_for.png index 47db42f78a..a08275b343 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_role_for.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_role_for.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d270dd6294520ba6267790cd6c3e41b08af9fefe4ee39b28fa1410751293fc6a -size 157698 +oid sha256:b060d494bba4aa6347d0982dca9b59ecc5f3dabadd1ed938353df2c20c783bfb +size 157880 diff --git a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_rows_selected.png b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_rows_selected.png index f78c078eb8..4bad5ff0fd 100644 --- a/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_rows_selected.png +++ b/plugins/UsersManager/tests/UI/expected-screenshots/UsersManager_rows_selected.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9a3a1ddc6b15a43f4e03bab30b6dca832f061715d488169cbd5d1589a5838177 -size 159439 +oid sha256:800b9a557adbb50ef3450c65ff1d8ecce0491ed262403088a9c4bc87b2868af7 +size 159630 diff --git a/plugins/UsersManager/vue/dist/UsersManager.umd.js b/plugins/UsersManager/vue/dist/UsersManager.umd.js index 0068cb98a0..8aa9a2b8de 100644 --- a/plugins/UsersManager/vue/dist/UsersManager.umd.js +++ b/plugins/UsersManager/vue/dist/UsersManager.umd.js @@ -128,6 +128,7 @@ __webpack_require__.r(__webpack_exports__); __webpack_require__.d(__webpack_exports__, "CapabilitiesEdit", function() { return /* reexport */ CapabilitiesEdit; }); __webpack_require__.d(__webpack_exports__, "UserPermissionsEdit", function() { return /* reexport */ UserPermissionsEdit; }); __webpack_require__.d(__webpack_exports__, "UserEditForm", function() { return /* reexport */ UserEditForm; }); +__webpack_require__.d(__webpack_exports__, "PagedUsersList", function() { return /* reexport */ PagedUsersList; }); // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/setPublicPath.js // This file is imported into lib/wc client bundles. @@ -1435,102 +1436,102 @@ UserPermissionsEditvue_type_script_lang_ts.render = UserPermissionsEditvue_type_ directiveName: 'piwikUserPermissionsEdit', restrict: 'E' })); -// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue?vue&type=template&id=40878ae4 +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue?vue&type=template&id=3d9513be -var UserEditFormvue_type_template_id_40878ae4_hoisted_1 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_1 = { class: "row" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_2 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_2 = { key: 0, class: "col m2 entityList" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_3 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_3 = { class: "listCircle" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_4 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_4 = { key: 0, class: "icon-warning" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_5 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { +var UserEditFormvue_type_template_id_3d9513be_hoisted_5 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { class: "save-button-spacer hide-on-small-only" }, null, -1); -var UserEditFormvue_type_template_id_40878ae4_hoisted_6 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_6 = { href: "", class: "entityCancelLink" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_7 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_7 = { class: "visibleTab col m10" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_8 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_8 = { key: 0, class: "basic-info-tab" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_9 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_9 = { key: 0, class: "entityCancel" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_10 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_10 = { key: 1, class: "user-permissions" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_11 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_11 = { key: 0 }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_12 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_12 = { key: 1, class: "alert alert-info" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_13 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_13 = { key: 2, class: "superuser-access" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_14 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_14 = { class: "superuser-confirm-modal modal", ref: "superUserConfirmModal" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_15 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_15 = { class: "modal-content" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_16 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_16 = { key: 0 }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_17 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_17 = { key: 1 }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_18 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_18 = { class: "modal-footer" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_19 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_19 = { key: 3, class: "twofa-reset" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_20 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_20 = { class: "resetTwoFa" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_21 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_21 = { class: "twofa-confirm-modal modal", ref: "twofaConfirmModal" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_22 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_22 = { class: "modal-content" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_23 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_23 = { class: "modal-footer" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_24 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_24 = { class: "change-password-modal modal", ref: "changePasswordModal" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_25 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_25 = { class: "modal-content" }; -var UserEditFormvue_type_template_id_40878ae4_hoisted_26 = ["innerHTML"]; -var UserEditFormvue_type_template_id_40878ae4_hoisted_27 = { +var UserEditFormvue_type_template_id_3d9513be_hoisted_26 = ["innerHTML"]; +var UserEditFormvue_type_template_id_3d9513be_hoisted_27 = { class: "modal-footer" }; -function UserEditFormvue_type_template_id_40878ae4_render(_ctx, _cache, $props, $setup, $data, $options) { +function UserEditFormvue_type_template_id_3d9513be_render(_ctx, _cache, $props, $setup, $data, $options) { var _component_Field = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Field"); var _component_SaveButton = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("SaveButton"); @@ -1548,7 +1549,7 @@ function UserEditFormvue_type_template_id_40878ae4_render(_ctx, _cache, $props, "content-title": "".concat(_ctx.formTitle, " ").concat(!_ctx.isAdd ? "'".concat(_ctx.theUser.login, "'") : '') }, { default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { - return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_1, [!_ctx.isAdd ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", UserEditFormvue_type_template_id_40878ae4_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_1, [!_ctx.isAdd ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", UserEditFormvue_type_template_id_3d9513be_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", { class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])([{ active: _ctx.activeTab === 'basic' }, "menuBasicInfo"]) @@ -1569,7 +1570,7 @@ function UserEditFormvue_type_template_id_40878ae4_render(_ctx, _cache, $props, style: { "margin-right": "3.5px" } - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_Permissions')), 1), !_ctx.userHasAccess && !_ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", UserEditFormvue_type_template_id_40878ae4_hoisted_4)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2), _ctx.currentUserRole === 'superuser' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_Permissions')), 1), !_ctx.userHasAccess && !_ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", UserEditFormvue_type_template_id_3d9513be_hoisted_4)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 2), _ctx.currentUserRole === 'superuser' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { key: 0, class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])([{ active: _ctx.activeTab === 'superuser' @@ -1589,12 +1590,12 @@ function UserEditFormvue_type_template_id_40878ae4_render(_ctx, _cache, $props, onClick: _cache[3] || (_cache[3] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { return _ctx.activeTab = '2fa'; }, ["prevent"])) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_TwoFactorAuthentication')), 1)], 2)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), UserEditFormvue_type_template_id_40878ae4_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_TwoFactorAuthentication')), 1)], 2)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), UserEditFormvue_type_template_id_3d9513be_hoisted_5, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", { class: "entityCancel", onClick: _cache[4] || (_cache[4] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { return _ctx.onDoneEditing(); }, ["prevent"])) - }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", UserEditFormvue_type_template_id_40878ae4_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Mobile_NavigationBack')), 1)])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_7, [_ctx.activeTab === 'basic' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", UserEditFormvue_type_template_id_3d9513be_hoisted_6, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('Mobile_NavigationBack')), 1)])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_7, [_ctx.activeTab === 'basic' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { modelValue: _ctx.theUser.login, "onUpdate:modelValue": _cache[5] || (_cache[5] = function ($event) { return _ctx.theUser.login = $event; @@ -1647,13 +1648,13 @@ function UserEditFormvue_type_template_id_40878ae4_render(_ctx, _cache, $props, onConfirm: _cache[9] || (_cache[9] = function ($event) { return _ctx.saveUserInfo(); }) - }, null, 8, ["value", "disabled", "saving"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), _ctx.isAdd ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + }, null, 8, ["value", "disabled", "saving"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), _ctx.isAdd ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { href: "", class: "entityCancelLink", onClick: _cache[10] || (_cache[10] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { return _ctx.onDoneEditing(); }, ["prevent"])) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Cancel')), 1)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.isAdd ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_10, [!_ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_11, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_UserPermissionsEdit, { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Cancel')), 1)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.isAdd ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_10, [!_ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_11, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_UserPermissionsEdit, { "user-login": _ctx.theUser.login, onUserHasAccessDetected: _cache[11] || (_cache[11] = function ($event) { return _ctx.userHasAccess = $event.hasAccess; @@ -1663,7 +1664,7 @@ function UserEditFormvue_type_template_id_40878ae4_render(_ctx, _cache, $props, }), "access-levels": _ctx.accessLevels, "filter-access-levels": _ctx.filterAccessLevels - }, null, 8, ["user-login", "access-levels", "filter-access-levels"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_12, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_SuperUsersPermissionsNotice')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.activeTab === 'permissions']]) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.activeTab === 'superuser' && _ctx.currentUserRole === 'superuser' && !_ctx.isAdd ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_SuperUserIntro1')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("strong", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_SuperUserIntro2')), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + }, null, 8, ["user-login", "access-levels", "filter-access-levels"])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_12, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_SuperUsersPermissionsNotice')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.activeTab === 'permissions']]) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.activeTab === 'superuser' && _ctx.currentUserRole === 'superuser' && !_ctx.isAdd ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_SuperUserIntro1')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("strong", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_SuperUserIntro2')), 1)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { modelValue: _ctx.superUserAccessChecked, "onUpdate:modelValue": _cache[13] || (_cache[13] = function ($event) { return _ctx.superUserAccessChecked = $event; @@ -1675,7 +1676,7 @@ function UserEditFormvue_type_template_id_40878ae4_render(_ctx, _cache, $props, uicontrol: "checkbox", name: "superuser_access", title: _ctx.translate('UsersManager_HasSuperUserAccess') - }, null, 8, ["modelValue", "disabled", "title"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_14, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_15, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_AreYouSure')), 1), _ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", UserEditFormvue_type_template_id_40878ae4_hoisted_16, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_RemoveSuperuserAccessConfirm')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", UserEditFormvue_type_template_id_40878ae4_hoisted_17, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_AddSuperuserAccessConfirm')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + }, null, 8, ["modelValue", "disabled", "title"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_14, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_15, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_AreYouSure')), 1), _ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", UserEditFormvue_type_template_id_3d9513be_hoisted_16, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_RemoveSuperuserAccessConfirm')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.theUser.superuser_access ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", UserEditFormvue_type_template_id_3d9513be_hoisted_17, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_AddSuperuserAccessConfirm')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { modelValue: _ctx.passwordConfirmationForSuperUser, "onUpdate:modelValue": _cache[15] || (_cache[15] = function ($event) { return _ctx.passwordConfirmationForSuperUser = $event; @@ -1685,7 +1686,7 @@ function UserEditFormvue_type_template_id_40878ae4_render(_ctx, _cache, $props, autocomplete: false, "full-width": true, title: _ctx.translate('UsersManager_YourCurrentPassword') - }, null, 8, ["modelValue", "title"])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_18, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + }, null, 8, ["modelValue", "title"])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_18, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { href: "", class: "modal-action modal-close btn", onClick: _cache[16] || (_cache[16] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { @@ -1702,13 +1703,13 @@ function UserEditFormvue_type_template_id_40878ae4_render(_ctx, _cache, $props, _ctx.passwordConfirmationForSuperUser = ''; }, ["prevent"])) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_No')), 1)])], 512)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.currentUserRole === 'superuser' && !_ctx.isAdd ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_19, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ResetTwoFactorAuthenticationInfo')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_20, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_SaveButton, { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_No')), 1)])], 512)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.currentUserRole === 'superuser' && !_ctx.isAdd ? Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])((Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_19, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ResetTwoFactorAuthenticationInfo')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_20, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_SaveButton, { saving: _ctx.isResetting2FA, onConfirm: _cache[18] || (_cache[18] = function ($event) { return _ctx.confirmReset2FA(); }), value: _ctx.translate('UsersManager_ResetTwoFactorAuthentication') - }, null, 8, ["saving", "value"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_21, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_22, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_AreYouSure')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ConfirmWithPassword')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + }, null, 8, ["saving", "value"])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_21, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_22, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_AreYouSure')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ConfirmWithPassword')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { modelValue: _ctx.passwordConfirmation, "onUpdate:modelValue": _cache[19] || (_cache[19] = function ($event) { return _ctx.passwordConfirmation = $event; @@ -1718,7 +1719,7 @@ function UserEditFormvue_type_template_id_40878ae4_render(_ctx, _cache, $props, autocomplete: false, "full-width": true, title: _ctx.translate('UsersManager_YourCurrentPassword') - }, null, 8, ["modelValue", "title"])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_23, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + }, null, 8, ["modelValue", "title"])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_23, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { href: "", class: "modal-action modal-close btn", onClick: _cache[20] || (_cache[20] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { @@ -1734,9 +1735,9 @@ function UserEditFormvue_type_template_id_40878ae4_render(_ctx, _cache, $props, $event.preventDefault(); _ctx.passwordConfirmation = ''; }) - }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_No')), 1)])], 512)], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.activeTab === '2fa']]) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 512), [[_directive_form]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_24, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_25, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", { + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_No')), 1)])], 512)], 512)), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vShow"], _ctx.activeTab === '2fa']]) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 512), [[_directive_form]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_24, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_25, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("h2", { innerHTML: _ctx.changePasswordTitle - }, null, 8, UserEditFormvue_type_template_id_40878ae4_hoisted_26), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ConfirmWithPassword')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + }, null, 8, UserEditFormvue_type_template_id_3d9513be_hoisted_26), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("p", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_ConfirmWithPassword')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { modelValue: _ctx.passwordConfirmation, "onUpdate:modelValue": _cache[22] || (_cache[22] = function ($event) { return _ctx.passwordConfirmation = $event; @@ -1746,7 +1747,7 @@ function UserEditFormvue_type_template_id_40878ae4_render(_ctx, _cache, $props, autocomplete: false, "full-width": true, title: _ctx.translate('UsersManager_YourCurrentPassword') - }, null, 8, ["modelValue", "title"])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_40878ae4_hoisted_27, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + }, null, 8, ["modelValue", "title"])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", UserEditFormvue_type_template_id_3d9513be_hoisted_27, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { href: "", class: "modal-action modal-close btn", onClick: _cache[23] || (_cache[23] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { @@ -1764,7 +1765,7 @@ function UserEditFormvue_type_template_id_40878ae4_render(_ctx, _cache, $props, _: 1 }, 8, ["class", "content-title"]); } -// CONCATENATED MODULE: ./plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue?vue&type=template&id=40878ae4 +// CONCATENATED MODULE: ./plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue?vue&type=template&id=3d9513be // CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue?vue&type=script&lang=ts @@ -1836,6 +1837,14 @@ var UserEditFormvue_type_script_lang_ts_window = window, emits: ['done', 'updated'], watch: { user: function user(newVal) { + this.onUserChange(newVal); + } + }, + created: function created() { + this.onUserChange(this.user); + }, + methods: { + onUserChange: function onUserChange(newVal) { this.theUser = newVal || Object.assign({}, DEFAULT_USER); if (!this.theUser.password) { @@ -1843,9 +1852,7 @@ var UserEditFormvue_type_script_lang_ts_window = window, } this.setSuperUserAccessChecked(); - } - }, - methods: { + }, confirmSuperUserChange: function confirmSuperUserChange() { UserEditFormvue_type_script_lang_ts_$(this.$refs.superUserConfirmModal).modal({ dismissible: false @@ -2030,7 +2037,7 @@ var UserEditFormvue_type_script_lang_ts_window = window, -UserEditFormvue_type_script_lang_ts.render = UserEditFormvue_type_template_id_40878ae4_render +UserEditFormvue_type_script_lang_ts.render = UserEditFormvue_type_template_id_3d9513be_render /* harmony default export */ var UserEditForm = (UserEditFormvue_type_script_lang_ts); // CONCATENATED MODULE: ./plugins/UsersManager/vue/src/UserEditForm/UserEditForm.adapter.ts @@ -2075,6 +2082,777 @@ UserEditFormvue_type_script_lang_ts.render = UserEditFormvue_type_template_id_40 directiveName: 'piwikUserEditForm', restrict: 'E' })); +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-babel/node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/@vue/cli-plugin-babel/node_modules/thread-loader/dist/cjs.js!./node_modules/babel-loader/lib!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/templateLoader.js??ref--6!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/UsersManager/vue/src/PagedUsersList/PagedUsersList.vue?vue&type=template&id=e9714b9a + +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_1 = { + class: "userListFilters row" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_2 = { + class: "col s12 m12 l6" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_3 = { + class: "input-field col s12 m4 l4" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_4 = { + id: "user-list-bulk-actions", + class: "dropdown-content" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_5 = { + class: "dropdown-trigger", + "data-target": "bulk-set-access" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_6 = { + id: "bulk-set-access", + class: "dropdown-content" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_7 = ["onClick"]; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_8 = { + key: 0 +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_9 = { + class: "input-field col s12 m4 l4" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_10 = { + class: "permissions-for-selector" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_11 = { + class: "input-field col s12 m4 l4" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_12 = { + key: 0, + class: "input-field col s12 m12 l6 users-list-pagination-container" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_13 = { + class: "usersListPagination" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_14 = { + class: "pointer" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_15 = { + class: "counter" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_16 = { + key: 0 +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_17 = { + class: "pointer" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_18 = { + key: 0, + class: "roles-help-notification" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_19 = ["innerHTML"]; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_20 = { + class: "select-cell" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_21 = { + class: "checkbox-container" +}; + +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_22 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, null, -1); + +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_23 = { + class: "first" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_24 = { + class: "role_header" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_25 = { + style: { + "margin-right": "3.5px" + } +}; + +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_26 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon-help" +}, null, -1); + +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_27 = [PagedUsersListvue_type_template_id_e9714b9a_hoisted_26]; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_28 = { + key: 0 +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_29 = ["title"]; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_30 = { + key: 2 +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_31 = { + class: "actions-cell-header" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_32 = { + key: 0, + class: "select-all-row" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_33 = { + colspan: "8" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_34 = { + key: 0 +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_35 = ["innerHTML"]; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_36 = ["innerHTML"]; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_37 = { + key: 1 +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_38 = ["innerHTML"]; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_39 = ["innerHTML"]; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_40 = ["id"]; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_41 = { + class: "select-cell" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_42 = { + class: "checkbox-container" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_43 = ["id", "onUpdate:modelValue"]; + +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_44 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", null, null, -1); + +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_45 = { + id: "userLogin" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_46 = { + class: "access-cell" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_47 = { + key: 0, + id: "email" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_48 = { + key: 1, + id: "twofa" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_49 = { + key: 0, + class: "icon-ok" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_50 = { + key: 1, + class: "icon-close" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_51 = { + key: 2, + id: "last_seen" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_52 = { + class: "center actions-cell" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_53 = ["onClick"]; + +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_54 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon-edit" +}, null, -1); + +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_55 = [PagedUsersListvue_type_template_id_e9714b9a_hoisted_54]; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_56 = ["onClick"]; + +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_57 = /*#__PURE__*/Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + class: "icon-delete" +}, null, -1); + +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_58 = [PagedUsersListvue_type_template_id_e9714b9a_hoisted_57]; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_59 = { + class: "delete-user-confirm-modal modal", + ref: "deleteUserConfirmModal" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_60 = { + class: "modal-content" +}; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_61 = ["innerHTML"]; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_62 = ["innerHTML"]; +var PagedUsersListvue_type_template_id_e9714b9a_hoisted_63 = { + class: "modal-footer" +}; +var _hoisted_64 = { + class: "change-user-role-confirm-modal modal", + ref: "changeUserRoleConfirmModal" +}; +var _hoisted_65 = { + class: "modal-content" +}; +var _hoisted_66 = ["innerHTML"]; +var _hoisted_67 = { + key: 1 +}; +var _hoisted_68 = ["innerHTML"]; +var _hoisted_69 = ["innerHTML"]; +var _hoisted_70 = { + class: "modal-footer" +}; +function PagedUsersListvue_type_template_id_e9714b9a_render(_ctx, _cache, $props, $setup, $data, $options) { + var _component_Field = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Field"); + + var _component_ActivityIndicator = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ActivityIndicator"); + + var _component_Notification = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("Notification"); + + var _component_ContentBlock = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveComponent"])("ContentBlock"); + + var _directive_dropdown_menu = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("dropdown-menu"); + + var _directive_content_table = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["resolveDirective"])("content-table"); + + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["pagedUsersList", { + loading: _ctx.isLoadingUsers + }]) + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PagedUsersListvue_type_template_id_e9714b9a_hoisted_1, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PagedUsersListvue_type_template_id_e9714b9a_hoisted_2, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PagedUsersListvue_type_template_id_e9714b9a_hoisted_3, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["dropdown-trigger btn bulk-actions", { + disabled: _ctx.isBulkActionsDisabled + }]), + href: "", + "data-target": "user-list-bulk-actions" + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_BulkActions')), 1)], 2), [[_directive_dropdown_menu]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", PagedUsersListvue_type_template_id_e9714b9a_hoisted_4, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", PagedUsersListvue_type_template_id_e9714b9a_hoisted_5, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_SetPermission')), 1)], 512), [[_directive_dropdown_menu]]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("ul", PagedUsersListvue_type_template_id_e9714b9a_hoisted_6, [(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.bulkActionAccessLevels, function (access) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", { + key: access.key + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + href: "", + onClick: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { + _ctx.userToChange = null; + _ctx.roleToChangeTo = access.key; + + _ctx.showAccessChangeConfirm(); + }, ["prevent"]) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(access.value), 9, PagedUsersListvue_type_template_id_e9714b9a_hoisted_7)]); + }), 128))])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("li", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + href: "", + onClick: _cache[0] || (_cache[0] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { + _ctx.userToChange = null; + _ctx.roleToChangeTo = 'noaccess'; + + _ctx.showAccessChangeConfirm(); + }, ["prevent"])) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_RemovePermissions')), 1)]), _ctx.currentUserRole === 'superuser' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("li", PagedUsersListvue_type_template_id_e9714b9a_hoisted_8, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + href: "", + onClick: _cache[1] || (_cache[1] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { + return _ctx.showDeleteConfirm(); + }, ["prevent"])) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_DeleteUsers')), 1)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PagedUsersListvue_type_template_id_e9714b9a_hoisted_9, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PagedUsersListvue_type_template_id_e9714b9a_hoisted_10, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + "model-value": _ctx.userTextFilter, + "onUpdate:modelValue": _cache[2] || (_cache[2] = function ($event) { + return _ctx.onUserTextFilterChange($event); + }), + name: "user-text-filter", + uicontrol: "text", + "full-width": true, + placeholder: _ctx.translate('UsersManager_UserSearch') + }, null, 8, ["model-value", "placeholder"])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PagedUsersListvue_type_template_id_e9714b9a_hoisted_11, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + "model-value": _ctx.accessLevelFilter, + "onUpdate:modelValue": _cache[3] || (_cache[3] = function ($event) { + _ctx.accessLevelFilter = $event; + + _ctx.changeSearch({ + filter_access: _ctx.accessLevelFilter, + offset: 0 + }); + }), + name: "access-level-filter", + uicontrol: "select", + options: _ctx.filterAccessLevels, + "full-width": true, + placeholder: _ctx.translate('UsersManager_FilterByAccess') + }, null, 8, ["model-value", "options", "placeholder"])])])]), _ctx.totalEntries > _ctx.searchParams.limit ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", PagedUsersListvue_type_template_id_e9714b9a_hoisted_12, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PagedUsersListvue_type_template_id_e9714b9a_hoisted_13, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["btn prev", { + disabled: _ctx.searchParams.offset <= 0 + }]), + onClick: _cache[4] || (_cache[4] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { + return _ctx.gotoPreviousPage(); + }, ["prevent"])) + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", PagedUsersListvue_type_template_id_e9714b9a_hoisted_14, "« " + Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Previous')), 1)], 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PagedUsersListvue_type_template_id_e9714b9a_hoisted_15, [!_ctx.isLoadingUsers ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", PagedUsersListvue_type_template_id_e9714b9a_hoisted_16, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Pagination', _ctx.paginationLowerBound, _ctx.paginationUpperBound, _ctx.totalEntries)), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.isLoadingUsers ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createBlock"])(_component_ActivityIndicator, { + key: 1, + loading: _ctx.isLoadingUsers + }, null, 8, ["loading"])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["btn next", { + disabled: _ctx.searchParams.offset + _ctx.searchParams.limit >= _ctx.totalEntries + }]), + onClick: _cache[5] || (_cache[5] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { + return _ctx.gotoNextPage(); + }, ["prevent"])) + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", PagedUsersListvue_type_template_id_e9714b9a_hoisted_17, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Next')) + " »", 1)], 2)])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), _ctx.isRoleHelpToggled ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", PagedUsersListvue_type_template_id_e9714b9a_hoisted_18, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Notification, { + context: "info", + type: "persistent", + noclear: true + }, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + innerHTML: _ctx.rolesHelpText + }, null, 8, PagedUsersListvue_type_template_id_e9714b9a_hoisted_19)]; + }), + _: 1 + })])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_ContentBlock, null, { + default: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withCtx"])(function () { + return [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("table", { + id: "manageUsersTable", + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])({ + loading: _ctx.isLoadingUsers + }) + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("thead", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tr", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", PagedUsersListvue_type_template_id_e9714b9a_hoisted_20, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", PagedUsersListvue_type_template_id_e9714b9a_hoisted_21, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "checkbox", + id: "paged_users_select_all", + checked: "checked", + "onUpdate:modelValue": _cache[6] || (_cache[6] = function ($event) { + return _ctx.isAllCheckboxSelected = $event; + }), + onChange: _cache[7] || (_cache[7] = function ($event) { + return _ctx.onAllCheckboxChange(); + }) + }, null, 544), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelCheckbox"], _ctx.isAllCheckboxSelected]]), PagedUsersListvue_type_template_id_e9714b9a_hoisted_22])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", PagedUsersListvue_type_template_id_e9714b9a_hoisted_23, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_Username')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", PagedUsersListvue_type_template_id_e9714b9a_hoisted_24, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", PagedUsersListvue_type_template_id_e9714b9a_hoisted_25, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_RoleFor')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + href: "", + class: Object(external_commonjs_vue_commonjs2_vue_root_Vue_["normalizeClass"])(["helpIcon", { + sticky: _ctx.isRoleHelpToggled + }]), + onClick: _cache[8] || (_cache[8] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { + return _ctx.isRoleHelpToggled = !_ctx.isRoleHelpToggled; + }, ["prevent"])) + }, PagedUsersListvue_type_template_id_e9714b9a_hoisted_27, 2), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + class: "permissions-for-selector", + "model-value": _ctx.permissionsForSite, + "onUpdate:modelValue": _cache[9] || (_cache[9] = function ($event) { + _ctx.onPermissionsForUpdate($event); + }), + uicontrol: "site", + "ui-control-attributes": { + onlySitesWithAdminAccess: _ctx.currentUserRole !== 'superuser' + } + }, null, 8, ["model-value", "ui-control-attributes"])])]), _ctx.currentUserRole === 'superuser' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("th", PagedUsersListvue_type_template_id_e9714b9a_hoisted_28, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_Email')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.currentUserRole === 'superuser' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("th", { + key: 1, + title: _ctx.translate('UsersManager_UsesTwoFactorAuthentication') + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_2FA')), 9, PagedUsersListvue_type_template_id_e9714b9a_hoisted_29)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.currentUserRole === 'superuser' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("th", PagedUsersListvue_type_template_id_e9714b9a_hoisted_30, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('UsersManager_LastSeen')), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("th", PagedUsersListvue_type_template_id_e9714b9a_hoisted_31, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Actions')), 1)])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("tbody", null, [_ctx.isAllCheckboxSelected && _ctx.users.length && _ctx.users.length < _ctx.totalEntries ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("tr", PagedUsersListvue_type_template_id_e9714b9a_hoisted_32, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", PagedUsersListvue_type_template_id_e9714b9a_hoisted_33, [!_ctx.areAllResultsSelected ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", PagedUsersListvue_type_template_id_e9714b9a_hoisted_34, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + innerHTML: _ctx.translate('UsersManager_TheDisplayedUsersAreSelected', "<strong>".concat(_ctx.users.length, "</strong>")), + style: { + "margin-right": "3.5px" + } + }, null, 8, PagedUsersListvue_type_template_id_e9714b9a_hoisted_35), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + class: "toggle-select-all-in-search", + href: "#", + onClick: _cache[10] || (_cache[10] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { + return _ctx.areAllResultsSelected = !_ctx.areAllResultsSelected; + }, ["prevent"])), + innerHTML: _ctx.translate('UsersManager_ClickToSelectAll', "<strong>".concat(_ctx.totalEntries, "</strong>")) + }, null, 8, PagedUsersListvue_type_template_id_e9714b9a_hoisted_36)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.areAllResultsSelected ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("div", PagedUsersListvue_type_template_id_e9714b9a_hoisted_37, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + innerHTML: _ctx.translate('UsersManager_AllUsersAreSelected', "<strong>".concat(_ctx.totalEntries, "</strong>")), + style: { + "margin-right": "3.5px" + } + }, null, 8, PagedUsersListvue_type_template_id_e9714b9a_hoisted_38), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + class: "toggle-select-all-in-search", + href: "#", + onClick: _cache[11] || (_cache[11] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { + return _ctx.areAllResultsSelected = !_ctx.areAllResultsSelected; + }, ["prevent"])), + innerHTML: _ctx.translate('UsersManager_ClickToSelectDisplayedUsers', "<strong>".concat(_ctx.users.length, "</strong>")) + }, null, 8, PagedUsersListvue_type_template_id_e9714b9a_hoisted_39)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])(external_commonjs_vue_commonjs2_vue_root_Vue_["Fragment"], null, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["renderList"])(_ctx.users, function (user, index) { + return Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("tr", { + id: "row".concat(index), + key: user.login + }, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", PagedUsersListvue_type_template_id_e9714b9a_hoisted_41, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", PagedUsersListvue_type_template_id_e9714b9a_hoisted_42, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("label", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withDirectives"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("input", { + type: "checkbox", + id: "paged_users_select_row".concat(index), + "onUpdate:modelValue": function onUpdateModelValue($event) { + return _ctx.selectedRows[index] = $event; + }, + onClick: _cache[12] || (_cache[12] = function ($event) { + return _ctx.onRowSelected(); + }) + }, null, 8, PagedUsersListvue_type_template_id_e9714b9a_hoisted_43), [[external_commonjs_vue_commonjs2_vue_root_Vue_["vModelCheckbox"], _ctx.selectedRows[index]]]), PagedUsersListvue_type_template_id_e9714b9a_hoisted_44])])]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", PagedUsersListvue_type_template_id_e9714b9a_hoisted_45, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(user.login), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", PagedUsersListvue_type_template_id_e9714b9a_hoisted_46, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createVNode"])(_component_Field, { + "model-value": user.role, + "onUpdate:modelValue": function onUpdateModelValue($event) { + _ctx.userToChange = user; + _ctx.roleToChangeTo = $event; + + _ctx.showAccessChangeConfirm(); + }, + disabled: user.role === 'superuser', + uicontrol: "select", + options: user.login !== 'anonymous' ? _ctx.accessLevels : _ctx.anonymousAccessLevels + }, null, 8, ["model-value", "onUpdate:modelValue", "disabled", "options"])])]), _ctx.currentUserRole === 'superuser' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("td", PagedUsersListvue_type_template_id_e9714b9a_hoisted_47, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(user.email), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.currentUserRole === 'superuser' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("td", PagedUsersListvue_type_template_id_e9714b9a_hoisted_48, [user.uses_2fa ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", PagedUsersListvue_type_template_id_e9714b9a_hoisted_49)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !user.uses_2fa ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("span", PagedUsersListvue_type_template_id_e9714b9a_hoisted_50)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.currentUserRole === 'superuser' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("td", PagedUsersListvue_type_template_id_e9714b9a_hoisted_51, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(user.last_seen ? "".concat(user.last_seen, " ago") : '-'), 1)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("td", PagedUsersListvue_type_template_id_e9714b9a_hoisted_52, [user.login !== 'anonymous' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("button", { + key: 0, + class: "edituser table-action", + title: "Edit", + onClick: function onClick($event) { + return _ctx.$emit('editUser', { + user: user + }); + } + }, PagedUsersListvue_type_template_id_e9714b9a_hoisted_55, 8, PagedUsersListvue_type_template_id_e9714b9a_hoisted_53)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.currentUserRole === 'superuser' && user.login !== 'anonymous' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("button", { + key: 1, + class: "deleteuser table-action", + title: "Delete", + onClick: function onClick($event) { + _ctx.userToChange = user; + + _ctx.showDeleteConfirm(); + } + }, PagedUsersListvue_type_template_id_e9714b9a_hoisted_58, 8, PagedUsersListvue_type_template_id_e9714b9a_hoisted_56)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)])], 8, PagedUsersListvue_type_template_id_e9714b9a_hoisted_40); + }), 128))])], 2), [[_directive_content_table]])]; + }), + _: 1 + }), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PagedUsersListvue_type_template_id_e9714b9a_hoisted_59, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PagedUsersListvue_type_template_id_e9714b9a_hoisted_60, [_ctx.userToChange ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("h3", { + key: 0, + innerHTML: _ctx.translate('UsersManager_DeleteUserConfirmSingle', "<strong>".concat(_ctx.userToChange.login, "</strong>")) + }, null, 8, PagedUsersListvue_type_template_id_e9714b9a_hoisted_61)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.userToChange ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", { + key: 1, + innerHTML: _ctx.translate('UsersManager_DeleteUserConfirmMultiple', "<strong>".concat(_ctx.affectedUsersCount, "</strong>")) + }, null, 8, PagedUsersListvue_type_template_id_e9714b9a_hoisted_62)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", PagedUsersListvue_type_template_id_e9714b9a_hoisted_63, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + href: "", + class: "modal-action modal-close btn", + onClick: _cache[13] || (_cache[13] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { + return _ctx.deleteRequestedUsers(); + }, ["prevent"])), + style: { + "margin-right": "3.5px" + } + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Yes')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + href: "", + class: "modal-action modal-close modal-no", + onClick: _cache[14] || (_cache[14] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { + _ctx.userToChange = null; + _ctx.roleToChangeTo = null; + }, ["prevent"])) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_No')), 1)])], 512), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_64, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_65, [_ctx.userToChange ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("h3", { + key: 0, + innerHTML: _ctx.$sanitize(_ctx.deleteUserPermConfirmSingleText) + }, null, 8, _hoisted_66)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), _ctx.userToChange && _ctx.userToChange.login === 'anonymous' && _ctx.roleToChangeTo === 'view' ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("h3", _hoisted_67, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("em", null, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createTextVNode"])(Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Note')) + ": ", 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("span", { + innerHTML: _ctx.translate('UsersManager_AnonymousUserRoleChangeWarning', 'anonymous', _ctx.getRoleDisplay(_ctx.roleToChangeTo)) + }, null, 8, _hoisted_68)])])) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true), !_ctx.userToChange ? (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["openBlock"])(), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementBlock"])("p", { + key: 2, + innerHTML: _ctx.deleteUserPermConfirmMultipleText + }, null, 8, _hoisted_69)) : Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createCommentVNode"])("", true)]), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("div", _hoisted_70, [Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + href: "", + class: "modal-action modal-close btn", + onClick: _cache[15] || (_cache[15] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { + return _ctx.changeUserRole(); + }, ["prevent"])), + style: { + "margin-right": "3.5px" + } + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_Yes')), 1), Object(external_commonjs_vue_commonjs2_vue_root_Vue_["createElementVNode"])("a", { + href: "", + class: "modal-action modal-close modal-no", + onClick: _cache[16] || (_cache[16] = Object(external_commonjs_vue_commonjs2_vue_root_Vue_["withModifiers"])(function ($event) { + _ctx.userToChange = null; + _ctx.roleToChangeTo = null; + }, ["prevent"])) + }, Object(external_commonjs_vue_commonjs2_vue_root_Vue_["toDisplayString"])(_ctx.translate('General_No')), 1)])], 512)], 2); +} +// CONCATENATED MODULE: ./plugins/UsersManager/vue/src/PagedUsersList/PagedUsersList.vue?vue&type=template&id=e9714b9a + +// CONCATENATED MODULE: ./node_modules/@vue/cli-plugin-typescript/node_modules/cache-loader/dist/cjs.js??ref--14-0!./node_modules/babel-loader/lib!./node_modules/@vue/cli-plugin-typescript/node_modules/ts-loader??ref--14-2!./node_modules/@vue/cli-service/node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist??ref--0-1!./plugins/UsersManager/vue/src/PagedUsersList/PagedUsersList.vue?vue&type=script&lang=ts + + + +var PagedUsersListvue_type_script_lang_ts_window = window, + PagedUsersListvue_type_script_lang_ts_$ = PagedUsersListvue_type_script_lang_ts_window.$; +/* harmony default export */ var PagedUsersListvue_type_script_lang_ts = (Object(external_commonjs_vue_commonjs2_vue_root_Vue_["defineComponent"])({ + props: { + initialSiteId: { + type: [String, Number], + required: true + }, + initialSiteName: { + type: String, + required: true + }, + currentUserRole: String, + isLoadingUsers: Boolean, + accessLevels: { + type: Array, + required: true + }, + filterAccessLevels: { + type: Array, + required: true + }, + totalEntries: Number, + users: { + type: Array, + required: true + }, + searchParams: { + type: Object, + required: true + } + }, + components: { + Field: external_CorePluginsAdmin_["Field"], + ActivityIndicator: external_CoreHome_["ActivityIndicator"], + Notification: external_CoreHome_["Notification"], + ContentBlock: external_CoreHome_["ContentBlock"] + }, + directives: { + DropdownMenu: external_CoreHome_["DropdownMenu"], + ContentTable: external_CoreHome_["ContentTable"] + }, + data: function data() { + return { + areAllResultsSelected: false, + selectedRows: {}, + isAllCheckboxSelected: false, + isBulkActionsDisabled: true, + userToChange: null, + roleToChangeTo: null, + accessLevelFilter: null, + isRoleHelpToggled: false, + userTextFilter: '', + permissionsForSite: { + id: this.initialSiteId, + name: this.initialSiteName + } + }; + }, + emits: ['editUser', 'changeUserRole', 'deleteUser', 'searchChange'], + created: function created() { + this.onUserTextFilterChange = Object(external_CoreHome_["debounce"])(this.onUserTextFilterChange, 300); + }, + watch: { + users: function users() { + this.clearSelection(); + } + }, + methods: { + onPermissionsForUpdate: function onPermissionsForUpdate(site) { + this.permissionsForSite = site; + this.changeSearch({ + idSite: this.permissionsForSite.id + }); + }, + clearSelection: function clearSelection() { + this.selectedRows = {}; + this.areAllResultsSelected = false; + this.isBulkActionsDisabled = true; + this.isAllCheckboxSelected = false; + this.userToChange = null; + }, + onAllCheckboxChange: function onAllCheckboxChange() { + if (!this.isAllCheckboxSelected) { + this.clearSelection(); + } else { + for (var i = 0; i !== this.users.length; i += 1) { + this.selectedRows[i] = true; + } + + this.isBulkActionsDisabled = false; + } + }, + changeUserRole: function changeUserRole() { + this.$emit('changeUserRole', { + users: this.userOperationSubject, + role: this.roleToChangeTo + }); + }, + onRowSelected: function onRowSelected() { + var _this = this; + + // (angularjs comment): use a timeout since the method is called after the model is updated + setTimeout(function () { + var selectedRowKeyCount = _this.selectedCount; + _this.isBulkActionsDisabled = selectedRowKeyCount === 0; + _this.isAllCheckboxSelected = selectedRowKeyCount === _this.users.length; + }); + }, + deleteRequestedUsers: function deleteRequestedUsers() { + this.$emit('deleteUser', { + users: this.userOperationSubject + }); + }, + showDeleteConfirm: function showDeleteConfirm() { + PagedUsersListvue_type_script_lang_ts_$(this.$refs.deleteUserConfirmModal).modal({ + dismissible: false + }).modal('open'); + }, + showAccessChangeConfirm: function showAccessChangeConfirm() { + PagedUsersListvue_type_script_lang_ts_$(this.$refs.changeUserRoleConfirmModal).modal({ + dismissible: false + }).modal('open'); + }, + getRoleDisplay: function getRoleDisplay(role) { + var result = null; + this.accessLevels.forEach(function (entry) { + if (entry.key === role) { + result = entry.value; + } + }); + return result; + }, + changeSearch: function changeSearch(changes) { + var params = Object.assign(Object.assign({}, this.searchParams), changes); + this.$emit('searchChange', { + params: params + }); + }, + gotoPreviousPage: function gotoPreviousPage() { + this.changeSearch({ + offset: Math.max(0, this.searchParams.offset - this.searchParams.limit) + }); + }, + gotoNextPage: function gotoNextPage() { + var newOffset = this.searchParams.offset + this.searchParams.limit; + + if (newOffset >= this.totalEntries) { + return; + } + + this.changeSearch({ + offset: newOffset + }); + }, + onUserTextFilterChange: function onUserTextFilterChange(filter) { + this.userTextFilter = filter; + this.changeSearch({ + filter_search: filter, + offset: 0 + }); + } + }, + computed: { + paginationLowerBound: function paginationLowerBound() { + return this.searchParams.offset + 1; + }, + paginationUpperBound: function paginationUpperBound() { + if (this.totalEntries === null) { + return '?'; + } + + var searchParams = this.searchParams; + return Math.min(searchParams.offset + searchParams.limit, this.totalEntries); + }, + userOperationSubject: function userOperationSubject() { + if (this.userToChange) { + return [this.userToChange]; + } + + if (this.areAllResultsSelected) { + return 'all'; + } + + return this.selectedUsers; + }, + selectedUsers: function selectedUsers() { + var _this2 = this; + + var users = this.users; + var result = []; + Object.keys(this.selectedRows).forEach(function (index) { + var indexN = parseInt(index, 10); + + if (_this2.selectedRows[index] && users[indexN] // sanity check + ) { + result.push(users[indexN]); + } + }); + return result; + }, + rolesHelpText: function rolesHelpText() { + var faq70 = 'https://matomo.org/faq/general/faq_70/'; + var faq69 = 'https://matomo.org/faq/general/faq_69/'; + return Object(external_CoreHome_["translate"])('UsersManager_RolesHelp', "<a href=\"".concat(faq70, "\" target=\"_blank\" rel=\"noreferrer noopener\">"), '</a>', "<a href=\"".concat(faq69, "\" target=\"_blank\" rel=\"noreferrer noopener\">"), '</a>'); + }, + affectedUsersCount: function affectedUsersCount() { + if (this.areAllResultsSelected) { + return this.totalEntries || 0; + } + + return this.selectedCount; + }, + selectedCount: function selectedCount() { + var _this3 = this; + + var selectedRowKeyCount = 0; + Object.keys(this.selectedRows).forEach(function (key) { + if (_this3.selectedRows[key]) { + selectedRowKeyCount += 1; + } + }); + return selectedRowKeyCount; + }, + deleteUserPermConfirmSingleText: function deleteUserPermConfirmSingleText() { + var _this$userToChange, _this$permissionsForS; + + return Object(external_CoreHome_["translate"])('UsersManager_DeleteUserPermConfirmSingle', "<strong>".concat(((_this$userToChange = this.userToChange) === null || _this$userToChange === void 0 ? void 0 : _this$userToChange.login) || '', "</strong>"), "<strong>".concat(this.getRoleDisplay(this.roleToChangeTo), "</strong>"), "<strong>".concat(((_this$permissionsForS = this.permissionsForSite) === null || _this$permissionsForS === void 0 ? void 0 : _this$permissionsForS.name) || '', "</strong>")); + }, + deleteUserPermConfirmMultipleText: function deleteUserPermConfirmMultipleText() { + var _this$permissionsForS2; + + return Object(external_CoreHome_["translate"])('UsersManager_DeleteUserPermConfirmMultiple', "<strong>".concat(this.affectedUsersCount, "</strong>"), "<strong>".concat(this.getRoleDisplay(this.roleToChangeTo), "</strong>"), "<strong>".concat(((_this$permissionsForS2 = this.permissionsForSite) === null || _this$permissionsForS2 === void 0 ? void 0 : _this$permissionsForS2.name) || '', "</strong>")); + }, + bulkActionAccessLevels: function bulkActionAccessLevels() { + return this.accessLevels.filter(function (e) { + return e.key !== 'noaccess' && e.key !== 'superuser'; + }); + }, + anonymousAccessLevels: function anonymousAccessLevels() { + return this.accessLevels.filter(function (e) { + return e.key === 'noaccess' || e.key === 'view'; + }); + } + } +})); +// CONCATENATED MODULE: ./plugins/UsersManager/vue/src/PagedUsersList/PagedUsersList.vue?vue&type=script&lang=ts + +// CONCATENATED MODULE: ./plugins/UsersManager/vue/src/PagedUsersList/PagedUsersList.vue + + + +PagedUsersListvue_type_script_lang_ts.render = PagedUsersListvue_type_template_id_e9714b9a_render + +/* harmony default export */ var PagedUsersList = (PagedUsersListvue_type_script_lang_ts); +// CONCATENATED MODULE: ./plugins/UsersManager/vue/src/PagedUsersList/PagedUsersList.adapter.ts +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + + +/* harmony default export */ var PagedUsersList_adapter = (Object(external_CoreHome_["createAngularJsAdapter"])({ + component: PagedUsersList, + scope: { + onEditUser: { + angularJsBind: '&', + vue: 'editUser' + }, + onChangeUserRole: { + angularJsBind: '&', + vue: 'changeUserRole' + }, + onDeleteUser: { + angularJsBind: '&', + vue: 'deleteUser' + }, + onSearchChange: { + angularJsBind: '&', + vue: 'searchChange' + }, + initialSiteId: { + angularJsBind: '<' + }, + initialSiteName: { + angularJsBind: '<' + }, + currentUserRole: { + angularJsBind: '<' + }, + isLoadingUsers: { + angularJsBind: '<' + }, + accessLevels: { + angularJsBind: '<' + }, + filterAccessLevels: { + angularJsBind: '<' + }, + totalEntries: { + angularJsBind: '<' + }, + users: { + angularJsBind: '<' + }, + searchParams: { + angularJsBind: '<' + } + }, + directiveName: 'piwikPagedUsersList', + restrict: 'E' +})); // CONCATENATED MODULE: ./plugins/UsersManager/vue/src/index.ts /*! * Matomo - free/libre analytics platform @@ -2088,6 +2866,8 @@ UserEditFormvue_type_script_lang_ts.render = UserEditFormvue_type_template_id_40 + + // CONCATENATED MODULE: ./node_modules/@vue/cli-service/lib/commands/build/entry-lib-no-default.js diff --git a/plugins/UsersManager/vue/dist/UsersManager.umd.min.js b/plugins/UsersManager/vue/dist/UsersManager.umd.min.js index b82517440a..91311400f7 100644 --- a/plugins/UsersManager/vue/dist/UsersManager.umd.min.js +++ b/plugins/UsersManager/vue/dist/UsersManager.umd.min.js @@ -1,26 +1,32 @@ -(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["UsersManager"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["UsersManager"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,s){return function(e){var t={};function s(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,s),i.l=!0,i.exports}return s.m=e,s.c=t,s.d=function(e,t,n){s.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},s.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},s.t=function(e,t){if(1&t&&(e=s(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(s.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)s.d(n,i,function(t){return e[t]}.bind(null,i));return n},s.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return s.d(t,"a",t),t},s.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},s.p="plugins/UsersManager/vue/dist/",s(s.s="fae3")}({"19dc":function(t,s){t.exports=e},"8bbf":function(e,s){e.exports=t},a5a2:function(e,t){e.exports=s},fae3:function(e,t,s){"use strict";if(s.r(t),s.d(t,"CapabilitiesEdit",(function(){return V})),s.d(t,"UserPermissionsEdit",(function(){return He})),s.d(t,"UserEditForm",(function(){return jt})),"undefined"!==typeof window){var n=window.document.currentScript,i=n&&n.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(s.p=i[1])}var a=s("19dc"),r=s("8bbf"),o=["title"],c=["onClick"],l={key:0,class:"addCapability"},d={class:"ui-confirm confirmCapabilityToggle modal",ref:"confirmCapabilityToggleModal"},u={class:"modal-content"},m=["innerHTML"],b=["innerHTML"],p={class:"modal-footer"};function f(e,t,s,n,i,a){var f=Object(r["resolveComponent"])("Field");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{class:Object(r["normalizeClass"])(["capabilitiesEdit",{busy:e.isBusy}])},[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.actualCapabilities,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{key:t.id,class:"chip"},[Object(r["createElementVNode"])("span",{class:"capability-name",title:"".concat(t.description," ").concat(e.isIncludedInRole(t)?"<br/><br/>".concat(e.translate("UsersManager_IncludedInUsersRole")):"")},Object(r["toDisplayString"])(t.category)+": "+Object(r["toDisplayString"])(t.name),9,o),e.isIncludedInRole(t)?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",{key:0,class:"icon-close",onClick:function(s){e.capabilityToRemoveId=t.id,e.onToggleCapability(!1)}},null,8,c))])})),128)),e.availableCapabilitiesGrouped.length?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",l,[Object(r["createVNode"])(f,{"model-value":e.capabilityToAddId,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.capabilityToAddId=t,e.onToggleCapability(!0)}),disabled:e.isBusy,uicontrol:"expandable-select",name:"add_capability","full-width":!0,options:e.availableCapabilitiesGrouped},null,8,["model-value","disabled","options"])])):Object(r["createCommentVNode"])("",!0),Object(r["createElementVNode"])("div",d,[Object(r["createElementVNode"])("div",u,[e.isAddingCapability?(Object(r["openBlock"])(),Object(r["createElementBlock"])("h2",{key:0,innerHTML:e.$sanitize(e.confirmAddCapabilityToggleContent)},null,8,m)):Object(r["createCommentVNode"])("",!0),e.isAddingCapability?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("h2",{key:1,innerHTML:e.$sanitize(e.confirmCapabilityToggleContent)},null,8,b))]),Object(r["createElementVNode"])("div",p,[Object(r["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[1]||(t[1]=Object(r["withModifiers"])((function(t){return e.toggleCapability()}),["prevent"]))},Object(r["toDisplayString"])(e.translate("General_Yes")),1),Object(r["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[2]||(t[2]=Object(r["withModifiers"])((function(t){e.capabilityToAddOrRemove=null,e.capabilityToAddId=null,e.capabilityToRemoveId=null}),["prevent"]))},Object(r["toDisplayString"])(e.translate("General_No")),1)])],512)],2)}var h=s("a5a2");function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){for(var s=0;s<t.length;s++){var n=t[s];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function j(e,t,s){return t&&O(e.prototype,t),s&&O(e,s),e}function v(e,t,s){return t in e?Object.defineProperty(e,t,{value:s,enumerable:!0,configurable:!0,writable:!0}):e[t]=s,e} +(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):"function"===typeof define&&define.amd?define(["CoreHome",,"CorePluginsAdmin"],t):"object"===typeof exports?exports["UsersManager"]=t(require("CoreHome"),require("vue"),require("CorePluginsAdmin")):e["UsersManager"]=t(e["CoreHome"],e["Vue"],e["CorePluginsAdmin"])})("undefined"!==typeof self?self:this,(function(e,t,n){return function(e){var t={};function n(s){if(t[s])return t[s].exports;var i=t[s]={i:s,l:!1,exports:{}};return e[s].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,s){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:s})},n.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"===typeof e&&e&&e.__esModule)return e;var s=Object.create(null);if(n.r(s),Object.defineProperty(s,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(s,i,function(t){return e[t]}.bind(null,i));return s},n.n=function(e){var t=e&&e.__esModule?function(){return e["default"]}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="plugins/UsersManager/vue/dist/",n(n.s="fae3")}({"19dc":function(t,n){t.exports=e},"8bbf":function(e,n){e.exports=t},a5a2:function(e,t){e.exports=n},fae3:function(e,t,n){"use strict";if(n.r(t),n.d(t,"CapabilitiesEdit",(function(){return E})),n.d(t,"UserPermissionsEdit",(function(){return He})),n.d(t,"UserEditForm",(function(){return jt})),n.d(t,"PagedUsersList",(function(){return Fn})),"undefined"!==typeof window){var s=window.document.currentScript,i=s&&s.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);i&&(n.p=i[1])}var r=n("19dc"),o=n("8bbf"),a=["title"],c=["onClick"],l={key:0,class:"addCapability"},d={class:"ui-confirm confirmCapabilityToggle modal",ref:"confirmCapabilityToggleModal"},u={class:"modal-content"},m=["innerHTML"],b=["innerHTML"],p={class:"modal-footer"};function h(e,t,n,s,i,r){var h=Object(o["resolveComponent"])("Field");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])(["capabilitiesEdit",{busy:e.isBusy}])},[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.actualCapabilities,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{key:t.id,class:"chip"},[Object(o["createElementVNode"])("span",{class:"capability-name",title:"".concat(t.description," ").concat(e.isIncludedInRole(t)?"<br/><br/>".concat(e.translate("UsersManager_IncludedInUsersRole")):"")},Object(o["toDisplayString"])(t.category)+": "+Object(o["toDisplayString"])(t.name),9,a),e.isIncludedInRole(t)?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",{key:0,class:"icon-close",onClick:function(n){e.capabilityToRemoveId=t.id,e.onToggleCapability(!1)}},null,8,c))])})),128)),e.availableCapabilitiesGrouped.length?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",l,[Object(o["createVNode"])(h,{"model-value":e.capabilityToAddId,"onUpdate:modelValue":t[0]||(t[0]=function(t){e.capabilityToAddId=t,e.onToggleCapability(!0)}),disabled:e.isBusy,uicontrol:"expandable-select",name:"add_capability","full-width":!0,options:e.availableCapabilitiesGrouped},null,8,["model-value","disabled","options"])])):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("div",d,[Object(o["createElementVNode"])("div",u,[e.isAddingCapability?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",{key:0,innerHTML:e.$sanitize(e.confirmAddCapabilityToggleContent)},null,8,m)):Object(o["createCommentVNode"])("",!0),e.isAddingCapability?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("h2",{key:1,innerHTML:e.$sanitize(e.confirmCapabilityToggleContent)},null,8,b))]),Object(o["createElementVNode"])("div",p,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[1]||(t[1]=Object(o["withModifiers"])((function(t){return e.toggleCapability()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[2]||(t[2]=Object(o["withModifiers"])((function(t){e.capabilityToAddOrRemove=null,e.capabilityToAddId=null,e.capabilityToRemoveId=null}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512)],2)}var f=n("a5a2");function g(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function O(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function j(e,t,n){return t&&O(e.prototype,t),n&&O(e,n),e}function v(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e} /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */var C=function(){function e(){var t=this;g(this,e),v(this,"privateState",Object(r["reactive"])({isLoading:!1,capabilities:[]})),v(this,"state",Object(r["computed"])((function(){return Object(r["readonly"])(t.privateState)}))),v(this,"capabilities",Object(r["computed"])((function(){return t.state.value.capabilities}))),v(this,"isLoading",Object(r["computed"])((function(){return t.state.value.isLoading}))),v(this,"fetchPromise",void 0),this.fetchCapabilities()}return j(e,[{key:"fetchCapabilities",value:function(){var e=this;return this.fetchPromise||(this.privateState.isLoading=!0,this.fetchPromise=a["AjaxHelper"].fetch({method:"UsersManager.getAvailableCapabilities"}).then((function(t){return e.privateState.capabilities=t,e.capabilities.value})).finally((function(){e.privateState.isLoading=!1}))),this.fetchPromise}}]),e}(),A=Object(a["lazyInitSingleton"])(C),y=window,S=y.$,N=Object(r["defineComponent"])({props:{idsite:[String,Number],siteName:{type:String,required:!0},userLogin:{type:String,required:!0},userRole:{type:String,required:!0},capabilities:Array},components:{Field:h["Field"]},data:function(){return{theCapabilities:this.capabilities||[],isBusy:!1,isAddingCapability:!1,capabilityToAddId:null,capabilityToRemoveId:null,capabilityToAddOrRemove:null}},emits:["change"],watch:{capabilities:function(e){e&&(this.theCapabilities=e)}},created:function(){var e=this;this.capabilities?this.theCapabilities=this.capabilities:(this.isBusy=!0,a["AjaxHelper"].fetch({method:"UsersManager.getUsersPlusRole",limit:"1",filter_search:this.userLogin}).then((function(e){return e&&e.capabilities?e.capabilities:[]})).then((function(t){e.theCapabilities=t})).finally((function(){e.isBusy=!1})))},methods:{onToggleCapability:function(e){var t=this;this.isAddingCapability=e;var s=e?this.capabilityToAddId:this.capabilityToRemoveId;this.capabilityToAddOrRemove=null,this.availableCapabilities.forEach((function(e){e.id===s&&(t.capabilityToAddOrRemove=e)})),this.$refs.confirmCapabilityToggleModal&&S(this.$refs.confirmCapabilityToggleModal).modal({dismissible:!1,yes:function(){return null}}).modal("open")},toggleCapability:function(){this.isAddingCapability?this.addCapability(this.capabilityToAddOrRemove):this.removeCapability(this.capabilityToAddOrRemove)},isIncludedInRole:function(e){return-1!==(e.includedInRoles||[]).indexOf(this.userRole)},getCapabilitiesList:function(){var e=this,t=[];return this.availableCapabilities.forEach((function(s){e.isIncludedInRole(s)||e.capabilitiesSet[s.id]&&t.push(s.id)})),t},addCapability:function(e){var t=this;this.isBusy=!0,a["AjaxHelper"].post({method:"UsersManager.addCapabilities"},{userLogin:this.userLogin,capabilities:e.id,idSites:this.idsite}).then((function(){t.$emit("change",t.getCapabilitiesList())})).finally((function(){t.isBusy=!1,t.capabilityToAddOrRemove=null,t.capabilityToAddId=null,t.capabilityToRemoveId=null}))},removeCapability:function(e){var t=this;this.isBusy=!0,a["AjaxHelper"].post({method:"UsersManager.removeCapabilities"},{userLogin:this.userLogin,capabilities:e.id,idSites:this.idsite}).then((function(){t.$emit("change",t.getCapabilitiesList())})).finally((function(){t.isBusy=!1,t.capabilityToAddOrRemove=null,t.capabilityToAddId=null,t.capabilityToRemoveId=null}))}},computed:{availableCapabilities:function(){return A.capabilities.value},confirmAddCapabilityToggleContent:function(){return Object(a["translate"])("UsersManager_AreYouSureAddCapability","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.capabilityToAddOrRemove?this.capabilityToAddOrRemove.name:"","</strong>"),"<strong>".concat(this.siteNameText,"</strong>"))},confirmCapabilityToggleContent:function(){return Object(a["translate"])("UsersManager_AreYouSureRemoveCapability","<strong>".concat(this.capabilityToAddOrRemove?this.capabilityToAddOrRemove.name:"","</strong>"),"<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.siteNameText,"</strong>"))},siteNameText:function(){return a["Matomo"].helper.htmlEntities(this.siteName)},availableCapabilitiesGrouped:function(){var e=this,t=this.availableCapabilities.filter((function(t){return!e.capabilitiesSet[t.id]})).map((function(e){return{group:e.category,key:e.id,value:e.name,tooltip:e.description}}));return t.sort((function(e,t){return e.group===t.group?e.value===t.value?0:e.value<t.value?-1:1:e.group<t.group?-1:1})),t},capabilitiesSet:function(){var e=this,t={},s=this.theCapabilities;return(s||[]).forEach((function(e){t[e]=!0})),(this.availableCapabilities||[]).forEach((function(s){e.isIncludedInRole(s)&&(t[s.id]=!0)})),t},actualCapabilities:function(){var e=this.capabilitiesSet;return this.availableCapabilities.filter((function(t){return!!e[t.id]}))}}});N.render=f;var V=N,E=(Object(a["createAngularJsAdapter"])({component:V,scope:{idsite:{angularJsBind:"<"},siteName:{angularJsBind:"<"},userLogin:{angularJsBind:"<"},userRole:{angularJsBind:"<"},capabilities:{angularJsBind:"<"},onCapabilitiesChange:{angularJsBind:"&",vue:"change"}},directiveName:"piwikCapabilitiesEdit",restrict:"E",$inject:["$timeout"],events:{change:function(e,t,s,n,i,a,r){r((function(){s.onCapabilitiesChange&&s.onCapabilitiesChange.call({capabilities:e})}))}}}),{key:0,class:"row"}),k={class:"row to-all-websites"},U={class:"col s12"},w={style:{"margin-right":"3.5px"}},T={id:"all-sites-access-select",style:{"margin-right":"3.5px"}},M=Object(r["createElementVNode"])("p",null," ",-1),B={class:"filters row"},_={class:"col s12 m12 l8"},L={class:"input-field bulk-actions",style:{"margin-right":"3.5px"}},x={id:"user-permissions-edit-bulk-actions",class:"dropdown-content"},R={class:"dropdown-trigger","data-target":"user-permissions-bulk-set-access"},D={id:"user-permissions-bulk-set-access",class:"dropdown-content"},P=["onClick"],H={class:"input-field site-filter",style:{"margin-right":"3.5px"}},F=["value","placeholder"],I={class:"input-field access-filter",style:{"margin-right":"3.5px"}},G={key:0,class:"col s12 m12 l4 sites-for-permission-pagination-container"},$={class:"sites-for-permission-pagination"},z={class:"counter"},J=["textContent"],W={class:"roles-help-notification"},q=["innerHTML"],Y={class:"capabilities-help-notification"},X={id:"sitesForPermission"},K={class:"select-cell"},Q={class:"checkbox-container"},Z=["checked"],ee=Object(r["createElementVNode"])("span",null,null,-1),te={class:"role_header"},se=["innerHTML"],ne=Object(r["createElementVNode"])("span",{class:"icon-help"},null,-1),ie=[ne],ae={class:"capabilities_header"},re=["innerHTML"],oe=Object(r["createElementVNode"])("span",{class:"icon-help"},null,-1),ce=[oe],le={key:0,class:"select-all-row"},de={colspan:"4"},ue={key:0},me=["innerHTML"],be=["innerHTML"],pe={key:1},fe=["innerHTML"],he=["innerHTML"],ge={class:"select-cell"},Oe={class:"checkbox-container"},je=["id","onUpdate:modelValue"],ve=Object(r["createElementVNode"])("span",null,null,-1),Ce={class:"role-select"},Ae={class:"delete-access-confirm-modal modal",ref:"deleteAccessConfirmModal"},ye={class:"modal-content"},Se=["innerHTML"],Ne=["innerHTML"],Ve={class:"modal-footer"},Ee={class:"change-access-confirm-modal modal",ref:"changeAccessConfirmModal"},ke={class:"modal-content"},Ue=["innerHTML"],we=["innerHTML"],Te={class:"modal-footer"},Me={class:"confirm-give-access-all-sites modal",ref:"confirmGiveAccessAllSitesModal"},Be={class:"modal-content"},_e=["innerHTML"],Le={class:"modal-footer"}; + */var C=function(){function e(){var t=this;g(this,e),v(this,"privateState",Object(o["reactive"])({isLoading:!1,capabilities:[]})),v(this,"state",Object(o["computed"])((function(){return Object(o["readonly"])(t.privateState)}))),v(this,"capabilities",Object(o["computed"])((function(){return t.state.value.capabilities}))),v(this,"isLoading",Object(o["computed"])((function(){return t.state.value.isLoading}))),v(this,"fetchPromise",void 0),this.fetchCapabilities()}return j(e,[{key:"fetchCapabilities",value:function(){var e=this;return this.fetchPromise||(this.privateState.isLoading=!0,this.fetchPromise=r["AjaxHelper"].fetch({method:"UsersManager.getAvailableCapabilities"}).then((function(t){return e.privateState.capabilities=t,e.capabilities.value})).finally((function(){e.privateState.isLoading=!1}))),this.fetchPromise}}]),e}(),k=Object(r["lazyInitSingleton"])(C),N=window,y=N.$,A=Object(o["defineComponent"])({props:{idsite:[String,Number],siteName:{type:String,required:!0},userLogin:{type:String,required:!0},userRole:{type:String,required:!0},capabilities:Array},components:{Field:f["Field"]},data:function(){return{theCapabilities:this.capabilities||[],isBusy:!1,isAddingCapability:!1,capabilityToAddId:null,capabilityToRemoveId:null,capabilityToAddOrRemove:null}},emits:["change"],watch:{capabilities:function(e){e&&(this.theCapabilities=e)}},created:function(){var e=this;this.capabilities?this.theCapabilities=this.capabilities:(this.isBusy=!0,r["AjaxHelper"].fetch({method:"UsersManager.getUsersPlusRole",limit:"1",filter_search:this.userLogin}).then((function(e){return e&&e.capabilities?e.capabilities:[]})).then((function(t){e.theCapabilities=t})).finally((function(){e.isBusy=!1})))},methods:{onToggleCapability:function(e){var t=this;this.isAddingCapability=e;var n=e?this.capabilityToAddId:this.capabilityToRemoveId;this.capabilityToAddOrRemove=null,this.availableCapabilities.forEach((function(e){e.id===n&&(t.capabilityToAddOrRemove=e)})),this.$refs.confirmCapabilityToggleModal&&y(this.$refs.confirmCapabilityToggleModal).modal({dismissible:!1,yes:function(){return null}}).modal("open")},toggleCapability:function(){this.isAddingCapability?this.addCapability(this.capabilityToAddOrRemove):this.removeCapability(this.capabilityToAddOrRemove)},isIncludedInRole:function(e){return-1!==(e.includedInRoles||[]).indexOf(this.userRole)},getCapabilitiesList:function(){var e=this,t=[];return this.availableCapabilities.forEach((function(n){e.isIncludedInRole(n)||e.capabilitiesSet[n.id]&&t.push(n.id)})),t},addCapability:function(e){var t=this;this.isBusy=!0,r["AjaxHelper"].post({method:"UsersManager.addCapabilities"},{userLogin:this.userLogin,capabilities:e.id,idSites:this.idsite}).then((function(){t.$emit("change",t.getCapabilitiesList())})).finally((function(){t.isBusy=!1,t.capabilityToAddOrRemove=null,t.capabilityToAddId=null,t.capabilityToRemoveId=null}))},removeCapability:function(e){var t=this;this.isBusy=!0,r["AjaxHelper"].post({method:"UsersManager.removeCapabilities"},{userLogin:this.userLogin,capabilities:e.id,idSites:this.idsite}).then((function(){t.$emit("change",t.getCapabilitiesList())})).finally((function(){t.isBusy=!1,t.capabilityToAddOrRemove=null,t.capabilityToAddId=null,t.capabilityToRemoveId=null}))}},computed:{availableCapabilities:function(){return k.capabilities.value},confirmAddCapabilityToggleContent:function(){return Object(r["translate"])("UsersManager_AreYouSureAddCapability","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.capabilityToAddOrRemove?this.capabilityToAddOrRemove.name:"","</strong>"),"<strong>".concat(this.siteNameText,"</strong>"))},confirmCapabilityToggleContent:function(){return Object(r["translate"])("UsersManager_AreYouSureRemoveCapability","<strong>".concat(this.capabilityToAddOrRemove?this.capabilityToAddOrRemove.name:"","</strong>"),"<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.siteNameText,"</strong>"))},siteNameText:function(){return r["Matomo"].helper.htmlEntities(this.siteName)},availableCapabilitiesGrouped:function(){var e=this,t=this.availableCapabilities.filter((function(t){return!e.capabilitiesSet[t.id]})).map((function(e){return{group:e.category,key:e.id,value:e.name,tooltip:e.description}}));return t.sort((function(e,t){return e.group===t.group?e.value===t.value?0:e.value<t.value?-1:1:e.group<t.group?-1:1})),t},capabilitiesSet:function(){var e=this,t={},n=this.theCapabilities;return(n||[]).forEach((function(e){t[e]=!0})),(this.availableCapabilities||[]).forEach((function(n){e.isIncludedInRole(n)&&(t[n.id]=!0)})),t},actualCapabilities:function(){var e=this.capabilitiesSet;return this.availableCapabilities.filter((function(t){return!!e[t.id]}))}}});A.render=h;var E=A,V=(Object(r["createAngularJsAdapter"])({component:E,scope:{idsite:{angularJsBind:"<"},siteName:{angularJsBind:"<"},userLogin:{angularJsBind:"<"},userRole:{angularJsBind:"<"},capabilities:{angularJsBind:"<"},onCapabilitiesChange:{angularJsBind:"&",vue:"change"}},directiveName:"piwikCapabilitiesEdit",restrict:"E",$inject:["$timeout"],events:{change:function(e,t,n,s,i,r,o){o((function(){n.onCapabilitiesChange&&n.onCapabilitiesChange.call({capabilities:e})}))}}}),{key:0,class:"row"}),S={class:"row to-all-websites"},U={class:"col s12"},T={style:{"margin-right":"3.5px"}},w={id:"all-sites-access-select",style:{"margin-right":"3.5px"}},M=Object(o["createElementVNode"])("p",null," ",-1),B={class:"filters row"},_={class:"col s12 m12 l8"},L={class:"input-field bulk-actions",style:{"margin-right":"3.5px"}},R={id:"user-permissions-edit-bulk-actions",class:"dropdown-content"},x={class:"dropdown-trigger","data-target":"user-permissions-bulk-set-access"},D={id:"user-permissions-bulk-set-access",class:"dropdown-content"},P=["onClick"],H={class:"input-field site-filter",style:{"margin-right":"3.5px"}},F=["value","placeholder"],I={class:"input-field access-filter",style:{"margin-right":"3.5px"}},G={key:0,class:"col s12 m12 l4 sites-for-permission-pagination-container"},$={class:"sites-for-permission-pagination"},J={class:"counter"},q=["textContent"],z={class:"roles-help-notification"},W=["innerHTML"],Y={class:"capabilities-help-notification"},X={id:"sitesForPermission"},K={class:"select-cell"},Q={class:"checkbox-container"},Z=["checked"],ee=Object(o["createElementVNode"])("span",null,null,-1),te={class:"role_header"},ne=["innerHTML"],se=Object(o["createElementVNode"])("span",{class:"icon-help"},null,-1),ie=[se],re={class:"capabilities_header"},oe=["innerHTML"],ae=Object(o["createElementVNode"])("span",{class:"icon-help"},null,-1),ce=[ae],le={key:0,class:"select-all-row"},de={colspan:"4"},ue={key:0},me=["innerHTML"],be=["innerHTML"],pe={key:1},he=["innerHTML"],fe=["innerHTML"],ge={class:"select-cell"},Oe={class:"checkbox-container"},je=["id","onUpdate:modelValue"],ve=Object(o["createElementVNode"])("span",null,null,-1),Ce={class:"role-select"},ke={class:"delete-access-confirm-modal modal",ref:"deleteAccessConfirmModal"},Ne={class:"modal-content"},ye=["innerHTML"],Ae=["innerHTML"],Ee={class:"modal-footer"},Ve={class:"change-access-confirm-modal modal",ref:"changeAccessConfirmModal"},Se={class:"modal-content"},Ue=["innerHTML"],Te=["innerHTML"],we={class:"modal-footer"},Me={class:"confirm-give-access-all-sites modal",ref:"confirmGiveAccessAllSitesModal"},Be={class:"modal-content"},_e=["innerHTML"],Le={class:"modal-footer"}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function xe(e,t,s,n,i,a){var o=Object(r["resolveComponent"])("Notification"),c=Object(r["resolveComponent"])("Field"),l=Object(r["resolveComponent"])("CapabilitiesEdit"),d=Object(r["resolveDirective"])("dropdown-menu"),u=Object(r["resolveDirective"])("content-table");return Object(r["openBlock"])(),Object(r["createElementBlock"])("div",{class:Object(r["normalizeClass"])(["userPermissionsEdit",{loading:e.isLoadingAccess}])},[e.hasAccessToAtLeastOneSite?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",E,[Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{context:"warning",type:"transient",noclear:!0},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("strong",null,Object(r["toDisplayString"])(e.translate("General_Warning"))+":",1),Object(r["createTextVNode"])(" "+Object(r["toDisplayString"])(e.translate("UsersManager_NoAccessWarning")),1)]})),_:1})])])),Object(r["createElementVNode"])("div",k,[Object(r["createElementVNode"])("div",U,[Object(r["createElementVNode"])("div",null,[Object(r["createElementVNode"])("span",w,Object(r["toDisplayString"])(e.translate("UsersManager_GiveAccessToAll"))+":",1),Object(r["createElementVNode"])("div",T,[Object(r["createVNode"])(c,{modelValue:e.allWebsitesAccssLevelSet,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.allWebsitesAccssLevelSet=t}),uicontrol:"select",options:e.filteredAccessLevels,"full-width":!0},null,8,["modelValue","options"])]),Object(r["createElementVNode"])("a",{href:"",class:Object(r["normalizeClass"])(["btn",{disabled:e.isGivingAccessToAllSites}]),onClick:t[1]||(t[1]=Object(r["withModifiers"])((function(t){return e.showChangeAccessAllSitesModal()}),["prevent"]))},Object(r["toDisplayString"])(e.translate("General_Apply")),3)]),M,Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("UsersManager_OrManageIndividually"))+":",1)])]),Object(r["createElementVNode"])("div",B,[Object(r["createElementVNode"])("div",_,[Object(r["createElementVNode"])("div",L,[Object(r["withDirectives"])(Object(r["createElementVNode"])("a",{class:Object(r["normalizeClass"])(["dropdown-trigger btn",{disabled:e.isBulkActionsDisabled}]),href:"","data-target":"user-permissions-edit-bulk-actions"},[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("UsersManager_BulkActions")),1)],2),[[d,{activates:"#user-permissions-edit-bulk-actions"}]]),Object(r["createElementVNode"])("ul",x,[Object(r["createElementVNode"])("li",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("a",R,[Object(r["createTextVNode"])(Object(r["toDisplayString"])(e.translate("UsersManager_SetPermission")),1)],512),[[d,{activates:"#user-permissions-bulk-set-access"}]]),Object(r["createElementVNode"])("ul",D,[(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.filteredAccessLevels,(function(t){return Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{key:t.key},[Object(r["createElementVNode"])("a",{href:"",onClick:Object(r["withModifiers"])((function(s){e.siteAccessToChange=null,e.roleToChangeTo=t.key,e.showChangeAccessConfirm()}),["prevent"])},Object(r["toDisplayString"])(t.value),9,P)])})),128))])]),Object(r["createElementVNode"])("li",null,[Object(r["createElementVNode"])("a",{href:"",onClick:t[2]||(t[2]=Object(r["withModifiers"])((function(t){e.siteAccessToChange=null,e.roleToChangeTo="noaccess",e.showRemoveAccessConfirm()}),["prevent"]))},Object(r["toDisplayString"])(e.translate("UsersManager_RemovePermissions")),1)])])]),Object(r["createElementVNode"])("div",H,[Object(r["createElementVNode"])("input",{type:"text",value:e.siteNameFilter,onKeydown:t[3]||(t[3]=function(t){e.onChangeSiteFilter(t)}),onChange:t[4]||(t[4]=function(t){e.onChangeSiteFilter(t)}),placeholder:e.translate("UsersManager_FilterByWebsite")},null,40,F)]),Object(r["createElementVNode"])("div",I,[Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(c,{modelValue:e.accessLevelFilter,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.accessLevelFilter=t}),uicontrol:"select",options:e.filteredSelectAccessLevels,"full-width":!0,placeholder:e.translate("UsersManager_FilterByAccess")},null,8,["modelValue","options","placeholder"])])])]),e.totalEntries>e.limit?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",G,[Object(r["createElementVNode"])("div",$,[Object(r["createElementVNode"])("a",{class:Object(r["normalizeClass"])(["prev",{disabled:e.offset<=0}])},[Object(r["createElementVNode"])("span",{class:"pointer",onClick:t[6]||(t[6]=function(t){return e.gotoPreviousPage()})},"« "+Object(r["toDisplayString"])(e.translate("General_Previous")),1)],2),Object(r["createElementVNode"])("span",z,[Object(r["createElementVNode"])("span",{textContent:Object(r["toDisplayString"])(e.paginationText)},null,8,J)]),Object(r["createElementVNode"])("a",{class:Object(r["normalizeClass"])(["next",{disabled:e.offset+e.limit>=e.totalEntries}])},[Object(r["createElementVNode"])("span",{class:"pointer",onClick:t[7]||(t[7]=function(t){return e.gotoNextPage()})},Object(r["toDisplayString"])(e.translate("General_Next"))+" »",1)],2)])])):Object(r["createCommentVNode"])("",!0)]),Object(r["createElementVNode"])("div",W,[e.isRoleHelpToggled?(Object(r["openBlock"])(),Object(r["createBlock"])(o,{key:0,context:"info",type:"persistent",noclear:!0},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.rolesHelpText)},null,8,q)]})),_:1})):Object(r["createCommentVNode"])("",!0)]),Object(r["createElementVNode"])("div",Y,[e.isCapabilitiesHelpToggled?(Object(r["openBlock"])(),Object(r["createBlock"])(o,{key:0,context:"info",type:"persistent",noclear:!0},{default:Object(r["withCtx"])((function(){return[Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(e.translate("UsersManager_CapabilitiesHelp")),1)]})),_:1})):Object(r["createCommentVNode"])("",!0)]),Object(r["withDirectives"])(Object(r["createElementVNode"])("table",X,[Object(r["createElementVNode"])("thead",null,[Object(r["createElementVNode"])("tr",null,[Object(r["createElementVNode"])("th",K,[Object(r["createElementVNode"])("span",Q,[Object(r["createElementVNode"])("label",null,[Object(r["createElementVNode"])("input",{type:"checkbox",id:"perm_edit_select_all",checked:e.isAllCheckboxSelected,onChange:t[8]||(t[8]=function(t){return e.onAllCheckboxChange(t)})},null,40,Z),ee])])]),Object(r["createElementVNode"])("th",null,Object(r["toDisplayString"])(e.translate("General_Name")),1),Object(r["createElementVNode"])("th",te,[Object(r["createElementVNode"])("span",{innerHTML:"".concat(e.translate("UsersManager_Role")," ")},null,8,se),Object(r["createElementVNode"])("a",{href:"",class:Object(r["normalizeClass"])(["helpIcon",{sticky:e.isRoleHelpToggled}]),onClick:t[9]||(t[9]=Object(r["withModifiers"])((function(t){return e.isRoleHelpToggled=!e.isRoleHelpToggled}),["prevent"]))},ie,2)]),Object(r["createElementVNode"])("th",ae,[Object(r["createElementVNode"])("span",{innerHTML:"".concat(e.translate("UsersManager_Capabilities")," ")},null,8,re),Object(r["createElementVNode"])("a",{href:"",class:Object(r["normalizeClass"])(["helpIcon",{sticky:e.isCapabilitiesHelpToggled}]),onClick:t[10]||(t[10]=Object(r["withModifiers"])((function(t){return e.isCapabilitiesHelpToggled=!e.isCapabilitiesHelpToggled}),["prevent"]))},ce,2)])])]),Object(r["createElementVNode"])("tbody",null,[e.isAllCheckboxSelected&&e.siteAccess.length<e.totalEntries?(Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",le,[Object(r["createElementVNode"])("td",de,[e.areAllResultsSelected?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",ue,[Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.theDisplayedWebsitesAreSelectedText),style:{"margin-right":"3.5px"}},null,8,me),Object(r["createElementVNode"])("a",{href:"#",onClick:t[11]||(t[11]=Object(r["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.clickToSelectAllText)},null,8,be)])),e.areAllResultsSelected?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",pe,[Object(r["createElementVNode"])("span",{innerHTML:e.$sanitize(e.allWebsitesAreSelectedText),style:{"margin-right":"3.5px"}},null,8,fe),Object(r["createElementVNode"])("a",{href:"#",onClick:t[12]||(t[12]=Object(r["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.clickToSelectDisplayedWebsitesText)},null,8,he)])):Object(r["createCommentVNode"])("",!0)])])):Object(r["createCommentVNode"])("",!0),(Object(r["openBlock"])(!0),Object(r["createElementBlock"])(r["Fragment"],null,Object(r["renderList"])(e.siteAccess,(function(s,n){return Object(r["openBlock"])(),Object(r["createElementBlock"])("tr",{key:s.idsite},[Object(r["createElementVNode"])("td",ge,[Object(r["createElementVNode"])("span",Oe,[Object(r["createElementVNode"])("label",null,[Object(r["withDirectives"])(Object(r["createElementVNode"])("input",{type:"checkbox",id:"perm_edit_select_row".concat(n),"onUpdate:modelValue":function(t){return e.selectedRows[n]=t},onClick:t[13]||(t[13]=function(t){return e.onRowSelected()})},null,8,je),[[r["vModelCheckbox"],e.selectedRows[n]]]),ve])])]),Object(r["createElementVNode"])("td",null,[Object(r["createElementVNode"])("span",null,Object(r["toDisplayString"])(s.site_name),1)]),Object(r["createElementVNode"])("td",null,[Object(r["createElementVNode"])("div",Ce,[Object(r["createVNode"])(c,{"model-value":s.role,"onUpdate:modelValue":function(t){e.onRoleChange(s,t)},uicontrol:"select",options:e.filteredAccessLevels,"full-width":!0},null,8,["model-value","onUpdate:modelValue","options"])])]),Object(r["createElementVNode"])("td",null,[Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(l,{idsite:s.idsite,"site-name":s.site_name,"user-login":e.userLogin,"user-role":s.role,capabilities:s.capabilities,onChange:t[14]||(t[14]=function(t){return e.fetchAccess()})},null,8,["idsite","site-name","user-login","user-role","capabilities"])])])])})),128))])],512),[[u]]),Object(r["createElementVNode"])("div",Ae,[Object(r["createElementVNode"])("div",ye,[e.siteAccessToChange?(Object(r["openBlock"])(),Object(r["createElementBlock"])("h3",{key:0,innerHTML:e.$sanitize(e.deletePermConfirmSingleText)},null,8,Se)):Object(r["createCommentVNode"])("",!0),e.siteAccessToChange?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("p",{key:1,innerHTML:e.$sanitize(e.deletePermConfirmMultipleText)},null,8,Ne))]),Object(r["createElementVNode"])("div",Ve,[Object(r["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[15]||(t[15]=Object(r["withModifiers"])((function(t){return e.changeUserRole()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(r["toDisplayString"])(e.translate("General_Yes")),1),Object(r["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[16]||(t[16]=Object(r["withModifiers"])((function(t){e.siteAccessToChange=null,e.roleToChangeTo=null}),["prevent"]))},Object(r["toDisplayString"])(e.translate("General_No")),1)])],512),Object(r["createElementVNode"])("div",Ee,[Object(r["createElementVNode"])("div",ke,[e.siteAccessToChange?(Object(r["openBlock"])(),Object(r["createElementBlock"])("h3",{key:0,innerHTML:e.$sanitize(e.changePermToSiteConfirmSingleText)},null,8,Ue)):Object(r["createCommentVNode"])("",!0),e.siteAccessToChange?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("p",{key:1,innerHTML:e.$sanitize(e.changePermToSiteConfirmMultipleText)},null,8,we))]),Object(r["createElementVNode"])("div",Te,[Object(r["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[17]||(t[17]=Object(r["withModifiers"])((function(t){return e.changeUserRole()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(r["toDisplayString"])(e.translate("General_Yes")),1),Object(r["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[18]||(t[18]=Object(r["withModifiers"])((function(t){e.siteAccessToChange.role=e.previousRole,e.siteAccessToChange=null,e.roleToChangeTo=null}),["prevent"]))},Object(r["toDisplayString"])(e.translate("General_No")),1)])],512),Object(r["createElementVNode"])("div",Me,[Object(r["createElementVNode"])("div",Be,[Object(r["createElementVNode"])("h3",{innerHTML:e.$sanitize(e.changePermToAllSitesConfirmText)},null,8,_e),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("UsersManager_ChangePermToAllSitesConfirm2")),1)]),Object(r["createElementVNode"])("div",Le,[Object(r["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[19]||(t[19]=Object(r["withModifiers"])((function(t){return e.giveAccessToAllSites()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(r["toDisplayString"])(e.translate("General_Yes")),1),Object(r["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[20]||(t[20]=function(e){return e.preventDefault()})},Object(r["toDisplayString"])(e.translate("General_No")),1)])],512)],2)}var Re=window,De=Re.$,Pe=Object(r["defineComponent"])({props:{userLogin:{type:String,required:!0},limit:{type:Number,default:10},accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0}},components:{Notification:a["Notification"],Field:h["Field"],CapabilitiesEdit:V},directives:{DropdownMenu:a["DropdownMenu"],ContentTable:a["ContentTable"]},data:function(){return{siteAccess:[],offset:0,totalEntries:null,accessLevelFilter:"",siteNameFilter:"",isLoadingAccess:!1,allWebsitesAccssLevelSet:"view",isAllCheckboxSelected:!1,selectedRows:{},isBulkActionsDisabled:!0,areAllResultsSelected:!1,previousRole:null,hasAccessToAtLeastOneSite:!0,isRoleHelpToggled:!1,isCapabilitiesHelpToggled:!1,isGivingAccessToAllSites:!1,roleToChangeTo:null,siteAccessToChange:null}},emits:["userHasAccessDetected","accessChanged"],created:function(){var e=this;this.onChangeSiteFilter=Object(a["debounce"])(this.onChangeSiteFilter,300),Object(r["watch"])((function(){return e.allPropsWatch}),(function(){e.limit&&e.fetchAccess()})),this.fetchAccess()},watch:{accessLevelFilter:function(){this.offset=0,this.fetchAccess()}},methods:{onAllCheckboxChange:function(e){var t=this;this.isAllCheckboxSelected=e.target.checked,this.isAllCheckboxSelected?(this.siteAccess.forEach((function(e,s){t.selectedRows[s]=!0})),this.isBulkActionsDisabled=!1):this.clearSelection()},clearSelection:function(){this.selectedRows={},this.areAllResultsSelected=!1,this.isBulkActionsDisabled=!0,this.isAllCheckboxSelected=!1,this.siteAccessToChange=null},onRowSelected:function(){var e=this;setTimeout((function(){var t=e.selectedRowsCount;e.isBulkActionsDisabled=0===t,e.isAllCheckboxSelected=t===e.siteAccess.length}))},fetchAccess:function(){var e=this;return this.isLoadingAccess=!0,a["AjaxHelper"].fetch({method:"UsersManager.getSitesAccessForUser",limit:this.limit,offset:this.offset,filter_search:this.siteNameFilter,filter_access:this.accessLevelFilter,userLogin:this.userLogin},{returnResponseObject:!0}).then((function(t){var s=t.getRequestHandle();e.isLoadingAccess=!1,e.siteAccess=s.responseJSON,e.totalEntries=parseInt(s.getResponseHeader("x-matomo-total-results"),10)||0,e.hasAccessToAtLeastOneSite=!!s.getResponseHeader("x-matomo-has-some"),e.$emit("userHasAccessDetected",{hasAccess:e.hasAccessToAtLeastOneSite}),e.clearSelection()})).catch((function(){e.isLoadingAccess=!1,e.clearSelection()}))},gotoPreviousPage:function(){this.offset=Math.max(0,this.offset-this.limit),this.fetchAccess()},gotoNextPage:function(){var e=this.offset+this.limit;e>=(this.totalEntries||0)||(this.offset=e,this.fetchAccess())},showRemoveAccessConfirm:function(){De(this.$refs.deleteAccessConfirmModal).modal({dismissible:!1}).modal("open")},changeUserRole:function(){var e=this,t=function(){var t=[];return Object.keys(e.selectedRows).forEach((function(s){e.selectedRows[s]&&e.siteAccess[s]&&t.push(e.siteAccess[s].idsite)})),t},s=function(){return a["AjaxHelper"].fetch({method:"UsersManager.getSitesAccessForUser",filter_search:e.siteNameFilter,filter_access:e.accessLevelFilter,userLogin:e.userLogin,filter_limit:"-1"}).then((function(e){return e.map((function(e){return e.idsite}))}))};return this.isLoadingAccess=!0,Promise.resolve().then((function(){return e.siteAccessToChange?[e.siteAccessToChange.idsite]:e.areAllResultsSelected?s():t()})).then((function(t){return a["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:e.userLogin,access:e.roleToChangeTo,idSites:t})})).catch((function(){})).then((function(){return e.$emit("accessChanged"),e.fetchAccess()}))},showChangeAccessConfirm:function(){De(this.$refs.changeAccessConfirmModal).modal({dismissible:!1}).modal("open")},getRoleDisplay:function(e){var t=null;return this.filteredAccessLevels.forEach((function(s){s.key===e&&(t=s.value)})),t},giveAccessToAllSites:function(){var e=this;this.isGivingAccessToAllSites=!0,a["AjaxHelper"].fetch({method:"SitesManager.getSitesWithAdminAccess"}).then((function(t){var s=t.map((function(e){return e.idsite}));return a["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:e.userLogin,access:e.allWebsitesAccssLevelSet,idSites:s})})).then((function(){return e.fetchAccess()})).finally((function(){e.isGivingAccessToAllSites=!1}))},showChangeAccessAllSitesModal:function(){De(this.$refs.confirmGiveAccessAllSitesModal).modal({dismissible:!1}).modal("open")},onChangeSiteFilter:function(e){var t=this;setTimeout((function(){var s=e.target.value;t.siteNameFilter!==s&&(t.siteNameFilter=s,t.offset=0,t.fetchAccess())}))},onRoleChange:function(e,t){this.previousRole=e.role,this.roleToChangeTo=t,this.siteAccessToChange=e,this.showChangeAccessConfirm()}},computed:{rolesHelpText:function(){return Object(a["translate"])("UsersManager_RolesHelp",'<a href="https://matomo.org/faq/general/faq_70/" target="_blank" rel="noreferrer noopener">',"</a>",'<a href="https://matomo.org/faq/general/faq_69/" target="_blank" rel="noreferrer noopener">',"</a>")},theDisplayedWebsitesAreSelectedText:function(){var e=Object(a["translate"])("UsersManager_TheDisplayedWebsitesAreSelected","<strong>".concat(this.siteAccess.length,"</strong>"));return"".concat(e," ")},clickToSelectAllText:function(){return Object(a["translate"])("UsersManager_ClickToSelectAll","<strong>".concat(this.totalEntries,"</strong>"))},allWebsitesAreSelectedText:function(){return Object(a["translate"])("UsersManager_AllWebsitesAreSelected","<strong>".concat(this.totalEntries,"</strong>"))},clickToSelectDisplayedWebsitesText:function(){return Object(a["translate"])("UsersManager_ClickToSelectDisplayedWebsites","<strong>".concat(this.siteAccess.length,"</strong>"))},deletePermConfirmSingleText:function(){return Object(a["translate"])("UsersManager_DeletePermConfirmSingle","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.siteAccessToChangeName,"</strong>"))},deletePermConfirmMultipleText:function(){return Object(a["translate"])("UsersManager_DeletePermConfirmMultiple","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.affectedSitesCount,"</strong>"))},changePermToSiteConfirmSingleText:function(){return Object(a["translate"])("UsersManager_ChangePermToSiteConfirmSingle","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.siteAccessToChangeName,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.roleToChangeTo),"</strong>"))},changePermToSiteConfirmMultipleText:function(){return Object(a["translate"])("UsersManager_ChangePermToSiteConfirmMultiple","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.affectedSitesCount,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.roleToChangeTo),"</strong>"))},changePermToAllSitesConfirmText:function(){return Object(a["translate"])("UsersManager_ChangePermToAllSitesConfirm","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.allWebsitesAccssLevelSet),"</strong>"))},paginationLowerBound:function(){return this.offset+1},paginationUpperBound:function(){return this.totalEntries?Math.min(this.offset+this.limit,this.totalEntries):"?"},filteredAccessLevels:function(){return this.accessLevels.filter((function(e){return"superuser"!==e.key}))},filteredSelectAccessLevels:function(){return this.filterAccessLevels.filter((function(e){return"superuser"!==e.key}))},selectedRowsCount:function(){var e=0;return Object.values(this.selectedRows).forEach((function(t){t&&(e+=1)})),e},affectedSitesCount:function(){return this.areAllResultsSelected?this.totalEntries:this.selectedRowsCount},allPropsWatch:function(){return this.userLogin,this.limit,this.accessLevels,this.filterAccessLevels,Date.now()},siteAccessToChangeName:function(){return this.siteAccessToChange?a["Matomo"].helper.htmlEntities(this.siteAccessToChange.site_name):""},paginationText:function(){var e=Object(a["translate"])("General_Pagination","".concat(this.paginationLowerBound),"".concat(this.paginationUpperBound),"".concat(this.totalEntries));return" ".concat(e," ")}}});Pe.render=xe;var He=Pe,Fe=(Object(a["createAngularJsAdapter"])({component:He,scope:{userLogin:{angularJsBind:"<"},limit:{angularJsBind:"<"},onUserHasAccessDetected:{angularJsBind:"&",vue:"userHasAccessDetected"},onAccessChange:{angularJsBind:"&",vue:"accessChanged"},accessLevels:{angularJsBind:"<"},filterAccessLevels:{angularJsBind:"<"}},directiveName:"piwikUserPermissionsEdit",restrict:"E"}),{class:"row"}),Ie={key:0,class:"col m2 entityList"},Ge={class:"listCircle"},$e={key:0,class:"icon-warning"},ze=Object(r["createElementVNode"])("div",{class:"save-button-spacer hide-on-small-only"},null,-1),Je={href:"",class:"entityCancelLink"},We={class:"visibleTab col m10"},qe={key:0,class:"basic-info-tab"},Ye={key:0,class:"entityCancel"},Xe={key:1,class:"user-permissions"},Ke={key:0},Qe={key:1,class:"alert alert-info"},Ze={key:2,class:"superuser-access"},et={class:"superuser-confirm-modal modal",ref:"superUserConfirmModal"},tt={class:"modal-content"},st={key:0},nt={key:1},it={class:"modal-footer"},at={key:3,class:"twofa-reset"},rt={class:"resetTwoFa"},ot={class:"twofa-confirm-modal modal",ref:"twofaConfirmModal"},ct={class:"modal-content"},lt={class:"modal-footer"},dt={class:"change-password-modal modal",ref:"changePasswordModal"},ut={class:"modal-content"},mt=["innerHTML"],bt={class:"modal-footer"}; + */function Re(e,t,n,s,i,r){var a=Object(o["resolveComponent"])("Notification"),c=Object(o["resolveComponent"])("Field"),l=Object(o["resolveComponent"])("CapabilitiesEdit"),d=Object(o["resolveDirective"])("dropdown-menu"),u=Object(o["resolveDirective"])("content-table");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])(["userPermissionsEdit",{loading:e.isLoadingAccess}])},[e.hasAccessToAtLeastOneSite?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",V,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{context:"warning",type:"transient",noclear:!0},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("General_Warning"))+":",1),Object(o["createTextVNode"])(" "+Object(o["toDisplayString"])(e.translate("UsersManager_NoAccessWarning")),1)]})),_:1})])])),Object(o["createElementVNode"])("div",S,[Object(o["createElementVNode"])("div",U,[Object(o["createElementVNode"])("div",null,[Object(o["createElementVNode"])("span",T,Object(o["toDisplayString"])(e.translate("UsersManager_GiveAccessToAll"))+":",1),Object(o["createElementVNode"])("div",w,[Object(o["createVNode"])(c,{modelValue:e.allWebsitesAccssLevelSet,"onUpdate:modelValue":t[0]||(t[0]=function(t){return e.allWebsitesAccssLevelSet=t}),uicontrol:"select",options:e.filteredAccessLevels,"full-width":!0},null,8,["modelValue","options"])]),Object(o["createElementVNode"])("a",{href:"",class:Object(o["normalizeClass"])(["btn",{disabled:e.isGivingAccessToAllSites}]),onClick:t[1]||(t[1]=Object(o["withModifiers"])((function(t){return e.showChangeAccessAllSitesModal()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_Apply")),3)]),M,Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_OrManageIndividually"))+":",1)])]),Object(o["createElementVNode"])("div",B,[Object(o["createElementVNode"])("div",_,[Object(o["createElementVNode"])("div",L,[Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["dropdown-trigger btn",{disabled:e.isBulkActionsDisabled}]),href:"","data-target":"user-permissions-edit-bulk-actions"},[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_BulkActions")),1)],2),[[d,{activates:"#user-permissions-edit-bulk-actions"}]]),Object(o["createElementVNode"])("ul",R,[Object(o["createElementVNode"])("li",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("a",x,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_SetPermission")),1)],512),[[d,{activates:"#user-permissions-bulk-set-access"}]]),Object(o["createElementVNode"])("ul",D,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.filteredAccessLevels,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:t.key},[Object(o["createElementVNode"])("a",{href:"",onClick:Object(o["withModifiers"])((function(n){e.siteAccessToChange=null,e.roleToChangeTo=t.key,e.showChangeAccessConfirm()}),["prevent"])},Object(o["toDisplayString"])(t.value),9,P)])})),128))])]),Object(o["createElementVNode"])("li",null,[Object(o["createElementVNode"])("a",{href:"",onClick:t[2]||(t[2]=Object(o["withModifiers"])((function(t){e.siteAccessToChange=null,e.roleToChangeTo="noaccess",e.showRemoveAccessConfirm()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_RemovePermissions")),1)])])]),Object(o["createElementVNode"])("div",H,[Object(o["createElementVNode"])("input",{type:"text",value:e.siteNameFilter,onKeydown:t[3]||(t[3]=function(t){e.onChangeSiteFilter(t)}),onChange:t[4]||(t[4]=function(t){e.onChangeSiteFilter(t)}),placeholder:e.translate("UsersManager_FilterByWebsite")},null,40,F)]),Object(o["createElementVNode"])("div",I,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(c,{modelValue:e.accessLevelFilter,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.accessLevelFilter=t}),uicontrol:"select",options:e.filteredSelectAccessLevels,"full-width":!0,placeholder:e.translate("UsersManager_FilterByAccess")},null,8,["modelValue","options","placeholder"])])])]),e.totalEntries>e.limit?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",G,[Object(o["createElementVNode"])("div",$,[Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["prev",{disabled:e.offset<=0}])},[Object(o["createElementVNode"])("span",{class:"pointer",onClick:t[6]||(t[6]=function(t){return e.gotoPreviousPage()})},"« "+Object(o["toDisplayString"])(e.translate("General_Previous")),1)],2),Object(o["createElementVNode"])("span",J,[Object(o["createElementVNode"])("span",{textContent:Object(o["toDisplayString"])(e.paginationText)},null,8,q)]),Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["next",{disabled:e.offset+e.limit>=e.totalEntries}])},[Object(o["createElementVNode"])("span",{class:"pointer",onClick:t[7]||(t[7]=function(t){return e.gotoNextPage()})},Object(o["toDisplayString"])(e.translate("General_Next"))+" »",1)],2)])])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",z,[e.isRoleHelpToggled?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,context:"info",type:"persistent",noclear:!0},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.rolesHelpText)},null,8,W)]})),_:1})):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",Y,[e.isCapabilitiesHelpToggled?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,context:"info",type:"persistent",noclear:!0},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(e.translate("UsersManager_CapabilitiesHelp")),1)]})),_:1})):Object(o["createCommentVNode"])("",!0)]),Object(o["withDirectives"])(Object(o["createElementVNode"])("table",X,[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",K,[Object(o["createElementVNode"])("span",Q,[Object(o["createElementVNode"])("label",null,[Object(o["createElementVNode"])("input",{type:"checkbox",id:"perm_edit_select_all",checked:e.isAllCheckboxSelected,onChange:t[8]||(t[8]=function(t){return e.onAllCheckboxChange(t)})},null,40,Z),ee])])]),Object(o["createElementVNode"])("th",null,Object(o["toDisplayString"])(e.translate("General_Name")),1),Object(o["createElementVNode"])("th",te,[Object(o["createElementVNode"])("span",{innerHTML:"".concat(e.translate("UsersManager_Role")," ")},null,8,ne),Object(o["createElementVNode"])("a",{href:"",class:Object(o["normalizeClass"])(["helpIcon",{sticky:e.isRoleHelpToggled}]),onClick:t[9]||(t[9]=Object(o["withModifiers"])((function(t){return e.isRoleHelpToggled=!e.isRoleHelpToggled}),["prevent"]))},ie,2)]),Object(o["createElementVNode"])("th",re,[Object(o["createElementVNode"])("span",{innerHTML:"".concat(e.translate("UsersManager_Capabilities")," ")},null,8,oe),Object(o["createElementVNode"])("a",{href:"",class:Object(o["normalizeClass"])(["helpIcon",{sticky:e.isCapabilitiesHelpToggled}]),onClick:t[10]||(t[10]=Object(o["withModifiers"])((function(t){return e.isCapabilitiesHelpToggled=!e.isCapabilitiesHelpToggled}),["prevent"]))},ce,2)])])]),Object(o["createElementVNode"])("tbody",null,[e.isAllCheckboxSelected&&e.siteAccess.length<e.totalEntries?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",le,[Object(o["createElementVNode"])("td",de,[e.areAllResultsSelected?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",ue,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.theDisplayedWebsitesAreSelectedText),style:{"margin-right":"3.5px"}},null,8,me),Object(o["createElementVNode"])("a",{href:"#",onClick:t[11]||(t[11]=Object(o["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.clickToSelectAllText)},null,8,be)])),e.areAllResultsSelected?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",pe,[Object(o["createElementVNode"])("span",{innerHTML:e.$sanitize(e.allWebsitesAreSelectedText),style:{"margin-right":"3.5px"}},null,8,he),Object(o["createElementVNode"])("a",{href:"#",onClick:t[12]||(t[12]=Object(o["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.$sanitize(e.clickToSelectDisplayedWebsitesText)},null,8,fe)])):Object(o["createCommentVNode"])("",!0)])])):Object(o["createCommentVNode"])("",!0),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.siteAccess,(function(n,s){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{key:n.idsite},[Object(o["createElementVNode"])("td",ge,[Object(o["createElementVNode"])("span",Oe,[Object(o["createElementVNode"])("label",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"checkbox",id:"perm_edit_select_row".concat(s),"onUpdate:modelValue":function(t){return e.selectedRows[s]=t},onClick:t[13]||(t[13]=function(t){return e.onRowSelected()})},null,8,je),[[o["vModelCheckbox"],e.selectedRows[s]]]),ve])])]),Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("span",null,Object(o["toDisplayString"])(n.site_name),1)]),Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("div",Ce,[Object(o["createVNode"])(c,{"model-value":n.role,"onUpdate:modelValue":function(t){e.onRoleChange(n,t)},uicontrol:"select",options:e.filteredAccessLevels,"full-width":!0},null,8,["model-value","onUpdate:modelValue","options"])])]),Object(o["createElementVNode"])("td",null,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(l,{idsite:n.idsite,"site-name":n.site_name,"user-login":e.userLogin,"user-role":n.role,capabilities:n.capabilities,onChange:t[14]||(t[14]=function(t){return e.fetchAccess()})},null,8,["idsite","site-name","user-login","user-role","capabilities"])])])])})),128))])],512),[[u]]),Object(o["createElementVNode"])("div",ke,[Object(o["createElementVNode"])("div",Ne,[e.siteAccessToChange?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h3",{key:0,innerHTML:e.$sanitize(e.deletePermConfirmSingleText)},null,8,ye)):Object(o["createCommentVNode"])("",!0),e.siteAccessToChange?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",{key:1,innerHTML:e.$sanitize(e.deletePermConfirmMultipleText)},null,8,Ae))]),Object(o["createElementVNode"])("div",Ee,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[15]||(t[15]=Object(o["withModifiers"])((function(t){return e.changeUserRole()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[16]||(t[16]=Object(o["withModifiers"])((function(t){e.siteAccessToChange=null,e.roleToChangeTo=null}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512),Object(o["createElementVNode"])("div",Ve,[Object(o["createElementVNode"])("div",Se,[e.siteAccessToChange?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h3",{key:0,innerHTML:e.$sanitize(e.changePermToSiteConfirmSingleText)},null,8,Ue)):Object(o["createCommentVNode"])("",!0),e.siteAccessToChange?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",{key:1,innerHTML:e.$sanitize(e.changePermToSiteConfirmMultipleText)},null,8,Te))]),Object(o["createElementVNode"])("div",we,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[17]||(t[17]=Object(o["withModifiers"])((function(t){return e.changeUserRole()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[18]||(t[18]=Object(o["withModifiers"])((function(t){e.siteAccessToChange.role=e.previousRole,e.siteAccessToChange=null,e.roleToChangeTo=null}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512),Object(o["createElementVNode"])("div",Me,[Object(o["createElementVNode"])("div",Be,[Object(o["createElementVNode"])("h3",{innerHTML:e.$sanitize(e.changePermToAllSitesConfirmText)},null,8,_e),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ChangePermToAllSitesConfirm2")),1)]),Object(o["createElementVNode"])("div",Le,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[19]||(t[19]=Object(o["withModifiers"])((function(t){return e.giveAccessToAllSites()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[20]||(t[20]=function(e){return e.preventDefault()})},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512)],2)}var xe=window,De=xe.$,Pe=Object(o["defineComponent"])({props:{userLogin:{type:String,required:!0},limit:{type:Number,default:10},accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0}},components:{Notification:r["Notification"],Field:f["Field"],CapabilitiesEdit:E},directives:{DropdownMenu:r["DropdownMenu"],ContentTable:r["ContentTable"]},data:function(){return{siteAccess:[],offset:0,totalEntries:null,accessLevelFilter:"",siteNameFilter:"",isLoadingAccess:!1,allWebsitesAccssLevelSet:"view",isAllCheckboxSelected:!1,selectedRows:{},isBulkActionsDisabled:!0,areAllResultsSelected:!1,previousRole:null,hasAccessToAtLeastOneSite:!0,isRoleHelpToggled:!1,isCapabilitiesHelpToggled:!1,isGivingAccessToAllSites:!1,roleToChangeTo:null,siteAccessToChange:null}},emits:["userHasAccessDetected","accessChanged"],created:function(){var e=this;this.onChangeSiteFilter=Object(r["debounce"])(this.onChangeSiteFilter,300),Object(o["watch"])((function(){return e.allPropsWatch}),(function(){e.limit&&e.fetchAccess()})),this.fetchAccess()},watch:{accessLevelFilter:function(){this.offset=0,this.fetchAccess()}},methods:{onAllCheckboxChange:function(e){var t=this;this.isAllCheckboxSelected=e.target.checked,this.isAllCheckboxSelected?(this.siteAccess.forEach((function(e,n){t.selectedRows[n]=!0})),this.isBulkActionsDisabled=!1):this.clearSelection()},clearSelection:function(){this.selectedRows={},this.areAllResultsSelected=!1,this.isBulkActionsDisabled=!0,this.isAllCheckboxSelected=!1,this.siteAccessToChange=null},onRowSelected:function(){var e=this;setTimeout((function(){var t=e.selectedRowsCount;e.isBulkActionsDisabled=0===t,e.isAllCheckboxSelected=t===e.siteAccess.length}))},fetchAccess:function(){var e=this;return this.isLoadingAccess=!0,r["AjaxHelper"].fetch({method:"UsersManager.getSitesAccessForUser",limit:this.limit,offset:this.offset,filter_search:this.siteNameFilter,filter_access:this.accessLevelFilter,userLogin:this.userLogin},{returnResponseObject:!0}).then((function(t){var n=t.getRequestHandle();e.isLoadingAccess=!1,e.siteAccess=n.responseJSON,e.totalEntries=parseInt(n.getResponseHeader("x-matomo-total-results"),10)||0,e.hasAccessToAtLeastOneSite=!!n.getResponseHeader("x-matomo-has-some"),e.$emit("userHasAccessDetected",{hasAccess:e.hasAccessToAtLeastOneSite}),e.clearSelection()})).catch((function(){e.isLoadingAccess=!1,e.clearSelection()}))},gotoPreviousPage:function(){this.offset=Math.max(0,this.offset-this.limit),this.fetchAccess()},gotoNextPage:function(){var e=this.offset+this.limit;e>=(this.totalEntries||0)||(this.offset=e,this.fetchAccess())},showRemoveAccessConfirm:function(){De(this.$refs.deleteAccessConfirmModal).modal({dismissible:!1}).modal("open")},changeUserRole:function(){var e=this,t=function(){var t=[];return Object.keys(e.selectedRows).forEach((function(n){e.selectedRows[n]&&e.siteAccess[n]&&t.push(e.siteAccess[n].idsite)})),t},n=function(){return r["AjaxHelper"].fetch({method:"UsersManager.getSitesAccessForUser",filter_search:e.siteNameFilter,filter_access:e.accessLevelFilter,userLogin:e.userLogin,filter_limit:"-1"}).then((function(e){return e.map((function(e){return e.idsite}))}))};return this.isLoadingAccess=!0,Promise.resolve().then((function(){return e.siteAccessToChange?[e.siteAccessToChange.idsite]:e.areAllResultsSelected?n():t()})).then((function(t){return r["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:e.userLogin,access:e.roleToChangeTo,idSites:t})})).catch((function(){})).then((function(){return e.$emit("accessChanged"),e.fetchAccess()}))},showChangeAccessConfirm:function(){De(this.$refs.changeAccessConfirmModal).modal({dismissible:!1}).modal("open")},getRoleDisplay:function(e){var t=null;return this.filteredAccessLevels.forEach((function(n){n.key===e&&(t=n.value)})),t},giveAccessToAllSites:function(){var e=this;this.isGivingAccessToAllSites=!0,r["AjaxHelper"].fetch({method:"SitesManager.getSitesWithAdminAccess"}).then((function(t){var n=t.map((function(e){return e.idsite}));return r["AjaxHelper"].post({method:"UsersManager.setUserAccess"},{userLogin:e.userLogin,access:e.allWebsitesAccssLevelSet,idSites:n})})).then((function(){return e.fetchAccess()})).finally((function(){e.isGivingAccessToAllSites=!1}))},showChangeAccessAllSitesModal:function(){De(this.$refs.confirmGiveAccessAllSitesModal).modal({dismissible:!1}).modal("open")},onChangeSiteFilter:function(e){var t=this;setTimeout((function(){var n=e.target.value;t.siteNameFilter!==n&&(t.siteNameFilter=n,t.offset=0,t.fetchAccess())}))},onRoleChange:function(e,t){this.previousRole=e.role,this.roleToChangeTo=t,this.siteAccessToChange=e,this.showChangeAccessConfirm()}},computed:{rolesHelpText:function(){return Object(r["translate"])("UsersManager_RolesHelp",'<a href="https://matomo.org/faq/general/faq_70/" target="_blank" rel="noreferrer noopener">',"</a>",'<a href="https://matomo.org/faq/general/faq_69/" target="_blank" rel="noreferrer noopener">',"</a>")},theDisplayedWebsitesAreSelectedText:function(){var e=Object(r["translate"])("UsersManager_TheDisplayedWebsitesAreSelected","<strong>".concat(this.siteAccess.length,"</strong>"));return"".concat(e," ")},clickToSelectAllText:function(){return Object(r["translate"])("UsersManager_ClickToSelectAll","<strong>".concat(this.totalEntries,"</strong>"))},allWebsitesAreSelectedText:function(){return Object(r["translate"])("UsersManager_AllWebsitesAreSelected","<strong>".concat(this.totalEntries,"</strong>"))},clickToSelectDisplayedWebsitesText:function(){return Object(r["translate"])("UsersManager_ClickToSelectDisplayedWebsites","<strong>".concat(this.siteAccess.length,"</strong>"))},deletePermConfirmSingleText:function(){return Object(r["translate"])("UsersManager_DeletePermConfirmSingle","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.siteAccessToChangeName,"</strong>"))},deletePermConfirmMultipleText:function(){return Object(r["translate"])("UsersManager_DeletePermConfirmMultiple","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.affectedSitesCount,"</strong>"))},changePermToSiteConfirmSingleText:function(){return Object(r["translate"])("UsersManager_ChangePermToSiteConfirmSingle","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.siteAccessToChangeName,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.roleToChangeTo),"</strong>"))},changePermToSiteConfirmMultipleText:function(){return Object(r["translate"])("UsersManager_ChangePermToSiteConfirmMultiple","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.affectedSitesCount,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.roleToChangeTo),"</strong>"))},changePermToAllSitesConfirmText:function(){return Object(r["translate"])("UsersManager_ChangePermToAllSitesConfirm","<strong>".concat(this.userLogin,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.allWebsitesAccssLevelSet),"</strong>"))},paginationLowerBound:function(){return this.offset+1},paginationUpperBound:function(){return this.totalEntries?Math.min(this.offset+this.limit,this.totalEntries):"?"},filteredAccessLevels:function(){return this.accessLevels.filter((function(e){return"superuser"!==e.key}))},filteredSelectAccessLevels:function(){return this.filterAccessLevels.filter((function(e){return"superuser"!==e.key}))},selectedRowsCount:function(){var e=0;return Object.values(this.selectedRows).forEach((function(t){t&&(e+=1)})),e},affectedSitesCount:function(){return this.areAllResultsSelected?this.totalEntries:this.selectedRowsCount},allPropsWatch:function(){return this.userLogin,this.limit,this.accessLevels,this.filterAccessLevels,Date.now()},siteAccessToChangeName:function(){return this.siteAccessToChange?r["Matomo"].helper.htmlEntities(this.siteAccessToChange.site_name):""},paginationText:function(){var e=Object(r["translate"])("General_Pagination","".concat(this.paginationLowerBound),"".concat(this.paginationUpperBound),"".concat(this.totalEntries));return" ".concat(e," ")}}});Pe.render=Re;var He=Pe,Fe=(Object(r["createAngularJsAdapter"])({component:He,scope:{userLogin:{angularJsBind:"<"},limit:{angularJsBind:"<"},onUserHasAccessDetected:{angularJsBind:"&",vue:"userHasAccessDetected"},onAccessChange:{angularJsBind:"&",vue:"accessChanged"},accessLevels:{angularJsBind:"<"},filterAccessLevels:{angularJsBind:"<"}},directiveName:"piwikUserPermissionsEdit",restrict:"E"}),{class:"row"}),Ie={key:0,class:"col m2 entityList"},Ge={class:"listCircle"},$e={key:0,class:"icon-warning"},Je=Object(o["createElementVNode"])("div",{class:"save-button-spacer hide-on-small-only"},null,-1),qe={href:"",class:"entityCancelLink"},ze={class:"visibleTab col m10"},We={key:0,class:"basic-info-tab"},Ye={key:0,class:"entityCancel"},Xe={key:1,class:"user-permissions"},Ke={key:0},Qe={key:1,class:"alert alert-info"},Ze={key:2,class:"superuser-access"},et={class:"superuser-confirm-modal modal",ref:"superUserConfirmModal"},tt={class:"modal-content"},nt={key:0},st={key:1},it={class:"modal-footer"},rt={key:3,class:"twofa-reset"},ot={class:"resetTwoFa"},at={class:"twofa-confirm-modal modal",ref:"twofaConfirmModal"},ct={class:"modal-content"},lt={class:"modal-footer"},dt={class:"change-password-modal modal",ref:"changePasswordModal"},ut={class:"modal-content"},mt=["innerHTML"],bt={class:"modal-footer"}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */function pt(e,t,s,n,i,a){var o=Object(r["resolveComponent"])("Field"),c=Object(r["resolveComponent"])("SaveButton"),l=Object(r["resolveComponent"])("UserPermissionsEdit"),d=Object(r["resolveComponent"])("ContentBlock"),u=Object(r["resolveDirective"])("form");return Object(r["openBlock"])(),Object(r["createBlock"])(d,{class:Object(r["normalizeClass"])(["userEditForm",{loading:e.isSavingUserInfo}]),"content-title":"".concat(e.formTitle," ").concat(e.isAdd?"":"'".concat(e.theUser.login,"'"))},{default:Object(r["withCtx"])((function(){return[Object(r["withDirectives"])(Object(r["createElementVNode"])("div",Fe,[e.isAdd?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ie,[Object(r["createElementVNode"])("ul",Ge,[Object(r["createElementVNode"])("li",{class:Object(r["normalizeClass"])([{active:"basic"===e.activeTab},"menuBasicInfo"])},[Object(r["createElementVNode"])("a",{href:"",onClick:t[0]||(t[0]=Object(r["withModifiers"])((function(t){return e.activeTab="basic"}),["prevent"]))},Object(r["toDisplayString"])(e.translate("UsersManager_BasicInformation")),1)],2),Object(r["createElementVNode"])("li",{class:Object(r["normalizeClass"])([{active:"permissions"===e.activeTab},"menuPermissions"])},[Object(r["createElementVNode"])("a",{href:"",onClick:t[1]||(t[1]=Object(r["withModifiers"])((function(t){return e.activeTab="permissions"}),["prevent"])),style:{"margin-right":"3.5px"}},Object(r["toDisplayString"])(e.translate("UsersManager_Permissions")),1),e.userHasAccess||e.theUser.superuser_access?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("span",$e))],2),"superuser"===e.currentUserRole?(Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{key:0,class:Object(r["normalizeClass"])([{active:"superuser"===e.activeTab},"menuSuperuser"])},[Object(r["createElementVNode"])("a",{href:"",onClick:t[2]||(t[2]=Object(r["withModifiers"])((function(t){return e.activeTab="superuser"}),["prevent"]))},Object(r["toDisplayString"])(e.translate("UsersManager_SuperUserAccess")),1)],2)):Object(r["createCommentVNode"])("",!0),"superuser"===e.currentUserRole&&e.theUser.uses_2fa&&!e.isAdd?(Object(r["openBlock"])(),Object(r["createElementBlock"])("li",{key:1,class:Object(r["normalizeClass"])([{active:"2fa"===e.activeTab},"menuUserTwoFa"])},[Object(r["createElementVNode"])("a",{href:"",onClick:t[3]||(t[3]=Object(r["withModifiers"])((function(t){return e.activeTab="2fa"}),["prevent"]))},Object(r["toDisplayString"])(e.translate("UsersManager_TwoFactorAuthentication")),1)],2)):Object(r["createCommentVNode"])("",!0)]),ze,Object(r["createElementVNode"])("div",{class:"entityCancel",onClick:t[4]||(t[4]=Object(r["withModifiers"])((function(t){return e.onDoneEditing()}),["prevent"]))},[Object(r["createElementVNode"])("a",Je,Object(r["toDisplayString"])(e.translate("Mobile_NavigationBack")),1)])])),Object(r["createElementVNode"])("div",We,["basic"===e.activeTab?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",qe,[Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{modelValue:e.theUser.login,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.theUser.login=t}),disabled:e.isSavingUserInfo||!e.isAdd||e.isShowingPasswordConfirm,uicontrol:"text",name:"user_login",maxlength:100,title:e.translate("General_Username")},null,8,["modelValue","disabled","title"])]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{"model-value":e.theUser.password,disabled:e.isSavingUserInfo||"superuser"!==e.currentUserRole&&!e.isAdd||e.isShowingPasswordConfirm,"onUpdate:modelValue":t[6]||(t[6]=function(t){e.theUser.password=t,e.isPasswordModified=!0}),uicontrol:"password",name:"user_password",title:e.translate("General_Password")},null,8,["model-value","disabled","title"])]),Object(r["createElementVNode"])("div",null,["superuser"===e.currentUserRole||e.isAdd?(Object(r["openBlock"])(),Object(r["createBlock"])(o,{key:0,modelValue:e.theUser.email,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.theUser.email=t}),disabled:e.isSavingUserInfo||"superuser"!==e.currentUserRole&&!e.isAdd||e.isShowingPasswordConfirm,uicontrol:"text",name:"user_email",maxlength:100,title:e.translate("UsersManager_Email")},null,8,["modelValue","disabled","title"])):Object(r["createCommentVNode"])("",!0)]),Object(r["createElementVNode"])("div",null,[e.isAdd?(Object(r["openBlock"])(),Object(r["createBlock"])(o,{key:0,modelValue:e.firstSiteAccess,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.firstSiteAccess=t}),disabled:e.isSavingUserInfo,uicontrol:"site",name:"user_site","ui-control-attributes":{onlySitesWithAdminAccess:!0},title:e.translate("UsersManager_FirstWebsitePermission"),"inline-help":e.translate("UsersManager_FirstSiteInlineHelp")},null,8,["modelValue","disabled","title","inline-help"])):Object(r["createCommentVNode"])("",!0)]),Object(r["createElementVNode"])("div",null,["superuser"===e.currentUserRole||e.isAdd?(Object(r["openBlock"])(),Object(r["createBlock"])(c,{key:0,value:e.saveButtonLabel,disabled:e.isAdd&&(!e.firstSiteAccess||!e.firstSiteAccess.id),saving:e.isSavingUserInfo,onConfirm:t[9]||(t[9]=function(t){return e.saveUserInfo()})},null,8,["value","disabled","saving"])):Object(r["createCommentVNode"])("",!0)]),e.isAdd?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ye,[Object(r["createElementVNode"])("a",{href:"",class:"entityCancelLink",onClick:t[10]||(t[10]=Object(r["withModifiers"])((function(t){return e.onDoneEditing()}),["prevent"]))},Object(r["toDisplayString"])(e.translate("General_Cancel")),1)])):Object(r["createCommentVNode"])("",!0)])):Object(r["createCommentVNode"])("",!0),e.isAdd?Object(r["createCommentVNode"])("",!0):Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Xe,[e.theUser.superuser_access?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ke,[Object(r["createVNode"])(l,{"user-login":e.theUser.login,onUserHasAccessDetected:t[11]||(t[11]=function(t){return e.userHasAccess=t.hasAccess}),onAccessChanged:t[12]||(t[12]=function(t){return e.isUserModified=!0}),"access-levels":e.accessLevels,"filter-access-levels":e.filterAccessLevels},null,8,["user-login","access-levels","filter-access-levels"])])),e.theUser.superuser_access?(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Qe,Object(r["toDisplayString"])(e.translate("UsersManager_SuperUsersPermissionsNotice")),1)):Object(r["createCommentVNode"])("",!0)],512)),[[r["vShow"],"permissions"===e.activeTab]]),"superuser"!==e.activeTab||"superuser"!==e.currentUserRole||e.isAdd?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("div",Ze,[Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("UsersManager_SuperUserIntro1")),1),Object(r["createElementVNode"])("p",null,[Object(r["createElementVNode"])("strong",null,Object(r["toDisplayString"])(e.translate("UsersManager_SuperUserIntro2")),1)]),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{modelValue:e.superUserAccessChecked,"onUpdate:modelValue":t[13]||(t[13]=function(t){return e.superUserAccessChecked=t}),onClick:t[14]||(t[14]=function(t){return e.confirmSuperUserChange()}),disabled:e.isSavingUserInfo,uicontrol:"checkbox",name:"superuser_access",title:e.translate("UsersManager_HasSuperUserAccess")},null,8,["modelValue","disabled","title"])]),Object(r["createElementVNode"])("div",et,[Object(r["createElementVNode"])("div",tt,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("UsersManager_AreYouSure")),1),e.theUser.superuser_access?(Object(r["openBlock"])(),Object(r["createElementBlock"])("p",st,Object(r["toDisplayString"])(e.translate("UsersManager_RemoveSuperuserAccessConfirm")),1)):Object(r["createCommentVNode"])("",!0),e.theUser.superuser_access?Object(r["createCommentVNode"])("",!0):(Object(r["openBlock"])(),Object(r["createElementBlock"])("p",nt,Object(r["toDisplayString"])(e.translate("UsersManager_AddSuperuserAccessConfirm")),1)),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{modelValue:e.passwordConfirmationForSuperUser,"onUpdate:modelValue":t[15]||(t[15]=function(t){return e.passwordConfirmationForSuperUser=t}),uicontrol:"password",name:"currentUserPasswordForSuperUser",autocomplete:!1,"full-width":!0,title:e.translate("UsersManager_YourCurrentPassword")},null,8,["modelValue","title"])])]),Object(r["createElementVNode"])("div",it,[Object(r["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[16]||(t[16]=Object(r["withModifiers"])((function(t){return e.toggleSuperuserAccess()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(r["toDisplayString"])(e.translate("General_Yes")),1),Object(r["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[17]||(t[17]=Object(r["withModifiers"])((function(t){e.setSuperUserAccessChecked(),e.passwordConfirmationForSuperUser=""}),["prevent"]))},Object(r["toDisplayString"])(e.translate("General_No")),1)])],512)])),"superuser"!==e.currentUserRole||e.isAdd?Object(r["createCommentVNode"])("",!0):Object(r["withDirectives"])((Object(r["openBlock"])(),Object(r["createElementBlock"])("div",at,[Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("UsersManager_ResetTwoFactorAuthenticationInfo")),1),Object(r["createElementVNode"])("div",rt,[Object(r["createVNode"])(c,{saving:e.isResetting2FA,onConfirm:t[18]||(t[18]=function(t){return e.confirmReset2FA()}),value:e.translate("UsersManager_ResetTwoFactorAuthentication")},null,8,["saving","value"])]),Object(r["createElementVNode"])("div",ot,[Object(r["createElementVNode"])("div",ct,[Object(r["createElementVNode"])("h2",null,Object(r["toDisplayString"])(e.translate("UsersManager_AreYouSure")),1),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{modelValue:e.passwordConfirmation,"onUpdate:modelValue":t[19]||(t[19]=function(t){return e.passwordConfirmation=t}),uicontrol:"password",name:"currentUserPassword",autocomplete:!1,"full-width":!0,title:e.translate("UsersManager_YourCurrentPassword")},null,8,["modelValue","title"])])]),Object(r["createElementVNode"])("div",lt,[Object(r["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[20]||(t[20]=Object(r["withModifiers"])((function(t){return e.reset2FA()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(r["toDisplayString"])(e.translate("General_Yes")),1),Object(r["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[21]||(t[21]=function(t){t.preventDefault(),e.passwordConfirmation=""})},Object(r["toDisplayString"])(e.translate("General_No")),1)])],512)],512)),[[r["vShow"],"2fa"===e.activeTab]])])],512),[[u]]),Object(r["createElementVNode"])("div",dt,[Object(r["createElementVNode"])("div",ut,[Object(r["createElementVNode"])("h2",{innerHTML:e.changePasswordTitle},null,8,mt),Object(r["createElementVNode"])("p",null,Object(r["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1),Object(r["createElementVNode"])("div",null,[Object(r["createVNode"])(o,{modelValue:e.passwordConfirmation,"onUpdate:modelValue":t[22]||(t[22]=function(t){return e.passwordConfirmation=t}),uicontrol:"password",name:"currentUserPassword",autocomplete:!1,"full-width":!0,title:e.translate("UsersManager_YourCurrentPassword")},null,8,["modelValue","title"])])]),Object(r["createElementVNode"])("div",bt,[Object(r["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[23]||(t[23]=Object(r["withModifiers"])((function(t){return e.updateUser()}),["prevent"]))},Object(r["toDisplayString"])(e.translate("General_Yes")),1),Object(r["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[24]||(t[24]=function(t){t.preventDefault(),e.passwordConfirmation=""})},Object(r["toDisplayString"])(e.translate("General_No")),1)])],512)]})),_:1},8,["class","content-title"])}var ft={login:"",superuser_access:!1,uses_2fa:!1,password:"",email:""},ht=window,gt=ht.$,Ot=Object(r["defineComponent"])({props:{user:Object,currentUserRole:{type:String,required:!0},accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0},initialSiteId:{type:[String,Number],required:!0},initialSiteName:{type:String,required:!0}},components:{ContentBlock:a["ContentBlock"],Field:h["Field"],SaveButton:h["SaveButton"],UserPermissionsEdit:He},directives:{Form:h["Form"]},data:function(){return{theUser:this.user||Object.assign({},ft),activeTab:"basic",permissionsForIdSite:1,isSavingUserInfo:!1,userHasAccess:!0,firstSiteAccess:{id:this.initialSiteId,name:this.initialSiteName},isUserModified:!1,passwordConfirmation:"",isPasswordModified:!1,superUserAccessChecked:null,passwordConfirmationForSuperUser:"",isResetting2FA:!1,isShowingPasswordConfirm:!1}},emits:["done","updated"],watch:{user:function(e){this.theUser=e||Object.assign({},ft),this.theUser.password||this.resetPasswordVar(),this.setSuperUserAccessChecked()}},methods:{confirmSuperUserChange:function(){gt(this.$refs.superUserConfirmModal).modal({dismissible:!1}).modal("open")},confirmReset2FA:function(){gt(this.$refs.twofaConfirmModal).modal({dismissible:!1}).modal("open")},toggleSuperuserAccess:function(){var e=this;this.isSavingUserInfo=!0,a["AjaxHelper"].post({method:"UsersManager.setSuperUserAccess"},{userLogin:this.theUser.login,hasSuperUserAccess:this.theUser.superuser_access?"0":"1",passwordConfirmation:this.passwordConfirmationForSuperUser}).then((function(){e.theUser.superuser_access=!e.theUser.superuser_access})).catch((function(){})).then((function(){e.isSavingUserInfo=!1,e.isUserModified=!0,e.passwordConfirmationForSuperUser="",e.setSuperUserAccessChecked()}))},saveUserInfo:function(){var e=this;return Promise.resolve().then((function(){return e.isAdd?e.createUser():e.confirmUserChange()})).then((function(){e.$emit("updated",{user:Object(r["readonly"])(e.theUser)})}))},createUser:function(){var e=this;return this.isSavingUserInfo=!0,a["AjaxHelper"].post({method:"UsersManager.addUser"},{userLogin:this.theUser.login,password:this.theUser.password,email:this.theUser.email,initialIdSite:this.firstSiteAccess?this.firstSiteAccess.id:void 0}).catch((function(t){throw e.isSavingUserInfo=!1,t})).then((function(){e.firstSiteAccess=null,e.isSavingUserInfo=!1,e.isUserModified=!0,e.resetPasswordVar(),e.showUserSavedNotification()}))},resetPasswordVar:function(){this.isAdd||(this.theUser.password="XXXXXXXX")},confirmUserChange:function(){var e=this;this.passwordConfirmation="",this.isShowingPasswordConfirm=!0;var t=function(t){var s=t.keyCode?t.keyCode:t.which;13===s&&(gt(e.$refs.changePasswordModal).modal("close"),e.updateUser())};gt(this.$refs.changePasswordModal).modal({dismissible:!1,onOpenEnd:function(){e.isShowingPasswordConfirm=!1,gt(".modal.open #currentUserPassword").focus().off("keypress").keypress(t)}}).modal("open")},showUserSavedNotification:function(){a["NotificationsStore"].show({message:Object(a["translate"])("General_YourChangesHaveBeenSaved"),context:"success",type:"toast"})},reset2FA:function(){var e=this;return this.isResetting2FA=!0,a["AjaxHelper"].post({method:"TwoFactorAuth.resetTwoFactorAuth",userLogin:this.theUser.login,passwordConfirmation:this.passwordConfirmation}).catch((function(t){throw e.isResetting2FA=!1,t})).then((function(){e.isResetting2FA=!1,e.theUser.uses_2fa=!1,e.activeTab="basic",e.showUserSavedNotification()})).finally((function(){e.passwordConfirmation=""}))},updateUser:function(){var e=this;return this.isSavingUserInfo=!0,a["AjaxHelper"].post({method:"UsersManager.updateUser"},{userLogin:this.theUser.login,password:this.isPasswordModified&&this.theUser.password?this.theUser.password:void 0,passwordConfirmation:this.passwordConfirmation?this.passwordConfirmation:void 0,email:this.theUser.email}).catch((function(t){throw e.isSavingUserInfo=!1,e.passwordConfirmation="",t})).then((function(){e.isSavingUserInfo=!1,e.passwordConfirmation="",e.isUserModified=!0,e.isPasswordModified=!1,e.resetPasswordVar(),e.showUserSavedNotification()}))},setSuperUserAccessChecked:function(){this.superUserAccessChecked=!!this.theUser.superuser_access},onDoneEditing:function(){this.$emit("done",{isUserModified:this.isUserModified})}},computed:{formTitle:function(){return this.isAdd?Object(a["translate"])("UsersManager_AddNewUser"):Object(a["translate"])("UsersManager_EditUser")},saveButtonLabel:function(){return this.isAdd?Object(a["translate"])("UsersManager_CreateUser"):Object(a["translate"])("UsersManager_SaveBasicInfo")},isAdd:function(){return!this.user},changePasswordTitle:function(){return Object(a["translate"])("UsersManager_AreYouSureChangeDetails","<strong>".concat(this.theUser.login,"</strong>"))}}});Ot.render=pt;var jt=Ot; + */function pt(e,t,n,s,i,r){var a=Object(o["resolveComponent"])("Field"),c=Object(o["resolveComponent"])("SaveButton"),l=Object(o["resolveComponent"])("UserPermissionsEdit"),d=Object(o["resolveComponent"])("ContentBlock"),u=Object(o["resolveDirective"])("form");return Object(o["openBlock"])(),Object(o["createBlock"])(d,{class:Object(o["normalizeClass"])(["userEditForm",{loading:e.isSavingUserInfo}]),"content-title":"".concat(e.formTitle," ").concat(e.isAdd?"":"'".concat(e.theUser.login,"'"))},{default:Object(o["withCtx"])((function(){return[Object(o["withDirectives"])(Object(o["createElementVNode"])("div",Fe,[e.isAdd?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ie,[Object(o["createElementVNode"])("ul",Ge,[Object(o["createElementVNode"])("li",{class:Object(o["normalizeClass"])([{active:"basic"===e.activeTab},"menuBasicInfo"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[0]||(t[0]=Object(o["withModifiers"])((function(t){return e.activeTab="basic"}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_BasicInformation")),1)],2),Object(o["createElementVNode"])("li",{class:Object(o["normalizeClass"])([{active:"permissions"===e.activeTab},"menuPermissions"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[1]||(t[1]=Object(o["withModifiers"])((function(t){return e.activeTab="permissions"}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("UsersManager_Permissions")),1),e.userHasAccess||e.theUser.superuser_access?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",$e))],2),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:0,class:Object(o["normalizeClass"])([{active:"superuser"===e.activeTab},"menuSuperuser"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[2]||(t[2]=Object(o["withModifiers"])((function(t){return e.activeTab="superuser"}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_SuperUserAccess")),1)],2)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole&&e.theUser.uses_2fa&&!e.isAdd?(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:1,class:Object(o["normalizeClass"])([{active:"2fa"===e.activeTab},"menuUserTwoFa"])},[Object(o["createElementVNode"])("a",{href:"",onClick:t[3]||(t[3]=Object(o["withModifiers"])((function(t){return e.activeTab="2fa"}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_TwoFactorAuthentication")),1)],2)):Object(o["createCommentVNode"])("",!0)]),Je,Object(o["createElementVNode"])("div",{class:"entityCancel",onClick:t[4]||(t[4]=Object(o["withModifiers"])((function(t){return e.onDoneEditing()}),["prevent"]))},[Object(o["createElementVNode"])("a",qe,Object(o["toDisplayString"])(e.translate("Mobile_NavigationBack")),1)])])),Object(o["createElementVNode"])("div",ze,["basic"===e.activeTab?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",We,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{modelValue:e.theUser.login,"onUpdate:modelValue":t[5]||(t[5]=function(t){return e.theUser.login=t}),disabled:e.isSavingUserInfo||!e.isAdd||e.isShowingPasswordConfirm,uicontrol:"text",name:"user_login",maxlength:100,title:e.translate("General_Username")},null,8,["modelValue","disabled","title"])]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{"model-value":e.theUser.password,disabled:e.isSavingUserInfo||"superuser"!==e.currentUserRole&&!e.isAdd||e.isShowingPasswordConfirm,"onUpdate:modelValue":t[6]||(t[6]=function(t){e.theUser.password=t,e.isPasswordModified=!0}),uicontrol:"password",name:"user_password",title:e.translate("General_Password")},null,8,["model-value","disabled","title"])]),Object(o["createElementVNode"])("div",null,["superuser"===e.currentUserRole||e.isAdd?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,modelValue:e.theUser.email,"onUpdate:modelValue":t[7]||(t[7]=function(t){return e.theUser.email=t}),disabled:e.isSavingUserInfo||"superuser"!==e.currentUserRole&&!e.isAdd||e.isShowingPasswordConfirm,uicontrol:"text",name:"user_email",maxlength:100,title:e.translate("UsersManager_Email")},null,8,["modelValue","disabled","title"])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",null,[e.isAdd?(Object(o["openBlock"])(),Object(o["createBlock"])(a,{key:0,modelValue:e.firstSiteAccess,"onUpdate:modelValue":t[8]||(t[8]=function(t){return e.firstSiteAccess=t}),disabled:e.isSavingUserInfo,uicontrol:"site",name:"user_site","ui-control-attributes":{onlySitesWithAdminAccess:!0},title:e.translate("UsersManager_FirstWebsitePermission"),"inline-help":e.translate("UsersManager_FirstSiteInlineHelp")},null,8,["modelValue","disabled","title","inline-help"])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("div",null,["superuser"===e.currentUserRole||e.isAdd?(Object(o["openBlock"])(),Object(o["createBlock"])(c,{key:0,value:e.saveButtonLabel,disabled:e.isAdd&&(!e.firstSiteAccess||!e.firstSiteAccess.id),saving:e.isSavingUserInfo,onConfirm:t[9]||(t[9]=function(t){return e.saveUserInfo()})},null,8,["value","disabled","saving"])):Object(o["createCommentVNode"])("",!0)]),e.isAdd?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ye,[Object(o["createElementVNode"])("a",{href:"",class:"entityCancelLink",onClick:t[10]||(t[10]=Object(o["withModifiers"])((function(t){return e.onDoneEditing()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_Cancel")),1)])):Object(o["createCommentVNode"])("",!0)])):Object(o["createCommentVNode"])("",!0),e.isAdd?Object(o["createCommentVNode"])("",!0):Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Xe,[e.theUser.superuser_access?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ke,[Object(o["createVNode"])(l,{"user-login":e.theUser.login,onUserHasAccessDetected:t[11]||(t[11]=function(t){return e.userHasAccess=t.hasAccess}),onAccessChanged:t[12]||(t[12]=function(t){return e.isUserModified=!0}),"access-levels":e.accessLevels,"filter-access-levels":e.filterAccessLevels},null,8,["user-login","access-levels","filter-access-levels"])])),e.theUser.superuser_access?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Qe,Object(o["toDisplayString"])(e.translate("UsersManager_SuperUsersPermissionsNotice")),1)):Object(o["createCommentVNode"])("",!0)],512)),[[o["vShow"],"permissions"===e.activeTab]]),"superuser"!==e.activeTab||"superuser"!==e.currentUserRole||e.isAdd?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Ze,[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_SuperUserIntro1")),1),Object(o["createElementVNode"])("p",null,[Object(o["createElementVNode"])("strong",null,Object(o["toDisplayString"])(e.translate("UsersManager_SuperUserIntro2")),1)]),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{modelValue:e.superUserAccessChecked,"onUpdate:modelValue":t[13]||(t[13]=function(t){return e.superUserAccessChecked=t}),onClick:t[14]||(t[14]=function(t){return e.confirmSuperUserChange()}),disabled:e.isSavingUserInfo,uicontrol:"checkbox",name:"superuser_access",title:e.translate("UsersManager_HasSuperUserAccess")},null,8,["modelValue","disabled","title"])]),Object(o["createElementVNode"])("div",et,[Object(o["createElementVNode"])("div",tt,[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("UsersManager_AreYouSure")),1),e.theUser.superuser_access?(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",nt,Object(o["toDisplayString"])(e.translate("UsersManager_RemoveSuperuserAccessConfirm")),1)):Object(o["createCommentVNode"])("",!0),e.theUser.superuser_access?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",st,Object(o["toDisplayString"])(e.translate("UsersManager_AddSuperuserAccessConfirm")),1)),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{modelValue:e.passwordConfirmationForSuperUser,"onUpdate:modelValue":t[15]||(t[15]=function(t){return e.passwordConfirmationForSuperUser=t}),uicontrol:"password",name:"currentUserPasswordForSuperUser",autocomplete:!1,"full-width":!0,title:e.translate("UsersManager_YourCurrentPassword")},null,8,["modelValue","title"])])]),Object(o["createElementVNode"])("div",it,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[16]||(t[16]=Object(o["withModifiers"])((function(t){return e.toggleSuperuserAccess()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[17]||(t[17]=Object(o["withModifiers"])((function(t){e.setSuperUserAccessChecked(),e.passwordConfirmationForSuperUser=""}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512)])),"superuser"!==e.currentUserRole||e.isAdd?Object(o["createCommentVNode"])("",!0):Object(o["withDirectives"])((Object(o["openBlock"])(),Object(o["createElementBlock"])("div",rt,[Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ResetTwoFactorAuthenticationInfo")),1),Object(o["createElementVNode"])("div",ot,[Object(o["createVNode"])(c,{saving:e.isResetting2FA,onConfirm:t[18]||(t[18]=function(t){return e.confirmReset2FA()}),value:e.translate("UsersManager_ResetTwoFactorAuthentication")},null,8,["saving","value"])]),Object(o["createElementVNode"])("div",at,[Object(o["createElementVNode"])("div",ct,[Object(o["createElementVNode"])("h2",null,Object(o["toDisplayString"])(e.translate("UsersManager_AreYouSure")),1),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{modelValue:e.passwordConfirmation,"onUpdate:modelValue":t[19]||(t[19]=function(t){return e.passwordConfirmation=t}),uicontrol:"password",name:"currentUserPassword",autocomplete:!1,"full-width":!0,title:e.translate("UsersManager_YourCurrentPassword")},null,8,["modelValue","title"])])]),Object(o["createElementVNode"])("div",lt,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[20]||(t[20]=Object(o["withModifiers"])((function(t){return e.reset2FA()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[21]||(t[21]=function(t){t.preventDefault(),e.passwordConfirmation=""})},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512)],512)),[[o["vShow"],"2fa"===e.activeTab]])])],512),[[u]]),Object(o["createElementVNode"])("div",dt,[Object(o["createElementVNode"])("div",ut,[Object(o["createElementVNode"])("h2",{innerHTML:e.changePasswordTitle},null,8,mt),Object(o["createElementVNode"])("p",null,Object(o["toDisplayString"])(e.translate("UsersManager_ConfirmWithPassword")),1),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{modelValue:e.passwordConfirmation,"onUpdate:modelValue":t[22]||(t[22]=function(t){return e.passwordConfirmation=t}),uicontrol:"password",name:"currentUserPassword",autocomplete:!1,"full-width":!0,title:e.translate("UsersManager_YourCurrentPassword")},null,8,["modelValue","title"])])]),Object(o["createElementVNode"])("div",bt,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[23]||(t[23]=Object(o["withModifiers"])((function(t){return e.updateUser()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[24]||(t[24]=function(t){t.preventDefault(),e.passwordConfirmation=""})},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512)]})),_:1},8,["class","content-title"])}var ht={login:"",superuser_access:!1,uses_2fa:!1,password:"",email:""},ft=window,gt=ft.$,Ot=Object(o["defineComponent"])({props:{user:Object,currentUserRole:{type:String,required:!0},accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0},initialSiteId:{type:[String,Number],required:!0},initialSiteName:{type:String,required:!0}},components:{ContentBlock:r["ContentBlock"],Field:f["Field"],SaveButton:f["SaveButton"],UserPermissionsEdit:He},directives:{Form:f["Form"]},data:function(){return{theUser:this.user||Object.assign({},ht),activeTab:"basic",permissionsForIdSite:1,isSavingUserInfo:!1,userHasAccess:!0,firstSiteAccess:{id:this.initialSiteId,name:this.initialSiteName},isUserModified:!1,passwordConfirmation:"",isPasswordModified:!1,superUserAccessChecked:null,passwordConfirmationForSuperUser:"",isResetting2FA:!1,isShowingPasswordConfirm:!1}},emits:["done","updated"],watch:{user:function(e){this.onUserChange(e)}},created:function(){this.onUserChange(this.user)},methods:{onUserChange:function(e){this.theUser=e||Object.assign({},ht),this.theUser.password||this.resetPasswordVar(),this.setSuperUserAccessChecked()},confirmSuperUserChange:function(){gt(this.$refs.superUserConfirmModal).modal({dismissible:!1}).modal("open")},confirmReset2FA:function(){gt(this.$refs.twofaConfirmModal).modal({dismissible:!1}).modal("open")},toggleSuperuserAccess:function(){var e=this;this.isSavingUserInfo=!0,r["AjaxHelper"].post({method:"UsersManager.setSuperUserAccess"},{userLogin:this.theUser.login,hasSuperUserAccess:this.theUser.superuser_access?"0":"1",passwordConfirmation:this.passwordConfirmationForSuperUser}).then((function(){e.theUser.superuser_access=!e.theUser.superuser_access})).catch((function(){})).then((function(){e.isSavingUserInfo=!1,e.isUserModified=!0,e.passwordConfirmationForSuperUser="",e.setSuperUserAccessChecked()}))},saveUserInfo:function(){var e=this;return Promise.resolve().then((function(){return e.isAdd?e.createUser():e.confirmUserChange()})).then((function(){e.$emit("updated",{user:Object(o["readonly"])(e.theUser)})}))},createUser:function(){var e=this;return this.isSavingUserInfo=!0,r["AjaxHelper"].post({method:"UsersManager.addUser"},{userLogin:this.theUser.login,password:this.theUser.password,email:this.theUser.email,initialIdSite:this.firstSiteAccess?this.firstSiteAccess.id:void 0}).catch((function(t){throw e.isSavingUserInfo=!1,t})).then((function(){e.firstSiteAccess=null,e.isSavingUserInfo=!1,e.isUserModified=!0,e.resetPasswordVar(),e.showUserSavedNotification()}))},resetPasswordVar:function(){this.isAdd||(this.theUser.password="XXXXXXXX")},confirmUserChange:function(){var e=this;this.passwordConfirmation="",this.isShowingPasswordConfirm=!0;var t=function(t){var n=t.keyCode?t.keyCode:t.which;13===n&&(gt(e.$refs.changePasswordModal).modal("close"),e.updateUser())};gt(this.$refs.changePasswordModal).modal({dismissible:!1,onOpenEnd:function(){e.isShowingPasswordConfirm=!1,gt(".modal.open #currentUserPassword").focus().off("keypress").keypress(t)}}).modal("open")},showUserSavedNotification:function(){r["NotificationsStore"].show({message:Object(r["translate"])("General_YourChangesHaveBeenSaved"),context:"success",type:"toast"})},reset2FA:function(){var e=this;return this.isResetting2FA=!0,r["AjaxHelper"].post({method:"TwoFactorAuth.resetTwoFactorAuth",userLogin:this.theUser.login,passwordConfirmation:this.passwordConfirmation}).catch((function(t){throw e.isResetting2FA=!1,t})).then((function(){e.isResetting2FA=!1,e.theUser.uses_2fa=!1,e.activeTab="basic",e.showUserSavedNotification()})).finally((function(){e.passwordConfirmation=""}))},updateUser:function(){var e=this;return this.isSavingUserInfo=!0,r["AjaxHelper"].post({method:"UsersManager.updateUser"},{userLogin:this.theUser.login,password:this.isPasswordModified&&this.theUser.password?this.theUser.password:void 0,passwordConfirmation:this.passwordConfirmation?this.passwordConfirmation:void 0,email:this.theUser.email}).catch((function(t){throw e.isSavingUserInfo=!1,e.passwordConfirmation="",t})).then((function(){e.isSavingUserInfo=!1,e.passwordConfirmation="",e.isUserModified=!0,e.isPasswordModified=!1,e.resetPasswordVar(),e.showUserSavedNotification()}))},setSuperUserAccessChecked:function(){this.superUserAccessChecked=!!this.theUser.superuser_access},onDoneEditing:function(){this.$emit("done",{isUserModified:this.isUserModified})}},computed:{formTitle:function(){return this.isAdd?Object(r["translate"])("UsersManager_AddNewUser"):Object(r["translate"])("UsersManager_EditUser")},saveButtonLabel:function(){return this.isAdd?Object(r["translate"])("UsersManager_CreateUser"):Object(r["translate"])("UsersManager_SaveBasicInfo")},isAdd:function(){return!this.user},changePasswordTitle:function(){return Object(r["translate"])("UsersManager_AreYouSureChangeDetails","<strong>".concat(this.theUser.login,"</strong>"))}}});Ot.render=pt;var jt=Ot,vt=(Object(r["createAngularJsAdapter"])({component:jt,scope:{user:{angularJsBind:"<"},onDoneEditing:{angularJsBind:"&",vue:"done"},currentUserRole:{angularJsBind:"<"},accessLevels:{angularJsBind:"<"},filterAccessLevels:{angularJsBind:"<"},initialSiteId:{angularJsBind:"<"},initialSiteName:{angularJsBind:"<"},onUpdated:{angularJsBind:"&",vue:"updated"}},directiveName:"piwikUserEditForm",restrict:"E"}),{class:"userListFilters row"}),Ct={class:"col s12 m12 l6"},kt={class:"input-field col s12 m4 l4"},Nt={id:"user-list-bulk-actions",class:"dropdown-content"},yt={class:"dropdown-trigger","data-target":"bulk-set-access"},At={id:"bulk-set-access",class:"dropdown-content"},Et=["onClick"],Vt={key:0},St={class:"input-field col s12 m4 l4"},Ut={class:"permissions-for-selector"},Tt={class:"input-field col s12 m4 l4"},wt={key:0,class:"input-field col s12 m12 l6 users-list-pagination-container"},Mt={class:"usersListPagination"},Bt={class:"pointer"},_t={class:"counter"},Lt={key:0},Rt={class:"pointer"},xt={key:0,class:"roles-help-notification"},Dt=["innerHTML"],Pt={class:"select-cell"},Ht={class:"checkbox-container"},Ft=Object(o["createElementVNode"])("span",null,null,-1),It={class:"first"},Gt={class:"role_header"},$t={style:{"margin-right":"3.5px"}},Jt=Object(o["createElementVNode"])("span",{class:"icon-help"},null,-1),qt=[Jt],zt={key:0},Wt=["title"],Yt={key:2},Xt={class:"actions-cell-header"},Kt={key:0,class:"select-all-row"},Qt={colspan:"8"},Zt={key:0},en=["innerHTML"],tn=["innerHTML"],nn={key:1},sn=["innerHTML"],rn=["innerHTML"],on=["id"],an={class:"select-cell"},cn={class:"checkbox-container"},ln=["id","onUpdate:modelValue"],dn=Object(o["createElementVNode"])("span",null,null,-1),un={id:"userLogin"},mn={class:"access-cell"},bn={key:0,id:"email"},pn={key:1,id:"twofa"},hn={key:0,class:"icon-ok"},fn={key:1,class:"icon-close"},gn={key:2,id:"last_seen"},On={class:"center actions-cell"},jn=["onClick"],vn=Object(o["createElementVNode"])("span",{class:"icon-edit"},null,-1),Cn=[vn],kn=["onClick"],Nn=Object(o["createElementVNode"])("span",{class:"icon-delete"},null,-1),yn=[Nn],An={class:"delete-user-confirm-modal modal",ref:"deleteUserConfirmModal"},En={class:"modal-content"},Vn=["innerHTML"],Sn=["innerHTML"],Un={class:"modal-footer"},Tn={class:"change-user-role-confirm-modal modal",ref:"changeUserRoleConfirmModal"},wn={class:"modal-content"},Mn=["innerHTML"],Bn={key:1},_n=["innerHTML"],Ln=["innerHTML"],Rn={class:"modal-footer"}; /*! * Matomo - free/libre analytics platform * * @link https://matomo.org * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later - */Object(a["createAngularJsAdapter"])({component:jt,scope:{user:{angularJsBind:"<"},onDoneEditing:{angularJsBind:"&",vue:"done"},currentUserRole:{angularJsBind:"<"},accessLevels:{angularJsBind:"<"},filterAccessLevels:{angularJsBind:"<"},initialSiteId:{angularJsBind:"<"},initialSiteName:{angularJsBind:"<"},onUpdated:{angularJsBind:"&",vue:"updated"}},directiveName:"piwikUserEditForm",restrict:"E"})}})})); + */function xn(e,t,n,s,i,r){var a=Object(o["resolveComponent"])("Field"),c=Object(o["resolveComponent"])("ActivityIndicator"),l=Object(o["resolveComponent"])("Notification"),d=Object(o["resolveComponent"])("ContentBlock"),u=Object(o["resolveDirective"])("dropdown-menu"),m=Object(o["resolveDirective"])("content-table");return Object(o["openBlock"])(),Object(o["createElementBlock"])("div",{class:Object(o["normalizeClass"])(["pagedUsersList",{loading:e.isLoadingUsers}])},[Object(o["createElementVNode"])("div",vt,[Object(o["createElementVNode"])("div",Ct,[Object(o["createElementVNode"])("div",kt,[Object(o["withDirectives"])(Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["dropdown-trigger btn bulk-actions",{disabled:e.isBulkActionsDisabled}]),href:"","data-target":"user-list-bulk-actions"},[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_BulkActions")),1)],2),[[u]]),Object(o["createElementVNode"])("ul",Nt,[Object(o["createElementVNode"])("li",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("a",yt,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("UsersManager_SetPermission")),1)],512),[[u]]),Object(o["createElementVNode"])("ul",At,[(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.bulkActionAccessLevels,(function(t){return Object(o["openBlock"])(),Object(o["createElementBlock"])("li",{key:t.key},[Object(o["createElementVNode"])("a",{href:"",onClick:Object(o["withModifiers"])((function(n){e.userToChange=null,e.roleToChangeTo=t.key,e.showAccessChangeConfirm()}),["prevent"])},Object(o["toDisplayString"])(t.value),9,Et)])})),128))])]),Object(o["createElementVNode"])("li",null,[Object(o["createElementVNode"])("a",{href:"",onClick:t[0]||(t[0]=Object(o["withModifiers"])((function(t){e.userToChange=null,e.roleToChangeTo="noaccess",e.showAccessChangeConfirm()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_RemovePermissions")),1)]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("li",Vt,[Object(o["createElementVNode"])("a",{href:"",onClick:t[1]||(t[1]=Object(o["withModifiers"])((function(t){return e.showDeleteConfirm()}),["prevent"]))},Object(o["toDisplayString"])(e.translate("UsersManager_DeleteUsers")),1)])):Object(o["createCommentVNode"])("",!0)])]),Object(o["createElementVNode"])("div",St,[Object(o["createElementVNode"])("div",Ut,[Object(o["createVNode"])(a,{"model-value":e.userTextFilter,"onUpdate:modelValue":t[2]||(t[2]=function(t){return e.onUserTextFilterChange(t)}),name:"user-text-filter",uicontrol:"text","full-width":!0,placeholder:e.translate("UsersManager_UserSearch")},null,8,["model-value","placeholder"])])]),Object(o["createElementVNode"])("div",Tt,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{"model-value":e.accessLevelFilter,"onUpdate:modelValue":t[3]||(t[3]=function(t){e.accessLevelFilter=t,e.changeSearch({filter_access:e.accessLevelFilter,offset:0})}),name:"access-level-filter",uicontrol:"select",options:e.filterAccessLevels,"full-width":!0,placeholder:e.translate("UsersManager_FilterByAccess")},null,8,["model-value","options","placeholder"])])])]),e.totalEntries>e.searchParams.limit?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",wt,[Object(o["createElementVNode"])("div",Mt,[Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["btn prev",{disabled:e.searchParams.offset<=0}]),onClick:t[4]||(t[4]=Object(o["withModifiers"])((function(t){return e.gotoPreviousPage()}),["prevent"]))},[Object(o["createElementVNode"])("span",Bt,"« "+Object(o["toDisplayString"])(e.translate("General_Previous")),1)],2),Object(o["createElementVNode"])("div",_t,[e.isLoadingUsers?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",Lt,Object(o["toDisplayString"])(e.translate("General_Pagination",e.paginationLowerBound,e.paginationUpperBound,e.totalEntries)),1)),e.isLoadingUsers?(Object(o["openBlock"])(),Object(o["createBlock"])(c,{key:1,loading:e.isLoadingUsers},null,8,["loading"])):Object(o["createCommentVNode"])("",!0)]),Object(o["createElementVNode"])("a",{class:Object(o["normalizeClass"])(["btn next",{disabled:e.searchParams.offset+e.searchParams.limit>=e.totalEntries}]),onClick:t[5]||(t[5]=Object(o["withModifiers"])((function(t){return e.gotoNextPage()}),["prevent"]))},[Object(o["createElementVNode"])("span",Rt,Object(o["toDisplayString"])(e.translate("General_Next"))+" »",1)],2)])])):Object(o["createCommentVNode"])("",!0)]),e.isRoleHelpToggled?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",xt,[Object(o["createVNode"])(l,{context:"info",type:"persistent",noclear:!0},{default:Object(o["withCtx"])((function(){return[Object(o["createElementVNode"])("span",{innerHTML:e.rolesHelpText},null,8,Dt)]})),_:1})])):Object(o["createCommentVNode"])("",!0),Object(o["createVNode"])(d,null,{default:Object(o["withCtx"])((function(){return[Object(o["withDirectives"])(Object(o["createElementVNode"])("table",{id:"manageUsersTable",class:Object(o["normalizeClass"])({loading:e.isLoadingUsers})},[Object(o["createElementVNode"])("thead",null,[Object(o["createElementVNode"])("tr",null,[Object(o["createElementVNode"])("th",Pt,[Object(o["createElementVNode"])("span",Ht,[Object(o["createElementVNode"])("label",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"checkbox",id:"paged_users_select_all",checked:"checked","onUpdate:modelValue":t[6]||(t[6]=function(t){return e.isAllCheckboxSelected=t}),onChange:t[7]||(t[7]=function(t){return e.onAllCheckboxChange()})},null,544),[[o["vModelCheckbox"],e.isAllCheckboxSelected]]),Ft])])]),Object(o["createElementVNode"])("th",It,Object(o["toDisplayString"])(e.translate("UsersManager_Username")),1),Object(o["createElementVNode"])("th",Gt,[Object(o["createElementVNode"])("span",$t,Object(o["toDisplayString"])(e.translate("UsersManager_RoleFor")),1),Object(o["createElementVNode"])("a",{href:"",class:Object(o["normalizeClass"])(["helpIcon",{sticky:e.isRoleHelpToggled}]),onClick:t[8]||(t[8]=Object(o["withModifiers"])((function(t){return e.isRoleHelpToggled=!e.isRoleHelpToggled}),["prevent"]))},qt,2),Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{class:"permissions-for-selector","model-value":e.permissionsForSite,"onUpdate:modelValue":t[9]||(t[9]=function(t){e.onPermissionsForUpdate(t)}),uicontrol:"site","ui-control-attributes":{onlySitesWithAdminAccess:"superuser"!==e.currentUserRole}},null,8,["model-value","ui-control-attributes"])])]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",zt,Object(o["toDisplayString"])(e.translate("UsersManager_Email")),1)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",{key:1,title:e.translate("UsersManager_UsesTwoFactorAuthentication")},Object(o["toDisplayString"])(e.translate("UsersManager_2FA")),9,Wt)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("th",Yt,Object(o["toDisplayString"])(e.translate("UsersManager_LastSeen")),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("th",Xt,[Object(o["createElementVNode"])("div",null,Object(o["toDisplayString"])(e.translate("General_Actions")),1)])])]),Object(o["createElementVNode"])("tbody",null,[e.isAllCheckboxSelected&&e.users.length&&e.users.length<e.totalEntries?(Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",Kt,[Object(o["createElementVNode"])("td",Qt,[e.areAllResultsSelected?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",Zt,[Object(o["createElementVNode"])("span",{innerHTML:e.translate("UsersManager_TheDisplayedUsersAreSelected","<strong>".concat(e.users.length,"</strong>")),style:{"margin-right":"3.5px"}},null,8,en),Object(o["createElementVNode"])("a",{class:"toggle-select-all-in-search",href:"#",onClick:t[10]||(t[10]=Object(o["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.translate("UsersManager_ClickToSelectAll","<strong>".concat(e.totalEntries,"</strong>"))},null,8,tn)])),e.areAllResultsSelected?(Object(o["openBlock"])(),Object(o["createElementBlock"])("div",nn,[Object(o["createElementVNode"])("span",{innerHTML:e.translate("UsersManager_AllUsersAreSelected","<strong>".concat(e.totalEntries,"</strong>")),style:{"margin-right":"3.5px"}},null,8,sn),Object(o["createElementVNode"])("a",{class:"toggle-select-all-in-search",href:"#",onClick:t[11]||(t[11]=Object(o["withModifiers"])((function(t){return e.areAllResultsSelected=!e.areAllResultsSelected}),["prevent"])),innerHTML:e.translate("UsersManager_ClickToSelectDisplayedUsers","<strong>".concat(e.users.length,"</strong>"))},null,8,rn)])):Object(o["createCommentVNode"])("",!0)])])):Object(o["createCommentVNode"])("",!0),(Object(o["openBlock"])(!0),Object(o["createElementBlock"])(o["Fragment"],null,Object(o["renderList"])(e.users,(function(n,s){return Object(o["openBlock"])(),Object(o["createElementBlock"])("tr",{id:"row".concat(s),key:n.login},[Object(o["createElementVNode"])("td",an,[Object(o["createElementVNode"])("span",cn,[Object(o["createElementVNode"])("label",null,[Object(o["withDirectives"])(Object(o["createElementVNode"])("input",{type:"checkbox",id:"paged_users_select_row".concat(s),"onUpdate:modelValue":function(t){return e.selectedRows[s]=t},onClick:t[12]||(t[12]=function(t){return e.onRowSelected()})},null,8,ln),[[o["vModelCheckbox"],e.selectedRows[s]]]),dn])])]),Object(o["createElementVNode"])("td",un,Object(o["toDisplayString"])(n.login),1),Object(o["createElementVNode"])("td",mn,[Object(o["createElementVNode"])("div",null,[Object(o["createVNode"])(a,{"model-value":n.role,"onUpdate:modelValue":function(t){e.userToChange=n,e.roleToChangeTo=t,e.showAccessChangeConfirm()},disabled:"superuser"===n.role,uicontrol:"select",options:"anonymous"!==n.login?e.accessLevels:e.anonymousAccessLevels},null,8,["model-value","onUpdate:modelValue","disabled","options"])])]),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",bn,Object(o["toDisplayString"])(n.email),1)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",pn,[n.uses_2fa?(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",hn)):Object(o["createCommentVNode"])("",!0),n.uses_2fa?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("span",fn))])):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole?(Object(o["openBlock"])(),Object(o["createElementBlock"])("td",gn,Object(o["toDisplayString"])(n.last_seen?"".concat(n.last_seen," ago"):"-"),1)):Object(o["createCommentVNode"])("",!0),Object(o["createElementVNode"])("td",On,["anonymous"!==n.login?(Object(o["openBlock"])(),Object(o["createElementBlock"])("button",{key:0,class:"edituser table-action",title:"Edit",onClick:function(t){return e.$emit("editUser",{user:n})}},Cn,8,jn)):Object(o["createCommentVNode"])("",!0),"superuser"===e.currentUserRole&&"anonymous"!==n.login?(Object(o["openBlock"])(),Object(o["createElementBlock"])("button",{key:1,class:"deleteuser table-action",title:"Delete",onClick:function(t){e.userToChange=n,e.showDeleteConfirm()}},yn,8,kn)):Object(o["createCommentVNode"])("",!0)])],8,on)})),128))])],2),[[m]])]})),_:1}),Object(o["createElementVNode"])("div",An,[Object(o["createElementVNode"])("div",En,[e.userToChange?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h3",{key:0,innerHTML:e.translate("UsersManager_DeleteUserConfirmSingle","<strong>".concat(e.userToChange.login,"</strong>"))},null,8,Vn)):Object(o["createCommentVNode"])("",!0),e.userToChange?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",{key:1,innerHTML:e.translate("UsersManager_DeleteUserConfirmMultiple","<strong>".concat(e.affectedUsersCount,"</strong>"))},null,8,Sn))]),Object(o["createElementVNode"])("div",Un,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[13]||(t[13]=Object(o["withModifiers"])((function(t){return e.deleteRequestedUsers()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[14]||(t[14]=Object(o["withModifiers"])((function(t){e.userToChange=null,e.roleToChangeTo=null}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512),Object(o["createElementVNode"])("div",Tn,[Object(o["createElementVNode"])("div",wn,[e.userToChange?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h3",{key:0,innerHTML:e.$sanitize(e.deleteUserPermConfirmSingleText)},null,8,Mn)):Object(o["createCommentVNode"])("",!0),e.userToChange&&"anonymous"===e.userToChange.login&&"view"===e.roleToChangeTo?(Object(o["openBlock"])(),Object(o["createElementBlock"])("h3",Bn,[Object(o["createElementVNode"])("em",null,[Object(o["createTextVNode"])(Object(o["toDisplayString"])(e.translate("General_Note"))+": ",1),Object(o["createElementVNode"])("span",{innerHTML:e.translate("UsersManager_AnonymousUserRoleChangeWarning","anonymous",e.getRoleDisplay(e.roleToChangeTo))},null,8,_n)])])):Object(o["createCommentVNode"])("",!0),e.userToChange?Object(o["createCommentVNode"])("",!0):(Object(o["openBlock"])(),Object(o["createElementBlock"])("p",{key:2,innerHTML:e.deleteUserPermConfirmMultipleText},null,8,Ln))]),Object(o["createElementVNode"])("div",Rn,[Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close btn",onClick:t[15]||(t[15]=Object(o["withModifiers"])((function(t){return e.changeUserRole()}),["prevent"])),style:{"margin-right":"3.5px"}},Object(o["toDisplayString"])(e.translate("General_Yes")),1),Object(o["createElementVNode"])("a",{href:"",class:"modal-action modal-close modal-no",onClick:t[16]||(t[16]=Object(o["withModifiers"])((function(t){e.userToChange=null,e.roleToChangeTo=null}),["prevent"]))},Object(o["toDisplayString"])(e.translate("General_No")),1)])],512)],2)}var Dn=window,Pn=Dn.$,Hn=Object(o["defineComponent"])({props:{initialSiteId:{type:[String,Number],required:!0},initialSiteName:{type:String,required:!0},currentUserRole:String,isLoadingUsers:Boolean,accessLevels:{type:Array,required:!0},filterAccessLevels:{type:Array,required:!0},totalEntries:Number,users:{type:Array,required:!0},searchParams:{type:Object,required:!0}},components:{Field:f["Field"],ActivityIndicator:r["ActivityIndicator"],Notification:r["Notification"],ContentBlock:r["ContentBlock"]},directives:{DropdownMenu:r["DropdownMenu"],ContentTable:r["ContentTable"]},data:function(){return{areAllResultsSelected:!1,selectedRows:{},isAllCheckboxSelected:!1,isBulkActionsDisabled:!0,userToChange:null,roleToChangeTo:null,accessLevelFilter:null,isRoleHelpToggled:!1,userTextFilter:"",permissionsForSite:{id:this.initialSiteId,name:this.initialSiteName}}},emits:["editUser","changeUserRole","deleteUser","searchChange"],created:function(){this.onUserTextFilterChange=Object(r["debounce"])(this.onUserTextFilterChange,300)},watch:{users:function(){this.clearSelection()}},methods:{onPermissionsForUpdate:function(e){this.permissionsForSite=e,this.changeSearch({idSite:this.permissionsForSite.id})},clearSelection:function(){this.selectedRows={},this.areAllResultsSelected=!1,this.isBulkActionsDisabled=!0,this.isAllCheckboxSelected=!1,this.userToChange=null},onAllCheckboxChange:function(){if(this.isAllCheckboxSelected){for(var e=0;e!==this.users.length;e+=1)this.selectedRows[e]=!0;this.isBulkActionsDisabled=!1}else this.clearSelection()},changeUserRole:function(){this.$emit("changeUserRole",{users:this.userOperationSubject,role:this.roleToChangeTo})},onRowSelected:function(){var e=this;setTimeout((function(){var t=e.selectedCount;e.isBulkActionsDisabled=0===t,e.isAllCheckboxSelected=t===e.users.length}))},deleteRequestedUsers:function(){this.$emit("deleteUser",{users:this.userOperationSubject})},showDeleteConfirm:function(){Pn(this.$refs.deleteUserConfirmModal).modal({dismissible:!1}).modal("open")},showAccessChangeConfirm:function(){Pn(this.$refs.changeUserRoleConfirmModal).modal({dismissible:!1}).modal("open")},getRoleDisplay:function(e){var t=null;return this.accessLevels.forEach((function(n){n.key===e&&(t=n.value)})),t},changeSearch:function(e){var t=Object.assign(Object.assign({},this.searchParams),e);this.$emit("searchChange",{params:t})},gotoPreviousPage:function(){this.changeSearch({offset:Math.max(0,this.searchParams.offset-this.searchParams.limit)})},gotoNextPage:function(){var e=this.searchParams.offset+this.searchParams.limit;e>=this.totalEntries||this.changeSearch({offset:e})},onUserTextFilterChange:function(e){this.userTextFilter=e,this.changeSearch({filter_search:e,offset:0})}},computed:{paginationLowerBound:function(){return this.searchParams.offset+1},paginationUpperBound:function(){if(null===this.totalEntries)return"?";var e=this.searchParams;return Math.min(e.offset+e.limit,this.totalEntries)},userOperationSubject:function(){return this.userToChange?[this.userToChange]:this.areAllResultsSelected?"all":this.selectedUsers},selectedUsers:function(){var e=this,t=this.users,n=[];return Object.keys(this.selectedRows).forEach((function(s){var i=parseInt(s,10);e.selectedRows[s]&&t[i]&&n.push(t[i])})),n},rolesHelpText:function(){var e="https://matomo.org/faq/general/faq_70/",t="https://matomo.org/faq/general/faq_69/";return Object(r["translate"])("UsersManager_RolesHelp",'<a href="'.concat(e,'" target="_blank" rel="noreferrer noopener">'),"</a>",'<a href="'.concat(t,'" target="_blank" rel="noreferrer noopener">'),"</a>")},affectedUsersCount:function(){return this.areAllResultsSelected?this.totalEntries||0:this.selectedCount},selectedCount:function(){var e=this,t=0;return Object.keys(this.selectedRows).forEach((function(n){e.selectedRows[n]&&(t+=1)})),t},deleteUserPermConfirmSingleText:function(){var e,t;return Object(r["translate"])("UsersManager_DeleteUserPermConfirmSingle","<strong>".concat((null===(e=this.userToChange)||void 0===e?void 0:e.login)||"","</strong>"),"<strong>".concat(this.getRoleDisplay(this.roleToChangeTo),"</strong>"),"<strong>".concat((null===(t=this.permissionsForSite)||void 0===t?void 0:t.name)||"","</strong>"))},deleteUserPermConfirmMultipleText:function(){var e;return Object(r["translate"])("UsersManager_DeleteUserPermConfirmMultiple","<strong>".concat(this.affectedUsersCount,"</strong>"),"<strong>".concat(this.getRoleDisplay(this.roleToChangeTo),"</strong>"),"<strong>".concat((null===(e=this.permissionsForSite)||void 0===e?void 0:e.name)||"","</strong>"))},bulkActionAccessLevels:function(){return this.accessLevels.filter((function(e){return"noaccess"!==e.key&&"superuser"!==e.key}))},anonymousAccessLevels:function(){return this.accessLevels.filter((function(e){return"noaccess"===e.key||"view"===e.key}))}}});Hn.render=xn;var Fn=Hn; +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */Object(r["createAngularJsAdapter"])({component:Fn,scope:{onEditUser:{angularJsBind:"&",vue:"editUser"},onChangeUserRole:{angularJsBind:"&",vue:"changeUserRole"},onDeleteUser:{angularJsBind:"&",vue:"deleteUser"},onSearchChange:{angularJsBind:"&",vue:"searchChange"},initialSiteId:{angularJsBind:"<"},initialSiteName:{angularJsBind:"<"},currentUserRole:{angularJsBind:"<"},isLoadingUsers:{angularJsBind:"<"},accessLevels:{angularJsBind:"<"},filterAccessLevels:{angularJsBind:"<"},totalEntries:{angularJsBind:"<"},users:{angularJsBind:"<"},searchParams:{angularJsBind:"<"}},directiveName:"piwikPagedUsersList",restrict:"E"})}})})); //# sourceMappingURL=UsersManager.umd.min.js.map
\ No newline at end of file diff --git a/plugins/UsersManager/vue/src/PagedUsersList/PagedUsersList.adapter.ts b/plugins/UsersManager/vue/src/PagedUsersList/PagedUsersList.adapter.ts new file mode 100644 index 0000000000..c67b71698c --- /dev/null +++ b/plugins/UsersManager/vue/src/PagedUsersList/PagedUsersList.adapter.ts @@ -0,0 +1,60 @@ +/*! + * Matomo - free/libre analytics platform + * + * @link https://matomo.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + */ + +import { createAngularJsAdapter } from 'CoreHome'; +import PagedUsersList from './PagedUsersList.vue'; + +export default createAngularJsAdapter({ + component: PagedUsersList, + scope: { + onEditUser: { + angularJsBind: '&', + vue: 'editUser', + }, + onChangeUserRole: { + angularJsBind: '&', + vue: 'changeUserRole', + }, + onDeleteUser: { + angularJsBind: '&', + vue: 'deleteUser', + }, + onSearchChange: { + angularJsBind: '&', + vue: 'searchChange', + }, + initialSiteId: { + angularJsBind: '<', + }, + initialSiteName: { + angularJsBind: '<', + }, + currentUserRole: { + angularJsBind: '<', + }, + isLoadingUsers: { + angularJsBind: '<', + }, + accessLevels: { + angularJsBind: '<', + }, + filterAccessLevels: { + angularJsBind: '<', + }, + totalEntries: { + angularJsBind: '<', + }, + users: { + angularJsBind: '<', + }, + searchParams: { + angularJsBind: '<', + }, + }, + directiveName: 'piwikPagedUsersList', + restrict: 'E', +}); diff --git a/plugins/UsersManager/angularjs/paged-users-list/paged-users-list.component.less b/plugins/UsersManager/vue/src/PagedUsersList/PagedUsersList.less index c8e263d2d6..f82f4a547e 100644 --- a/plugins/UsersManager/angularjs/paged-users-list/paged-users-list.component.less +++ b/plugins/UsersManager/vue/src/PagedUsersList/PagedUsersList.less @@ -45,8 +45,8 @@ piwik-paged-users-list { } table#manageUsersTable { - [piwik-field] { - .form-group { + .matomo-form-field { + &.form-group { margin: 0; } .input-field { diff --git a/plugins/UsersManager/vue/src/PagedUsersList/PagedUsersList.vue b/plugins/UsersManager/vue/src/PagedUsersList/PagedUsersList.vue new file mode 100644 index 0000000000..28ba40b687 --- /dev/null +++ b/plugins/UsersManager/vue/src/PagedUsersList/PagedUsersList.vue @@ -0,0 +1,684 @@ +<!-- + Matomo - free/libre analytics platform + @link https://matomo.org + @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later +--> + +<template> + <div + class="pagedUsersList" + :class="{loading: isLoadingUsers}" + > + <div class="userListFilters row"> + <div class="col s12 m12 l6"> + <div class="input-field col s12 m4 l4"> + <a + class="dropdown-trigger btn bulk-actions" + href="" + data-target="user-list-bulk-actions" + :class="{ disabled: isBulkActionsDisabled }" + v-dropdown-menu + > + {{ translate('UsersManager_BulkActions') }} + </a> + <ul + id="user-list-bulk-actions" + class="dropdown-content" + > + <li> + <a + class="dropdown-trigger" + data-target="bulk-set-access" + v-dropdown-menu + > + {{ translate('UsersManager_SetPermission') }} + </a> + <ul + id="bulk-set-access" + class="dropdown-content" + > + <li v-for="access in bulkActionAccessLevels" :key="access.key"> + <a + href="" + @click.prevent=" + userToChange = null; roleToChangeTo = access.key; showAccessChangeConfirm(); + " + > + {{ access.value }} + </a> + </li> + </ul> + </li> + <li> + <a + href="" + @click.prevent=" + userToChange = null; roleToChangeTo = 'noaccess'; showAccessChangeConfirm(); + " + > + {{ translate('UsersManager_RemovePermissions') }} + </a> + </li> + <li v-if="currentUserRole === 'superuser'"> + <a + href="" + @click.prevent="showDeleteConfirm()" + >{{ translate('UsersManager_DeleteUsers') }}</a> + </li> + </ul> + </div> + <div class="input-field col s12 m4 l4"> + <div + class="permissions-for-selector" + > + <Field + :model-value="userTextFilter" + @update:model-value="onUserTextFilterChange($event)" + name="user-text-filter" + uicontrol="text" + :full-width="true" + :placeholder="translate('UsersManager_UserSearch')" + /> + </div> + </div> + <div class="input-field col s12 m4 l4"> + <div> + <Field + :model-value="accessLevelFilter" + @update:model-value="accessLevelFilter = $event; changeSearch({ + filter_access: accessLevelFilter, + offset: 0, + })" + name="access-level-filter" + uicontrol="select" + :options="filterAccessLevels" + :full-width="true" + :placeholder="translate('UsersManager_FilterByAccess')" + /> + </div> + </div> + </div> + <div + class="input-field col s12 m12 l6 users-list-pagination-container" + v-if="totalEntries > searchParams.limit" + > + <div class="usersListPagination"> + <a + class="btn prev" + :class="{ disabled: searchParams.offset <= 0 }" + @click.prevent="gotoPreviousPage()" + > + <span class="pointer">« {{ translate('General_Previous') }}</span> + </a> + <div class="counter"> + <span + v-if="!isLoadingUsers" + > + {{ translate( + 'General_Pagination', + paginationLowerBound, + paginationUpperBound, + totalEntries + ) }} + </span> + <ActivityIndicator + v-if="isLoadingUsers" + :loading="isLoadingUsers" + /> + </div> + <a + class="btn next" + :class="{ disabled: searchParams.offset + searchParams.limit >= totalEntries }" + @click.prevent="gotoNextPage()" + > + <span class="pointer">{{ translate('General_Next') }} »</span> + </a> + </div> + </div> + </div> + <div + class="roles-help-notification" + v-if="isRoleHelpToggled" + > + <Notification + context="info" + type="persistent" + :noclear="true" + > + <span v-html="rolesHelpText"></span> + </Notification> + </div> + <ContentBlock> + <table + id="manageUsersTable" + :class="{ loading: isLoadingUsers }" + v-content-table + > + <thead> + <tr> + <th class="select-cell"> + <span class="checkbox-container"> + <label> + <input + type="checkbox" + id="paged_users_select_all" + checked="checked" + v-model="isAllCheckboxSelected" + @change="onAllCheckboxChange()" + /> + <span /> + </label> + </span> + </th> + <th class="first">{{ translate('UsersManager_Username') }}</th> + <th class="role_header"> + <span style="margin-right: 3.5px">{{ translate('UsersManager_RoleFor') }}</span> + <a + href="" + class="helpIcon" + @click.prevent="isRoleHelpToggled = !isRoleHelpToggled" + :class="{ sticky: isRoleHelpToggled }" + > + <span class="icon-help" /> + </a> + <div> + <Field + class="permissions-for-selector" + :model-value="permissionsForSite" + @update:model-value="onPermissionsForUpdate($event);" + uicontrol="site" + :ui-control-attributes="{ + onlySitesWithAdminAccess: currentUserRole !== 'superuser', + }" + /> + </div> + </th> + <th v-if="currentUserRole === 'superuser'">{{ translate('UsersManager_Email') }}</th> + <th + v-if="currentUserRole === 'superuser'" + :title="translate('UsersManager_UsesTwoFactorAuthentication')" + >{{ translate('UsersManager_2FA') }}</th> + <th v-if="currentUserRole === 'superuser'">{{ translate('UsersManager_LastSeen') }}</th> + <th class="actions-cell-header"> + <div>{{ translate('General_Actions') }}</div> + </th> + </tr> + </thead> + <tbody> + <tr + class="select-all-row" + v-if="isAllCheckboxSelected && users.length && users.length < totalEntries" + > + <td colspan="8"> + <div v-if="!areAllResultsSelected"> + <span + v-html="translate( + 'UsersManager_TheDisplayedUsersAreSelected', + `<strong>${users.length}</strong>`, + )" + style="margin-right:3.5px" + ></span> + <a + class="toggle-select-all-in-search" + href="#" + @click.prevent="areAllResultsSelected = !areAllResultsSelected" + v-html="translate( + 'UsersManager_ClickToSelectAll', + `<strong>${totalEntries}</strong>`, + )" + ></a> + </div> + <div v-if="areAllResultsSelected"> + <span v-html="translate( + 'UsersManager_AllUsersAreSelected', + `<strong>${totalEntries}</strong>`, + )" + style="margin-right:3.5px" + ></span> + <a + class="toggle-select-all-in-search" + href="#" + @click.prevent="areAllResultsSelected = !areAllResultsSelected" + v-html="translate( + 'UsersManager_ClickToSelectDisplayedUsers', + `<strong>${users.length}</strong>`, + )" + ></a> + </div> + </td> + </tr> + <tr + v-for="(user, index) in users" + :id="`row${index}`" + :key="user.login" + > + <td class="select-cell"> + <span class="checkbox-container"> + <label> + <input + type="checkbox" + :id="`paged_users_select_row${index}`" + v-model="selectedRows[index]" + @click="onRowSelected()" + /> + <span /> + </label> + </span> + </td> + <td id="userLogin">{{ user.login }}</td> + <td class="access-cell"> + <div> + <Field + :model-value="user.role" + @update:model-value=" + userToChange = user; + roleToChangeTo = $event; + showAccessChangeConfirm();" + :disabled="user.role === 'superuser'" + uicontrol="select" + :options="user.login !== 'anonymous' ? accessLevels : anonymousAccessLevels" + /> + </div> + </td> + <td + id="email" + v-if="currentUserRole === 'superuser'" + >{{ user.email }}</td> + <td + id="twofa" + v-if="currentUserRole === 'superuser'" + > + <span + class="icon-ok" + v-if="user.uses_2fa" + /> + <span + class="icon-close" + v-if="!user.uses_2fa" + /> + </td> + <td + id="last_seen" + v-if="currentUserRole === 'superuser'" + > + {{ user.last_seen ? `${user.last_seen} ago` : '-' }} + </td> + <td class="center actions-cell"> + <button + class="edituser table-action" + title="Edit" + @click="$emit('editUser', { user: user })" + v-if="user.login !== 'anonymous'" + > + <span class="icon-edit" /> + </button> + <button + class="deleteuser table-action" + title="Delete" + @click="userToChange = user; showDeleteConfirm()" + v-if="currentUserRole === 'superuser' && user.login !== 'anonymous'" + > + <span class="icon-delete" /> + </button> + </td> + </tr> + </tbody> + </table> + </ContentBlock> + <div class="delete-user-confirm-modal modal" ref="deleteUserConfirmModal"> + <div class="modal-content"> + <h3 + v-if="userToChange" + v-html="translate( + 'UsersManager_DeleteUserConfirmSingle', + `<strong>${userToChange.login}</strong>`, + )" + ></h3> + <p + v-if="!userToChange" + v-html="translate( + 'UsersManager_DeleteUserConfirmMultiple', + `<strong>${affectedUsersCount}</strong>`, + )" + ></p> + </div> + <div class="modal-footer"> + <a + href="" + class="modal-action modal-close btn" + @click.prevent="deleteRequestedUsers()" + style="margin-right:3.5px" + >{{ translate('General_Yes') }}</a> + <a + href="" + class="modal-action modal-close modal-no" + @click.prevent="userToChange = null; roleToChangeTo = null;" + >{{ translate('General_No') }}</a> + </div> + </div> + <div class="change-user-role-confirm-modal modal" ref="changeUserRoleConfirmModal"> + <div class="modal-content"> + <h3 + v-if="userToChange" + v-html="$sanitize(deleteUserPermConfirmSingleText)" + ></h3> + <h3 v-if="userToChange && userToChange.login === 'anonymous' && roleToChangeTo === 'view'"> + <em>{{ translate('General_Note') }}: + <span v-html="translate( + 'UsersManager_AnonymousUserRoleChangeWarning', + 'anonymous', + getRoleDisplay(roleToChangeTo), + )"> + </span> + </em> + </h3> + <p + v-if="!userToChange" + v-html="deleteUserPermConfirmMultipleText" + ></p> + </div> + <div class="modal-footer"> + <a + href="" + class="modal-action modal-close btn" + @click.prevent="changeUserRole()" + style="margin-right:3.5px" + >{{ translate('General_Yes') }}</a> + <a + href="" + class="modal-action modal-close modal-no" + @click.prevent=" + userToChange = null; + roleToChangeTo = null;" + >{{ translate('General_No') }}</a> + </div> + </div> + </div> +</template> + +<script lang="ts"> +import { defineComponent } from 'vue'; +import { + DropdownMenu, + ActivityIndicator, + Notification, + ContentBlock, + ContentTable, + debounce, + translate, + SiteRef, +} from 'CoreHome'; +import { Field } from 'CorePluginsAdmin'; +import User from '../User'; + +interface AccessLevel { + key: string; + value: unknown; +} + +interface SearchParams { + idSite: number|string; + limit: number; + offset: number; + filter_search?: string; +} + +interface PagedUsersListState { + areAllResultsSelected: boolean; + selectedRows: Record<string, boolean>; + isAllCheckboxSelected: boolean; + isBulkActionsDisabled: boolean; + userToChange: User|null; + roleToChangeTo: string|null; + accessLevelFilter: string|null; + isRoleHelpToggled: boolean; + userTextFilter: string; + permissionsForSite: SiteRef; +} + +const { $ } = window; + +export default defineComponent({ + props: { + initialSiteId: { + type: [String, Number], + required: true, + }, + initialSiteName: { + type: String, + required: true, + }, + currentUserRole: String, + isLoadingUsers: Boolean, + accessLevels: { + type: Array, + required: true, + }, + filterAccessLevels: { + type: Array, + required: true, + }, + totalEntries: Number, + users: { + type: Array, + required: true, + }, + searchParams: { + type: Object, + required: true, + }, + }, + components: { + Field, + ActivityIndicator, + Notification, + ContentBlock, + }, + directives: { + DropdownMenu, + ContentTable, + }, + data(): PagedUsersListState { + return { + areAllResultsSelected: false, + selectedRows: {}, + isAllCheckboxSelected: false, + isBulkActionsDisabled: true, + userToChange: null, + roleToChangeTo: null, + accessLevelFilter: null, + isRoleHelpToggled: false, + userTextFilter: '', + permissionsForSite: { + id: this.initialSiteId, + name: this.initialSiteName, + }, + }; + }, + emits: ['editUser', 'changeUserRole', 'deleteUser', 'searchChange'], + created() { + this.onUserTextFilterChange = debounce(this.onUserTextFilterChange, 300); + }, + watch: { + users() { + this.clearSelection(); + }, + }, + methods: { + onPermissionsForUpdate(site: SiteRef) { + this.permissionsForSite = site; + this.changeSearch({ idSite: this.permissionsForSite.id }); + }, + clearSelection() { + this.selectedRows = {}; + this.areAllResultsSelected = false; + this.isBulkActionsDisabled = true; + this.isAllCheckboxSelected = false; + this.userToChange = null; + }, + onAllCheckboxChange() { + if (!this.isAllCheckboxSelected) { + this.clearSelection(); + } else { + for (let i = 0; i !== this.users.length; i += 1) { + this.selectedRows[i] = true; + } + this.isBulkActionsDisabled = false; + } + }, + changeUserRole() { + this.$emit('changeUserRole', { + users: this.userOperationSubject, + role: this.roleToChangeTo, + }); + }, + onRowSelected() { + // (angularjs comment): use a timeout since the method is called after the model is updated + setTimeout(() => { + const selectedRowKeyCount = this.selectedCount; + this.isBulkActionsDisabled = selectedRowKeyCount === 0; + this.isAllCheckboxSelected = selectedRowKeyCount === this.users.length; + }); + }, + deleteRequestedUsers() { + this.$emit('deleteUser', { + users: this.userOperationSubject, + }); + }, + showDeleteConfirm() { + $(this.$refs.deleteUserConfirmModal as HTMLElement).modal({ + dismissible: false, + }).modal('open'); + }, + showAccessChangeConfirm() { + $(this.$refs.changeUserRoleConfirmModal as HTMLElement).modal({ + dismissible: false, + }).modal('open'); + }, + getRoleDisplay(role: string|null) { + let result = null; + (this.accessLevels as AccessLevel[]).forEach((entry) => { + if (entry.key === role) { + result = entry.value; + } + }); + return result; + }, + changeSearch(changes: Partial<SearchParams>) { + const params = { ...this.searchParams, ...changes }; + this.$emit('searchChange', { params }); + }, + gotoPreviousPage() { + this.changeSearch({ + offset: Math.max(0, this.searchParams.offset - this.searchParams.limit), + }); + }, + gotoNextPage() { + const newOffset = this.searchParams.offset + this.searchParams.limit; + if (newOffset >= this.totalEntries!) { + return; + } + + this.changeSearch({ + offset: newOffset, + }); + }, + onUserTextFilterChange(filter: string) { + this.userTextFilter = filter; + this.changeSearch({ filter_search: filter, offset: 0 }); + }, + }, + computed: { + paginationLowerBound() { + return this.searchParams.offset + 1; + }, + paginationUpperBound() { + if (this.totalEntries === null) { + return '?'; + } + + const searchParams = this.searchParams as SearchParams; + + return Math.min(searchParams.offset + searchParams.limit, this.totalEntries!); + }, + userOperationSubject() { + if (this.userToChange) { + return [this.userToChange]; + } + + if (this.areAllResultsSelected) { + return 'all'; + } + + return this.selectedUsers; + }, + selectedUsers() { + const users = this.users as User[]; + + const result: User[] = []; + Object.keys(this.selectedRows).forEach((index) => { + const indexN = parseInt(index, 10); + if (this.selectedRows[index] + && users[indexN] // sanity check + ) { + result.push(users[indexN]); + } + }); + return result; + }, + rolesHelpText() { + const faq70 = 'https://matomo.org/faq/general/faq_70/'; + const faq69 = 'https://matomo.org/faq/general/faq_69/'; + return translate( + 'UsersManager_RolesHelp', + `<a href="${faq70}" target="_blank" rel="noreferrer noopener">`, + '</a>', + `<a href="${faq69}" target="_blank" rel="noreferrer noopener">`, + '</a>', + ); + }, + affectedUsersCount() { + if (this.areAllResultsSelected) { + return this.totalEntries || 0; + } + + return this.selectedCount; + }, + selectedCount() { + let selectedRowKeyCount = 0; + Object.keys(this.selectedRows).forEach((key) => { + if (this.selectedRows[key]) { + selectedRowKeyCount += 1; + } + }); + return selectedRowKeyCount; + }, + deleteUserPermConfirmSingleText() { + return translate( + 'UsersManager_DeleteUserPermConfirmSingle', + `<strong>${this.userToChange?.login || ''}</strong>`, + `<strong>${this.getRoleDisplay(this.roleToChangeTo)}</strong>`, + `<strong>${this.permissionsForSite?.name || ''}</strong>`, + ); + }, + deleteUserPermConfirmMultipleText() { + return translate( + 'UsersManager_DeleteUserPermConfirmMultiple', + `<strong>${this.affectedUsersCount}</strong>`, + `<strong>${this.getRoleDisplay(this.roleToChangeTo)}</strong>`, + `<strong>${this.permissionsForSite?.name || ''}</strong>`, + ); + }, + bulkActionAccessLevels() { + return (this.accessLevels as AccessLevel[]).filter( + (e) => e.key !== 'noaccess' && e.key !== 'superuser', + ); + }, + anonymousAccessLevels() { + return (this.accessLevels as AccessLevel[]).filter( + (e) => e.key === 'noaccess' || e.key === 'view', + ); + }, + }, +}); +</script> diff --git a/plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue b/plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue index a818b6d768..6b1d34864c 100644 --- a/plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue +++ b/plugins/UsersManager/vue/src/UserEditForm/UserEditForm.vue @@ -395,6 +395,14 @@ export default defineComponent({ emits: ['done', 'updated'], watch: { user(newVal) { + this.onUserChange(newVal); + }, + }, + created() { + this.onUserChange(this.user as User); + }, + methods: { + onUserChange(newVal: User) { this.theUser = newVal || { ...DEFAULT_USER }; if (!this.theUser.password) { @@ -403,8 +411,6 @@ export default defineComponent({ this.setSuperUserAccessChecked(); }, - }, - methods: { confirmSuperUserChange() { $(this.$refs.superUserConfirmModal as HTMLElement).modal({ dismissible: false, diff --git a/plugins/UsersManager/vue/src/index.ts b/plugins/UsersManager/vue/src/index.ts index ebe55df225..0982bcce18 100644 --- a/plugins/UsersManager/vue/src/index.ts +++ b/plugins/UsersManager/vue/src/index.ts @@ -7,8 +7,10 @@ import './CapabilitiesEdit/CapabilitiesEdit.adapter'; import './UserPermissionsEdit/UserPermissionsEdit.adapter'; import './UserEditForm/UserEditForm.adapter'; +import './PagedUsersList/PagedUsersList.adapter'; export { default as CapabilitiesEdit } from './CapabilitiesEdit/CapabilitiesEdit.vue'; export { default as Capability } from './CapabilitiesStore/Capability'; export { default as UserPermissionsEdit } from './UserPermissionsEdit/UserPermissionsEdit.vue'; export { default as UserEditForm } from './UserEditForm/UserEditForm.vue'; +export { default as PagedUsersList } from './PagedUsersList/PagedUsersList.vue'; |