From a557a283453dc50f170d58cbed09d84ccb92fe9f Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Mon, 22 Jan 2024 17:32:17 -0500 Subject: [PATCH] Improve layout and UX for External Identity Source Records (CFM-363) (#145) --- app/resources/locales/en_US/field.po | 10 +- app/resources/locales/en_US/information.po | 6 + .../ExternalIdentitySources/retrieve.php | 276 +++++++++++------- .../ExternalIdentitySources/search.php | 141 +++++---- app/templates/element/menuPanel.php | 18 +- app/templates/element/menuTop.php | 97 +++--- app/templates/element/subnavigation.php | 23 +- app/webroot/css/co-base.css | 53 +++- app/webroot/css/co-responsive.css | 3 + 9 files changed, 397 insertions(+), 230 deletions(-) diff --git a/app/resources/locales/en_US/field.po b/app/resources/locales/en_US/field.po index d54299d3e..ac02352bc 100644 --- a/app/resources/locales/en_US/field.po +++ b/app/resources/locales/en_US/field.po @@ -113,6 +113,9 @@ msgstr "Frozen" msgid "id" msgstr "ID" +msgid "item" +msgstr "Item" + msgid "family" msgstr "Family Name" @@ -258,6 +261,9 @@ msgstr "Timestamp" msgid "title" msgstr "Title" +msgid "type" +msgstr "Type" + msgid "url" msgstr "URL" @@ -351,8 +357,8 @@ msgstr "Limit Global Search Scope" msgid "CoSettings.search_global_limited_models.desc" msgstr "If true, Global Search will only search Names, Email Addresses, and Identifiers. This may result in faster searches for larger deployments." -msgid "ExternalIdentitySources.source_record.desc" -msgstr "If the source record is empty, it likely indicates this record is no longer available from the datasource" +msgid "ExternalIdentitySources.source_record.empty" +msgstr "The source record is empty. This suggests the record is no longer available from the datasource." msgid "GroupMembers.source" msgstr "Membership Source" diff --git a/app/resources/locales/en_US/information.po b/app/resources/locales/en_US/information.po index e5183c44e..73edccf50 100644 --- a/app/resources/locales/en_US/information.po +++ b/app/resources/locales/en_US/information.po @@ -60,12 +60,18 @@ msgstr "This External Identity was created from {0} ({1})" msgid "ExternalIdentitySources.retrieve" msgstr "This is the current record available directly from the source. To view the latest record retrieved and cached by Registry, click View External Identity Source Record." +msgid "ExternalIdentitySourceRecords.metadata" +msgstr "Metadata" + msgid "ExternalIdentitySourceRecords.view" msgstr "This is the latest record retrieved from the source, as cached by Registry. To view the current record directly from the source, select Retrieve from External Identity Source." msgid "ExternalIdentitySources.search.attrs.none" msgstr "The External Identity Source cannot be searched." +msgid "ExternalIdentitySources.search.single.placeholder" +msgstr "Search directly against the source for any value" + msgid "global.attribute.modal" msgstr "Attribute Modal" diff --git a/app/templates/ExternalIdentitySources/retrieve.php b/app/templates/ExternalIdentitySources/retrieve.php index cebe36a39..6ad48a2d0 100644 --- a/app/templates/ExternalIdentitySources/retrieve.php +++ b/app/templates/ExternalIdentitySources/retrieve.php @@ -26,105 +26,139 @@ */ use \Cake\Utility\Inflector; + + // Include the plugin subnavigation + $subnav = [ + 'name' => 'plugin', + 'active' => 'search' + ]; + + // Generate the subnavigation title and tabs + print $this->element('subnavigation', $subnav); ?>
-

+

-
- - -
- Flash->render() ?> - - - - Alert->alert($b, 'warning') ?> - - - - - - Alert->alert($b, 'warning') ?> - - -
- - - - - - + ], + 'label' => __d('operation', 'ExternalIdentitySources.sync') + ]; + + if(!empty($vv_external_identity_record)) { + $action_args['vv_actions'][] = [ + 'order' => 2, + 'icon' => 'visibility', + 'url' => [ + 'controller' => 'external-identities', + 'action' => 'view', + $vv_external_identity_record->external_identity_id + ], + 'label' => __d('operation', 'view.a', [__d('controller', 'ExternalIdentities', [1])]) + ]; + $action_args['vv_actions'][] = [ + 'order' => 3, + 'icon' => 'visibility', + 'url' => [ + 'controller' => 'ext-identity-source-records', + 'action' => 'view', + $vv_external_identity_record->id + ], + 'label' => __d('operation', 'view.a', [__d('controller', 'ExtIdentitySourceRecords', [1])]) + ]; + } + + print ''; + ?> + + + +
- +

+
+ + + + + + - - - + + + + + + + +
description; ?>description; ?>
+ +

+ + - - - + + + + + + - - - + + + + + - - - + + + \n"; - print "\n"; - print "\n"; - print "\n"; + print "\n"; + print "\n"; - print "\n"; - print "\n"; - print "\n"; + print "\n"; + print "\n"; + print "\n"; print "\n"; } } ?> + +
-
    - $value) { - if($field == 'type') continue; - - print "
  • " . $field . ": " . $value . "
  • \n"; - } - ?> -
-
+
    + $value) { + if($field == 'type') continue; + + print "
  • " . $field . ": " . $value . "
  • \n"; + } + ?> +
+
" . __d('controller', Inflector::camelize($model), 1) . "" . ($m['type'] ?? "") . "
    \n"; + print "
" . __d('controller', Inflector::camelize($model), 1) . "" . ($m['type'] ?? "") . "
    \n"; foreach($m as $field => $value) { if($field == 'type') continue; @@ -158,35 +192,45 @@ if(!empty($vv_eis_record['entity_data']['ad_hoc_attributes'])) { foreach($vv_eis_record['entity_data']['ad_hoc_attributes'] as $aha) { print "
" . __d('controller', 'AdHocAttributes', 1) . "" . $aha['tag'] . "" . $aha['value'] . "" . __d('controller', 'AdHocAttributes', 1) . "" . $aha['tag'] . "" . $aha['value'] . "
+ + +

+ + + + + + + + + \n"; - print "\n"; - print "\n"; print "\n"; - print "\n"; - print "\n"; - print "\n"; + print "\n"; + print "\n"; + print "\n"; print "\n"; foreach(array_keys($role) as $field) { if($field == 'role_key' || is_array($role[$field])) continue; print "\n"; - print "\n"; - print "\n"; - print "\n"; + print "\n"; + print "\n"; + print "\n"; print "\n"; } } @@ -202,9 +246,9 @@ if(!empty($role[$model])) { foreach($role[$model] as $m) { print "\n"; - print "\n"; - print "\n"; - print "\n"; + print "\n"; + print "\n"; - print "\n"; - print "\n"; - print "\n"; + print "\n"; + print "\n"; + print "\n"; print "\n"; } } ?> - - - - - - - -
" . __d('controller', 'ExternalIdentityRoles', 1) . "
" . __d('field', 'role_key') . "" . $role['role_key'] . "" . __d('field', 'role_key') . "" . $role['role_key'] . "
" . __d('field', $field) . "" . $role[$field] . "" . __d('field', $field) . "" . $role[$field] . "
" . __d('controller', Inflector::camelize($model), 1) . "" . ($m['type'] ?? "") . "
    \n"; + print "
" . __d('controller', Inflector::camelize($model), 1) . "" . ($m['type'] ?? "") . "
    \n"; foreach($m as $field => $value) { if($field == 'type') continue; @@ -221,31 +265,37 @@ if(!empty($role['ad_hoc_attributes'])) { foreach($role['ad_hoc_attributes'] as $aha) { print "
" . __d('controller', 'AdHocAttributes', 1) . "" . $aha['tag'] . "" . $aha['value'] . "" . __d('controller', 'AdHocAttributes', 1) . "" . $aha['tag'] . "" . $aha['value'] . "
-
- -
- - - -
+ + + + + +

+
+ + + + + + + +
+
diff --git a/app/templates/ExternalIdentitySources/search.php b/app/templates/ExternalIdentitySources/search.php index 835f2a9e8..53f6c7eee 100644 --- a/app/templates/ExternalIdentitySources/search.php +++ b/app/templates/ExternalIdentitySources/search.php @@ -24,70 +24,88 @@ * @since COmanage Registry v5.0.0 * @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0) */ + + // Include the plugin subnavigation + $subnav = [ + 'name' => 'plugin', + 'active' => 'search' + ]; + + // Generate the subnavigation title and tabs + print $this->element('subnavigation', $subnav); ?>
-

+

- -
- Flash->render() ?> - - - - Alert->alert($b, 'warning') ?> - - - - - - Alert->alert($b, 'warning') ?> - - -
- - -
- info -
- + -
    -Form->create(null, [ - 'id' => 'eis-search-form', - 'type' => 'post' - ]); - - foreach($vv_search_attrs as $field => $label) { - $key = "search." . $field; - - print "
  • " . $this->Form->control($key, - [ - 'label' => $label - ]) - . "
  • \n"; - - } -?> -
  • -
    -
    -
    - Form->submit(__d('operation', 'search')); - print $this->Form->end(); - ?> -
    -
  • -
+ Form->create(null, [ + 'id' => 'eis-search-form', + 'type' => 'post' + ]); + ?> + + + $label): ?> + + + + +
    + $label): ?> + +
  • +
    +
    +
    + Form->label($key, $label) ?> +
    +
    +
    + Form->control($key, ['label' => false]) ?> +
    +
    +
  • + +
  • +
    +
    +
    + Form->submit(__d('operation', 'search')); + ?> +
    +
  • +
+ + Form->end() ?> @@ -116,7 +134,7 @@ $r): ?> - + Html->link( $source_key, @@ -124,18 +142,15 @@ 'action' => 'retrieve', $this->request->getParam('pass')[0], '?' => ['source_key' => $source_key] + ], + [ + 'class' => 'row-link row-link-retrieve' ] ); ?> - - - - - + + + diff --git a/app/templates/element/menuPanel.php b/app/templates/element/menuPanel.php index 46088a350..d4065b255 100644 --- a/app/templates/element/menuPanel.php +++ b/app/templates/element/menuPanel.php @@ -248,6 +248,22 @@