From 4c063804b45520369ac28c8115102e9063bfaae9 Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Fri, 7 Oct 2022 10:01:18 -0400 Subject: [PATCH 1/3] Improve Manage Matchgrid layout: make Matchgrid History a top-link, and shorten label to "History" (CO-2527) --- app/resources/locales/en_US/default.po | 3 ++ app/src/View/Helper/MenuHelper.php | 3 +- app/templates/MatchgridRecords/columns.inc | 3 +- app/templates/Matchgrids/manage.php | 33 +++++++++++++++------- 4 files changed, 30 insertions(+), 12 deletions(-) diff --git a/app/resources/locales/en_US/default.po b/app/resources/locales/en_US/default.po index ad62d121e..b7da898d9 100644 --- a/app/resources/locales/en_US/default.po +++ b/app/resources/locales/en_US/default.po @@ -671,6 +671,9 @@ msgstr "differences" msgid "match.op.highlight.matches" msgstr "matches" +msgid "match.op.history" +msgstr "History" + msgid "match.op.last" msgstr "Last" diff --git a/app/src/View/Helper/MenuHelper.php b/app/src/View/Helper/MenuHelper.php index 57ca4035c..cdd3a6970 100644 --- a/app/src/View/Helper/MenuHelper.php +++ b/app/src/View/Helper/MenuHelper.php @@ -79,7 +79,8 @@ public function getMenuIcon($action) { 'Edit' => 'edit', 'Duplicate' => 'content_copy', 'Default' => 'link', // default icon for arbitrary menu items - 'Delete' => 'delete' + 'Delete' => 'delete', + 'History' => 'history' ); return $icon[$action]; diff --git a/app/templates/MatchgridRecords/columns.inc b/app/templates/MatchgridRecords/columns.inc index 958746848..9a9915603 100644 --- a/app/templates/MatchgridRecords/columns.inc +++ b/app/templates/MatchgridRecords/columns.inc @@ -82,6 +82,7 @@ $indexActions = [ 'sorid' => $e->sorid ]; }, - 'icon' => 'history' + 'icon' => 'history', + 'label' => __('match.op.history') ] ]; diff --git a/app/templates/Matchgrids/manage.php b/app/templates/Matchgrids/manage.php index 6b548c9af..7ad958de4 100644 --- a/app/templates/Matchgrids/manage.php +++ b/app/templates/Matchgrids/manage.php @@ -31,6 +31,29 @@

+ + $this->Menu->getMenuOrder('Add'), + 'icon' => $this->Menu->getMenuIcon('History'), + 'url' => $this->Url->build([ + 'controller' => 'MatchgridHistoryRecords', + 'action' => 'index', + '?' => ['matchgrid_id' => $vv_cur_mg->id] + ]), + 'label' => __('match.op.history') + ); + + // Output the topLinks + if(!empty($action_args['vv_actions'])) { + print ''; + } + ?>
@@ -61,15 +84,5 @@ ?>
-
- Html->link('' . __('match.op.display.history'), - ['controller' => 'MatchgridHistoryRecords', - 'action' => 'index', - '?' => ['matchgrid_id' => $vv_cur_mg->id] - ], - ['escape' => false, 'class' => 'btn btn-default']); - ?> -
-
From e21e2b80bafaa1cef418fb9783e31189a633f160 Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Sat, 8 Oct 2022 10:13:45 -0400 Subject: [PATCH 2/3] Update to Matchgrid History top-link label (CO-2527) --- app/templates/Matchgrids/manage.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/Matchgrids/manage.php b/app/templates/Matchgrids/manage.php index 7ad958de4..9ca7c5cc6 100644 --- a/app/templates/Matchgrids/manage.php +++ b/app/templates/Matchgrids/manage.php @@ -44,7 +44,7 @@ 'action' => 'index', '?' => ['matchgrid_id' => $vv_cur_mg->id] ]), - 'label' => __('match.op.history') + 'label' => __('match.ct.MatchgridHistoryRecords',2) ); // Output the topLinks From 5ec1b9560bd05ed428cd5934117231e8081e71a7 Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Thu, 27 Oct 2022 15:08:16 -0400 Subject: [PATCH 3/3] Test for empty vv_attr_id for topLinks (CO-2527) --- app/templates/element/menuAction.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/element/menuAction.php b/app/templates/element/menuAction.php index 7027556ae..c49b7fb93 100644 --- a/app/templates/element/menuAction.php +++ b/app/templates/element/menuAction.php @@ -28,7 +28,7 @@ $actionsCount = count($vv_actions); $actionsCountClass = $actionsCount > 0 ? ' actions-count-' . $actionsCount : ''; $actionsMenuClass = 'field-actions-menu dropdown dropleft' . $actionsCountClass; -$actionsMenuUid = md5($vv_attr_mdl . $vv_attr_id); +$actionsMenuUid = md5($vv_attr_mdl . (!empty($vv_attr_id) ? $vv_attr_id : '')); ?>