From a7e076f6e9986720ccc5e09a644a17be35ce21dd Mon Sep 17 00:00:00 2001 From: Ioannis Igoumenos Date: Thu, 7 Mar 2024 17:12:51 +0200 Subject: [PATCH] add people picker element --- Controller/GrouperGroupsController.php | 1 + Lib/lang.php | 2 +- View/GrouperGroups/index.ctp | 1 - webroot/js/autocomplete.js | 6 ++---- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/Controller/GrouperGroupsController.php b/Controller/GrouperGroupsController.php index ae3e336..7800d23 100644 --- a/Controller/GrouperGroupsController.php +++ b/Controller/GrouperGroupsController.php @@ -439,6 +439,7 @@ function isAuthorized(): array|bool $p['groupSubscribers'] = true; $p['addSubscriber'] = true; $p['findSubscriber'] = true; + $p['usermanager'] = true; $p['removeSubscriber'] = true; $p['groupCreate'] = true; diff --git a/Lib/lang.php b/Lib/lang.php index 34bad66..43afa4e 100644 --- a/Lib/lang.php +++ b/Lib/lang.php @@ -163,7 +163,7 @@ 'pl.grouperlite.form.template.value.positive' => 'Yes', 'pl.grouperlite.form.template.value.negative' => 'No', - 'pl.grouperlite.search.tags.text' => 'Search', + 'pl.grouperlite.title.search' => 'Search', 'pl.grouperlite.pagination.counter' => 'Viewing {:start}-{:end} of {:count}', 'pl.grouperlite.attributes.zero-state' => 'No Attributes Associated to this Group.', diff --git a/View/GrouperGroups/index.ctp b/View/GrouperGroups/index.ctp index 376f9e3..f22b2e9 100644 --- a/View/GrouperGroups/index.ctp +++ b/View/GrouperGroups/index.ctp @@ -92,7 +92,6 @@ removeSubscriberError: "", removeSubscriberSuccess: "", getSubscriberError: "", - searchTag: "", peoplePickerPlaceHolder: "", noaccess: "", empty: "", diff --git a/webroot/js/autocomplete.js b/webroot/js/autocomplete.js index 978bd08..8fb8a54 100644 --- a/webroot/js/autocomplete.js +++ b/webroot/js/autocomplete.js @@ -28,18 +28,16 @@ export default { this.$emit(this.action, this.item); }, toKebabCase(str) { - console.log('to kebab') - console.log('str', str) return str.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(); } }, computed: { btnTxt() { - return eval(`this.txt.${this.action}`) + return eval(`this.txt.${this.action}`) ?? eval(`this.txt.${this.icon}`) } }, mounted(el) { - const input = $(this.$el).find('#add-user-input'); + const input = $(this.$el).find(`#${this.toKebabCase(this.action)}-input`); input.autocomplete({ source: `${this.api.find}?co=${this.api.co}&mode=${this.api.mode}`, minLength: 3,