Skip to content

Commit

Permalink
Add EIS badges to Person Canvas (CFM-417)
Browse files Browse the repository at this point in the history
  • Loading branch information
arlen committed Jan 20, 2026
1 parent 6184224 commit 2ee926a
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 1 deletion.
23 changes: 23 additions & 0 deletions app/src/Controller/PeopleController.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,29 @@ 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') {
// Get the external identity sources for this person
$externalIdentitySources = $this->fetchTable('ExternalIdentities')
->find()
->where(['ExternalIdentities.person_id' => $this->request->getParam('pass.0')])
->contain([
'ExtIdentitySourceRecords' => [
'ExternalIdentitySources'
]
])
->all();

// Create a lookup table for badging EIS descriptions on Person Canvas MVEAS
$eisLookupTable = [];
foreach ($externalIdentitySources as $extIdentity) {
if (!empty($extIdentity->ext_identity_source_record) &&
!empty($extIdentity->ext_identity_source_record->external_identity_source)) {
$eisLookupTable[$extIdentity->id] = $extIdentity->ext_identity_source_record->external_identity_source->description;
}
}

$this->set('vv_external_identity_sources', $eisLookupTable);
}
return parent::beforeRender($event);
}
}
3 changes: 2 additions & 1 deletion app/templates/element/mveaJs.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@
mveaController: '<?= Cake\Utility\Inflector::dasherize($mveaController) ?>',
mveaTitle: '<?= $title ?>',
webroot: '<?= $this->request->getAttribute('webroot') ?>',
action: '<?= $vv_action ?>'
action: '<?= $vv_action ?>',
externalIdentitySources: <?= json_encode($vv_external_identity_sources ?? null) ?>
},
txt: JSON.parse('<?= json_encode($vueHelper->locales()) ?>'),
isLoading: true,
Expand Down
1 change: 1 addition & 0 deletions app/webroot/css/co-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -2703,6 +2703,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);
Expand Down
32 changes: 32 additions & 0 deletions app/webroot/js/comanage/components/mvea/mvea-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,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() {
Expand Down Expand Up @@ -106,6 +109,7 @@ export default {
<span v-if="this.mvea.primary_name" class="mr-1 badge bg-outline-secondary primary">{{ this.txt['field.primary'] }}</span>
<span class="mr-1 badge bg-light">{{ this.mvea.type.display_name }}</span>
<span v-if="this.mvea.language" class="mr-1 badge bg-light">{{ calcLangHR(this.mvea.language) }}</span>
<!-- XXX Add EIS lookup here -->
</div>
<!-- row actions -->
<!-- TODO: Should this action be open to the unpriviledged CoMember? -->
Expand Down Expand Up @@ -133,6 +137,10 @@ export default {
<div class="field-data data-label">
<span v-if="!(this.mvea.verified)" class="mr-1 badge bg-warning unverified">{{ this.txt['field.unverified'] }}</span>
<span class="mr-1 badge bg-light">{{ this.mvea.type.display_name }}</span>
<span v-if="getEisDescription(this.mvea?.source_email_address?.external_identity_id)"
class="mr-1 badge bg-light badge-eis">
{{ getEisDescription(this.mvea?.source_email_address?.external_identity_id) }}
</span>
</div>
</li>
<!-- Identifiers -->
Expand All @@ -148,6 +156,10 @@ export default {
<span v-if="this.mvea.status == 'S'" class="mr-1 badge bg-danger">{{ this.txt['enumeration.SuspendableStatusEnum.S'] }}</span>
<span v-if="this.mvea.login" class="mr-1 badge bg-outline-secondary login">{{ this.txt['field.login'] }}</span>
<span class="mr-1 badge bg-light">{{ this.mvea.type.display_name }}</span>
<span v-if="getEisDescription(mvea?.source_identifier?.external_identity_id)"
class="mr-1 badge bg-light badge-eis">
{{ getEisDescription(mvea?.source_identifier?.external_identity_id) }}
</span>
</div>
</li>
<!-- Ad Hoc Attributes -->
Expand All @@ -162,6 +174,10 @@ export default {
</div>
<div v-if="this.mvea.tag != ''" class="field-data data-label">
<span class="mr-1 badge bg-light ad-hoc">{{ this.mvea.tag }}</span>
<span v-if="getEisDescription(this.mvea?.source_ad_hoc_attribute?.external_identity_id)"
class="mr-1 badge bg-light badge-eis">
{{ getEisDescription(this.mvea?.source_ad_hoc_attribute?.external_identity_id) }}
</span>
</div>
</li>
<!-- Addresses -->
Expand All @@ -185,6 +201,10 @@ export default {
</div>
<div class="field-data data-label">
<span class="mr-1 badge bg-light">{{ this.mvea.type.display_name }}</span>
<span v-if="getEisDescription(mvea?.source_address?.external_identity_id)"
class="mr-1 badge bg-light badge-eis">
{{ getEisDescription(mvea?.source_address?.external_identity_id) }}
</span>
</div>
</li>
<!-- Telephone Numbers -->
Expand All @@ -198,6 +218,10 @@ export default {
</div>
<div class="field-data data-label">
<span class="mr-1 badge bg-light">{{ this.mvea.type.display_name }}</span>
<span v-if="getEisDescription(mvea?.source_telephone_number?.external_identity_id)"
class="mr-1 badge bg-light badge-eis">
{{ getEisDescription(mvea?.source_telephone_number?.external_identity_id) }}
</span>
</div>
</li>
<!-- Urls -->
Expand All @@ -212,6 +236,10 @@ export default {
</div>
<div class="field-data data-label">
<span class="mr-1 badge bg-light">{{ this.mvea.type.display_name }}</span>
<span v-if="getEisDescription(mvea?.source_url?.external_identity_id)"
class="mr-1 badge bg-light badge-eis">
{{ getEisDescription(mvea?.source_url?.external_identity_id) }}
</span>
</div>
</li>
<!-- Pronouns -->
Expand All @@ -225,6 +253,10 @@ export default {
</div>
<div class="field-data data-label">
<span class="mr-1 badge bg-light">{{ this.mvea.type.display_name }}</span>
<span v-if="getEisDescription(mvea?.source_pronoun?.external_identity_id)"
class="mr-1 badge bg-light badge-eis">
{{ getEisDescription(mvea?.source_pronoun?.external_identity_id) }}
</span>
</div>
</li>
`
Expand Down

0 comments on commit 2ee926a

Please sign in to comment.