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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/src/Controller/Component/AuthorizationComponent.php
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does this go away?

Copy link
Contributor Author

@arlen arlen Sep 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My thinking is that the only way to get to the Platform-level Matchgrid listing (where we can edit or delete a Matchgrid) is from the Platform menu. When we're in the context of managing the matches, we want to only operate within the interior context of the matchgrid. So the breacrumbs will reflect getting to the matchgrid selector and then the matchgrid management page only. (The matchgrid select view should also not have the interstitial "Matchgrids" crumb, so I should weed that out.) I think the interstitial link to the platform level matchgrid page is otherwise a little confusing even for platform admins - because the grid selector list is the simple path to switch between the grids, and having both crumbs creates a situation where we have two adjacent links to extremely similar but slightly different information ... and in reality the activies and contexts of the pages are different. (One for moving between matchgrids, one for managing matchgrids themselves.)

(On a related note, I'd like to bounce users straight to the matchgrid management page on login if only one matchgrid exists, and we've discussed adding a quick selector to switch between matchgrids near the matchgrid management title, too. ...But both can wait.)

$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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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; ?>


Loading