Skip to content

Add Identifier attributes to Group "canvas" (CFM-291) #107

Merged
merged 2 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/src/Model/Table/GroupsTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class GroupsTable extends Table {
use \App\Lib\Traits\PermissionsTrait;
use \App\Lib\Traits\PrimaryLinkTrait;
use \App\Lib\Traits\ProvisionableTrait;
use \App\Lib\Traits\QueryModificationTrait;
use \App\Lib\Traits\TableMetaTrait;
use \App\Lib\Traits\ValidationTrait;
use \App\Lib\Traits\SearchFilterTrait;
Expand Down Expand Up @@ -97,6 +98,10 @@ public function initialize(array $config): void {
$this->setPrimaryLink('co_id');
$this->setAllowLookupPrimaryLink(['provision', 'reconcile']);
$this->setRequiresCO(true);

$this->setEditContains([
'Identifiers'
]);

$this->setAutoViewVars([
'statuses' => [
Expand Down
19 changes: 19 additions & 0 deletions app/templates/Groups/fields-nav.inc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

// List the MVEAs that may be shown on the mveaCanvas
// When this array exists, the mveaCanvas.php element will render
$mveas = [
'identifiers'
];

// Name the MVEAs Entity Type
$mveasEntityType = "group";

// XXX: if CFM-218 (Make fields.inc configuration only) is accepted, move the contents of this file into fields.inc
$topLinks = [
[
Expand Down Expand Up @@ -63,6 +72,16 @@ $topLinks = [
]
];

// $addMenuLinks is also given slightly different treatment from the typical $topLinks found in most views:
// it is a page-global menu used for adding MVEAs and is given special treatment in element/mveaCanvas.php.
$addMenuLinks = [
[
'controller' => 'identifiers',
'action' => 'add',
'icon' => 'fingerprint'
]
];

$subnav = [
'name' => 'group',
'active' => 'properties'
Expand Down
8 changes: 1 addition & 7 deletions app/templates/element/mveaJs.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,7 @@
},
methods: {
getMveas(mveaType,entityType) {
var entityTypeIdRef = 'person_id';
if(entityType == 'person_role') {
entityTypeIdRef = 'person_role_id';
}
if(entityType == 'external_identity') {
entityTypeIdRef = 'external_identity_id';
}
var entityTypeIdRef = entityType + '_id';
let url = '<?=
$this->Url->build(['controller' => 'api', 'action' => 'v2'])
?>/' + mveaType + '?' + entityTypeIdRef + '=<?php print $parentId ?>&extended';
Expand Down
2 changes: 1 addition & 1 deletion app/webroot/css/co-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -1090,7 +1090,7 @@ html.dark-mode #pagination {
}
#mvea-canvas-title-container {
display: flex;
justify-content: space-between;
gap: 0.5em;
align-items: center;
margin: 3em 0 -0.5em;
}
Expand Down