From 99e04b35dce9493c563c294393c1396deff005ca Mon Sep 17 00:00:00 2001 From: Ryan Mathis Date: Fri, 24 Feb 2023 15:40:51 -0700 Subject: [PATCH] Initial conversion work --- View/CoGrouperLites/display.ctp | 2 +- View/GrouperGroups/base.ctp | 19 +- View/GrouperGroups/emaillistinfo.ctp | 70 ------- View/GrouperGroups/emaillistsmanage.ctp | 57 ----- View/GrouperGroups/emaillistsmember.ctp | 47 ----- View/GrouperGroups/emaillistsoptin.ctp | 44 ---- View/GrouperGroups/groupcreate.ctp | 35 ---- View/GrouperGroups/groupcreatetemplate.ctp | 30 --- View/GrouperGroups/groupfields.inc | 210 ------------------- View/GrouperGroups/groupmember.ctp | 231 +++++++++------------ webroot/js/collapse.js | 26 +++ webroot/js/empty | 0 webroot/js/grouper-groups-view.js | 127 +++++++++++ webroot/js/popover.js | 10 + 14 files changed, 280 insertions(+), 628 deletions(-) delete mode 100644 View/GrouperGroups/emaillistinfo.ctp delete mode 100644 View/GrouperGroups/emaillistsmanage.ctp delete mode 100644 View/GrouperGroups/emaillistsmember.ctp delete mode 100644 View/GrouperGroups/emaillistsoptin.ctp delete mode 100644 View/GrouperGroups/groupcreate.ctp delete mode 100644 View/GrouperGroups/groupcreatetemplate.ctp delete mode 100644 View/GrouperGroups/groupfields.inc create mode 100644 webroot/js/collapse.js delete mode 100644 webroot/js/empty create mode 100644 webroot/js/grouper-groups-view.js create mode 100644 webroot/js/popover.js diff --git a/View/CoGrouperLites/display.ctp b/View/CoGrouperLites/display.ctp index 90ec902..53dd633 100644 --- a/View/CoGrouperLites/display.ctp +++ b/View/CoGrouperLites/display.ctp @@ -25,7 +25,7 @@ * * @link http://www.internet2.edu/comanage COmanage Project * @package registry - * @since COmanage Registry v3.2.0 + * @since COmanage Registry v4.1.1 * @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) */ diff --git a/View/GrouperGroups/base.ctp b/View/GrouperGroups/base.ctp index 07f2ec5..3242b27 100644 --- a/View/GrouperGroups/base.ctp +++ b/View/GrouperGroups/base.ctp @@ -1,4 +1,7 @@ + + Html->meta( array('http-equiv' => 'Cache-Control', 'content' => 'no-cache, no-store, must-revalidate'), null, @@ -14,24 +17,30 @@ echo $this->Html->meta( null, array('inline' => false) ); -?> -element('GrouperLite.base-styles'); print $this->Html->css('GrouperLite.co-grouper-plugin') . "\n "; +print $this->Html->script('vue/vue-3.2.31.global.prod.js'); + ?> - -Html->script('GrouperLite.typeahead.bundle.js') . "\n "; + +Html->addCrumb(_txt('pl.grouperlite.crumb.root'), array('controller' => 'grouper_groups', 'action' => 'groupmember'), array('prepend' => true)); ?> + + + + +
Html->image('GrouperLite.Grouper.jpg', array('class' => 'img-fluid mr-2', 'style' => 'height: 50px')); ?>

+ fetch('content'); ?>
diff --git a/View/GrouperGroups/emaillistinfo.ctp b/View/GrouperGroups/emaillistinfo.ctp deleted file mode 100644 index f2d9356..0000000 --- a/View/GrouperGroups/emaillistinfo.ctp +++ /dev/null @@ -1,70 +0,0 @@ -extend('/GrouperGroups/base'); ?> - - -
-
-

-
- -
-
-
-
-
-

- - - -
- element('Components/groupproperties', array( - 'group' => $groupergroupsdetail - )); ?> -
-
-
-

- element('Components/groupattributes', array( - 'attributes' => $groupergroupsdetail['attributes'], - 'baseUrl' => $attrUrlBase - )); ?> -
-
-
-
- - - - \ No newline at end of file diff --git a/View/GrouperGroups/emaillistsmanage.ctp b/View/GrouperGroups/emaillistsmanage.ctp deleted file mode 100644 index 6eadf4e..0000000 --- a/View/GrouperGroups/emaillistsmanage.ctp +++ /dev/null @@ -1,57 +0,0 @@ -extend('/GrouperGroups/base'); ?> -Html->addCrumb(_txt('pl.grouperlite.title.emaillists-manage')); ?> -element('Components/navigation-emaillists', array('active' => 'emaillistsmanage', 'create' => true)); ?> -element('Components/search', array('active' => 'emaillistsmanaged')); ?> - - 0) : ?> -
- - - - - - - - - - - - - - - - - - - -
- - - (10) | - (2) | - (1) - - - - - -
- element("pagination", array( - 'goto' => false, - 'limit' => true, - 'numbers' => true, - 'counter' => false - )); ?> -
- - -
-

-
- \ No newline at end of file diff --git a/View/GrouperGroups/emaillistsmember.ctp b/View/GrouperGroups/emaillistsmember.ctp deleted file mode 100644 index c26d517..0000000 --- a/View/GrouperGroups/emaillistsmember.ctp +++ /dev/null @@ -1,47 +0,0 @@ -extend('/GrouperGroups/base'); ?> -Html->addCrumb(_txt('pl.grouperlite.title.emaillists-member')); ?> -element('Components/navigation-emaillists', array('active' => 'emaillistsmember')); ?> -element('Components/search', array('active' => 'emaillistsmember')); ?> - - 0) : ?> -
- - - - - - - - - - $group) : ?> - - - - - - - -
- - - element('GrouperLite.Components/optAction', array( - 'member' => $group['optedin'], - 'action' => 'leavegroup', - 'group' => $group['name'], - 'idx' => $key - )) : ''; ?> -
- element("pagination", array( - 'goto' => false, - 'limit' => true, - 'numbers' => true, - 'counter' => false - )); ?> -
- - -
-

-
- \ No newline at end of file diff --git a/View/GrouperGroups/emaillistsoptin.ctp b/View/GrouperGroups/emaillistsoptin.ctp deleted file mode 100644 index 391109c..0000000 --- a/View/GrouperGroups/emaillistsoptin.ctp +++ /dev/null @@ -1,44 +0,0 @@ -extend('/GrouperGroups/base'); ?> -Html->addCrumb(_txt('pl.grouperlite.title.emaillists-join')); ?> -element('Components/navigation-emaillists', array('active' => 'emaillistsoptin')); ?> -element('Components/search', array('active' => 'emaillistsoptin')); ?> - 0) : ?> -
- - - - - - - - - - - - - - - - - -
- - - -
- element("pagination", array( - 'goto' => false, - 'limit' => true, - 'numbers' => true, - 'counter' => false - )); ?> -
- - -
-

-
- \ No newline at end of file diff --git a/View/GrouperGroups/groupcreate.ctp b/View/GrouperGroups/groupcreate.ctp deleted file mode 100644 index 25e446c..0000000 --- a/View/GrouperGroups/groupcreate.ctp +++ /dev/null @@ -1,35 +0,0 @@ -extend('/GrouperGroups/base'); -$this->Html->addCrumb(_txt('pl.grouperlite.title.groupcreate')); - -$model = $this->name; -?> -
-
-
-
-
-
Stems coming in are: Id=stem
- -
Value= Display=
- - - Form->create(false, array( - 'url' => array('controller' => 'grouper_groups', 'action' => 'groupcreate') - )); ?> - plugin)) { - if (file_exists(APP . "Plugin/" . $this->plugin . "/View/" . $model . "/groupfields.inc")) { - include(APP . "Plugin/" . $this->plugin . "/View/" . $model . "/groupfields.inc"); - } elseif (file_exists(LOCAL . "Plugin/" . $this->plugin . "/View/" . $model . "/groupfields.inc")) { - include(LOCAL . "Plugin/" . $this->plugin . "/View/" . $model . "/groupfields.inc"); - } - } else { - include(APP . "View/" . $model . "/groupfields.inc"); - } - ?> - Form->end(); ?> -
-
-
-
\ No newline at end of file diff --git a/View/GrouperGroups/groupcreatetemplate.ctp b/View/GrouperGroups/groupcreatetemplate.ctp deleted file mode 100644 index d465236..0000000 --- a/View/GrouperGroups/groupcreatetemplate.ctp +++ /dev/null @@ -1,30 +0,0 @@ -extend('/GrouperGroups/base'); -$this->Html->addCrumb(_txt('pl.grouperlite.title.templatecreate')); - -$model = $this->name; -?> -
-
-
-
-
- Form->create(false, array( - 'url' => array('controller' => 'grouper_groups', 'action' => 'groupcreatetemplate') - )); ?> - plugin)) { - if (file_exists(APP . "Plugin/" . $this->plugin . "/View/" . $model . "/templatefields.inc")) { - include(APP . "Plugin/" . $this->plugin . "/View/" . $model . "/templatefields.inc"); - } elseif (file_exists(LOCAL . "Plugin/" . $this->plugin . "/View/" . $model . "/templatefields.inc")) { - include(LOCAL . "Plugin/" . $this->plugin . "/View/" . $model . "/templatefields.inc"); - } - } else { - include(APP . "View/" . $model . "/templatefields.inc"); - } - ?> - Form->end(); ?> -
-
-
-
diff --git a/View/GrouperGroups/groupfields.inc b/View/GrouperGroups/groupfields.inc deleted file mode 100644 index c3b3066..0000000 --- a/View/GrouperGroups/groupfields.inc +++ /dev/null @@ -1,210 +0,0 @@ - - - - - -
-
- Form->label(false, _txt('pl.grouperlite.form.group.name.label'), array( - 'for' => 'name', - 'class' => "col-sm-3 col-form-label" - )); ?> -
- Form->input('name', array( - 'label' => false, - 'class' => 'form-control', - 'id' => 'name' - )); ?> - - - -
-
- - Form->label(false, _txt('pl.grouperlite.form.group.stem.label'), array( - 'for' => 'folder', - 'class' => "col-sm-3 col-form-label" - )); ?> -
- Form->input('grouptemplate', array( - 'label' => false, - 'class' => 'form-control', - 'id' => 'folder', - 'default' => 'sandbox:org:unicon:', - 'readonly' => true - )); ?> - - - -
- - */ ?> -
- Form->label(false, 'Description:', array( - 'for' => 'descr', - 'class' => "col-sm-3 col-form-label" - )); ?> -
- Form->textarea('description', array( - 'class' => 'form-control', - 'id' => 'descr', - 'rows' => 5 - )); ?> - - - -
-
-
- : -
-
- -
- Form->checkbox('privileges', array( - 'value' => $OPT, - 'class' => 'form-check-input', - 'id' => 'assign-' . $opt, - 'hiddenField' => false - )); ?> - Form->label(false, _txt('pl.grouperlite.form.group.privs.label.' . $opt), array( - 'for' => 'assign-' . $opt, - 'class' => "form-check-label" - )); ?> -
- -
-
-
- - echo $this->Form->label(false, _txt('pl.grouperlite.form.group.subs.label'), array( - 'for' => 'subscribers', - 'class' => "col-sm-3 col-form-label" - )); ?> -
- Form->input('grouptemplate', array( - 'label' => false, - 'class' => 'typeahead form-control', - 'id' => 'name', - 'placeholder' => _txt('pl.grouperlite.form.group.subs.placeholder') - )); ?> - - - -
-
- */ ?> -
-
- Form->button(_txt('pl.grouperlite.form.group.action.save'), array( - 'type' => 'submit', - 'class' => 'btn btn-grouper btn-primary btn-lg btn-raised' - )); ?> -
-
-
\ No newline at end of file diff --git a/View/GrouperGroups/groupmember.ctp b/View/GrouperGroups/groupmember.ctp index a2c40a2..ce7f61e 100644 --- a/View/GrouperGroups/groupmember.ctp +++ b/View/GrouperGroups/groupmember.ctp @@ -4,140 +4,112 @@ element('GrouperLite.Components/navigation-groups', array('active' => 'groupmember')); ?> element('GrouperLite.Components/search', array('active' => 'groupmember')); ?> 'pl.grouperlite.table.name', - 'role' => 'pl.grouperlite.table.role', - 'description' => 'pl.grouperlite.table.description', - 'action' => 'pl.grouperlite.table.action' -]; - -if ($isuserowner !== 'T') { - array_splice($columns, 1, 1); -} - -$numColumns = count($columns); $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; +$collapsed = false; + ?> - 0 || count($wgmemberships) > 0) : ?> -
- element("pagination", array( - 'goto' => false, - 'limit' => false, - 'numbers' => false, - 'counter' => true, - 'class' => 'counter' - )); ?> - - - - $label) : ?> - - - - - - - - - $group) : ?> - - - - - - - - - - - - - - - - - - - - - - - - - $group) : ?> - - - - - - - - - - - - - - -
- -
- - - - - - element('GrouperLite.Components/optAction', array( - 'member' => $group['optOut'], - 'action' => 'leavegroup', - 'group' => $group['name'], - 'groupDisplay' => $group['friendlyName'], - 'idx' => $key - )) : ''; ?> - - -
- -
None
- - - -
- - - -
- element("pagination", array( - 'goto' => false, - 'limit' => true, - 'numbers' => true, - 'counter' => false - )); ?> + + + + +
+ element("pagination", array( + 'goto' => false, + 'limit' => false, + 'numbers' => false, + 'counter' => true, + 'class' => 'counter' + )); ?> +
+ + + +
+ + element("pagination", array( + 'goto' => false, + 'limit' => true, + 'numbers' => true, + 'counter' => false + )); ?>
- - +

@@ -145,4 +117,5 @@ $collapsed = $config['defaultCollapse'] === 'collapsed' ? true : false; element('Components/subscriberList', array('addSubscribers' => false)); ?> + \ No newline at end of file diff --git a/webroot/js/collapse.js b/webroot/js/collapse.js new file mode 100644 index 0000000..2dc4d7c --- /dev/null +++ b/webroot/js/collapse.js @@ -0,0 +1,26 @@ +export default { + props: { + default: { + type: Boolean, + default: false + } + }, + components: { + }, + data() { + return { + collapsed: false, + } + }, + methods: { + toggle () { + this.collapsed = !this.collapsed; + } + }, + mounted() { + this.collapsed = this.default; + }, + template: /*html*/` + + ` +} \ No newline at end of file diff --git a/webroot/js/empty b/webroot/js/empty deleted file mode 100644 index e69de29..0000000 diff --git a/webroot/js/grouper-groups-view.js b/webroot/js/grouper-groups-view.js new file mode 100644 index 0000000..275178e --- /dev/null +++ b/webroot/js/grouper-groups-view.js @@ -0,0 +1,127 @@ +import Collapse from './collapse.js'; +import Popover from './popover.js'; + +export default { + props: { + groups: Object, + columns: Object, + config: Object, + action: { + type: String, + default: 'leave' + }, + url: String, + owner: Boolean, + txt: Object, + }, + components: { + Collapse + }, + computed: { + numColumns() { + return this.columns.length; + }, + collapsed() { + return this.config.collapsed; + } + }, + directives: { + Popover + }, + template: /*html*/` + + + + + + + + + + + + + + + + + + + + + + + + + +
{{ column.label }}
+ +
+ +
None
+ ` + } \ No newline at end of file diff --git a/webroot/js/popover.js b/webroot/js/popover.js new file mode 100644 index 0000000..68ac519 --- /dev/null +++ b/webroot/js/popover.js @@ -0,0 +1,10 @@ +export default { + mounted(el, { value }) { + jQuery(el).popover({ + content: value, + trigger: 'hover', + placement: 'top', + container: 'body' + }) + } +} \ No newline at end of file