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

Make timeline and deadline dates fully data driven #168

Closed

Conversation

evoskamp
Copy link
Collaborator

Changed the Settings to add a second exclusion so the main config page can ignore the timeline dates (they begin with 'config.timelineDates.') and to add a tab for Timeline Dates filtering on the same. The config values are meant all to be dates. As code and value are both 100 characters and the database doesn't care I use the code as the label to display. Finally added an entry to the configuration to read the config.timelineDates values and add an array of label and date entries.

Created a CutoffDateWarning component that takes a date key (i.e. the label) and if the date value of that is in the past it shows a warning not to register without first contacting registration by email to the email in ContactEmail configuration. If that date is in the future it shows nothing.

Created a TimelineList component that takes the array of lable/date values, and an optional ignore before date. Again, it's a label of any of the dates. It takes the array, filters out any dates before the date with that label, sorts it in ascending order on the dates and displays them. If the date is in the past it uses the class deadlineExpired, otherwise deadline.

Changed the class deadlineExpired from red (error.main) to a 700 gray with strike through.

In use it cleans up the Welcome page.

ACUS' is now:

<Page title='Welcome' titleElement={titleElement}>
  <MdxWithExternalLinks>
    <WelcomeContent />
  </MdxWithExternalLinks>
  <DynamicMemberContent />
  <CutoffDateWarning cutoffDateConfig='Membership Payment In Full Due' />
  <TimelineList ignoreBeforeDateConfig='Registration Open' />
</Page>

More imortantly, the cutoff date warning doesn't require reading and interpreting, but shows as needed.

And the timeline dates are easily maintained in settings and ones can be added/removed, or, for this year, left out, by leaving their value set to last year's.

Resolves: #166, #167

Changed the Settings to add a second exclusion so the main config page
can ignore the timeline dates (they begin with 'config.timelineDates.')
and to add a tab for Timeline Dates filtering on the same. The config
values are meant all to be dates. As code and value are both 100
characters and the database doesn't care I use the code as the label to
display. Finally added an entry to the configuration to read the
config.timelineDates values and add an array of label and date entries.

Created a CutoffDateWarning component that takes a date key (i.e. the
label) and if the date value of that is in the past it shows a warning
not to register without first contacting registration by email to the
email in ContactEmail configuration. If that date is in the future it
shows nothing.

Created a TimelineList component that takes the array of lable/date
values, and an optional ignore before date. Again, it's a label of any
of the dates. It takes the array, filters out any dates before the date
with that label, sorts it in ascending order on the dates and displays
them. If the date is in the past it uses the class deadlineExpired,
otherwise deadline.

Changed the class deadlineExpired from red (error.main) to a 700 gray
with strike through.

In use it cleans up the Welcome page.

ACUS' is now:

    <Page title='Welcome' titleElement={titleElement}>
      <MdxWithExternalLinks>
        <WelcomeContent />
      </MdxWithExternalLinks>
      <DynamicMemberContent />
      <CutoffDateWarning cutoffDateConfig='Membership Payment In Full Due' />
      <TimelineList ignoreBeforeDateConfig='Registration Open' />
    </Page>

More imortantly, the cutoff date warning doesn't require reading and
interpreting, but shows as needed.

And the timeline dates are easily maintained in settings and ones can
be added/removed, or, for this year, left out, by leaving their value
set to last year's.

Resolves: #166, #167
Copy link

vercel bot commented Jan 24, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
amber-acus ❌ Failed (Inspect) Jan 24, 2024 4:22am
amberconnw ❌ Failed (Inspect) Jan 24, 2024 4:22am

@evoskamp
Copy link
Collaborator Author

Builds fail for lack of the timelineDates in configuration.

But ACUS fails on code that didn't change because configuration[node] is unhappy. I think the zod schema definition of timeline dates and not use the z.record type as it flows through to places where configuration[x] of configuration.x now get undesirable possible values.

@evoskamp evoskamp marked this pull request as draft February 14, 2024 16:00
@evoskamp
Copy link
Collaborator Author

Canceling.

Need to consider how to strictly validate the config, and have this, while "Create a new year" needs to be set up.

@evoskamp evoskamp closed this Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant