From 2b9cf8afcf74ad95b23658072e93b4b8d2b99cb5 Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Wed, 10 Aug 2022 18:42:23 -0400 Subject: [PATCH 1/3] Improve display of unresolved requests: duplicate referenceids are now merged into a single column heading for Suggestion #, referenceid, and the "Assign this ReferenceID" button. (CO-2167) --- app/templates/Matchgrids/reconcile.php | 47 +++++++++++++++++--------- 1 file changed, 31 insertions(+), 16 deletions(-) diff --git a/app/templates/Matchgrids/reconcile.php b/app/templates/Matchgrids/reconcile.php index c701c5305..d4dcbb1c5 100644 --- a/app/templates/Matchgrids/reconcile.php +++ b/app/templates/Matchgrids/reconcile.php @@ -29,25 +29,40 @@ use \App\Lib\Util\ArrayUtil; - // extract the attribute field names into a simple array + // Ensure that the candidates array is sorted by referenceid so we can easily match up identical adjacent referenceids. + // Note that this will retain the "New" record in first position (because the referenceid is empty). + array_multisort(array_column($vv_candidates, 'referenceid'), SORT_ASC, $vv_candidates); + + // Generate the referenceid label output by creating a simple array that contains the unique referenceid values + // along with the count of how many occurrences each has in the $vv_candidates structure (for colspan). + // Note that we must assign an empty string when encountering a NULL referenceid because array_count_values + // can only work on integers or strings. + $refIds = array(); + foreach ($vv_candidates as $candidate) { + $refIds[] = !empty($candidate['referenceid']) ? $candidate['referenceid'] : ''; + } + $refIds = array_count_values($refIds); + + // Extract the attribute field names into a simple array. $fieldNames = array(); foreach ($vv_candidates as $candidate) { $fieldNames = array_keys($candidate); break; } - // remove "referenceid" - it is given special treatment and should not be included in our structure + // Remove "referenceid" from the field names - it is given special treatment and should not be included in our + // attributes structure. array_splice($fieldNames, array_search('referenceid',$fieldNames), 1); - // build the data for the candidates into a structure for generating the view: + // Build the data for the candidates into a structure for generating the view: // attribute field name | attribute values | do the values match? $canAttr = array(); for($i = 0; $i < count($fieldNames); $i++) { - // put the field name in the first column + // Put the field name in the first column. $canAttr[$i][0] = $fieldNames[$i]; - // put all the values for the current attribute into the second column + // Put all the values for the current attribute into the second column. $canAttr[$i][1] = array(); foreach($vv_candidates as $c) { foreach($c as $key => $val) { @@ -75,10 +90,10 @@ - - - - + + $refIdCount): ?> + + @@ -90,9 +105,9 @@ - - - + $refIdCount): ?> + + @@ -101,16 +116,16 @@ - - + $refIdCount): ?> + Form->postLink(__('match.op.reconcile.' . (!empty($c['referenceid']) ? 'assign' : 'generate')), + $this->Form->postLink(__('match.op.reconcile.' . (!empty($refId) ? 'assign' : 'generate')), ['action' => 'reconcile', $vv_cur_mg->id], ['data' => [ 'rowid' => $vv_request['id'], // Default value needs to be the literal string "new" and not a localized text string - 'referenceid' => (!empty($c['referenceid']) ? $c['referenceid'] : 'new') + 'referenceid' => (!empty($refId) ? $refId : 'new') ], 'confirm' => __('match.op.assign.confirm'), 'class' => 'btn btn-primary nospin']); From c05c13e155e086da86b6db6c59371fd26a5355e5 Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Thu, 6 Oct 2022 15:32:44 -0400 Subject: [PATCH 2/3] Improve Pending Match UX Attribute Display - add highlight switches and improve ordering of attributes (CO-2233) --- app/resources/locales/en_US/default.po | 12 +++++ app/templates/Matchgrids/reconcile.php | 69 +++++++++++++++++++++++--- app/webroot/css/co-base.css | 14 +++++- app/webroot/css/co-color.css | 2 +- 4 files changed, 88 insertions(+), 9 deletions(-) diff --git a/app/resources/locales/en_US/default.po b/app/resources/locales/en_US/default.po index fc2416610..68cf0efc5 100644 --- a/app/resources/locales/en_US/default.po +++ b/app/resources/locales/en_US/default.po @@ -590,6 +590,18 @@ msgstr "Filter" msgid "match.op.go" msgstr "Go" +msgid "match.op.highlight" +msgstr "Highlight:" + +msgid "match.op.highlight.both" +msgstr "both" + +msgid "match.op.highlight.differences" +msgstr "differences" + +msgid "match.op.highlight.matches" +msgstr "matches" + msgid "match.op.last" msgstr "Last" diff --git a/app/templates/Matchgrids/reconcile.php b/app/templates/Matchgrids/reconcile.php index d4dcbb1c5..2792cd79f 100644 --- a/app/templates/Matchgrids/reconcile.php +++ b/app/templates/Matchgrids/reconcile.php @@ -75,8 +75,23 @@ // Test for content and equality between the row's attribute values and // set the third "match?" column to true (1) if non-empty equality found $canAttr[$i][2] = !empty($canAttr[$i][1][0]) && count(ArrayUtil::array_iunique($canAttr[$i][1])) === 1 ? 1 : 0; - } + + // Move the standard attributes to the bottom + $tempArr = []; + foreach ($canAttr as $key => $val) { + if( + $val[0] == 'id' + || $val[0] == 'sor' + || $val[0] == 'sorid' + || $val[0] == 'request_time' + || $val[0] == 'resolution_time' + ) { + $tempArr[] = $val; + unset($canAttr[$key]); + } + } + $canAttr = array_merge($canAttr,$tempArr); ?>
@@ -84,9 +99,23 @@

- +
+ +
+ + +
+
+ + +
+
+ + +
+
- +
@@ -135,12 +164,28 @@ - - > + + $val): ?>
- + Html->link( $val, ['controller' => 'matchgrid-records', @@ -156,4 +201,14 @@
-
\ No newline at end of file + + + \ No newline at end of file diff --git a/app/webroot/css/co-base.css b/app/webroot/css/co-base.css index 8c6b8f862..e5aa1dbf0 100644 --- a/app/webroot/css/co-base.css +++ b/app/webroot/css/co-base.css @@ -694,9 +694,21 @@ body.logged-in #top-menu { #reconcile-table tr:nth-child(2n+1) td { background-color: var(--cmg-color-white); } -#reconcile-table tr.match td { +#reconcile-table.view-mode-match tr.match td, +#reconcile-table.view-mode-both tr.match td { background-color: var(--cmg-color-green-003); } +#reconcile-table.view-mode-diff tr.diff td, +#reconcile-table.view-mode-both tr.diff td { + background-color: var(--cmg-color-yellow-003); +} +#reconcile-table tr.matr-id td { + border-top: 4px solid var(--cmg-color-lightgray-007); +} +/* view-controls */ +.view-controls-title { + margin-right: 1em; +} /* MATCHGRID MANAGEMENT */ #matchgrid-management { padding: 0; diff --git a/app/webroot/css/co-color.css b/app/webroot/css/co-color.css index b5243f0a6..a9479ad62 100644 --- a/app/webroot/css/co-color.css +++ b/app/webroot/css/co-color.css @@ -63,7 +63,7 @@ --cmg-color-yellow-001: #f5f5bb; /* yellow warning */ --cmg-color-yellow-002: #fbec88; /* infobox informational area */ - --cmg-color-yellow-003: #ffd; /* forms: focused input */ + --cmg-color-yellow-003: #ffd; /* forms: focused input; diffing fields for reconciliation */ --cmg-color-red-001: #fcc; /* red warning */ --cmg-color-red-002: #c00; /* forms: error icons */ From 062212b3acd8fe77e352d9e8b314b2726aa49725 Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Wed, 12 Oct 2022 17:18:30 -0400 Subject: [PATCH 3/3] Restore id, sor, and sorid to the top of attributes listing and outline defined attributes (CO-2233) --- app/templates/Matchgrids/reconcile.php | 13 ++++--------- app/webroot/css/co-base.css | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 11 deletions(-) diff --git a/app/templates/Matchgrids/reconcile.php b/app/templates/Matchgrids/reconcile.php index 2792cd79f..589cb984e 100644 --- a/app/templates/Matchgrids/reconcile.php +++ b/app/templates/Matchgrids/reconcile.php @@ -77,21 +77,15 @@ $canAttr[$i][2] = !empty($canAttr[$i][1][0]) && count(ArrayUtil::array_iunique($canAttr[$i][1])) === 1 ? 1 : 0; } - // Move the standard attributes to the bottom + // Move request_time and resolution_time to the bottom $tempArr = []; foreach ($canAttr as $key => $val) { - if( - $val[0] == 'id' - || $val[0] == 'sor' - || $val[0] == 'sorid' - || $val[0] == 'request_time' - || $val[0] == 'resolution_time' - ) { + if($val[0] == 'request_time' || $val[0] == 'resolution_time') { $tempArr[] = $val; unset($canAttr[$key]); } } - $canAttr = array_merge($canAttr,$tempArr); + $canAttr = array_merge($canAttr, $tempArr); ?>
@@ -178,6 +172,7 @@ ) { $matchClass .= ' standard'; } else { + $matchClass .= ' defined-attr'; $matchClass .= ($canAttr[$i][2] ? ' match' : ' diff'); } ?> diff --git a/app/webroot/css/co-base.css b/app/webroot/css/co-base.css index e5aa1dbf0..57ab08f60 100644 --- a/app/webroot/css/co-base.css +++ b/app/webroot/css/co-base.css @@ -702,8 +702,20 @@ body.logged-in #top-menu { #reconcile-table.view-mode-both tr.diff td { background-color: var(--cmg-color-yellow-003); } -#reconcile-table tr.matr-id td { - border-top: 4px solid var(--cmg-color-lightgray-007); +#reconcile-table tr.defined-attr th { + background-color: var(--cmg-color-lightgray-001); + border-left: 4px solid var(--cmg-color-lightgray-007); +} +#reconcile-table tr.defined-attr td:last-child { + border-right: 2px solid var(--cmg-color-lightgray-007); +} +#reconcile-table tr.matr-sorid th, +#reconcile-table tr.matr-sorid td { + border-bottom: 2px solid var(--cmg-color-lightgray-007); +} +#reconcile-table tr.matr-request_time th, +#reconcile-table tr.matr-request_time td { + border-top: 2px solid var(--cmg-color-lightgray-007); } /* view-controls */ .view-controls-title {