-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
149 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| <?php | ||
|
|
||
| // Get parameters | ||
| $baseUrl = $vv_config['CoGrouperLiteWidget']['grouper_url']; | ||
| $path = '/grouper/grouperUi/app/UiV2Main.index'; | ||
| $groupOperation = '?operation=UiV2Group.viewGroup&groupId='; | ||
| $grouperUrlBase = $baseUrl . $path . $groupOperation; | ||
| $suffix = Configure::read('debug') > 0 ? '?time=' . time() : ''; | ||
|
|
||
|
|
||
| ?> | ||
|
|
||
| <script type="module"> | ||
| import Autocomplete from '<?= $this->webroot ?>grouper_lite_widget/js/autocomplete.js<?= $suffix ?>'; | ||
| import Loader from '<?= $this->webroot ?>grouper_lite_widget/js/loader.js<?= $suffix ?>'; | ||
|
|
||
| // XXX Probably move this to comanage.js | ||
| const provided = { | ||
| collapsed: <?= $vv_config['CoGrouperLiteWidget']['default_collapse'] == 'collapsed' ? 'true' : 'false' ?>, | ||
| optAction: "<?= $optAction ?? 'none' ?>", | ||
| owner: <?= $vv_is_user_owner ? 'true' : 'false' ?>, | ||
| url: "<?= $actionUrl ?? 'null' ?>", | ||
| grouperUrl: "<?= $grouperUrlBase ?>", | ||
| view: "<?= $this->action ?>", | ||
| txt: { | ||
| adhocHeading: "<?= $vv_config['CoGrouperLiteWidget']['adhoc_heading'] ?? 'Ad-hoc groups' ?>", | ||
| wgHeading: "<?= $vv_config['CoGrouperLiteWidget']['wg_heading'] ?? 'Working groups' ?>", | ||
| search: "<?= _txt('pl.grouperlite.title.search') ?>", | ||
| searchForGroups: "<?= _txt('pl.grouperlite.action.search') ?>", | ||
| display: "<?= _txt('fd.page.limit.display') ?>", | ||
| records: "<?= _txt('fd.page.limit.records') ?>", | ||
| first: "<?= _txt('op.first') ?>", | ||
| last: "<?= _txt('op.last') ?>", | ||
| previous: "<?= _txt('op.previous') ?>", | ||
| next: "<?= _txt('op.next') ?>", | ||
| groups: "<?= _txt('pl.grouperlite.dashboard.heading.groups') ?>", | ||
| grouper: "<?= _txt('pl.grouperlite.action.grouper') ?>", | ||
| leave: "<?= _txt('pl.grouperlite.action.leave') ?>", | ||
| zero: { | ||
| description: "<?= _txt('pl.grouperlite.value.descr.zerostate') ?>", | ||
| records: "<?= _txt('pl.grouperlite.groups.zero-state') ?>" | ||
| }, | ||
| members: "<?= _txt('pl.grouperlite.action.members') ?>", | ||
| email: "<?= _txt('pl.grouperlite.value.email') ?>", | ||
| close: "<?= _txt('pl.grouperlite.action.close') ?>", | ||
| remove: "<?= _txt('pl.grouperlite.action.remove-user') ?>", | ||
| addUser: "<?= _txt('pl.grouperlite.action.add-user') ?>", | ||
| addSubscriberError: "<?= _txt('pl.grouperlite.message.flash.add-subscriber-failed') ?>", | ||
| addSubscriberSuccess: "<?= _txt('pl.grouperlite.message.flash.add-subscriber-success') ?>", | ||
| 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') ?>", | ||
| peoplePickerPlaceHolder: "<?= _txt('op.grm.add.placeholder') ?>", | ||
| memberships: "<?= _txt('pl.grouperlite.action.memberships') ?>", | ||
| noaccess: "<?= _txt('pl.grouperlite.members.noaccess') ?>", | ||
| empty: "<?= _txt('pl.grouperlite.members.empty') ?>", | ||
| join: "<?= _txt('pl.grouperlite.action.join') ?>", | ||
| joinSuccess: "<?= _txt('pl.grouperlite.message.flash.join-group-success') ?>", | ||
| joinFailure: "<?= _txt('pl.grouperlite.message.flash.join-group-failed') ?>", | ||
| joinError: "<?= _txt('pl.grouperlite.message.flash.join-group-error') ?>", | ||
| leaveSuccess: "<?= _txt('pl.grouperlite.message.flash.leave-group-success') ?>", | ||
| leaveFailure: "<?= _txt('pl.grouperlite.message.flash.leave-group-failure') ?>", | ||
| leaveError: "<?= _txt('pl.grouperlite.message.flash.leave-group-error') ?>", | ||
| tabs: { | ||
| memberships: "<?= _txt('pl.grouperlite.nav.memberships') ?>", | ||
| optin: "<?= _txt('pl.grouperlite.nav.groups-can-join') ?>", | ||
| owner: "<?= _txt('pl.grouperlite.nav.groups-presided') ?>", | ||
| manager: "<?= _txt('pl.grouperlite.nav.users-presided') ?>", | ||
| }, | ||
| columns: <?= json_encode(['name' => _txt('pl.grouperlite.table.name'), | ||
| 'role' => _txt('pl.grouperlite.table.role'), | ||
| 'description' => _txt('pl.grouperlite.table.description'), | ||
| 'status' => _txt('pl.grouperlite.table.status'), | ||
| 'action' => _txt('pl.grouperlite.table.action')], | ||
| JSON_THROW_ON_ERROR) ?>, | ||
| }, | ||
| api: { | ||
| co: <?= $vv_coid ?>, | ||
| glid: <?= $vv_config['CoGrouperLiteWidget']['id'] ?>, | ||
| mode: "<?= PeoplePickerModeEnum::All ?>", | ||
| base: "<?= $this->webroot ?>grouper_lite_widget/grouper_groups", | ||
| find: "<?= $this->webroot ?>grouper_lite_widget/grouper_groups/findSubscriber/co:<?= $vv_coid ?>/glid:<?= $vv_config['CoGrouperLiteWidget']['id'] ?>", | ||
| join: "<?= $this->webroot ?>grouper_lite_widget/grouper_groups/joinGroup/co:<?= $vv_coid ?>/glid:<?= $vv_config['CoGrouperLiteWidget']['id'] ?>", | ||
| leave: "<?= $this->webroot ?>grouper_lite_widget/grouper_groups/leaveGroup/co:<?= $vv_coid ?>/glid:<?= $vv_config['CoGrouperLiteWidget']['id'] ?>", | ||
| remove: "<?= $this->webroot ?>grouper_lite_widget/grouper_groups/removeSubscriber/co:<?= $vv_coid ?>/glid:<?= $vv_config['CoGrouperLiteWidget']['id'] ?>", | ||
| add: "<?= $this->webroot ?>grouper_lite_widget/grouper_groups/addSubscriber/co:<?= $vv_coid ?>/glid:<?= $vv_config['CoGrouperLiteWidget']['id'] ?>", | ||
| group: "<?= $this->webroot ?>grouper_lite_widget/grouper_groups/groupSubscribers/co:<?= $vv_coid ?>/glid:<?= $vv_config['CoGrouperLiteWidget']['id'] ?>", | ||
| memberships: "<?= $this->webroot ?>grouper_lite_widget/grouper_groups/groupmemberapi/co:<?= $vv_coid ?>/glid:<?= $vv_config['CoGrouperLiteWidget']['id'] ?>", | ||
| managing: "<?= $this->webroot ?>grouper_lite_widget/grouper_groups/usermanagerapi/co:<?= $vv_coid ?>/glid:<?= $vv_config['CoGrouperLiteWidget']['id'] ?>", | ||
| optin: "<?= $this->webroot ?>grouper_lite_widget/grouper_groups/groupoptinapi/co:<?= $vv_coid ?>/glid:<?= $vv_config['CoGrouperLiteWidget']['id'] ?>", | ||
| owner: "<?= $this->webroot ?>grouper_lite_widget/grouper_groups/groupownerapi/co:<?= $vv_coid ?>/glid:<?= $vv_config['CoGrouperLiteWidget']['id'] ?>", | ||
| }, | ||
| } | ||
|
|
||
| const app = Vue.createApp({ | ||
| provide: provided, | ||
| data() { | ||
| return { | ||
| loading: false, | ||
| search: '', | ||
| subscribers: [], | ||
| disabled: [], | ||
| } | ||
| }, | ||
| components: { | ||
| Autocomplete, | ||
| Loader | ||
| }, | ||
| inject: ['txt', 'api'], | ||
| methods: { | ||
| addUser({ name }) { | ||
| console.log('test add user') | ||
| }, | ||
| } | ||
| }); | ||
|
|
||
|
|
||
| app.config.unwrapInjectedRef = true; | ||
| // Mount the component and provide a global reference for this app instance. | ||
| app.mount("#<?= $htmlId ?>-container"); | ||
| </script> | ||
|
|
||
| <div id="<?= $htmlId ?>-container" class="cm-autocomplete-container"> | ||
| <Autocomplete @callback="(item) => addUser(item)" | ||
| icon="add"/> | ||
| <Loader :active="loading"/> | ||
| </div> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.