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

Add recurring opening hours logic - DDFFORM 662 #1147

Merged
merged 11 commits into from
Apr 30, 2024

Conversation

kasperbirch1
Copy link
Contributor

@kasperbirch1 kasperbirch1 commented Apr 23, 2024

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

@@ -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",
Copy link
Contributor Author

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

kasperbirch1 added a commit to danskernesdigitalebibliotek/dpl-design-system that referenced this pull request Apr 23, 2024
This is relevant to the pull request: danskernesdigitalebibliotek/dpl-react#1147 and will not be reflected in the design system.
@kasperbirch1 kasperbirch1 force-pushed the DDFFORM-662-frontend branch 4 times, most recently from e6d5d20 to d2cdb52 Compare April 25, 2024 08:45
Copy link
Contributor

@kasperg kasperg left a 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!

Comment on lines +243 to +222
<Dialog closeDialog={closeDialog} ref={dialogRef}>
{dialogContent}
</Dialog>
Copy link
Contributor

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/helper.ts Show resolved Hide resolved
src/apps/opening-hours-editor/EventForm.tsx Show resolved Hide resolved
@kasperbirch1 kasperbirch1 assigned kasperg and unassigned kasperg and LasseStaus Apr 25, 2024
- 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.
@kasperbirch1 kasperbirch1 force-pushed the DDFFORM-662-frontend branch from f122db9 to 45297fa Compare April 26, 2024 08:28
@kasperbirch1 kasperbirch1 merged commit d104aa4 into release/hermod-13 Apr 30, 2024
20 checks passed
@kasperbirch1 kasperbirch1 deleted the DDFFORM-662-frontend branch April 30, 2024 13:00
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.

3 participants