Skip to content

Fix up menus and information architecture to improve navigability. Fi… #2

Merged
merged 3 commits into from Sep 17, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions app/src/Controller/Component/AuthorizationComponent.php
Expand Up @@ -191,6 +191,7 @@ public function menuPermissions($username, $matchgridId=null) {
'matchgrid_settings' => $platformAdmin || $mgAdmin,
'rules' => $platformAdmin || $mgAdmin,
'systems_of_record' => $platformAdmin || $mgAdmin,
'reconcile' => $platformAdmin || $mgAdmin || $recMgr,
// Permissions specific to a matchgrid
'gridroles' => $perms['matchgrids'],
// Overall permission to manage the matchgrids
Expand Down
34 changes: 29 additions & 5 deletions app/src/Locale/en_US/default.po
Expand Up @@ -478,16 +478,21 @@ msgid "match.home.welcome"
msgstr "Welcome to {0}."

### Informational Messages
msgid "match.in.matchgrid.display"
msgstr "Display all records associated with this Matchgrid."

msgid "match.in.matchgrid.reconcile"
msgstr "Resolve matching records when COmanage determines the same person may be coming from multiple systems of record."

msgid "match.in.matchgrid.select"
msgstr "Select the Matchgrid you'd like to manage. A Matchgrid is used to match identity records across multiple authoritative systems of record."

msgid "match.in.matchgrids.none"
msgstr "There are no matchgrids currently defined."

msgid "match.in.pagination.format"
msgstr "Page {{page}} of {{pages}}, Viewing {{start}}-{{end}} of {{count}}"

### Menu Items
msgid "match.me.platform"
msgstr "Platform"

### Operations (Commands)
msgid "match.op.add.a"
msgstr "Add New {0}"
Expand All @@ -504,6 +509,9 @@ msgstr "Build"
msgid "match.op.build.confirm"
msgstr "Are you sure you wish to (re)build this matchgrid?"

msgid "match.op.configure.a"
msgstr "Configure {0}"

msgid "match.op.delete"
msgstr "Delete"

Expand All @@ -513,6 +521,9 @@ msgstr "Are you sure you wish to delete this record ({0})?"
msgid "match.op.display"
msgstr "Display"

msgid "match.op.display.records"
msgstr "Display Records"

msgid "match.op.duplicate"
msgstr "Duplicate"

Expand Down Expand Up @@ -555,11 +566,17 @@ msgstr "Display"
msgid "match.op.page.goto"
msgstr "Go To Page"

msgid "match.op.platform"
msgstr "Platform"

msgid "match.op.previous"
msgstr "Previous"

msgid "match.op.reconcile"
msgstr "Reconcile Unresolved Requests"
msgstr "Reconcile"

msgid "match.op.reconcile.requests"
msgstr "Reconcile Requests"

msgid "match.op.reconcile.a"
msgstr "Reconcile Unresolved Requests ({0})"
Expand Down Expand Up @@ -615,3 +632,10 @@ msgstr "Request could not be canonically resolved, pending record {0} created"

msgid "match.rs.saved"
msgstr "Saved"

### Titles
msgid "match.ti.matchgrid.config"
msgstr "Matchgrid Configuration"

msgid "match.ti.matchgrid"
msgstr "Matchgrid: {0}"
12 changes: 1 addition & 11 deletions app/src/Template/Element/breadcrumbs.ctp
Expand Up @@ -47,16 +47,6 @@ if($this->request->getRequestTarget(false) != '/') {
'action' => 'select']
);

if($modelsName != 'Matchgrids' && $modelsName != 'Permissions' && $modelsName != 'ApiUsers'
|| ($modelsName == 'Matchgrids' && ($action == 'reconcile' || $action == 'pending'))) {
// Link to matchgrids listing where appropriate
$this->Breadcrumbs->add(
__('match.ct.Matchgrids', [99]),
['controller' => 'matchgrids',
'action' => 'index' ]
);
}

if(!empty($vv_cur_mg)
&& ($modelsName != 'Matchgrids' || $action != 'manage')) {
// Link to matchgrid if set
Expand Down Expand Up @@ -93,7 +83,7 @@ if($this->request->getRequestTarget(false) != '/') {
);
}

if($action != 'index'
if($action != 'index' && $action != 'manage'
&& !($modelsName == 'Matchgrids' && $action == 'pending')) {

// Default parent is index, to which we might need to append the Primary Link ID
Expand Down
3 changes: 0 additions & 3 deletions app/src/Template/Element/javascript.ctp
Expand Up @@ -29,9 +29,6 @@

<script>
$(function() {
// Establish left-side navigation
$('#main-menu').metisMenu();

// Focus any designated form element
$('.focusFirst').focus();

Expand Down
103 changes: 38 additions & 65 deletions app/src/Template/Element/menuMain.ctp
Expand Up @@ -27,70 +27,43 @@

// XXX we're using the same cookie as registry to determine collapsing of the menu,
// we should probably have our own cookie (note other cookies already use "match" prefix)

// The following menu will only render if we have a user and matchgrid (see default.ctp)
?>
<ul id="main-menu" class="metismenu">
<?php
if(!empty($vv_cur_mg)) {
// Matchgrid specific models

$models = [
'matchgrid_settings' => 'settings',
'api_users' => 'vpn_key',
'attributes' => 'edit',
'attribute_groups' => 'storage',
'attribute_maps' => 'swap_horiz',
'rules' => 'assignment',
'systems_of_record' => 'gavel',
];

foreach($models as $model => $icon) {
if($vv_menu_permissions[$model]) {
print '<li class="configMenu">';

$linkContent = '<em class="material-icons" aria-hidden="true">' . $icon . '</em><span class="menuTitle">'
. __('match.ct.'.\Cake\Utility\Inflector::camelize($model), [99])
. '</span>';

print $this->Html->link(
$linkContent,
['plugin' => null,
'controller' => $model,
'action' => 'index',
'matchgrid_id' => $vv_cur_mg->id],
['escape' => false]
);

print "</li>";
}
}
} else {
// Only render platform level configuration when not in the context of a matchgrid

$models = [
'matchgrids' => 'grid_on',
'permissions' => 'lock',
'api_users' => 'vpn_key'
];

foreach($models as $model => $icon) {
if($vv_menu_permissions[$model]) {
print '<li class="configMenu">';

$linkContent = '<em class="material-icons" aria-hidden="true">' . $icon . '</em><span class="menuTitle">'
. __('match.ct.'.\Cake\Utility\Inflector::camelize($model), [99])
. '</span>';

print $this->Html->link(
$linkContent,
['plugin' => null,
'controller' => $model,
'action' => 'index'],
['escape' => false]
);

print "</li>";
}
}
}
?>
<ul id="main-menu">
<?php // Always render the Manage link - limit what users can see from the page view ?>
<li class="configMenu">
<?= $this->Html->link(
'<em class="material-icons" aria-hidden="true">home</em>
<span class="menu-title">' . __('match.op.manage') . '</span>',
['controller' => 'Matchgrids',
'action' => 'manage',
$vv_cur_mg->id],
['escape' => false]);
?>
</li>
<?php if($vv_menu_permissions['gridroles']): ?>
<li class="configMenu">
<?= $this->Html->link(
'<em class="material-icons" aria-hidden="true">list</em>
<span class="menu-title">' . __('match.op.display') . '</span>',
['controller' => 'MatchgridRecords',
'action' => 'index',
'matchgrid_id' => $vv_cur_mg->id],
['escape' => false]);
?>
</li>
<?php endif; // $vv_menu_permissions['gridroles'] ?>
<?php if($vv_menu_permissions['reconcile']): ?>
<li class="configMenu">
<?= $this->Html->link(
'<em class="material-icons" aria-hidden="true">check_circle</em>
<span class="menu-title">' . __('match.op.reconcile') . '</span>',
['controller' => 'Matchgrids',
'action' => 'pending',
$vv_cur_mg->id],
['escape' => false]);
?>
</li>
<?php endif; // $vv_menu_permissions['reconcile'] ?>
</ul>
108 changes: 108 additions & 0 deletions app/src/Template/Element/menuTop.ctp
@@ -0,0 +1,108 @@
<?php
/*
* COmanage Match Secondary Menu Bar
* Displayed above all pages when logged in
*
* 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 http://www.internet2.edu/comanage COmanage Project
* @package match
* @since COmanage Match v1.0.0
* @license Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/
?>
<?php if(!empty($vv_user)): ?>
<ul>
<?php if($vv_menu_permissions['gridroles']): ?>
<li id="top-menu-platform">
<a class="dropdown-toggle" href="#" role="button" id="platform-dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="top-menu-link-text">
<?= __('match.op.platform'); ?>
</span>
<em class="material-icons">settings</em>
</a>

<div class="dropdown-menu" aria-labelledby="platform-dropdown-toggle">
<?php
$models = [
'matchgrids' => 'grid_on',
'permissions' => 'lock',
'api_users' => 'vpn_key'
];

foreach($models as $model => $icon) {
if($vv_menu_permissions[$model]) {
$linkContent = '<em class="material-icons" aria-hidden="true">' . $icon . '</em><span class="menu-title">'
. __('match.ct.'.\Cake\Utility\Inflector::camelize($model), [99])
. '</span>';

print $this->Html->link(
$linkContent,
['plugin' => null,
'controller' => $model,
'action' => 'index'],
['escape' => false,'class' => 'dropdown-item']
);
}
}
?>
</div>
</li>
<?php endif; ?>
<li id="top-menu-user">
<a class="dropdown-toggle" href="#" role="button" id="user-panel-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="top-menu-link-text">
<?= $vv_user['username']; ?>
</span>
<em class="material-icons icon-adjust">person</em>
</a>
<!-- Account Dropdown -->
<div id="user-panel" aria-expanded="false" style="display: none;">
<div id="logout-in-panel">
<?php
print $this->Html->link(__('match.op.logout'),
'/auth/logout/logout.php',
['escape' => false,
'class' => 'btn']);
?>
</div>
<div id="user-panel-user-info">
<em class="material-icons">person</em>
<div id="user-panel-cn"><?= $vv_user['username']; ?></div>
<div id="user-panel-id"><?php print $this->getRequest()->getSession()->read('Auth.User.username'); ?></div>
</div>
</div>
</li>
</ul>
<?php endif; ?>

<?php if(!isset($noLoginLogout) || !$noLoginLogout) : ?>
<?php
if(!$vv_user) {
print $this->Html->link(__('match.op.login'),
['controller' => 'matchgrids',
'action' => 'select',
'plugin' => false],
['escape' => false,
'id' => 'login',
'class' => '']);
}
?>
<?php endif; ?>