CMS-1933: Add DateType display name transform function - #697
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a centralized “display name” transformation for DateType names so the UI can show “Facility available” wherever the API/CMS still uses “Operation”, without changing the underlying DateType record in Strapi/DB.
Changes:
- Added
getDateTypeDisplayName()helper(s) and applied them across season forms, submit table UI, filters, and validation labels. - Updated the CSV export generation to output the transformed DateType label in the exported file.
- Adjusted Strapi feature import to default
datesCanSpan2Yearstofalsewhen the source value is null/undefined.
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| frontend/src/lib/getDateTypeDisplayName.js | New frontend helper to map API DateType names to display labels (Operation → Facility available). |
| frontend/src/hooks/useValidation/rules/winterDateYears.js | Uses display-name transform in winter date field labels. |
| frontend/src/hooks/useValidation/rules/startDateBeforeEndDate.js | Uses display-name transform for date range validation label. |
| frontend/src/hooks/useValidation/rules/requiredDateRanges.js | Uses display-name transform in required-field labels. |
| frontend/src/hooks/useValidation/rules/noOverlapPrevious.js | Uses display-name transform in overlap validation label. |
| frontend/src/hooks/useValidation/rules/dateInOperatingYear.js | Uses display-name transform in operating-year validation labels. |
| frontend/src/hooks/useValidation/rules/completeDateRanges.js | Uses display-name transform in completeness validation labels. |
| frontend/src/components/SubmitPageTable.jsx | Displays transformed DateType name in submit table row header. |
| frontend/src/components/SeasonForms/ParkSeasonForm.jsx | Displays transformed DateType name in park season form headings. |
| frontend/src/components/SeasonForms/FeatureSeasonForm.jsx | Displays transformed DateType name in feature season form headings. |
| frontend/src/components/SeasonForms/AreaSeasonForm.jsx | Displays transformed DateType name in area season form headings (two sections). |
| frontend/src/components/FilterStatus.jsx | Displays transformed DateType name in active filter tags. |
| frontend/src/components/DateRangeFields.jsx | Uses transformed DateType name in “Add more … dates” UI copy. |
| backend/utils/getDateTypeDisplayName.js | New backend helper mirroring the frontend mapping (Operation → Facility available). |
| backend/strapi-sync/import-features/import-features.js | Defaults datesCanSpan2Years to false when missing from Strapi payload. |
| backend/routes/api/export.js | Uses backend display-name transform for the CSV export Date type column. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
duncan-oxd
commented
Aug 5, 2026
duncan-oxd
force-pushed
the
CMS-1933-only-frontend
branch
from
August 5, 2026 21:41
91e53bd to
a4dd1ed
Compare
molund
reviewed
Aug 5, 2026
molund
approved these changes
Aug 5, 2026
molund
left a comment
Collaborator
There was a problem hiding this comment.
I added one comment about a line I didn't understand
Collaborator
Author
I posted a knowledge dump 🎓 🎓 , let me know if you have any questions! I'll send it over to QA and see what they think of it 👍 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Jira Ticket
CMS-1933
Description
We need to change the label for the "Operation" date type to say "Facility available" - only on the frontend, without changing the database. This branch adds a
getDateTypeDisplayNamefunction on the frontend and backend that simply takes the name as input and returns the changed string as output (or the unchanged string, in most cases).Requirements from the ticket:
There's a more comprehensive branch in #696 that would be good to merge some time, but it doesn't need to happen for this release so I've marked it "DO NOT MERGE". It would prevent the app from breaking if we ever changed the DateType names in the CMS.