From 346e7fe8e53b0f277d9e93b09272c866768f74bd Mon Sep 17 00:00:00 2001 From: spartanicus Date: Fri, 22 Oct 2021 16:46:30 -0400 Subject: [PATCH 1/4] Add clickability to all data rows when a default action is obvious (CO-1949) --- app/templates/ApiUsers/columns.inc | 3 ++- app/templates/AttributeGroups/columns.inc | 3 ++- app/templates/AttributeMappings/columns.inc | 3 ++- app/templates/AttributeMaps/columns.inc | 3 ++- app/templates/Attributes/columns.inc | 3 ++- app/templates/Matchgrids/columns.inc | 3 ++- app/templates/Permissions/columns.inc | 3 ++- app/templates/RuleAttributes/columns.inc | 3 ++- app/templates/Rules/columns.inc | 3 ++- app/templates/Standard/index.php | 2 +- app/templates/SystemsOfRecord/columns.inc | 3 ++- app/templates/element/javascript.php | 22 ++++++++++++++++++--- app/webroot/css/co-base.css | 2 +- 13 files changed, 41 insertions(+), 15 deletions(-) diff --git a/app/templates/ApiUsers/columns.inc b/app/templates/ApiUsers/columns.inc index 0d2dc59e6..add209b90 100644 --- a/app/templates/ApiUsers/columns.inc +++ b/app/templates/ApiUsers/columns.inc @@ -35,7 +35,8 @@ if(!empty($vv_cur_mg)) { $indexColumns = [ 'username' => [ - 'type' => 'link' + 'type' => 'link', + 'cssClass' => 'row-link' ] ]; diff --git a/app/templates/AttributeGroups/columns.inc b/app/templates/AttributeGroups/columns.inc index 5ad7ec404..0e23b1e39 100644 --- a/app/templates/AttributeGroups/columns.inc +++ b/app/templates/AttributeGroups/columns.inc @@ -27,6 +27,7 @@ $indexColumns = [ 'name' => [ - 'type' => 'link' + 'type' => 'link', + 'cssClass' => 'row-link' ] ]; diff --git a/app/templates/AttributeMappings/columns.inc b/app/templates/AttributeMappings/columns.inc index 0356bb0b9..87bd4a30f 100644 --- a/app/templates/AttributeMappings/columns.inc +++ b/app/templates/AttributeMappings/columns.inc @@ -29,7 +29,8 @@ $indexColumns = [ 'query' => [ 'type' => 'link', - 'sortable' => true + 'sortable' => true, + 'cssClass' => 'row-link' ], 'value' => [ 'type' => 'echo', diff --git a/app/templates/AttributeMaps/columns.inc b/app/templates/AttributeMaps/columns.inc index 18c983844..4ab1ecdfa 100644 --- a/app/templates/AttributeMaps/columns.inc +++ b/app/templates/AttributeMaps/columns.inc @@ -27,7 +27,8 @@ $indexColumns = [ 'name' => [ - 'type' => 'link' + 'type' => 'link', + 'cssClass' => 'row-link' ] ]; diff --git a/app/templates/Attributes/columns.inc b/app/templates/Attributes/columns.inc index 9f02e671d..7eb1c6dbb 100644 --- a/app/templates/Attributes/columns.inc +++ b/app/templates/Attributes/columns.inc @@ -27,7 +27,8 @@ $indexColumns = [ 'name' => [ - 'type' => 'link' + 'type' => 'link', + 'cssClass' => 'row-link' ], 'attribute_group_id' => [ 'type' => 'fk' diff --git a/app/templates/Matchgrids/columns.inc b/app/templates/Matchgrids/columns.inc index 47e450773..c001f7bee 100644 --- a/app/templates/Matchgrids/columns.inc +++ b/app/templates/Matchgrids/columns.inc @@ -27,7 +27,8 @@ $indexColumns = [ 'table_name' => [ - 'type' => 'link' + 'type' => 'link', + 'cssClass' => 'row-link' ], 'status' => [ 'type' => 'enum', diff --git a/app/templates/Permissions/columns.inc b/app/templates/Permissions/columns.inc index 9be86bcc1..61510c87e 100644 --- a/app/templates/Permissions/columns.inc +++ b/app/templates/Permissions/columns.inc @@ -27,7 +27,8 @@ $indexColumns = [ 'username' => [ - 'type' => 'link' + 'type' => 'link', + 'cssClass' => 'row-link' ], 'matchgrid_id' => [ 'type' => 'fk' ], 'permission' => [ diff --git a/app/templates/RuleAttributes/columns.inc b/app/templates/RuleAttributes/columns.inc index e5f0de1f5..d9788b62e 100644 --- a/app/templates/RuleAttributes/columns.inc +++ b/app/templates/RuleAttributes/columns.inc @@ -30,7 +30,8 @@ $indexColumns = [ 'type' => 'link', 'model' => 'attribute', 'field' => 'name', - 'sortable' => 'Attributes.name' + 'sortable' => 'Attributes.name', + 'cssClass' => 'row-link' ], 'crosscheck_attribute_id' => [ 'type' => 'fk', diff --git a/app/templates/Rules/columns.inc b/app/templates/Rules/columns.inc index c9ae5eaa0..7d1925cc4 100644 --- a/app/templates/Rules/columns.inc +++ b/app/templates/Rules/columns.inc @@ -27,7 +27,8 @@ $indexColumns = [ 'name' => [ - 'type' => 'link' + 'type' => 'link', + 'cssClass' => 'row-link' ], 'confidence_mode' => [ 'type' => 'enum', diff --git a/app/templates/Standard/index.php b/app/templates/Standard/index.php index 0779da6d5..0f44bf089 100644 --- a/app/templates/Standard/index.php +++ b/app/templates/Standard/index.php @@ -171,7 +171,7 @@ function _column_key($modelsName, $c, $tz=null) { ?> $cfg): ?> - + > [ - 'type' => 'link' + 'type' => 'link', + 'cssClass' => 'row-link' ], 'resolution_mode' => [ 'type' => 'enum', diff --git a/app/templates/element/javascript.php b/app/templates/element/javascript.php index b22a0c93e..de2eb58e3 100644 --- a/app/templates/element/javascript.php +++ b/app/templates/element/javascript.php @@ -175,11 +175,27 @@ // Enable Bootstrap Popovers. Unless needed elsewhere, constrain this to #content $('#content [data-toggle="popover"]').popover(); + + // Generic row click handling for div-based rows + $('div.linked-row').click(function (e) { + location.href = $(this).find('a.row-link').attr('href'); + }); - // Generic row click handling - $('.linked-row').click(function (e) { - location.href = $(this).find('a.row-link').attr('href'); + // Generic row click handling for table rows + $('td.row-link').each(function (e) { + url = $(this).find('a').attr('href'); + if(url != undefined && url != '') { + $(this).closest('tr').addClass('linked-row').attr('data-target',url).click(function (e) { + location.href = $(this).attr('data-target'); + }).find('a').on('click',function(e){ + // don't propagate on other links to avoid redirecting dialog boxes + e.stopPropagation(); + }); + } }); + + // Ensure that other links on table rows don't propigate + // Add loading animation when a form is submitted, when any item with a "spin" class is clicked, // or on any button or anchor tag lacking the .nospin class. diff --git a/app/webroot/css/co-base.css b/app/webroot/css/co-base.css index bed15781c..6d2798c49 100644 --- a/app/webroot/css/co-base.css +++ b/app/webroot/css/co-base.css @@ -1161,7 +1161,7 @@ td.indented { } .linked-row:hover, .linked-row:hover td { - background-color: var(--cmg-color-lightgray-002) !important; + background-color: var(--cmg-color-lightgray-004) !important; } .menuitembutton { width: 250px; From 476f012eac3b1aede1fe0d384fe7c0e66b836a65 Mon Sep 17 00:00:00 2001 From: spartanicus Date: Fri, 22 Oct 2021 16:56:25 -0400 Subject: [PATCH 2/4] Include cssClass on as well as when defined for a column (CO-1949) --- app/templates/Standard/index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/templates/Standard/index.php b/app/templates/Standard/index.php index 0f44bf089..e048c37a2 100644 --- a/app/templates/Standard/index.php +++ b/app/templates/Standard/index.php @@ -143,7 +143,7 @@ function _column_key($modelsName, $c, $tz=null) { $cfg): ?> - -
> Date: Fri, 22 Oct 2021 22:54:23 -0400 Subject: [PATCH 3/4] Fix legacy row-link for Reconcile table (CO-1949) --- app/templates/Matchgrids/pending.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/templates/Matchgrids/pending.php b/app/templates/Matchgrids/pending.php index 3fed4d7fc..bb3e6aacb 100644 --- a/app/templates/Matchgrids/pending.php +++ b/app/templates/Matchgrids/pending.php @@ -44,13 +44,12 @@
+ From 6e8e126666e2233222c0073dd75f409ed20c9e27 Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Sun, 24 Oct 2021 10:11:03 -0400 Subject: [PATCH 4/4] Remove legacy comment --- app/templates/element/javascript.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/app/templates/element/javascript.php b/app/templates/element/javascript.php index de2eb58e3..fb6c62f95 100644 --- a/app/templates/element/javascript.php +++ b/app/templates/element/javascript.php @@ -192,10 +192,7 @@ e.stopPropagation(); }); } - }); - - // Ensure that other links on table rows don't propigate - + }); // Add loading animation when a form is submitted, when any item with a "spin" class is clicked, // or on any button or anchor tag lacking the .nospin class. @@ -219,4 +216,4 @@ -Flash->render() ?> \ No newline at end of file +Flash->render() ?>