Skip to content

Commit

Permalink
Submenus first commit: add submenus to People and Groups (CFM-192)
Browse files Browse the repository at this point in the history
  • Loading branch information
arlen committed Oct 24, 2022
1 parent 57627d6 commit acfc840
Show file tree
Hide file tree
Showing 29 changed files with 706 additions and 157 deletions.
3 changes: 3 additions & 0 deletions app/resources/locales/en_US/menu.po
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

# Menu Messages

msgid "co.Attributes"
msgstr "Attributes"

msgid "co.configuration"
msgstr "Config"

Expand Down
12 changes: 9 additions & 3 deletions app/src/Controller/MVEAController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ public function beforeRender(\Cake\Event\EventInterface $event) {
$this->set('vv_ei_id', $externalIdentity->id);

// What's the primary name of the Person?
$this->set('vv_person_name', $Names->primaryName($externalIdentity->person_id));
$personName = $Names->primaryName($externalIdentity->person_id);
$this->set('vv_person_name', $personName);
$this->set('vv_supertitle', $personName->full_name);
$this->set('vv_person_id', $externalIdentity->person_id);
break;
case 'person_role_id':
Expand All @@ -92,11 +94,15 @@ public function beforeRender(\Cake\Event\EventInterface $event) {
$this->set('vv_person_role_id', $link->value);

// Also set a name
$this->set('vv_person_name', $Names->primaryName($roleEntity->person_id));
$personName = $Names->primaryName($roleEntity->person_id);
$this->set('vv_person_name', $personName);
$this->set('vv_supertitle', $personName->full_name);
$this->set('vv_person_id', $roleEntity->person_id);
break;
case 'person_id':
$this->set('vv_person_name', $Names->primaryName((int)$link->value));
$personName = $Names->primaryName((int)$link->value);
$this->set('vv_person_name', $personName);
$this->set('vv_supertitle', $personName->full_name);
$this->set('vv_person_id', $link->value);
break;
default;
Expand Down
7 changes: 7 additions & 0 deletions app/src/Controller/StandardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ public function add() {

// Default title is add new object
$this->set('vv_title', __d('operation', 'add.a', __d('controller', $modelsName, [1])));

// Supertitle is normally the display name of the parent object when subnavigation exists.
// Set this here as the fallback default. This value is overriden in MVEAController to hold the
// name of the parent object, not the model name of the current object.
// TODO: set this to a better value for other kinds of child objects (e.g. Group member)
$this->set('vv_supertitle', __d('controller', $modelsName, [1]));

// Let the view render
$this->render('/Standard/add-edit-view');
Expand Down Expand Up @@ -322,6 +328,7 @@ public function edit(string $id) {
// We don't use a trait for this since each table will implement different logic

$this->set('vv_title', __d('operation', 'edit.ai', $table->generateDisplayField($obj)));
$this->set('vv_supertitle', $table->generateDisplayField($obj));
} else {
// Default view title is edit object display field
$field = $table->getDisplayField();
Expand Down
6 changes: 6 additions & 0 deletions app/templates/AdHocAttributes/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@ $indexColumns = [
$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];

$subnav = [
'name' => 'person',
'active' => 'attributes',
'subActive' => 'ad_hoc_attributes'
];
35 changes: 35 additions & 0 deletions app/templates/AdHocAttributes/fields-nav.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/**
* COmanage Registry Ad Hoc Attributes Edit Navigation
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

// XXX: if CFM-218 (Make fields.inc configuration only) is accepted, move the contents of this file into fields.inc
$topLinks = [];

$subnav = [
'name' => 'person',
'active' => 'attributes',
'subActive' => 'ad_hoc_attributes'
];
6 changes: 6 additions & 0 deletions app/templates/Addresses/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,9 @@ $bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];

$subnav = [
'name' => 'person',
'active' => 'attributes',
'subActive' => 'addresses'
];
35 changes: 35 additions & 0 deletions app/templates/Addresses/fields-nav.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/**
* COmanage Registry Addresses Edit Navigation
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

// XXX: if CFM-218 (Make fields.inc configuration only) is accepted, move the contents of this file into fields.inc
$topLinks = [];

$subnav = [
'name' => 'person',
'active' => 'attributes',
'subActive' => 'addresses'
];
6 changes: 6 additions & 0 deletions app/templates/EmailAddresses/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,10 @@ $indexColumns = [
$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];

$subnav = [
'name' => 'person',
'active' => 'attributes',
'subActive' => 'email_addresses'
];
35 changes: 35 additions & 0 deletions app/templates/EmailAddresses/fields-nav.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/**
* COmanage Registry Email Address Edit Navigation
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

// XXX: if CFM-218 (Make fields.inc configuration only) is accepted, move the contents of this file into fields.inc
$topLinks = [];

$subnav = [
'name' => 'person',
'active' => 'attributes',
'subActive' => 'email_addresses'
];
5 changes: 5 additions & 0 deletions app/templates/ExternalIdentities/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,9 @@ $indexColumns = [
$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];

$subnav = [
'name' => 'person',
'active' => 'external_identities'
];
5 changes: 5 additions & 0 deletions app/templates/GroupMembers/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,9 @@ $indexColumns = [
$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];

$subnav = [
'name' => 'group',
'active' => 'members'
];
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* COmanage Registry Groups Edit Navigation
* COmanage Registry Group Members Edit Navigation
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
Expand All @@ -25,14 +25,10 @@
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

$topLinks = [
[
'icon' => 'sync',
'order' => 'Default',
'label' => __d('operation', 'reconcile'),
'link' => [
'action' => 'reconcile'
],
'class' => ''
]
// XXX: if CFM-218 (Make fields.inc configuration only) is accepted, move the contents of this file into fields.inc
$topLinks = [];

$subnav = [
'name' => 'group',
'active' => 'members'
];
5 changes: 5 additions & 0 deletions app/templates/GroupNestings/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,9 @@ $indexColumns = [
$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];

$subnav = [
'name' => 'group',
'active' => 'nestings'
];
34 changes: 34 additions & 0 deletions app/templates/GroupNestings/fields-nav.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php
/**
* COmanage Registry Group Nestings Edit Navigation
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

// XXX: if CFM-218 (Make fields.inc configuration only) is accepted, move the contents of this file into fields.inc
$topLinks = [];

$subnav = [
'name' => 'group',
'active' => 'nestings'
];
5 changes: 5 additions & 0 deletions app/templates/GroupOwners/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@ $indexColumns = [
$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];

$subnav = [
'name' => 'group',
'active' => 'owners'
];
16 changes: 11 additions & 5 deletions app/templates/Identifiers/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,6 @@ $indexColumns = [
]
];

$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];

$indexActions = [
[
'controller' => 'authentication_events',
Expand All @@ -52,4 +47,15 @@ $indexActions = [
];
}
]
];

$bulkActions = [
// TODO: develop bulk actions. For now, use a placeholder.
'delete' => true
];

$subnav = [
'name' => 'person',
'active' => 'attributes',
'subActive' => 'identifiers'
];
35 changes: 35 additions & 0 deletions app/templates/Identifiers/fields-nav.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/**
* COmanage Registry Names Edit Navigation
*
* Portions licensed to the University Corporation for Advanced Internet
* Development, Inc. ("UCAID") under one or more contributor license agreements.
* See the NOTICE file distributed with this work for additional information
* regarding copyright ownership.
*
* UCAID licenses this file to you under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
* @link https://www.internet2.edu/comanage COmanage Project
* @package registry
* @since COmanage Registry v5.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/

// XXX: if CFM-218 (Make fields.inc configuration only) is accepted, move the contents of this file into fields.inc
$topLinks = [];

$subnav = [
'name' => 'person',
'active' => 'attributes',
'subActive' => 'identifiers'
];
6 changes: 6 additions & 0 deletions app/templates/Names/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,10 @@ $rowActions = [
// TODO: develop bulk actions. For now, use a placeholder.
$bulkActions = [
'delete' => true
];

$subnav = [
'name' => 'person',
'active' => 'attributes',
'subActive' => 'names'
];
Loading

0 comments on commit acfc840

Please sign in to comment.