Skip to content

Provide subnavigation between EISes and their plugins (and plugins generally) (CFM-363) #143

Merged
merged 2 commits into from
Jan 17, 2024
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
* COmanage Registry API Source Plugin 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)
*/

$subnav = [
'name' => 'plugin',
'active' => 'plugin'
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
* COmanage Registry File Source Plugin 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)
*/

$subnav = [
'name' => 'plugin',
'active' => 'plugin'
];
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
* COmanage Registry SQL Provisioner Plugin 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)
*/

$subnav = [
'name' => 'plugin',
'active' => 'plugin'
];
2 changes: 1 addition & 1 deletion app/resources/locales/en_US/menu.po
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ msgid "co.connections.external_identity_sources.desc"
msgstr "Define external \"systems of record\" from which to receive Person data through a Pipeline"

msgid "co.connections.pipelines.desc"
msgstr "Connect external data to Person Records"
msgstr "Connect external data to Person records"

msgid "co.connections.provisioning_targets.desc"
msgstr "Create access to applications and services"
Expand Down
44 changes: 44 additions & 0 deletions app/templates/ExternalIdentitySources/fields-nav.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<?php
/**
* COmanage Registry External Identity Sources 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)
*/

$topLinks = [
[
'icon' => 'search',
'order' => 'Default',
'label' => __d('operation', 'ExternalIdentitySources.search'),
'link' => [
'action' => 'search',
$vv_obj->id
],
'class' => ''
]
];

$subnav = [
'name' => 'plugin',
'active' => 'properties'
];
4 changes: 3 additions & 1 deletion app/templates/Pipelines/columns.inc
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ $indexColumns = [
]
];

/*
// TODO: develop $bulkActions. For now, use a placeholder.
$bulkActions = [
'delete' => true
];
];
*/
31 changes: 31 additions & 0 deletions app/templates/ProvisioningTargets/fields-nav.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<?php
/**
* COmanage Registry Provisioning Targets 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)
*/

$subnav = [
'name' => 'plugin',
'active' => 'properties'
];
45 changes: 43 additions & 2 deletions app/templates/element/subnavigation.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
$curId = NULL;
$curController = $this->request->getParam('controller');
$curAction = $this->request->getParam('action');
$navController = $curController;

if(!empty($vv_primary_link) && !empty($this->request->getQuery($vv_primary_link))) {
// This will work for most top-level index views
Expand All @@ -48,12 +49,17 @@
} elseif (!empty($vv_obj)) {
// This will work for most top-level edit views
// XXX we might produce the $vv_primary_link for edit views so the approach below could be deprecated
// XXX $vv_primary_link_obj is the equivalent for plugins however
$curId = $vv_obj->id;
if(!empty($vv_person_id)) {
$curId = $vv_person_id;
} elseif($active == 'plugin' && !empty($vv_primary_link_obj) && !empty($vv_primary_link_model)) {
$curId = $vv_primary_link_obj->id;
$navController = $vv_primary_link_model;
} elseif(!empty($vv_primary_link_id)) {
$curId = $vv_primary_link_id;
}

// For top-level nav while in edit pages.
if ($name == 'person') {
$linkFilter = ['person_id' => $curId];
Expand All @@ -73,7 +79,9 @@
}

$supertitle = __d('information','global.title.none');
if(!empty($vv_person_name)) {
if($active == 'plugin' && !empty($vv_bc_parent_obj)) {
$supertitle = $vv_bc_parent_obj->$vv_bc_parent_displayfield;
} elseif(!empty($vv_person_name)) {
$supertitle = $vv_person_name->full_name;
} elseif(!empty($vv_supertitle)) {
$supertitle = $vv_supertitle;
Expand Down Expand Up @@ -301,6 +309,40 @@
?>
</li>
<?php endif; // group ?>

<?php if ($name == 'plugin'): ?>
<!-- General Plugin Configuration Subnavigation -->
<!-- Used for all plugins that have a parent object with a child plugin config -->
<li class="nav-item">
<?php
$linkClass = ($active == 'properties') ? 'nav-link active' : 'nav-link';

// Because we are in a plugin, the normal link() and build() functions want to
// include the plugin path as part of the URL (and plugin => false cannot be used
// with these functions like it can with references to resources). Pass a string instead.
$navUrl = '/' . \Cake\Utility\Inflector::dasherize($navController) .
($curAction == 'view' ? '/view/' : '/edit/') . $curId;

print $this->Html->link(
__d('controller', 'Properties', [99]),
$navUrl,
['class' => $linkClass]
);
?>
</li>
<li class="nav-item">
<?php
$linkClass = ($active == 'plugin') ? 'nav-link active' : 'nav-link';
$navUrl = '/' . \Cake\Utility\Inflector::dasherize($navController) . '/configure/' . $curId;
print $this->Html->link(
__d('operation', 'configure.plugin'),
$navUrl,
['class' => $linkClass]
);
?>
</li>
<?php endif; // plugin ?>

</ul>
</nav>

Expand Down Expand Up @@ -361,4 +403,3 @@

<?php endif; // end $isExternalId ?>
</div>