Skip to content

Feature/dep272: Added start/end time to engagement config, other misc fixes. - #2864

Merged
jareth-whitney merged 7 commits into
mainfrom
feature/dep272
Jun 2, 2026
Merged

Feature/dep272: Added start/end time to engagement config, other misc fixes.#2864
jareth-whitney merged 7 commits into
mainfrom
feature/dep272

Conversation

@jareth-whitney

Copy link
Copy Markdown
Contributor

Issue #: https://citz-gdx.atlassian.net/browse/DESENG-272

Description of changes:

  • Feature Added start/end time to engagement period in engagement configuration.
    • Added time input components to existing date picker component
    • Added accurate times to form state where start/end dates are not modifiable
    • Updated single engagement config view component to show correct date/time
      • Modified revalidation perameters to show up to date information directly after updating engagement
    • Made sure dates are stored in UTC but displayed in local pacific time
    • Modified API logic for Engagement.submissionStatus so that it sets to open/closed at expected times
  • Aligned all dates that were previously being stored as pacific to UTC
  • Updated common time conversion functions for readability
  • Made some small visual updates
    • Updated some CSS for our "under construction" component
    • Updated auto breadcrumbs component for increased visual stability (less flickering)
    • Updated authoring section for greater visual stability (less flickering)
    • Moved header items (badge and breadcrumbs) out of AuthoringTemplate component, which is forced to re-render because it's keyed
    • Utilized useDefferedValue in bottom nav component for language list
    • Removed several async/await components that were causing flickering
  • Utilized useParams instead of waiting on engagement values in some cases
  • Allowed modifying of engagement config while it's scheduled but not published

User Guide update ticket (if applicable):

    • Yes, a user guide update ticket has been created. (Link to ticket)
    • No, a user guide update ticket is not required.

Common component changes:

    • Yes, I have updated CONTRIBUTING.md and the docblocks to document any changes to the common components.
    • No, there are no changes to the common components.

…l dates to store in UTC and not Pacific. Updated time conversion functions and usage of them. Updated some visual components to reduce flicker and give fresh data. Allowed modifying of engagement config while it's scheduled but not published.
@jareth-whitney
jareth-whitney requested a review from NatSquared May 26, 2026 02:03
@codecov-commenter

codecov-commenter commented May 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.51020% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 75.15%. Comparing base (7af870e) to head (c53e9ba).

Files with missing lines Patch % Lines
...eb/src/components/common/Navigation/Breadcrumb.tsx 32.35% 23 Missing ⚠️
api/src/api/utils/datetime.py 42.85% 8 Missing ⚠️
api/src/api/models/engagement.py 72.72% 3 Missing ⚠️
api/src/api/utils/submission_status.py 90.47% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2864      +/-   ##
==========================================
- Coverage   75.17%   75.15%   -0.02%     
==========================================
  Files         517      517              
  Lines       20067    20107      +40     
  Branches     1720     1726       +6     
==========================================
+ Hits        15085    15112      +27     
- Misses       4973     4986      +13     
  Partials        9        9              
Flag Coverage Δ
api 85.32% <81.69%> (+<0.01%) ⬆️
web 63.40% <69.73%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
api/src/api/models/base_model.py 98.11% <100.00%> (ø)
api/src/api/models/comment.py 80.91% <100.00%> (ø)
api/src/api/models/contact.py 97.29% <100.00%> (ø)
api/src/api/models/email_queue.py 78.26% <ø> (ø)
api/src/api/models/email_verification.py 95.12% <100.00%> (ø)
api/src/api/models/feedback.py 98.30% <100.00%> (ø)
api/src/api/models/membership.py 87.20% <100.00%> (ø)
api/src/api/models/submission.py 90.10% <100.00%> (ø)
api/src/api/models/subscription.py 88.88% <100.00%> (ø)
api/src/api/models/survey.py 86.52% <100.00%> (+0.09%) ⬆️
... and 25 more
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread api/tests/utilities/factory_scenarios.py Fixed
Comment thread api/tests/utilities/factory_scenarios.py Fixed
Comment thread api/tests/utilities/factory_scenarios.py Fixed
Comment thread api/tests/utilities/factory_scenarios.py Fixed
Comment thread api/tests/utilities/factory_scenarios.py Fixed

@NatSquared NatSquared left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good; thanks for all the work cleaning up the utcnow() calls. Just a few questions, including a few about replacing the formatDate function which did not include the time with the convertToPacific function which does.

if engagement.status_id != Status.Draft:
raise ValueError(f'Engagement {engagement_id} is not in draft status')
if engagement.status_id not in valid_statuses:
raise ValueError(f'Engagement {engagement_id} has already been published, cannot update slug')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A semicolon works better to join these two related but independent clauses

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I can't argue

</Grid>
<Grid>
<BodyText sx={{ pl: 2 }}>{formatDate(created_date)}</BodyText>
<BodyText sx={{ pl: 2 }}>{formatToPacific(created_date)}</BodyText>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Before this change, this page would have shown only the date, but will now also show the time. Is this intentional?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed. When I first replaced it, it was 1-to-1, then I changed the default formatting. I will use YYYY-MM-DD format here.

<b>Comment Date: </b>
</BodyText>
<BodyText>{formatDate(row.created_date)}</BodyText>
<BodyText>{formatToPacific(row.created_date)}</BodyText>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Same here; formatDate did not include the full time but formatToPacific does

<Grid container direction="row">
<Grid>
<Grid container direction="row" sx={{ gap: '2rem', flexWrap: { xs: 'wrap', lg: 'nowrap' } }}>
<Stack sx={stackStyles}>

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Why are we replacing the Grid with a Stack here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I used stack here because both Grid2 and Stack use flex, but stack defaults to column orientation whereas Grid defaults to horizontal/row orientation. It also makes the code a bit more human-readable, since they know the direction just by reading the component name. If you don't like it I can switch it back though.

<Grid sx={{ '&.MuiGrid-root': { paddingTop: 0 } }}>
<Button onClick={() => setIsPickingDate(true)} icon={<FontAwesomeIcon icon={faCalendar} />}>
{numberOfDays ? 'Change Dates' : 'Select Dates'}
{`${numberOfDays ? 'Change' : 'Select'} Dates and Times`}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

We may be able to just say "Times" or "Time Range" rather than "Dates and Times"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok I'll change it to Time Range

Comment thread CHANGELOG.MD Outdated
- Updated auto breadcrumbs component for increased visual stability (less flickering)
- Updated authoring section for greater visual stability (less flickering)
- Moved header items (badge and breadcrumbs) out of AuthoringTemplate component, which is forced to re-render because it's keyed
- Utilized useDefferedValue in bottom nav component for language list

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- Utilized useDefferedValue in bottom nav component for language list
- Utilized useDeferredValue in bottom nav component for language list

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch! I always mix up the double consonant in this word.

@sonarqubecloud

sonarqubecloud Bot commented Jun 2, 2026

Copy link
Copy Markdown

@jareth-whitney
jareth-whitney merged commit 6c659f3 into main Jun 2, 2026
16 checks passed
@jareth-whitney
jareth-whitney deleted the feature/dep272 branch June 2, 2026 18:35
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.

4 participants