Skip to content

Commit

Permalink
Add Identifier attributes to Group "canvas" (CFM-291)
Browse files Browse the repository at this point in the history
  • Loading branch information
arlen committed Jun 29, 2023
1 parent 3ed18be commit 4741c7f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
3 changes: 3 additions & 0 deletions app/resources/locales/en_US/operation.po
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ msgstr "Add"
msgid "add.a"
msgstr "Add a New {0}"

msgid "add.attribute"
msgstr "Add Attribute"

msgid "api.key.generate"
msgstr "Generate API Key"

Expand Down
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
2 changes: 1 addition & 1 deletion app/templates/element/mveaCanvas.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
$action_args = array();
$action_args['vv_attr_id'] = $objId;
$action_args['vv_actions_type'] = 'mvea-add-menu';
$action_args['vv_actions_title'] = __d('operation', 'add');
$action_args['vv_actions_title'] = __d('operation', 'add.attribute');
$action_args['vv_actions_icon'] = 'add_circle';
$action_args['vv_actions_class'] = 'mvea-add-menu';
$actionOrderDefault = $this->Menu->getMenuOrder('Default');
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

0 comments on commit 4741c7f

Please sign in to comment.