Skip to content

Commit

Permalink
add people picker element
Browse files Browse the repository at this point in the history
  • Loading branch information
Ioannis committed Mar 7, 2024
1 parent a3da55e commit a7e076f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
1 change: 1 addition & 0 deletions Controller/GrouperGroupsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion Lib/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.',
Expand Down
1 change: 0 additions & 1 deletion View/GrouperGroups/index.ctp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@
removeSubscriberError: "<?= _txt('pl.grouperlite.message.flash.remove-subscriber-failed') ?>",
removeSubscriberSuccess: "<?= _txt('pl.grouperlite.message.flash.remove-subscriber-success') ?>",
getSubscriberError: "<?= _txt('pl.grouperlite.message.flash.group-detail-members-failed') ?>",
searchTag: "<?= _txt('pl.grouperlite.search.tags.text') ?>",
peoplePickerPlaceHolder: "<?= _txt('op.grm.add.placeholder') ?>",
noaccess: "<?= _txt('pl.grouperlite.members.noaccess') ?>",
empty: "<?= _txt('pl.grouperlite.members.empty') ?>",
Expand Down
6 changes: 2 additions & 4 deletions webroot/js/autocomplete.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit a7e076f

Please sign in to comment.