Skip to content

Commit

Permalink
Restore attribute cards on External Id canvas (CFM-345) (#133)
Browse files Browse the repository at this point in the history
* Add test for ext_identity_source_records on External Id canvas (CFM-345)

* Restore attribute cards on External Id canvas. Improve read-only form-list styling.  (CFM-345)
  • Loading branch information
arlen authored Oct 11, 2023
1 parent 8008f1e commit 23f9182
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 28 deletions.
6 changes: 1 addition & 5 deletions app/src/Model/Table/ExternalIdentitiesTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,14 @@ public function initialize(array $config): void {
'Addresses',
'AdHocAttributes',
'EmailAddresses',
'ExtIdentitySourceRecords' => ['ExternalIdentitySources'],
'Identifiers',
'Names',
'Pronouns',
'TelephoneNumbers',
'Urls'
]);

$this->setViewContains([
'PrimaryName',
'ExtIdentitySourceRecords' => ['ExternalIdentitySources']
]);

$this->setAutoViewVars([
'statuses' => [
'type' => 'enum',
Expand Down
2 changes: 1 addition & 1 deletion app/src/View/Helper/FieldHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ public function dateControl(string $fieldName, string $dateType=DateTypeEnum::St
$controlCode = '<time>' . $entity->$fieldName->i18nFormat("yyyy-MM-dd HH:mm:ss", $this->getView()->get('vv_tz')) . '</time>';
}
} else {
$controlCode = __d('information', 'notset');
$controlCode = '<div class="not-set">' . __d('information', 'notset') . '</div>';
}
// Return this to the generic control() function
return $this->control($fieldName, $coptions, ctrlCode: $controlCode, labelIsTextOnly: true);
Expand Down
46 changes: 24 additions & 22 deletions app/templates/ExternalIdentities/fields.inc
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,30 @@

// This view will not support add/edit
if($vv_action == 'add' || $vv_action == 'edit' || $vv_action == 'view') {
print __d(
'information',
'ExternalIdentities.source',
[
$this->Html->link(
$vv_obj->ext_identity_source_records[0]->external_identity_source->description,
[
'controller' => 'external-identity-sources',
'action' => 'edit',
$vv_obj->ext_identity_source_records[0]->external_identity_source->id
]
),
$this->Html->link(
__d('operation', 'view.a', [__d('controller', 'ExtIdentitySourceRecords', 1)]),
[
'controller' => 'ext-identity-source-records',
'action' => 'view',
$vv_obj->ext_identity_source_records[0]->id
]
)
]
);
if(!empty($vv_obj->ext_identity_source_records[0])) {
print __d(
'information',
'ExternalIdentities.source',
[
$this->Html->link(
$vv_obj->ext_identity_source_records[0]->external_identity_source->description,
[
'controller' => 'external-identity-sources',
'action' => 'edit',
$vv_obj->ext_identity_source_records[0]->external_identity_source->id
]
),
$this->Html->link(
__d('operation', 'view.a', [__d('controller', 'ExtIdentitySourceRecords', 1)]),
[
'controller' => 'ext-identity-source-records',
'action' => 'view',
$vv_obj->ext_identity_source_records[0]->id
]
)
]
);
}

print $this->Field->control('status', ['empty' => false]);

Expand Down
9 changes: 9 additions & 0 deletions app/webroot/css/co-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1200,6 +1200,9 @@ ul.form-list {
clear: both;
padding: 0;
}
body.view ul.form-list {
border-bottom: 1px solid var(--cmg-color-bg-005);
}
.cm-time-picker-vals ul li,
ul.form-list li {
background-color: var(--cmg-color-body-bg);
Expand Down Expand Up @@ -1231,6 +1234,9 @@ ul.form-list li.fields-submit {
border-left: none;
border-right: none;
}
ul.form-list li.fields-submit .field:hover {
background-color: var(--cmg-color-body-bg);
}
ul.form-list .field-name {
display: block;
}
Expand Down Expand Up @@ -1273,6 +1279,9 @@ ul.form-list select {
background-color: var(--cmg-color-body-bg);
border-color: var(--cmg-color-bg-007);
}
ul.form-list .not-set {
padding: 4px 6px;
}
.form-select:disabled {
background-color: var(--cmg-color-bg-009);
}
Expand Down

0 comments on commit 23f9182

Please sign in to comment.