Skip to content

fix: default date configs to empty; coerce date config fields to date#975

Merged
3mcd merged 2 commits into
mainfrom
em/action-dates
Feb 13, 2025
Merged

fix: default date configs to empty; coerce date config fields to date#975
3mcd merged 2 commits into
mainfrom
em/action-dates

Conversation

@3mcd
Copy link
Copy Markdown
Collaborator

@3mcd 3mcd commented Feb 12, 2025

Issue(s) Resolved

Resolves #904

High-level Explanation of PR

This PR removes the implicit default of new Date() from our datepicker component, meaning it will be empty by default as expected.

In addition it updates the Datacite action's date fields to use z.coerce.date instead of z.date, which will automatically coerce action config dates (represented as strings) to Date objects.

Test Plan

Using the Arcadia dev community,

  1. Add the DataCite action to a stage with pubs in it.
  2. Configure the action. The "Publication Date" field should be empty be default. Do not modify the field.
  3. Attempt to save the action config. It should fail, informing you that the Publication Date is required.
  4. Set a value for the Publication Date, optionally specifying a pub field override.
  5. Save the action. It should save successfully.
  6. Run the action on a Pub. The action run should not show any validation errors. If you didn't set a pub field override in step 4, you should get an error telling you to.
  7. Give the publication date an override value and run the action again. You should get the same result as from step 6.

@3mcd 3mcd marked this pull request as ready for review February 12, 2025 18:14
@3mcd 3mcd requested review from allisonking and kalilsn February 12, 2025 18:17
Copy link
Copy Markdown
Contributor

@allisonking allisonking left a comment

Choose a reason for hiding this comment

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

🎉

@3mcd 3mcd merged commit 9f5b8d9 into main Feb 13, 2025
@3mcd 3mcd deleted the em/action-dates branch February 13, 2025 17:16
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.

Date fields should show as blank unless a date is actually selected

2 participants