Skip to content

Commit d304d75

Browse files
feat: add pEvent.isQueueingAllowed & studyGroup.preferredTimes support
upgrade packages: - @sentry/browser ^7.107.0 → ^7.110.0 - @testing-library/react ^14.2.1 → ^15.0.1 - @vitest/coverage-v8 ^1.4.0 → ^1.5.0 - dompurify ^3.0.11 → ^3.1.0 - hds-design-tokens ^3.5.0 → ^3.7.0 - hds-react ^3.5.0 → ^3.7.0 - html-react-parser ^5.1.9 → ^5.1.10 - i18next ^23.10.1 → ^23.11.1 - i18next-browser-languagedetector ^7.2.0 → ^7.2.1 - react-helsinki-headless-cms 1.0.0-alpha264 → 1.0.0-alpha273 - sass ^1.72.0 → ^1.75.0 - typescript ^5.4.3 → ^5.4.5 - vite ^5.2.2 → ^5.2.8 - vitest ^1.4.0 → ^1.5.0 also: - CreateEventPage.test.tsx: - rename defaultFormData to partialDefaultFormData, remove unused fields from it and type it - EventBasicInfo.tsx: - make mandatoryAdditionalInformation info showing code more succinct and more readable by using <p></p> only once and renaming: - eventDetails.basicInfo.mandatoryAdditionalInformationTrueText -> eventDetails.basicInfo.mandatoryAdditionalInformation - eventDetails.basicInfo.mandatoryAdditionalInformationFalseText -> eventDetails.basicInfo.optionalAdditionalInformation - EditEventPage.tsx: - invalidate edited event from apollo cache in order to make sure the data is shown up to date, without this change the event's card display didn't show event keywords after editing the event, only the specially handled isFree and isQueueingAllowed keywords refs PT-1718 (pEvent.isQueueingAllowed) refs PT-1719 (studyGroup.preferredTimes)
1 parent a27757c commit d304d75

27 files changed

Lines changed: 483 additions & 398 deletions

File tree

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
"@datepicker-react/hooks": "^2.8.4",
3232
"@faker-js/faker": "^8.4.1",
3333
"@reduxjs/toolkit": "^1.9.7",
34-
"@sentry/browser": "^7.107.0",
34+
"@sentry/browser": "^7.110.0",
3535
"@testing-library/jest-dom": "^6.4.2",
36-
"@testing-library/react": "^14.2.1",
36+
"@testing-library/react": "^15.0.1",
3737
"@testing-library/react-hooks": "^8.0.1",
3838
"@testing-library/testcafe": "^5.0.1",
3939
"@testing-library/user-event": "^14.5.2",
@@ -58,13 +58,13 @@
5858
"@types/react-table": "^7.7.19",
5959
"@vitejs/plugin-react": "^4.2.1",
6060
"@vitejs/plugin-react-swc": "^3.6.0",
61-
"@vitest/coverage-v8": "^1.4.0",
61+
"@vitest/coverage-v8": "^1.5.0",
6262
"apollo-upload-client": "^18.0.1",
6363
"axios": "^1.6.7",
6464
"classnames": "^2.5.1",
6565
"cross-env": "^7.0.3",
6666
"date-fns": "^2.30.0",
67-
"dompurify": "^3.0.11",
67+
"dompurify": "^3.1.0",
6868
"dotenv": "^16.4.5",
6969
"draft-js": "^0.11.7",
7070
"draftjs-to-html": "^0.9.1",
@@ -78,12 +78,12 @@
7878
"formik": "^2.4.5",
7979
"graphql": "^16.8.1",
8080
"graphql-tag": "^2.12.6",
81-
"hds-design-tokens": "^3.5.0",
82-
"hds-react": "^3.5.0",
83-
"html-react-parser": "^5.1.9",
81+
"hds-design-tokens": "^3.7.0",
82+
"hds-react": "^3.7.0",
83+
"html-react-parser": "^5.1.10",
8484
"html-to-draftjs": "^1.5.0",
85-
"i18next": "^23.10.1",
86-
"i18next-browser-languagedetector": "^7.2.0",
85+
"i18next": "^23.11.1",
86+
"i18next-browser-languagedetector": "^7.2.1",
8787
"i18next-intervalplural-postprocessor": "^3.0.0",
8888
"ics": "^3.7.2",
8989
"jsdom": "^24.0.0",
@@ -95,7 +95,7 @@
9595
"react-dom": "^18.2.0",
9696
"react-draft-wysiwyg": "^1.15.0",
9797
"react-helmet": "^6.1.0",
98-
"react-helsinki-headless-cms": "1.0.0-alpha264",
98+
"react-helsinki-headless-cms": "1.0.0-alpha273",
9999
"react-i18next": "^13.5.0",
100100
"react-modal": "^3.16.1",
101101
"react-redux": "^8.1.3",
@@ -105,14 +105,14 @@
105105
"react-toastify": "^9.1.3",
106106
"redux-oidc": "^4.0.0-beta1",
107107
"redux-persist": "^6.0.0",
108-
"sass": "^1.72.0",
108+
"sass": "^1.75.0",
109109
"testcafe": "^3.5.0",
110-
"typescript": "^5.4.3",
110+
"typescript": "^5.4.5",
111111
"use-deep-compare-effect": "^1.8.1",
112-
"vite": "^5.2.2",
112+
"vite": "^5.2.8",
113113
"vite-plugin-eslint": "^1.8.1",
114114
"vite-tsconfig-paths": "^4.3.2",
115-
"vitest": "^1.4.0",
115+
"vitest": "^1.5.0",
116116
"vitest-axe": "^0.1.0",
117117
"vitest-sonar-reporter": "^2.0.0",
118118
"waait": "^1.0.5",

src/domain/app/apollo/utils.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@ export const clearApolloCache = async () => {
44
apolloClient.stop();
55
await Promise.all([apolloClient.resetStore(), apolloClient.clearStore()]);
66
};
7+
8+
/**
9+
* Invalidate given event's cache
10+
* @param eventId The ID of the event to invalidate
11+
*/
12+
export const invalidateEventCache = (eventId: string) =>
13+
apolloClient.cache.evict({ id: `Event:${eventId}` });

src/domain/app/footer/__tests__/__snapshots__/Footer.test.tsx.snap

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ exports[`Footer matches snapshot 1`] = `
9393
class="FooterBase-module_links__3lfLo"
9494
>
9595
<span
96+
aria-hidden="true"
9697
class="FooterBase-module_separator__cwQTe"
9798
>
9899
|
@@ -106,6 +107,7 @@ exports[`Footer matches snapshot 1`] = `
106107
</span>
107108
</a>
108109
<span
110+
aria-hidden="true"
109111
class="FooterBase-module_separator__cwQTe"
110112
>
111113
|

src/domain/app/header/__tests__/__snapshots__/Header.test.tsx.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
exports[`Header matches snapshot 1`] = `
44
<header
5-
class="hds-header Header-module_header__291GF custom-theme-1"
6-
theme="[object Object]"
5+
class="hds-header Header-module_header__291GF"
6+
style="--header-max-width: var(--breakpoint-xl);"
77
>
88
<div
99
class="Header-module_headerBackgroundWrapper__KsFy2"

src/domain/app/i18n/en.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,8 +307,11 @@
307307
"enrolmentStart": "{{date}} at {{time}}",
308308
"labelDescription": "Description",
309309
"labelMandatoryAdditionalInformation": "Mandatory entry of additional information",
310-
"mandatoryAdditionalInformationTrueText": "Entering additional information is mandatory for the registrant",
311-
"mandatoryAdditionalInformationFalseText": "Additional information is not mandatory",
310+
"mandatoryAdditionalInformation": "Entering additional information is mandatory for the registrant",
311+
"optionalAdditionalInformation": "Additional information is not mandatory",
312+
"labelQueueing": "Queueing to the event",
313+
"queueingAllowed": "Queueing to the event is allowed",
314+
"queueingNotAllowed": "Queueing to the event is not allowed",
312315
"labelEnrolmentEndDays": "Enrolment closes, days",
313316
"labelEnrolmentStart": "Enrolment begins",
314317
"labelInfoUrl": "A web address where you can find more information about the event",
@@ -377,6 +380,7 @@
377380
"labelImageAltText": "Picture alt-text",
378381
"labelImagePhotographer": "Photographer",
379382
"labelInfoUrl": "A web address where you can find more information about the event",
383+
"labelIsQueueingAllowed": "Queueing to this event is allowed",
380384
"labelName": "Event name",
381385
"labelShortDescription": "Short description (up to 160 characters)",
382386
"helperEnrolmentEndDays": "Select how many days before occurrences enrolment ends",
@@ -480,6 +484,8 @@
480484
"statusPublished": "Published",
481485
"statusNotPublished": "Not published",
482486
"free": "Free of charge",
487+
"queueingAllowed": "Queueing allowed",
488+
"queueingNotAllowed": "No queueing",
483489
"startTime": {
484490
"other": "{{date}} at {{time}}",
485491
"today": "Today at {{time}}",

src/domain/app/i18n/fi.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -312,8 +312,11 @@
312312
"enrolmentStart": "{{date}} klo {{time}}",
313313
"labelDescription": "Kuvaus",
314314
"labelMandatoryAdditionalInformation": "Lisätietojen syöttämisen pakollisuus",
315-
"mandatoryAdditionalInformationTrueText": "Lisätietojen syöttäminen on ilmoittautujalle pakollista",
316-
"mandatoryAdditionalInformationFalseText": "Lisätietojen syöttäminen ei ole pakollista",
315+
"mandatoryAdditionalInformation": "Lisätietojen syöttäminen on ilmoittautujalle pakollista",
316+
"optionalAdditionalInformation": "Lisätietojen syöttäminen ei ole pakollista",
317+
"labelQueueing": "Tapahtumaan jonottaminen",
318+
"queueingAllowed": "Tapahtumaan saa jonottaa",
319+
"queueingNotAllowed": "Tapahtumaan ei saa jonottaa",
317320
"labelEnrolmentEndDays": "Ilmoittautuminen sulkeutuu, päivää",
318321
"labelEnrolmentStart": "Ilmoittautuminen alkaa",
319322
"labelInfoUrl": "WWW-osoite, josta saa lisätietoja tapahtumasta",
@@ -383,6 +386,7 @@
383386
"labelImageAltText": "Kuvan alt-teksti",
384387
"labelImagePhotographer": "Valokuvaaja",
385388
"labelInfoUrl": "WWW-osoite, josta saa lisätietoja tapahtumasta",
389+
"labelIsQueueingAllowed": "Tapahtumaan saa jonottaa",
386390
"labelName": "Tapahtuman nimi",
387391
"labelShortDescription": "Lyhyt kuvaus (korkeintaan 160 merkkiä)",
388392
"helperEnrolmentEndDays": "Valitse kuinka monta päivää ennen tapahtuma-aikaa ilmoittautuminen päättyy",
@@ -486,6 +490,8 @@
486490
"statusPublished": "Julkaistu",
487491
"statusNotPublished": "Ei julkaistu",
488492
"free": "Maksuton",
493+
"queueingAllowed": "Jonotus sallittu",
494+
"queueingNotAllowed": "Ei jonotusta",
489495
"startTime": {
490496
"other": "{{date}} klo {{time}}",
491497
"today": "Tänään klo {{time}}",
@@ -818,7 +824,7 @@
818824
"labelHasIndoorPlayingArea": "Leikkitilaa sisällä",
819825
"labelHasOutdoorPlayingArea": "Leikkitilaa ulkona",
820826
"labelLocationDescription": "Tapahtumapaikan kuvaus",
821-
"placeholderLocationDescription": "Esimeriksi miten ryhmä mahtuu vaihtamaan ulkovaatteita, missä voi syödä eväitä..."
827+
"placeholderLocationDescription": "Esimerkiksi miten ryhmä mahtuu vaihtamaan ulkovaatteita, missä voi syödä eväitä..."
822828
}
823829
},
824830
"cmspage": {

src/domain/app/i18n/sv.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,11 @@
311311
"enrolmentStart": "{{date}} på {{time}}",
312312
"labelDescription": "Beskrivning",
313313
"labelMandatoryAdditionalInformation": "Obligatorisk registrering av ytterligare information",
314-
"mandatoryAdditionalInformationTrueText": "Ytterligare information är inte obligatoriskt",
315-
"mandatoryAdditionalInformationFalseText": "Ytterligare information är inte obligatoriskt",
314+
"mandatoryAdditionalInformation": "Ytterligare information är inte obligatoriskt",
315+
"optionalAdditionalInformation": "Ytterligare information är inte obligatoriskt",
316+
"labelQueueing": "Kö till evenemanget",
317+
"queueingAllowed": "Det är tillåtet att köa till evenemanget",
318+
"queueingNotAllowed": "Det är inte tillåtet att köa till evenemanget",
316319
"labelEnrolmentEndDays": "Registreringen stängs, dagar",
317320
"labelEnrolmentStart": "Registrering börjar",
318321
"labelInfoUrl": "En webbadress där du kan hitta mer information om evenemanget",
@@ -383,6 +386,7 @@
383386
"labelImageAltText": "Bildens alt-text",
384387
"labelImagePhotographer": "Fotograf",
385388
"labelInfoUrl": "Webbadress där du hittar mer information om evenemanget",
389+
"labelIsQueueingAllowed": "Det är tillåtet att köa till detta evenemang",
386390
"labelName": "Evenemangets namn",
387391
"labelShortDescription": "Kort beskrivning (upp till 160 tecken)",
388392
"labelTargetGroup": "Målgrupper",
@@ -487,6 +491,8 @@
487491
"statusPublished": "Publicerat",
488492
"statusNotPublished": "Ej publicerat",
489493
"free": "Gratis",
494+
"queueingAllowed": "Kö tillåts",
495+
"queueingNotAllowed": "Ingen kö",
490496
"startTime": {
491497
"other": "{{date}} kl. {{time}}",
492498
"today": "Idag kl. {{time}}",
@@ -503,7 +509,6 @@
503509
"placesClearButtonAriaLabel": "Radera ut de utvalda platserna",
504510
"placesSelectedItemRemoveButtonAriaLabel": "Tabort (det här) stället"
505511
},
506-
507512
"textEventCount": "{{count}} st",
508513
"textNoComingEvents": "Inga evenemang med kommande evenemangtider",
509514
"title": "Evenemang",

src/domain/app/layout/__tests__/__snapshots__/PageLayout.test.tsx.snap

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ exports[`PageLayout matches snapshot 1`] = `
55
class="pageLayout"
66
>
77
<header
8-
class="hds-header Header-module_header__291GF custom-theme-4"
9-
theme="[object Object]"
8+
class="hds-header Header-module_header__291GF"
9+
style="--header-max-width: var(--breakpoint-xl);"
1010
>
1111
<div
1212
class="Header-module_headerBackgroundWrapper__KsFy2"
@@ -643,6 +643,7 @@ exports[`PageLayout matches snapshot 1`] = `
643643
class="FooterBase-module_links__3lfLo"
644644
>
645645
<span
646+
aria-hidden="true"
646647
class="FooterBase-module_separator__cwQTe"
647648
>
648649
|
@@ -656,6 +657,7 @@ exports[`PageLayout matches snapshot 1`] = `
656657
</span>
657658
</a>
658659
<span
660+
aria-hidden="true"
659661
class="FooterBase-module_separator__cwQTe"
660662
>
661663
|

src/domain/enrolment/query.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export const QUERY_ENROLMENT = gql`
3030
}
3131
}
3232
extraNeeds
33+
preferredTimes
3334
person {
3435
...personFields
3536
}

src/domain/enrolment/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ export const getEnrolmentFields = (
2222
enrolment
2323
? {
2424
extraNeeds: enrolment.studyGroup.extraNeeds,
25+
preferredTimes: enrolment.studyGroup.preferredTimes,
2526
language:
2627
enrolment.person?.language || enrolment.studyGroup.person?.language,
2728
personInfo: [

0 commit comments

Comments
 (0)