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

feat: Add enroll-by date to the assignment table #1248

Merged
merged 12 commits into from
Jun 12, 2024
Merged

Conversation

brobro10000
Copy link
Member

@brobro10000 brobro10000 commented Jun 5, 2024

Adds a net new column to the learner credit management budget detail page on the assignments table called "Enroll-by date".
The column component determines if the date should render a "Warning" icon if the enroll by date is within 10 days of expiration.

Screen.Recording.2024-06-06.at.12.32.07.PM.mov

For all changes

  • Ensure adequate tests are in place (or reviewed existing tests cover changes)

Only if submitting a visual change

  • Ensure to attach screenshots
  • Ensure to have UX team confirm screenshots

Copy link
Member Author

Choose a reason for hiding this comment

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

Opted to move this function into the existing utils folder within the same directory.

Copy link

codecov bot commented Jun 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.35%. Comparing base (e9b406f) to head (8342bd9).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1248      +/-   ##
==========================================
+ Coverage   85.32%   85.35%   +0.02%     
==========================================
  Files         538      539       +1     
  Lines       11860    11881      +21     
  Branches     2496     2535      +39     
==========================================
+ Hits        10120    10141      +21     
+ Misses       1682     1681       -1     
- Partials       58       59       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@brobro10000 brobro10000 marked this pull request as ready for review June 7, 2024 13:40
Comment on lines 18 to 20
<Stack gap={0} direction="horizontal">
<span>
<p data-testid="assignments-table-enroll-by-column-header" className="mb-0 mr-1">
Copy link
Member

Choose a reason for hiding this comment

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

This is putting a block element (p) in an inline element (span), which is not valid HTML. For example, from this w3schools article about block vs. inline elements:

image

It's also not really using Stack as intended since you have gap={0} and are relying on the mr-1 class name to add the spacing between the text and the icon button (i.e., Stack intends to remove the need for using spacing utility classes to implement gaps between elements).

I would suggest changing this to be more inline with the following Paragon Playground example.

<Stack gap={1} direction="horizontal">
  <span data-testid="assignments-table-enroll-by-column-header">
    Enroll-by date
  </span>
  <IconButtonWithTooltip
    tooltipContent="Failure to enroll by midnight of enrollment deadline date will release funds back into the budget"
    tooltipPlacement="right"
    src={InfoOutline}
    iconAs={Icon}
    size="inline"
    data-testid="enroll-by-date-tooltip"
    />
</Stack>

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated 👍🏽
There are currently 2 other components that follow the original pattern I implemented against. I am wondering if its worth updating those as well? It would not be considered a big lift.
MemberStatustableColumnHeader
MemberEnrollmentsTableColumnHeader

src/components/learner-credit-management/data/utils.js Outdated Show resolved Hide resolved
defaultMessage: 'When your plan expires you will lose access to administrative functions and the remaining balance of your plan{apostrophe}s budget(s) will be unusable. Contact support today to renew your plan.',
description: 'Message for the notification that the Learner Credit plan is expiring in less than 30 days.',
}, { aposrophe: "'" }),
}, { apostrophe: "'" }),
Copy link
Member

@adamstankiewicz adamstankiewicz Jun 11, 2024

Choose a reason for hiding this comment

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

[inform] I wonder if it's worth changing this up a bit to not treat apostrophe as a dynamic property passed into the message, given it is static.

For example, would this work?

{
  defaultMessage: "When your plan expires you will lose access to administrative functions and the remaining balance of your plan's budget(s) will be unusable. Contact support today to renew your plan.",
}

Copy link
Member

@adamstankiewicz adamstankiewicz left a comment

Choose a reason for hiding this comment

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

LGTM! Just a handful of nits on those i18n strings using a dynamic message arg for the double quote " character.

@brobro10000 brobro10000 merged commit 2a326e7 into master Jun 12, 2024
6 checks passed
@brobro10000 brobro10000 deleted the hu/ent-8885 branch June 12, 2024 16:09
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