Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Fix pending matches bug #1189

Merged
merged 1 commit into from Dec 11, 2020
Merged

Fix pending matches bug #1189

merged 1 commit into from Dec 11, 2020

Conversation

TaiWilkin
Copy link
Contributor

@TaiWilkin TaiWilkin commented Dec 11, 2020

Overview

During confirm/reject analysis of a list, the following bug was noticed.
When an entry had multiple potential matches, names and address of the
multiple facilities were not broken by line items. The links were
linked to an incorrect address. Additionally, the confirm and reject
button showed only for the top-most potential match.

When facilities have multiple potential matches, the matches show in
individual line items with a Confirm and Reject option for each
potential match.

There were a minor propType warning and key warning which have also
been corrected.

Connects #1185

Demo

Screen Shot 2020-12-11 at 1 28 30 PM

Notes

The line items aren't currently perfectly aligned. This PR fixes the functionality issue, but additional styling might be desired in the future.

Currently, the matches are all stored in a single row, with each cell containing the section header and multiple matches' data for that value. Due to the varying height of the cells, and the cell component being used in multiple places, my attempts to fix this with styling were inefficient. I also worried that a set height to the cell content would cause overflow issues.

My suggested long-term fix for the styling is to refactor this section to render the headers and each facility match as separate rows in the table, which would keep the line-items aligned despite the variable height.

Testing Instructions

  • Checkout this branch.
  • Run vagrant ssh and ./scripts/server
  • Navigate to a list item with two pending matches
  • The matches should be rendered as distinct items.
  • The Facility Match Name link should lead to the correct facilities.
  • Selecting 'confirm' or 'reject' should confirm or reject the correct facility.

Checklist

  • fixup! commits have been squashed
  • CI passes after rebase
  • CHANGELOG.md updated with summary of features or fixes, following Keep a Changelog guidelines

@@ -756,7 +756,3 @@ hr {
.STATUS_PARSED:not(:hover) {
background: #fff !important;
}

.STATUS_POTENTIAL_MATCH--ACTIONS + .STATUS_POTENTIAL_MATCH--ACTIONS {
display: none !important;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line explicitly hid any confirm/reject buttons after the first.

@@ -71,7 +71,7 @@ export default function FacilityListItemsDetailedTableRowCell({
</div>
{
data.map((item, index) => (
<Fragment key={hasActions ? item.id : item}>
<Fragment key={item.id ? item.id : item}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line was causing the main facility to receive an object as a key, instead of an id, causing a key warning in the console.

<FacilityListItemsDetailedTableRowCell
title
title=" "
Copy link
Contributor Author

Choose a reason for hiding this comment

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

A string title is required by the FacilityListItemsDetailedTableRowCell. Not passing one causes a prop-type warning.

@jwalgran
Copy link
Contributor

CI caught some lint

/usr/local/src/src/components/FacilityListItemsConfirmationTableRow.jsx
  158:31  error  Curly braces are unnecessary here  react/jsx-curly-brace-presence
  172:31  error  Curly braces are unnecessary here  react/jsx-curly-brace-presence
  184:31  error  Curly braces are unnecessary here  react/jsx-curly-brace-presence

@jwalgran
Copy link
Contributor

Looking at this now.

Copy link
Contributor

@jwalgran jwalgran left a comment

Choose a reason for hiding this comment

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

Thanks for digging into one of the trickiest bits of code in the project and finding a relatively simple solution. I confirmed that this is working. Nice explanatory comments.

@designmatty I decided to get this partial fix to #1185 sooner rather than later because a significant feature is broken on production. I would like to follow up with a more comprehensive refactor that aligns each potential match.

@TaiWilkin could you please add a note explaining the challenge you encountered when trying to align the matches?

@jwalgran jwalgran assigned TaiWilkin and unassigned jwalgran Dec 11, 2020
During confirm/reject analysis of a list, the following bug was noticed.
When an entry had multiple potential matches, names and address of the
multiple facilities were not broken by line items. The links were
linked to an incorrect address. Additionally, the confirm and reject
button showed only for the top-most potential match.

When facilities have multiple potential matches, the matches show in
individual line items with a Confirm and Reject option for each
potential match.

There were a minor propType warning and key warning which have also
been corrected.
@TaiWilkin TaiWilkin merged commit d3951c1 into develop Dec 11, 2020
@TaiWilkin TaiWilkin deleted the tw/fix-potential-match-bug branch December 11, 2020 21:03
@TaiWilkin TaiWilkin mentioned this pull request Feb 16, 2021
3 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants