diff --git a/app/resources/locales/en_US/field.po b/app/resources/locales/en_US/field.po index 5afbfafcb..61fdcbf3b 100644 --- a/app/resources/locales/en_US/field.po +++ b/app/resources/locales/en_US/field.po @@ -197,6 +197,9 @@ msgstr "Full Name" msgid "hostname" msgstr "Hostname" +msgid "key" +msgstr "Key" + msgid "language" msgstr "Language" diff --git a/app/src/Controller/PeopleController.php b/app/src/Controller/PeopleController.php index 42cb3eb77..c37e1ca81 100644 --- a/app/src/Controller/PeopleController.php +++ b/app/src/Controller/PeopleController.php @@ -90,6 +90,30 @@ public function beforeRender(\Cake\Event\EventInterface $event) { $this->set('vv_default_name_type', $settings->default_name_type_id); } + if(!$this->request->is('restful') && $this->request->getParam('action') == 'edit') { + // Create a lookup table for badging External Identity Source descriptions on Person Canvas MVEAS. + // This will be passed to the view and made available to the JavaScript components. + $extIdentities = TableRegistry::getTableLocator()->get('ExternalIdentities'); + $personId = $this->request->getParam('pass.0'); + $eisLookupTable = $extIdentities + ->find('list', [ + 'keyField' => 'id', + 'valueField' => 'description', + ]) + ->select([ + 'id' => 'ExternalIdentities.id', + 'description' => 'ExternalIdentitySources.description', + ]) + ->innerJoinWith('ExtIdentitySourceRecords.ExternalIdentitySources') + ->where([ + 'ExternalIdentities.person_id' => $personId, + ]) + ->enableHydration(false) + ->toArray(); + + $this->set('vv_external_identity_sources', $eisLookupTable); + } + return parent::beforeRender($event); } } \ No newline at end of file diff --git a/app/src/View/Helper/VueHelper.php b/app/src/View/Helper/VueHelper.php index 3e5043d3f..d8ea9b672 100644 --- a/app/src/View/Helper/VueHelper.php +++ b/app/src/View/Helper/VueHelper.php @@ -53,13 +53,17 @@ class VueHelper extends Helper { ], 'field' => [ 'email', + 'key', 'login', 'primary', 'datepicker.chooseTime', 'datepicker.hour', 'datepicker.minute', + 'source', 'status', + 'type', 'unverified', + 'value' ], 'information' => [ 'global.attributes.none', @@ -98,7 +102,7 @@ class VueHelper extends Helper { ]; /** - * Helper which will produce an array of configured locales + * Helper which will produce an array of configured locales from the locales_list above. * * @param string $lang The language of the locale * diff --git a/app/templates/element/mveaCanvas.php b/app/templates/element/mveaCanvas.php index 48c6474cd..9da27119e 100644 --- a/app/templates/element/mveaCanvas.php +++ b/app/templates/element/mveaCanvas.php @@ -92,7 +92,7 @@ } ?>
-
+
diff --git a/app/templates/element/mveaJs.php b/app/templates/element/mveaJs.php index ec33c7be2..7baa5f9d9 100644 --- a/app/templates/element/mveaJs.php +++ b/app/templates/element/mveaJs.php @@ -64,7 +64,8 @@ mveaController: '', mveaTitle: '', webroot: 'request->getAttribute('webroot') ?>', - action: '' + action: '', + externalIdentitySources: }, txt: JSON.parse('locales()) ?>'), isLoading: true, diff --git a/app/webroot/css/co-base.css b/app/webroot/css/co-base.css index c07b7a294..fdfcfd962 100644 --- a/app/webroot/css/co-base.css +++ b/app/webroot/css/co-base.css @@ -1374,6 +1374,18 @@ h2.card-title a { #main h2.card-title a:hover { text-decoration: none; } +table.cm-mvea td { + width: 30%; +} +table.cm-mvea td:first-child { + width: 70%; +} +table.cm-mvea.cm-mvea-with-eis td { + width: 25%; +} +table.cm-mvea.cm-mvea-with-eis td:first-child { + width: 50%; +} .field-data-container .id-col { text-align: right; padding-right: 1em; @@ -2411,7 +2423,7 @@ code.source-record { align-items: center; } button.cm-copy-value-button { - display: flex; + display: none; /* turn on at 576px */ align-items: center; gap: 0.1em; padding: 0 0.5em 0.2em; @@ -2703,6 +2715,7 @@ html.dark-mode .btn-default:active { margin-top: auto; margin-bottom: auto; line-height: 1.2em; + border: 1px solid var(--cmg-color-bg-006); } .bg-light { color: var(--cmg-color-highlight-005); @@ -2724,6 +2737,9 @@ html.dark-mode .btn-default:active { .bg-secondary { background-color: var(--cmg-color-btn-bg-003); } +.badge-eis { + box-shadow: var(--cmg-color-shadow-01); +} /* Bootstrap bg-outline */ .bg-outline-primary { color: var(--cmg-color-link); diff --git a/app/webroot/css/co-color.css b/app/webroot/css/co-color.css index cd6ab939e..09e5131ce 100644 --- a/app/webroot/css/co-color.css +++ b/app/webroot/css/co-color.css @@ -89,6 +89,8 @@ --cmg-color-highlight-017: #cee6f8; /* alert: info border color (blue) */ --cmg-color-highlight-018: yellow; /* autocomplete highlight for query text */ + + --cmg-color-shadow-01: 0px 0px 2px 0px rgba(13,69,115,0.6); /* RGBA box-shadow color based on --cmg-color-btn-bg-001 */ /* Fonts */ --cmg-font-regular: 'open_sansregular','Trebuchet MS',Arial,Helvetica,sans-serif; @@ -172,6 +174,8 @@ html.dark-mode { --cmg-color-highlight-017: #333; /* alert: info border color (blue) */ --cmg-color-highlight-018: #cc0; /* autocomplete highlight for query text */ + --cmg-color-shadow-01: 0px 0px 2px 0px rgba(13,69,115,0.8); /* RGBA box-shadow color based on --cmg-color-btn-bg-001 */ + /* Bootstrap Overrides for Dark Mode */ --bs-light-rgb: #151515; } diff --git a/app/webroot/css/co-responsive.css b/app/webroot/css/co-responsive.css index cc5aa9ad2..5564640e5 100644 --- a/app/webroot/css/co-responsive.css +++ b/app/webroot/css/co-responsive.css @@ -112,13 +112,17 @@ } /* PERSON CANVAS / CARDS */ .co-cards .field-data-container { - display: grid; - grid-template-columns: 1fr 1fr; - align-items: center; - min-height: 2.5em; + vertical-align: center; } - #mvea-canvas-roles .field-data-container { - grid-template-columns: 1fr 1fr 2fr auto; + .co-cards th { + font-size: 0.8rem; + padding: 0.25rem 0.75rem; + } + .co-cards .field-data.data-eis .badge { + margin: 0; + } + button.cm-copy-value-button { + display: flex; } /* PAGINATION */ #pagination { diff --git a/app/webroot/js/comanage/components/mvea/mvea-item.js b/app/webroot/js/comanage/components/mvea/mvea-item.js index 91098c540..d60aa44a7 100644 --- a/app/webroot/js/comanage/components/mvea/mvea-item.js +++ b/app/webroot/js/comanage/components/mvea/mvea-item.js @@ -47,6 +47,9 @@ export default { }, mveaAddress: function() { return this.mvea.room + ' ' + this.mvea.street + ' ' + this.mvea.locality + ' ' + this.mvea.state + ' ' + this.mvea.postal_code + ' ' + this.mvea.country; + }, + hasEis: function() { + return this.core?.externalIdentitySources && Object.keys(this.core.externalIdentitySources).length > 0; } }, methods: { @@ -59,6 +62,9 @@ export default { var componentReference = 'mvea' + this.core.mveaType; this.$parent.$parent.launchModal(this.core.mveaTitle, this.mveaLink, componentReference); }); + }, + getEisDescription(externalIdentityId) { + return externalIdentityId ? this.core?.externalIdentitySources[externalIdentityId] : null; } }, mounted() { @@ -66,166 +72,228 @@ export default { }, template: ` -
  • -
    - - - - {{ this.mvea.display_name }} - - - {{ this.mvea.family }} {{ this.mvea.given }} - - - {{ this.mvea.honorific }} {{ this.mvea.given }} {{ this.mvea.middle }} {{ this.mvea.family }} {{ this.mvea.suffix }} + + + + + +
    + {{ this.mvea.type.display_name }} + + + + +
    + + +
    + + {{ getEisDescription(this.mvea?.source_name?.external_identity_id) }} - - - - - - - - -
    -
    -
    - {{ this.txt['field.primary'] }} - {{ this.mvea.type.display_name }} - {{ calcLangHR(this.mvea.language) }} + +
    - - - - -
    -
  • + + -
  • - -
    - {{ this.txt['field.unverified'] }} - {{ this.mvea.type.display_name }} -
    -
  • + + +
    + {{ this.mvea.mail }} + {{ this.txt['field.unverified'] }} + + +
    + + + {{ this.mvea.type.display_name }} + + + + {{ getEisDescription(this.mvea?.source_email_address?.external_identity_id) }} + + + -
  • - -
    - {{ this.txt['enumeration.SuspendableStatusEnum.S'] }} - - {{ this.mvea.type.display_name }} -
    -
  • + + +
    + {{ this.mvea.identifier }} {{ this.txt['enumeration.SuspendableStatusEnum.S'] }} + + +
    + + + {{ this.mvea.type.display_name }} + + + + {{ getEisDescription(mvea?.source_identifier?.external_identity_id) }} + + + -
  • - -
    - {{ this.mvea.tag }} -
    -
  • + + + + + + {{ this.mvea.tag }} + + + + {{ getEisDescription(this.mvea?.source_ad_hoc_attribute?.external_identity_id) }} + + + -
  • -
  • + + + +
    + + + {{ this.mvea.type.display_name }} + + + + {{ getEisDescription(mvea?.source_address?.external_identity_id) }} + + + -
  • - -
    - {{ this.mvea.type.display_name }} -
    -
  • + + + + + + {{ this.mvea.type.display_name }} + + + + {{ getEisDescription(mvea?.source_telephone_number?.external_identity_id) }} + + + -
  • - -
    - {{ this.mvea.type.display_name }} -
    -
  • + + + + + + {{ this.mvea.type.display_name }} + + + + {{ getEisDescription(mvea?.source_url?.external_identity_id) }} + + + -
  • - -
    - {{ this.mvea.type.display_name }} -
    -
  • + + + + + + {{ this.mvea.type.display_name }} + + + + {{ getEisDescription(mvea?.source_pronoun?.external_identity_id) }} + + + ` } diff --git a/app/webroot/js/comanage/components/mvea/mveas.js b/app/webroot/js/comanage/components/mvea/mveas.js index 0f50bac7c..6f3b1f997 100644 --- a/app/webroot/js/comanage/components/mvea/mveas.js +++ b/app/webroot/js/comanage/components/mvea/mveas.js @@ -46,6 +46,10 @@ export default { computed: { mveaModel: function() { return this.mveas?.[camelize(this.core.mveaType)] + }, + hasEis() { + return this.core?.externalIdentitySources && + Object.keys(this.core.externalIdentitySources).length > 0; } }, methods: { @@ -54,16 +58,26 @@ export default { } }, template: ` -