-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add recurring opening hours logic - DDFFORM 662 #1147
Conversation
@@ -139,7 +139,7 @@ export default defineConfig({ | |||
}, | |||
input: { | |||
target: | |||
"https://raw.githubusercontent.com/danskernesdigitalebibliotek/dpl-cms/opening-hours-api/openapi.json", | |||
"https://raw.githubusercontent.com/danskernesdigitalebibliotek/dpl-cms/opening-hours-repeated/openapi.json", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This must be set to the develop
branch after danskernesdigitalebibliotek/dpl-cms#1027 is merged
This is relevant to the pull request: danskernesdigitalebibliotek/dpl-react#1147 and will not be reflected in the design system.
e6d5d20
to
d2cdb52
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 I have a few suggestions for you to look into. In general I think it looks great!
.docker/wiremock/cms/mappings/opening-hours-all-b0c2a2f9-7b4d-4a6d-8324-13051e946c02.json
Outdated
Show resolved
Hide resolved
<Dialog closeDialog={closeDialog} ref={dialogRef}> | ||
{dialogContent} | ||
</Dialog> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please consider what is going on with this dialog within the form.
As far as I can tell it is not used. dialogContent
is never assigned.
src/apps/opening-hours-editor/OpeningHoursEditorEventContent.tsx
Outdated
Show resolved
Hide resolved
src/apps/opening-hours-editor/ConfirmAddRepeatedOpeningHour.tsx
Outdated
Show resolved
Hide resolved
- Convert `initialStartTime` and `initialEndTime` to date objects to facilitate retrieval of `weekDayName` and `DateString` from `startDate` in `EventForm`. Consequently, we've relocated the `extractTime` method into `EventForm` for improved organization. - Introduce `isRepeatedOpeningHour` property to `EventForm` to enable additional fields specific to recurring opening hours - Reposition the `children` elements, now dedicated to the "remove opening hour" functionality, below the submit button to enhance user experience.
This introduces an additional confirmation form for repeated opening hours, displayed in a dialog (modal)
The `target` inside `orval.config.ts` should be set back to develop when danskernesdigitalebibliotek/dpl-cms#1027 is merged.
…est OpenAPI spec adoption from DPL-CMS. Changes include: - Refactoring the opening hour editor for new `repetition` field. - Applying correct Types. - Adding a series-specific logo. - Refreshing WireMock with new opening hours data and adding `opening-hours-data.js` to handle it
Use consistent data across the editor and frontend, and assign more descriptive names to stubs.
This is needed to retrieve the latest SVG from `release/hermod-13`
This was unnecessary and caused the remove request to be called twice.
Instead, we give the label a more descriptive title.
Because the `OpeningHoursEditorEventContent` component can't be rendered normally, I need the translation in its parent component.
and transform the date into the required strings inside.
f122db9
to
45297fa
Compare
Link to issue
https://reload.atlassian.net/browse/DDFFORM-662
Info: https://reload.atlassian.net/browse/DDFFORM-632
Description
This pull request adds logic for the inclusion of recurring opening hours. It updates our openAPI specification from dpl-cms and refactors the logic to handle the new field repetition.
a checkbox has been added when adding an opening hour, which enables creating a recurring opening time. An extra modal has also been included, which shows the user the series they are creating and asks if they are sure they want to approve it.
Additionally, have i also updated our wiremock data to ensure consistency between the editor and frontend.
Screenshot of the result
You cannot rely on the design of the 'Are you sure' modal, as Drupal has some styling for their tables.
Skaermoptagelse.2024-04-23.kl.19.09.57.mov