Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding step letters to abl #1953

Merged
merged 34 commits into from
Feb 16, 2022
Merged

adding step letters to abl #1953

merged 34 commits into from
Feb 16, 2022

Conversation

SidelineCory24
Copy link

@SidelineCory24 SidelineCory24 commented Feb 1, 2022

BE PR

To-Do & Feedback:

  • Remove sorting for step letters
  • Add icon and tooltip for step letter
  • Change date format to MM/D/YY in tooltip
  • Add asterisk to step letters text (editor)
  • Align Bureau share icon
  • Fix date picker styling (flex issue)
  • Enlarge date picker
  • Default dates to null
  • Add clear icon/functionality (active/inactive triggers)
  • Disable step2 if step1 is null (in editor)
  • Enable step2 when step1 exist
  • Disable the clear step1 icon if step2 exist
  • Show red outline around step 1 when step 1 has been manually deleted and step 2 still exist in the payload
  • Show red outline around step 2 when the step 1 date is ahead of the step 2 date (ex: step1 2/15/2022, step2 1/15/2022)
  • Disable the submit button if the red error outline appears around step 1 or 2

@SidelineCory24 SidelineCory24 removed do not merge WIP Work in progress labels Feb 7, 2022
@mjoyce91
Copy link

mjoyce91 commented Feb 8, 2022

@SidelineCory24 - is this ready for review?

@SidelineCory24
Copy link
Author

@SidelineCory24 - is this ready for review?

Yes. I see I only tagged someone on the BE PR 😅

@SidelineCory24
Copy link
Author

@mjoyce91 I'm having the code climate/coverage issue again and there's no info when I click the details.

@mjoyce91
Copy link

mjoyce91 commented Feb 9, 2022

@SidelineCory24 - just need to bump your test coverage

Screen Shot 2022-02-09 at 11 00 09 AM

@mjoyce91
Copy link

mjoyce91 commented Feb 9, 2022

Looks like the Bureau Share lock icon got thrown off to the right:
Screen Shot 2022-02-09 at 11 20 23 AM

@mjoyce91
Copy link

mjoyce91 commented Feb 9, 2022

Date picker isn't displaying correctly:
Screen Shot 2022-02-09 at 11 22 08 AM

Comment on lines 19 to 20
const stepLetterOneDate = get(details, 'stepLetterOne') === null ? new Date() : new Date(get(details, 'stepLetterOne'));
const stepLetterTwoDate = get(details, 'stepLetterTwo') === null ? new Date() : new Date(get(details, 'stepLetterTwo'));
Copy link

Choose a reason for hiding this comment

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

These should probably default to null instead of new Date()? Otherwise it auto-fills the input field with a date, even if the person didn't originally have step letter dates.

Defaulting to current date:
Screen Shot 2022-02-09 at 11 23 23 AM

Copy link
Author

Choose a reason for hiding this comment

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

done

@mjoyce91
Copy link

mjoyce91 commented Feb 9, 2022

Optional suggestion: some users may not know that they can just delete the date to clear it. Maybe a red X icon like we have elsewhere?

@SidelineCory24
Copy link
Author

Optional suggestion: some users may not know that they can just delete the date to clear it. Maybe a red X icon like we have elsewhere?

Good idea!

@SidelineCory24
Copy link
Author

@mjoyce91 in reference to the styling fixes, should I do that on this PR or the cleanup ticket that I'm working on with the other styling updates?

@mjoyce91
Copy link

mjoyce91 commented Feb 9, 2022

@mjoyce91 in reference to the styling fixes, should I do that on this PR or the cleanup ticket that I'm working on with the other styling updates?

I would do it in this one. I think of the cleanup more specifically as how we display the data in the table

@mjoyce91
Copy link

mjoyce91 commented Feb 9, 2022

Receiving an error when I try to submit data
Screen Shot 2022-02-09 at 11 59 11 AM

@SidelineCory24 - this actually isn't because of anything new in your code. This happens when you try to update a bidder with a null status.

Comment on lines 42 to 45
const stepLetterOne = get(bidder, 'available_bidder_details.step_letter_one');
const formattedStepLetterOne = stepLetterOne ? formatDate(stepLetterOne) : NO_DATE;
const stepLetterTwo = get(bidder, 'available_bidder_details.step_letter_two');
const formattedStepLetterTwo = stepLetterTwo ? formatDate(stepLetterTwo) : NO_DATE;
Copy link

Choose a reason for hiding this comment

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

What if we used "D/M/YY" instead of "DD/MM/YYYY" to save space?
Screen Shot 2022-02-09 at 4 03 53 PM

Ex: 02/08/2022 becomes 2/8/22

Copy link
Author

Choose a reason for hiding this comment

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

done

Copy link
Author

Choose a reason for hiding this comment

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

replaced with tooltip/icon

image

Comment on lines 42 to 45
const stepLetterOne = get(bidder, 'available_bidder_details.step_letter_one');
const formattedStepLetterOne = stepLetterOne ? formatDate(stepLetterOne) : NO_DATE;
const stepLetterTwo = get(bidder, 'available_bidder_details.step_letter_two');
const formattedStepLetterTwo = stepLetterTwo ? formatDate(stepLetterTwo) : NO_DATE;
Copy link

Choose a reason for hiding this comment

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

Do we need to show "None listed" for the second if there's only one step letter?

Screen Shot 2022-02-09 at 4 05 53 PM

Copy link
Author

Choose a reason for hiding this comment

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

I was wondering that myself. I can remove it and it back if more clarity is needed. They can always use the editor as well to see the second letter has no date.

Copy link
Author

Choose a reason for hiding this comment

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

done

Copy link
Author

Choose a reason for hiding this comment

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

ss in above comment to show update

Comment on lines 192 to 207
<div>
<dt>Step Letter 1:</dt>
<DatePicker
selected={stepLetterOne}
onChange={d => { updateStepLetterOne(d); }}
dateFormat="MMMM d, yyyy"
/>
</div>
<div>
<dt>Step Letter 2:</dt>
<DatePicker
selected={stepLetterTwo}
onChange={d => { updateStepLetterTwo(d); }}
dateFormat="MMMM d, yyyy"
/>
</div>
Copy link

@mjoyce91 mjoyce91 Feb 9, 2022

Choose a reason for hiding this comment

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

Question: should we do data validation to ensure that Step Letter 1 exists before allowing them to enter Step Letter 2?

Copy link

Choose a reason for hiding this comment

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

And then it goes in reverse as well. If Step Letter 1 and Step Letter 2 both exist, can they delete Step Letter 1 without deleting Step Letter 2?

Copy link
Author

Choose a reason for hiding this comment

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

Data validation makes sense. I'll do the None listed styling like the OC edit options.

For the reverse option, making step1 read only if step2 isn't null sounds good since step1 has to exist before step2.

Copy link
Author

Choose a reason for hiding this comment

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

done

@SidelineCory24
Copy link
Author

@mjoyce91 larger date picker styling has been pushed

@mjoyce91
Copy link

These should get asterisk added to designate as CDO-only

Screen Shot 2022-02-15 at 12 44 47 PM

@mjoyce91
Copy link

mjoyce91 commented Feb 15, 2022

One edge case that isn't accounted for:

Step 1. Give an available bidder 2 step letters
Step 2. Re-open the edit modal for that bidder
Step 3. Manually highlight and delete the date text for Step Letter 1. Step Letter 2 will show "None listed" but if you save, then Step Letter 2 date is still send in request payload.

Screen Shot 2022-02-15 at 2 23 17 PM

SidelineCory24 and others added 3 commits February 15, 2022 15:53
* dev:
  abl table cleanup (#1976)

# Conflicts:
#	src/Components/AvailableBidder/AvailableBidderRow/AvailableBidderRow.jsx
#	src/sass/_availableBidders.scss
@SidelineCory24
Copy link
Author

SidelineCory24 commented Feb 15, 2022

@elizabeth-jimenez @mjoyce91 this should show all the changes based on feedback.

step_letter_feedback.mp4

Step letter one has been removed manually and Step letter two still exist in the payload
image

Step letter one date > Step letter two date
image

@mjoyce91
Copy link

@SidelineCory24 I like the SL2 before SL1 date check. There may be a way to add that validation to the datepicker itself so that you can't even click on a past date. That can be a tech debt task.

@SidelineCory24
Copy link
Author

SidelineCory24 commented Feb 15, 2022

@SidelineCory24 I like the SL2 before SL1 date check. There may be a way to add that validation to the datepicker itself so that you can't even click on a past date. That can be a tech debt task.

done
new icon for step letters is shown as well

step_letter_date_disabled.mp4

@elizabeth-jimenez
Copy link

image
so nice having the previous dates un-selectable!

@elizabeth-jimenez
Copy link

One edge case that isn't accounted for:

Step 1. Give an available bidder 2 step letters Step 2. Re-open the edit modal for that bidder Step 3. Manually highlight and delete the date text for Step Letter 1. Step Letter 2 will show "None listed" but if you save, then Step Letter 2 date is still send in request payload.

Screen Shot 2022-02-15 at 2 23 17 PM

image
this problem doesn't exist anymore cause the user is prevented from submitting - but when they re-add their SL1, the old SL2 pops back in where None Listed is, not sure if we want to address that or not

Comment on lines 251 to 264
{stepLetterTwoFlag &&
<div className="step-letter-clear-icon">
<FA name="times-circle fa-lg inactive" />
</div>
}
{!stepLetterTwoFlag &&
<div className="step-letter-clear-icon">
<InteractiveElement
onClick={clearStepLetterTwoDate}
>
<FA name="times-circle fa-lg active" />
</InteractiveElement>
</div>
}

Choose a reason for hiding this comment

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

can this be a .... 🥁 ternary?

Choose a reason for hiding this comment

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

Yeah really lines 234-264 could all be encapsulated in a single ternary

Copy link
Author

Choose a reason for hiding this comment

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

ternary fix has been pushed

Choose a reason for hiding this comment

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

can they mike? like one big one? I see two smaller ones but can't see the big one :(

@mjoyce91
Copy link

One edge case that isn't accounted for:
Step 1. Give an available bidder 2 step letters Step 2. Re-open the edit modal for that bidder Step 3. Manually highlight and delete the date text for Step Letter 1. Step Letter 2 will show "None listed" but if you save, then Step Letter 2 date is still send in request payload.
Screen Shot 2022-02-15 at 2 23 17 PM

image this problem doesn't exist anymore cause the user is prevented from submitting - but when they re-add their SL1, the old SL2 pops back in where None Listed is, not sure if we want to address that or not

@elizabeth-jimenez - I think I like current functionality. That way if they delete SL1 on accident, they don't lose the SL2 date.

@elizabeth-jimenez
Copy link

One edge case that isn't accounted for:
Step 1. Give an available bidder 2 step letters Step 2. Re-open the edit modal for that bidder Step 3. Manually highlight and delete the date text for Step Letter 1. Step Letter 2 will show "None listed" but if you save, then Step Letter 2 date is still send in request payload.
Screen Shot 2022-02-15 at 2 23 17 PM

image this problem doesn't exist anymore cause the user is prevented from submitting - but when they re-add their SL1, the old SL2 pops back in where None Listed is, not sure if we want to address that or not

@elizabeth-jimenez - I think I like current functionality. That way if they delete SL1 on accident, they don't lose the SL2 date.

ok cool 😁 - I could see the pros and cons to it

@@ -407,6 +460,7 @@
}

.tippy-popper {
// TODO - consolidate these two classes

Choose a reason for hiding this comment

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

i'm looking into consolidating them, but all good if we dont!

Copy link

@elizabeth-jimenez elizabeth-jimenez left a comment

Choose a reason for hiding this comment

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

i win

@elizabeth-jimenez
Copy link

I got the consolidation!

.tippy-popper {
  .tippy-tooltip.ab-row-theme, .tippy-tooltip.step-letters-theme {
    background-color: $color-white;
    color: $color-black;
    border: 2px solid $tm-gray;
    font-size: 14px;
    font-family: Roboto;
    padding: 15px;
    text-align: left;
    box-shadow: $tm-gray 3px 14px 29px;
    .arrow-regular {
      border: none;
    }
    .ab-row-tooltip-wrapper, .step-letter-tooltip-wrapper {
      display: flex;
      padding-bottom: 10px;
      div {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
      }
      .title {
        font-size: 16px;
        font-weight: bold;
      }
      .ab-row-tooltip-data, .step-letter-date {
        font-weight: 400;
        font-style: italic;
      }
    }

    .step-letter-tooltip-wrapper {
      div:first-child {
        padding-right: 10px;
        border-right: 1px solid $color-gray-light;
      }
      div:nth-child(2) {
        padding-left: 10px;
      }
    }

    .title {
      font-size: 16px;
      font-weight: bold;
    }
  }
}

@mjoyce91 mjoyce91 merged commit f65f84e into dev Feb 16, 2022
@mjoyce91 mjoyce91 deleted the feature/abl-step-letters branch February 16, 2022 14:07
@SidelineCory24
Copy link
Author

I got the consolidation!

.tippy-popper {
  .tippy-tooltip.ab-row-theme, .tippy-tooltip.step-letters-theme {
    background-color: $color-white;
    color: $color-black;
    border: 2px solid $tm-gray;
    font-size: 14px;
    font-family: Roboto;
    padding: 15px;
    text-align: left;
    box-shadow: $tm-gray 3px 14px 29px;
    .arrow-regular {
      border: none;
    }
    .ab-row-tooltip-wrapper, .step-letter-tooltip-wrapper {
      display: flex;
      padding-bottom: 10px;
      div {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
      }
      .title {
        font-size: 16px;
        font-weight: bold;
      }
      .ab-row-tooltip-data, .step-letter-date {
        font-weight: 400;
        font-style: italic;
      }
    }

    .step-letter-tooltip-wrapper {
      div:first-child {
        padding-right: 10px;
        border-right: 1px solid $color-gray-light;
      }
      div:nth-child(2) {
        padding-left: 10px;
      }
    }

    .title {
      font-size: 16px;
      font-weight: bold;
    }
  }
}

this consolidation is being done on another pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants