From fd7f6f2c808bf295927f8bb3945fc017d74799f8 Mon Sep 17 00:00:00 2001 From: Arlen Johnson Date: Tue, 3 Jan 2023 16:15:07 -0500 Subject: [PATCH] Update reconciliation view to make use of new $vv_candidate_diff array and use cell-based rather than row-based highlighting. (CO-2481) --- app/src/Lib/Match/MatchService.php | 4 +-- app/src/Lib/Util/ArrayUtil.php | 44 -------------------------- app/templates/Matchgrids/reconcile.php | 31 +++++++++++------- app/webroot/css/co-base.css | 8 ++--- 4 files changed, 26 insertions(+), 61 deletions(-) delete mode 100644 app/src/Lib/Util/ArrayUtil.php diff --git a/app/src/Lib/Match/MatchService.php b/app/src/Lib/Match/MatchService.php index ec6c1ad17..95e141825 100644 --- a/app/src/Lib/Match/MatchService.php +++ b/app/src/Lib/Match/MatchService.php @@ -140,8 +140,8 @@ public function diffCandidates(array $original, array $candidates) { // out in PHP code. Also, RuleAttributes can affect how matching // works, and right now we don't look at those at all. - $origvalue = $original[$attr]; - $value = $c[$attr]; + $origvalue = !empty($original[$attr]) ? $original[$attr] : ''; + $value = !empty($c[$attr]) ? $c[$attr] : ''; if($attrConfig[$attr]->alphanumeric) { $origvalue = preg_replace('/[^A-Za-z0-9]/', '', $origvalue); diff --git a/app/src/Lib/Util/ArrayUtil.php b/app/src/Lib/Util/ArrayUtil.php deleted file mode 100644 index fde2cc5fc..000000000 --- a/app/src/Lib/Util/ArrayUtil.php +++ /dev/null @@ -1,44 +0,0 @@ - $val) { if($key == $fieldNames[$i]) { - $canAttr[$i][1][] = $val; + $id = $c['id']; + $diff = in_array($key,$vv_candidate_diff[$id]) ? 1 : 0; + $canAttr[$i][1][] = [$val, $id, $diff]; } } } - - // 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 request_time and resolution_time to the bottom @@ -160,6 +158,7 @@ $val): ?> - + + Html->link( - $val, + $val[0], ['controller' => 'matchgrid-records', 'action' => 'edit', - $val, + $val[0], '?' => ['matchgrid_id' => $vv_cur_mg->id]]); ?> - + diff --git a/app/webroot/css/co-base.css b/app/webroot/css/co-base.css index 342ebc117..cb3a8e492 100644 --- a/app/webroot/css/co-base.css +++ b/app/webroot/css/co-base.css @@ -724,12 +724,12 @@ body.logged-in #top-menu { #reconcile-table tr:nth-child(2n+1) td { background-color: var(--cmg-color-white); } -#reconcile-table.view-mode-match tr.match td, -#reconcile-table.view-mode-both tr.match td { +#reconcile-table.view-mode-match td.match, +#reconcile-table.view-mode-both td.match { background-color: var(--cmg-color-green-003); } -#reconcile-table.view-mode-diff tr.diff td, -#reconcile-table.view-mode-both tr.diff td { +#reconcile-table.view-mode-diff td.diff, +#reconcile-table.view-mode-both td.diff { background-color: var(--cmg-color-yellow-003); } #reconcile-table tr.defined-attr th {