@recras/online-booking-js 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2409 +0,0 @@
1
- Index: changelog.md
2
- IDEA additional info:
3
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
4
- <+>UTF-8
5
- ===================================================================
6
- diff --git a/changelog.md b/changelog.md
7
- --- a/changelog.md (revision d780da01ee0c7b5cc3f074836a047f9edadd2e9f)
8
- +++ b/changelog.md (date 1659356720915)
9
- @@ -1,5 +1,28 @@
10
- # Changelog
11
-
12
- +## development (unreleased)
13
- +* Add inline error messages
14
- +
15
- +## 1.6.3 (2020-08-05)
16
- +* Show warning if the selected date has no available time slots
17
- +
18
- +## 1.6.2 (2020-06-30)
19
- +* Fix german translation for 'Voucher applied'
20
- +
21
- +## 1.6.1 (2020-06-22)
22
- +* Fix "window.ga.getAll is not a function" error in Firefox
23
- +
24
- +## 1.6.0 (2020-06-09)
25
- +* Show customer extra fields in contact forms
26
- +* Fix checking discount codes containing "special" characters, such as `#`
27
- +
28
- +## 1.5.1 (2020-05-26)
29
- +* Fix calendar alignment on small screens
30
- +* Fix attachments not being visible when pre-filling amounts
31
- +
32
- +## 1.5.0 (2020-05-25)
33
- +* Allow pre-filling of date and time
34
- +
35
- ## 1.4.8 (2020-05-15)
36
- * After submitting a form, re-enable button later, to prevent users being able to submit twice
37
-
38
- Index: src/cssHelper.js
39
- IDEA additional info:
40
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
41
- <+>UTF-8
42
- ===================================================================
43
- diff --git a/src/cssHelper.js b/src/cssHelper.js
44
- --- a/src/cssHelper.js (revision d780da01ee0c7b5cc3f074836a047f9edadd2e9f)
45
- +++ b/src/cssHelper.js (date 1659356720919)
46
- @@ -5,7 +5,7 @@
47
- .recras-onlinebooking {
48
- max-width: 800px;
49
- }
50
- -.recras-onlinebooking > *:not(:first-child) + * {
51
- +.recras-onlinebooking > form + form, .recras-finalise {
52
- border-top: 2px solid #dedede; /* Any love for Kirby out there? */
53
- }
54
- .recras-amountsform > div {
55
- @@ -32,6 +32,12 @@
56
- .booking-error, .minimum-amount {
57
- color: hsl(0, 50%, 50%);
58
- }
59
- +.booking-error {
60
- + -ms-grid-column: 1;
61
- + -ms-grid-column-span: 2;
62
- + grid-column: 1 / 3;
63
- + -ms-grid-row: 999; /* No specified row will place it on top of certain elements. This will put it at the very end */
64
- +}
65
- .minimum-amount {
66
- padding-left: 0.5em;
67
- }
68
- @@ -64,6 +70,9 @@
69
- .recrasUnitPrice {
70
- opacity: 0.5;
71
- }
72
- +.recras-onlinebooking .recrasHidden {
73
- + display: none;
74
- +}
75
- `;
76
- }
77
-
78
- Index: src/eventHelper.js
79
- IDEA additional info:
80
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
81
- <+>UTF-8
82
- ===================================================================
83
- diff --git a/src/eventHelper.js b/src/eventHelper.js
84
- --- a/src/eventHelper.js (revision d780da01ee0c7b5cc3f074836a047f9edadd2e9f)
85
- +++ b/src/eventHelper.js (date 1659356720919)
86
- @@ -86,11 +86,13 @@
87
- eventData.eventValue = value;
88
- }
89
- // Google Analytics via Google Tag Manager doesn't work without a prefix
90
- - let prefix = window.ga.getAll()[0].get('name');
91
- - if (prefix) {
92
- - prefix += '.';
93
- - }
94
- - window.ga(prefix + 'send', eventData);
95
- + window.ga(function() {
96
- + let prefix = window.ga.getAll()[0].get('name');
97
- + if (prefix) {
98
- + prefix += '.';
99
- + }
100
- + window.ga(prefix + 'send', eventData);
101
- + })
102
- }
103
- }
104
-
105
- Index: package.json
106
- IDEA additional info:
107
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
108
- <+>UTF-8
109
- ===================================================================
110
- diff --git a/package.json b/package.json
111
- --- a/package.json (revision d780da01ee0c7b5cc3f074836a047f9edadd2e9f)
112
- +++ b/package.json (date 1659356720919)
113
- @@ -1,6 +1,6 @@
114
- {
115
- "name": "@recras/online-booking-js",
116
- - "version": "1.4.7",
117
- + "version": "1.6.3",
118
- "description": "JS library for easy integration of Recras online booking and voucher sales",
119
- "main": "dist/onlinebooking.js",
120
- "scripts": {
121
- @@ -41,7 +41,7 @@
122
- "jasmine-core": "3.5.0",
123
- "jasmine-spec-reporter": "5.0.2",
124
- "jshint": "2.11.1",
125
- - "karma": "4.4.1",
126
- + "karma": "5.0.5",
127
- "karma-chrome-launcher": "3.1.0",
128
- "karma-firefox-launcher": "1.3.0",
129
- "karma-jasmine": "3.1.1",
130
- Index: src/calendarHelper.js
131
- IDEA additional info:
132
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
133
- <+>UTF-8
134
- ===================================================================
135
- diff --git a/src/calendarHelper.js b/src/calendarHelper.js
136
- --- a/src/calendarHelper.js (revision d780da01ee0c7b5cc3f074836a047f9edadd2e9f)
137
- +++ b/src/calendarHelper.js (date 1659356720919)
138
- @@ -5,6 +5,7 @@
139
- minDate: new Date(),
140
- numberOfMonths: 2,
141
- reposition: false,
142
- + position: 'bottom right',
143
- toString: (date) => RecrasDateHelper.toString(date),
144
- };
145
- }
146
- Index: package-lock.json
147
- IDEA additional info:
148
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
149
- <+>UTF-8
150
- ===================================================================
151
- diff --git a/package-lock.json b/package-lock.json
152
- --- a/package-lock.json (revision d780da01ee0c7b5cc3f074836a047f9edadd2e9f)
153
- +++ b/package-lock.json (date 1659356720919)
154
- @@ -1,6 +1,6 @@
155
- {
156
- "name": "@recras/online-booking-js",
157
- - "version": "1.4.7",
158
- + "version": "1.5.1",
159
- "lockfileVersion": 1,
160
- "requires": true,
161
- "dependencies": {
162
- @@ -1347,6 +1347,12 @@
163
- "to-fast-properties": "^2.0.0"
164
- }
165
- },
166
- + "@types/color-name": {
167
- + "version": "1.1.1",
168
- + "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz",
169
- + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==",
170
- + "dev": true
171
- + },
172
- "accepts": {
173
- "version": "1.3.7",
174
- "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
175
- @@ -1821,12 +1827,6 @@
176
- "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz",
177
- "integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig==",
178
- "dev": true
179
- - },
180
- - "bluebird": {
181
- - "version": "3.7.2",
182
- - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz",
183
- - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==",
184
- - "dev": true
185
- },
186
- "body-parser": {
187
- "version": "1.19.0",
188
- @@ -1899,28 +1899,6 @@
189
- "pkg-up": "^2.0.0"
190
- }
191
- },
192
- - "buffer-alloc": {
193
- - "version": "1.2.0",
194
- - "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz",
195
- - "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==",
196
- - "dev": true,
197
- - "requires": {
198
- - "buffer-alloc-unsafe": "^1.1.0",
199
- - "buffer-fill": "^1.0.0"
200
- - }
201
- - },
202
- - "buffer-alloc-unsafe": {
203
- - "version": "1.1.0",
204
- - "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz",
205
- - "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==",
206
- - "dev": true
207
- - },
208
- - "buffer-fill": {
209
- - "version": "1.0.0",
210
- - "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz",
211
- - "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=",
212
- - "dev": true
213
- - },
214
- "bytes": {
215
- "version": "3.1.0",
216
- "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz",
217
- @@ -1951,6 +1929,12 @@
218
- "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=",
219
- "dev": true
220
- },
221
- + "camelcase": {
222
- + "version": "5.3.1",
223
- + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz",
224
- + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==",
225
- + "dev": true
226
- + },
227
- "caniuse-lite": {
228
- "version": "1.0.30001048",
229
- "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001048.tgz",
230
- @@ -2024,6 +2008,34 @@
231
- "glob": "^7.1.1"
232
- }
233
- },
234
- + "cliui": {
235
- + "version": "6.0.0",
236
- + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz",
237
- + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==",
238
- + "dev": true,
239
- + "requires": {
240
- + "string-width": "^4.2.0",
241
- + "strip-ansi": "^6.0.0",
242
- + "wrap-ansi": "^6.2.0"
243
- + },
244
- + "dependencies": {
245
- + "ansi-regex": {
246
- + "version": "5.0.0",
247
- + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
248
- + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
249
- + "dev": true
250
- + },
251
- + "strip-ansi": {
252
- + "version": "6.0.0",
253
- + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
254
- + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
255
- + "dev": true,
256
- + "requires": {
257
- + "ansi-regex": "^5.0.0"
258
- + }
259
- + }
260
- + }
261
- + },
262
- "collection-visit": {
263
- "version": "1.0.0",
264
- "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz",
265
- @@ -2192,6 +2204,12 @@
266
- "ms": "2.0.0"
267
- }
268
- },
269
- + "decamelize": {
270
- + "version": "1.2.0",
271
- + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
272
- + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=",
273
- + "dev": true
274
- + },
275
- "decode-uri-component": {
276
- "version": "0.2.0",
277
- "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz",
278
- @@ -2347,6 +2365,12 @@
279
- "integrity": "sha512-jXdnLcawJ/EMdN+j77TC3YyeAWiIjo1U63DFCKrjtLv4cu8ToyoF4HYXtFvkVVHhEtIl7lU1uDd307Xj1/YDjw==",
280
- "dev": true
281
- },
282
- + "emoji-regex": {
283
- + "version": "8.0.0",
284
- + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
285
- + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
286
- + "dev": true
287
- + },
288
- "encodeurl": {
289
- "version": "1.0.2",
290
- "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
291
- @@ -2452,9 +2476,9 @@
292
- "dev": true
293
- },
294
- "eventemitter3": {
295
- - "version": "4.0.0",
296
- - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.0.tgz",
297
- - "integrity": "sha512-qerSRB0p+UDEssxTtm6EDKcE7W4OaoisfIMl4CngyEhjpYglocpNg6UEqCvemdGhosAsg4sO2dXJOdyBifPGCg==",
298
- + "version": "4.0.4",
299
- + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.4.tgz",
300
- + "integrity": "sha512-rlaVLnVxtxvoyLsQQFBx53YmXHDxRIzzTLbdfxqi4yocpSjAxXwkU0cScM5JgSKMqEhrZpnvQ2D9gjylR0AimQ==",
301
- "dev": true
302
- },
303
- "exit": {
304
- @@ -2658,15 +2682,15 @@
305
- }
306
- },
307
- "flatted": {
308
- - "version": "2.0.1",
309
- - "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.1.tgz",
310
- - "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==",
311
- + "version": "2.0.2",
312
- + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz",
313
- + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==",
314
- "dev": true
315
- },
316
- "follow-redirects": {
317
- - "version": "1.10.0",
318
- - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.10.0.tgz",
319
- - "integrity": "sha512-4eyLK6s6lH32nOvLLwlIOnr9zrL8Sm+OvW4pVTJNoXeGzYIkHVf+pADQi+OJ0E67hiuSLezPVPyBcIZO50TmmQ==",
320
- + "version": "1.11.0",
321
- + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.11.0.tgz",
322
- + "integrity": "sha512-KZm0V+ll8PfBrKwMzdo5D13b1bur9Iq9Zd/RMmAoQQcl2PxxFml8cxXPaaPYVbV0RjNjq1CU7zIzAOqtUPudmA==",
323
- "dev": true,
324
- "requires": {
325
- "debug": "^3.0.0"
326
- @@ -3299,6 +3323,12 @@
327
- "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==",
328
- "dev": true
329
- },
330
- + "get-caller-file": {
331
- + "version": "2.0.5",
332
- + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz",
333
- + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==",
334
- + "dev": true
335
- + },
336
- "get-value": {
337
- "version": "2.0.6",
338
- "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz",
339
- @@ -3626,6 +3656,12 @@
340
- "number-is-nan": "^1.0.0"
341
- }
342
- },
343
- + "is-fullwidth-code-point": {
344
- + "version": "3.0.0",
345
- + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
346
- + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
347
- + "dev": true
348
- + },
349
- "is-glob": {
350
- "version": "4.0.1",
351
- "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz",
352
- @@ -3687,13 +3723,10 @@
353
- "dev": true
354
- },
355
- "isbinaryfile": {
356
- - "version": "3.0.3",
357
- - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-3.0.3.tgz",
358
- - "integrity": "sha512-8cJBL5tTd2OS0dM4jz07wQd5g0dCCqIhUxPIGtZfa5L6hWlvV5MHTITy/DBAsF+Oe2LS1X3krBUhNwaGUWpWxw==",
359
- - "dev": true,
360
- - "requires": {
361
- - "buffer-alloc": "^1.2.0"
362
- - }
363
- + "version": "4.0.6",
364
- + "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.6.tgz",
365
- + "integrity": "sha512-ORrEy+SNVqUhrCaal4hA4fBzhggQQ+BaLntyPOdoEiwlKZW9BZiJXjg3RMiruE4tPEI3pyVPpySHQF/dKWperg==",
366
- + "dev": true
367
- },
368
- "isexe": {
369
- "version": "2.0.0",
370
- @@ -3786,12 +3819,11 @@
371
- }
372
- },
373
- "karma": {
374
- - "version": "4.4.1",
375
- - "resolved": "https://registry.npmjs.org/karma/-/karma-4.4.1.tgz",
376
- - "integrity": "sha512-L5SIaXEYqzrh6b1wqYC42tNsFMx2PWuxky84pK9coK09MvmL7mxii3G3bZBh/0rvD27lqDd0le9jyhzvwif73A==",
377
- + "version": "5.0.5",
378
- + "resolved": "https://registry.npmjs.org/karma/-/karma-5.0.5.tgz",
379
- + "integrity": "sha512-Q4Su7kNwkTgqS+KbSCYgH0p4a/0JIxVLyp7qKNV7vgPNhIF4kIoh0GlUfMKpw67BrR3hgPQSJoxgF7xnzUtPpg==",
380
- "dev": true,
381
- "requires": {
382
- - "bluebird": "^3.3.0",
383
- "body-parser": "^1.16.1",
384
- "braces": "^3.0.2",
385
- "chokidar": "^3.0.0",
386
- @@ -3803,20 +3835,19 @@
387
- "glob": "^7.1.1",
388
- "graceful-fs": "^4.1.2",
389
- "http-proxy": "^1.13.0",
390
- - "isbinaryfile": "^3.0.0",
391
- + "isbinaryfile": "^4.0.2",
392
- "lodash": "^4.17.14",
393
- "log4js": "^4.0.0",
394
- "mime": "^2.3.1",
395
- "minimatch": "^3.0.2",
396
- - "optimist": "^0.6.1",
397
- "qjobs": "^1.1.4",
398
- "range-parser": "^1.2.0",
399
- "rimraf": "^2.6.0",
400
- - "safe-buffer": "^5.0.1",
401
- "socket.io": "2.1.1",
402
- "source-map": "^0.6.1",
403
- "tmp": "0.0.33",
404
- - "useragent": "2.3.0"
405
- + "ua-parser-js": "0.7.21",
406
- + "yargs": "^15.3.1"
407
- },
408
- "dependencies": {
409
- "anymatch": {
410
- @@ -3845,9 +3876,9 @@
411
- }
412
- },
413
- "chokidar": {
414
- - "version": "3.3.1",
415
- - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz",
416
- - "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==",
417
- + "version": "3.4.0",
418
- + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.0.tgz",
419
- + "integrity": "sha512-aXAaho2VJtisB/1fg1+3nlLJqGOuewTzQpd/Tz0yTg2R0e4IGtshYvtjowyEumcBv2z+y4+kc75Mz7j5xJskcQ==",
420
- "dev": true,
421
- "requires": {
422
- "anymatch": "~3.1.1",
423
- @@ -3857,7 +3888,7 @@
424
- "is-binary-path": "~2.1.0",
425
- "is-glob": "~4.0.1",
426
- "normalize-path": "~3.0.0",
427
- - "readdirp": "~3.3.0"
428
- + "readdirp": "~3.4.0"
429
- }
430
- },
431
- "fill-range": {
432
- @@ -3870,16 +3901,16 @@
433
- }
434
- },
435
- "fsevents": {
436
- - "version": "2.1.2",
437
- - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz",
438
- - "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==",
439
- + "version": "2.1.3",
440
- + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz",
441
- + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==",
442
- "dev": true,
443
- "optional": true
444
- },
445
- "glob-parent": {
446
- - "version": "5.1.0",
447
- - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz",
448
- - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==",
449
- + "version": "5.1.1",
450
- + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz",
451
- + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==",
452
- "dev": true,
453
- "requires": {
454
- "is-glob": "^4.0.1"
455
- @@ -3901,12 +3932,12 @@
456
- "dev": true
457
- },
458
- "readdirp": {
459
- - "version": "3.3.0",
460
- - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz",
461
- - "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==",
462
- + "version": "3.4.0",
463
- + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz",
464
- + "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==",
465
- "dev": true,
466
- "requires": {
467
- - "picomatch": "^2.0.7"
468
- + "picomatch": "^2.2.1"
469
- }
470
- },
471
- "source-map": {
472
- @@ -4039,16 +4070,6 @@
473
- "js-tokens": "^3.0.0 || ^4.0.0"
474
- }
475
- },
476
- - "lru-cache": {
477
- - "version": "4.1.5",
478
- - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz",
479
- - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==",
480
- - "dev": true,
481
- - "requires": {
482
- - "pseudomap": "^1.0.2",
483
- - "yallist": "^2.1.2"
484
- - }
485
- - },
486
- "make-dir": {
487
- "version": "2.1.0",
488
- "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz",
489
- @@ -4105,24 +4126,24 @@
490
- }
491
- },
492
- "mime": {
493
- - "version": "2.4.4",
494
- - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz",
495
- - "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==",
496
- + "version": "2.4.5",
497
- + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.5.tgz",
498
- + "integrity": "sha512-3hQhEUF027BuxZjQA3s7rIv/7VCQPa27hN9u9g87sEkWaKwQPuXOkVKtOeiyUrnWqTDiOs8Ed2rwg733mB0R5w==",
499
- "dev": true
500
- },
501
- "mime-db": {
502
- - "version": "1.43.0",
503
- - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.43.0.tgz",
504
- - "integrity": "sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ==",
505
- + "version": "1.44.0",
506
- + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
507
- + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==",
508
- "dev": true
509
- },
510
- "mime-types": {
511
- - "version": "2.1.26",
512
- - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.26.tgz",
513
- - "integrity": "sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ==",
514
- + "version": "2.1.27",
515
- + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
516
- + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
517
- "dev": true,
518
- "requires": {
519
- - "mime-db": "1.43.0"
520
- + "mime-db": "1.44.0"
521
- }
522
- },
523
- "minimatch": {
524
- @@ -4134,12 +4155,6 @@
525
- "brace-expansion": "^1.1.7"
526
- }
527
- },
528
- - "minimist": {
529
- - "version": "0.0.10",
530
- - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz",
531
- - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=",
532
- - "dev": true
533
- - },
534
- "mixin-deep": {
535
- "version": "1.3.2",
536
- "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz",
537
- @@ -4333,16 +4348,6 @@
538
- "wrappy": "1"
539
- }
540
- },
541
- - "optimist": {
542
- - "version": "0.6.1",
543
- - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz",
544
- - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=",
545
- - "dev": true,
546
- - "requires": {
547
- - "minimist": "~0.0.1",
548
- - "wordwrap": "~0.0.2"
549
- - }
550
- - },
551
- "os-homedir": {
552
- "version": "1.0.2",
553
- "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz",
554
- @@ -4436,9 +4441,9 @@
555
- "dev": true
556
- },
557
- "picomatch": {
558
- - "version": "2.2.1",
559
- - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.1.tgz",
560
- - "integrity": "sha512-ISBaA8xQNmwELC7eOjqFKMESB2VIqt4PPDD0nsS95b/9dZXvVKOlz9keMSnoGGKcOHXfTvDD6WMaRoSc9UuhRA==",
561
- + "version": "2.2.2",
562
- + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz",
563
- + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==",
564
- "dev": true
565
- },
566
- "pify": {
567
- @@ -4476,12 +4481,6 @@
568
- "dev": true,
569
- "optional": true
570
- },
571
- - "pseudomap": {
572
- - "version": "1.0.2",
573
- - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz",
574
- - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=",
575
- - "dev": true
576
- - },
577
- "qjobs": {
578
- "version": "1.2.0",
579
- "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz",
580
- @@ -4680,6 +4679,18 @@
581
- "is-finite": "^1.0.0"
582
- }
583
- },
584
- + "require-directory": {
585
- + "version": "2.1.1",
586
- + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz",
587
- + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=",
588
- + "dev": true
589
- + },
590
- + "require-main-filename": {
591
- + "version": "2.0.0",
592
- + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz",
593
- + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==",
594
- + "dev": true
595
- + },
596
- "requires-port": {
597
- "version": "1.0.0",
598
- "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz",
599
- @@ -4751,6 +4762,12 @@
600
- "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
601
- "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==",
602
- "dev": true
603
- + },
604
- + "set-blocking": {
605
- + "version": "2.0.0",
606
- + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz",
607
- + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
608
- + "dev": true
609
- },
610
- "set-value": {
611
- "version": "2.0.1",
612
- @@ -5109,6 +5126,34 @@
613
- }
614
- }
615
- },
616
- + "string-width": {
617
- + "version": "4.2.0",
618
- + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
619
- + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
620
- + "dev": true,
621
- + "requires": {
622
- + "emoji-regex": "^8.0.0",
623
- + "is-fullwidth-code-point": "^3.0.0",
624
- + "strip-ansi": "^6.0.0"
625
- + },
626
- + "dependencies": {
627
- + "ansi-regex": {
628
- + "version": "5.0.0",
629
- + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
630
- + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
631
- + "dev": true
632
- + },
633
- + "strip-ansi": {
634
- + "version": "6.0.0",
635
- + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
636
- + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
637
- + "dev": true,
638
- + "requires": {
639
- + "ansi-regex": "^5.0.0"
640
- + }
641
- + }
642
- + }
643
- + },
644
- "string_decoder": {
645
- "version": "0.10.31",
646
- "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
647
- @@ -5228,6 +5273,12 @@
648
- "mime-types": "~2.1.24"
649
- }
650
- },
651
- + "ua-parser-js": {
652
- + "version": "0.7.21",
653
- + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.21.tgz",
654
- + "integrity": "sha512-+O8/qh/Qj8CgC6eYBVBykMrNtp5Gebn4dlGD/kKXVkJNDwyrAwSIqwz8CDf+tsAIWVycKcku6gIXJ0qwx/ZXaQ==",
655
- + "dev": true
656
- + },
657
- "ultron": {
658
- "version": "1.1.1",
659
- "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz",
660
- @@ -5359,16 +5410,6 @@
661
- "dev": true,
662
- "optional": true
663
- },
664
- - "useragent": {
665
- - "version": "2.3.0",
666
- - "resolved": "https://registry.npmjs.org/useragent/-/useragent-2.3.0.tgz",
667
- - "integrity": "sha512-4AoH4pxuSvHCjqLO04sU6U/uE65BYza8l/KKBS0b0hnUPWi+cQ2BpeTEwejCSx9SPV5/U03nniDTrWx5NrmKdw==",
668
- - "dev": true,
669
- - "requires": {
670
- - "lru-cache": "4.1.x",
671
- - "tmp": "0.0.x"
672
- - }
673
- - },
674
- "util-deprecate": {
675
- "version": "1.0.2",
676
- "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
677
- @@ -5397,11 +5438,64 @@
678
- "isexe": "^2.0.0"
679
- }
680
- },
681
- - "wordwrap": {
682
- - "version": "0.0.3",
683
- - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",
684
- - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=",
685
- + "which-module": {
686
- + "version": "2.0.0",
687
- + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz",
688
- + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=",
689
- "dev": true
690
- + },
691
- + "wrap-ansi": {
692
- + "version": "6.2.0",
693
- + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz",
694
- + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==",
695
- + "dev": true,
696
- + "requires": {
697
- + "ansi-styles": "^4.0.0",
698
- + "string-width": "^4.1.0",
699
- + "strip-ansi": "^6.0.0"
700
- + },
701
- + "dependencies": {
702
- + "ansi-regex": {
703
- + "version": "5.0.0",
704
- + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
705
- + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
706
- + "dev": true
707
- + },
708
- + "ansi-styles": {
709
- + "version": "4.2.1",
710
- + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz",
711
- + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==",
712
- + "dev": true,
713
- + "requires": {
714
- + "@types/color-name": "^1.1.1",
715
- + "color-convert": "^2.0.1"
716
- + }
717
- + },
718
- + "color-convert": {
719
- + "version": "2.0.1",
720
- + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz",
721
- + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==",
722
- + "dev": true,
723
- + "requires": {
724
- + "color-name": "~1.1.4"
725
- + }
726
- + },
727
- + "color-name": {
728
- + "version": "1.1.4",
729
- + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz",
730
- + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==",
731
- + "dev": true
732
- + },
733
- + "strip-ansi": {
734
- + "version": "6.0.0",
735
- + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
736
- + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
737
- + "dev": true,
738
- + "requires": {
739
- + "ansi-regex": "^5.0.0"
740
- + }
741
- + }
742
- + }
743
- },
744
- "wrappy": {
745
- "version": "1.0.2",
746
- @@ -5426,12 +5520,92 @@
747
- "integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4=",
748
- "dev": true
749
- },
750
- - "yallist": {
751
- - "version": "2.1.2",
752
- - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz",
753
- - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=",
754
- + "y18n": {
755
- + "version": "4.0.0",
756
- + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz",
757
- + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==",
758
- "dev": true
759
- + },
760
- + "yargs": {
761
- + "version": "15.3.1",
762
- + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz",
763
- + "integrity": "sha512-92O1HWEjw27sBfgmXiixJWT5hRBp2eobqXicLtPBIDBhYB+1HpwZlXmbW2luivBJHBzki+7VyCLRtAkScbTBQA==",
764
- + "dev": true,
765
- + "requires": {
766
- + "cliui": "^6.0.0",
767
- + "decamelize": "^1.2.0",
768
- + "find-up": "^4.1.0",
769
- + "get-caller-file": "^2.0.1",
770
- + "require-directory": "^2.1.1",
771
- + "require-main-filename": "^2.0.0",
772
- + "set-blocking": "^2.0.0",
773
- + "string-width": "^4.2.0",
774
- + "which-module": "^2.0.0",
775
- + "y18n": "^4.0.0",
776
- + "yargs-parser": "^18.1.1"
777
- + },
778
- + "dependencies": {
779
- + "find-up": {
780
- + "version": "4.1.0",
781
- + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz",
782
- + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==",
783
- + "dev": true,
784
- + "requires": {
785
- + "locate-path": "^5.0.0",
786
- + "path-exists": "^4.0.0"
787
- + }
788
- + },
789
- + "locate-path": {
790
- + "version": "5.0.0",
791
- + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz",
792
- + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==",
793
- + "dev": true,
794
- + "requires": {
795
- + "p-locate": "^4.1.0"
796
- + }
797
- + },
798
- + "p-limit": {
799
- + "version": "2.3.0",
800
- + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz",
801
- + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==",
802
- + "dev": true,
803
- + "requires": {
804
- + "p-try": "^2.0.0"
805
- + }
806
- + },
807
- + "p-locate": {
808
- + "version": "4.1.0",
809
- + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz",
810
- + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==",
811
- + "dev": true,
812
- + "requires": {
813
- + "p-limit": "^2.2.0"
814
- + }
815
- + },
816
- + "p-try": {
817
- + "version": "2.2.0",
818
- + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz",
819
- + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==",
820
- + "dev": true
821
- + },
822
- + "path-exists": {
823
- + "version": "4.0.0",
824
- + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
825
- + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
826
- + "dev": true
827
- + }
828
- + }
829
- },
830
- + "yargs-parser": {
831
- + "version": "18.1.3",
832
- + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz",
833
- + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==",
834
- + "dev": true,
835
- + "requires": {
836
- + "camelcase": "^5.0.0",
837
- + "decamelize": "^1.2.0"
838
- + }
839
- + },
840
- "yeast": {
841
- "version": "0.1.2",
842
- "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz",
843
- Index: README.md
844
- IDEA additional info:
845
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
846
- <+>UTF-8
847
- ===================================================================
848
- diff --git a/README.md b/README.md
849
- --- a/README.md (revision d780da01ee0c7b5cc3f074836a047f9edadd2e9f)
850
- +++ b/README.md (date 1659356720915)
851
- @@ -1,7 +1,7 @@
852
- [![Build Status](https://travis-ci.org/Recras/online-booking-js.svg?branch=master)](https://travis-ci.org/Recras/online-booking-js)
853
-
854
- # Recras JS Integration Library
855
- -Version: 1.4.8
856
- +Version: 1.6.3
857
-
858
- JS library for easy online booking, contact form, and voucher integration
859
-
860
- @@ -84,6 +84,8 @@
861
- }
862
- ```
863
- The package line ID's can be obtained by inspecting the amounts form, or by checking the [packages API specification](https://demo.recras.nl/docs/api/endpoints/arrangementen.html) - use the `id` field for each entry in `regels`.
864
- +* `date` - optional, use in combination with a single `package_id`. Set this to an ISO 8601 date (e.g. "2021-06-28") to prefill the date. If the selected date is not available for the chosen package or selected products, the date selection will be visible.
865
- +* `time` - optional, use in combination with a single `package_id`. Set this to a 24-hour time string (e.g. "16:00") to prefill the time. This can be used in combination with `date`, but this is not required. If the selected time is not available for the chosen date, the time selection will be visible.
866
-
867
- ### Vouchers only
868
- * `voucher_template_id` - optional - the ID of a voucher template. This will hide the template selection dropdown and skip this step.
869
- Index: docs/demo.css
870
- IDEA additional info:
871
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
872
- <+>UTF-8
873
- ===================================================================
874
- diff --git a/docs/demo.css b/docs/demo.css
875
- --- a/docs/demo.css (revision d780da01ee0c7b5cc3f074836a047f9edadd2e9f)
876
- +++ b/docs/demo.css (date 1659356720915)
877
- @@ -50,6 +50,11 @@
878
- color: #a00;
879
- padding: calc(0.25em - 1px);
880
- }
881
- +.booking-error {
882
- + background: hsl(0, 25%, 96%);
883
- + border: 1px solid #a00;
884
- + padding: 0.5em;
885
- +}
886
- button:disabled {
887
- cursor: not-allowed;
888
- }
889
- @@ -80,11 +85,11 @@
890
- }
891
- .booking-error {
892
- background: hsl(0, 25%, 96%);
893
- - border: 1px solid #a00;
894
- - padding: 0.5em;
895
- + border: 1px solid #a00 !important;
896
- + padding: 0.5em !important;
897
- }
898
-
899
- -.recras-onlinebooking > *:not(:first-child) + * {
900
- +.recras-onlinebooking > form + form, .recras-finalise {
901
- border-top: 2px solid hsla(147, 25%, 25%, 0.25);
902
- }
903
-
904
- Index: src/languageHelper.js
905
- IDEA additional info:
906
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
907
- <+>UTF-8
908
- ===================================================================
909
- diff --git a/src/languageHelper.js b/src/languageHelper.js
910
- --- a/src/languageHelper.js (revision d780da01ee0c7b5cc3f074836a047f9edadd2e9f)
911
- +++ b/src/languageHelper.js (date 1659356720919)
912
- @@ -13,9 +13,13 @@
913
- ATTR_REQUIRED: 'Erforderlich',
914
- BOOKING_DISABLED_AGREEMENT: 'Sie haben den Bedingungen noch nicht zugestimmt',
915
- BOOKING_DISABLED_AMOUNTS_INVALID: 'Programmbeträge sind ungültig',
916
- + BOOKING_DISABLED_CONTACT_FORM_EMPTY: 'Contact form is not filled in',
917
- BOOKING_DISABLED_CONTACT_FORM_INVALID: 'Das Kontaktformular ist nicht korrekt ausgefüllt',
918
- + BOOKING_DISABLED_CONTACT_FORM_REQUIRED: 'Contact form is not filled in completely',
919
- BOOKING_DISABLED_INVALID_DATE: 'Kein Datum ausgewählt',
920
- BOOKING_DISABLED_INVALID_TIME: 'Keine Zeit ausgewählt',
921
- + BOOKING_DISABLED_NO_PRODUCTS: 'Select at least one product',
922
- + BOOKING_DISABLED_PRODUCTS_BEFORE_DATE: 'Select at least one product before choosing a date',
923
- BOOKING_DISABLED_REQUIRED_PRODUCT: 'Erforderliches Produkt noch nicht ausgewählt',
924
- BUTTON_BOOK_NOW: 'Jetzt buchen',
925
- BUTTON_BUY_NOW: 'Jetzt kaufen',
926
- @@ -62,14 +66,19 @@
927
- DISCOUNT_INVALID: 'Ungültiger Rabattcode oder Gutschein',
928
- ERR_AMOUNTS_NO_PACKAGE: 'Die Option "productAmounts" ist gesetzt, aber "package_id" ist nicht gesetzt',
929
- ERR_CONTACT_FORM_EMPTY: 'Das Kontaktformular ist nicht ausgefüllt',
930
- + ERR_DATE_NO_SINGLE_PACKAGE: 'Die Option "date" erfordert ein einzelnes vorgefülltes Arrangement ("package_id")',
931
- + ERR_DATE_PAST: 'Option "date" ist ein Datum in der Vergangenheit',
932
- ERR_GENERAL: 'Etwas ist schief gelaufen:',
933
- + ERR_INVALID_DATE: 'Die Option "date" ist keine gültige ISO 8601-Datumszeichenfolge (z. B. "2019-06-28")',
934
- ERR_INVALID_ELEMENT: 'Option "Element" ist kein gültiges Element',
935
- ERR_INVALID_HOSTNAME: 'Option "recras_hostname" ist ungültig.',
936
- ERR_INVALID_LOCALE: 'Ungültiges Gebietsschema. Gültige Optionen sind: {LOCALES}',
937
- ERR_INVALID_REDIRECT_URL: 'Ungültige redirect URL. Stellen Sie sicher, dass es mit http:// or https:// beginnt',
938
- + ERR_INVALID_TIME: 'Die Option "time" ist keine gültige Zeitzeichenfolge (z. B. "16:15")',
939
- ERR_NO_ELEMENT: 'Option "element" nicht eingestellt.',
940
- ERR_NO_FORM: 'Option "form_id" nicht eingestellt.',
941
- ERR_NO_HOSTNAME: 'Option "recras_hostname" nicht eingestellt.',
942
- + ERR_NO_TIMES_FOR_DATE: 'Für diese Mengen sind an diesem Datum keine Zeiten mehr verfügbar. Versuchen Sie es mit einem anderen Datum.',
943
- ERR_OPTIONS_INVALID: 'Options is not a "RecrasOptions" object',
944
- GENDER_UNKNOWN: 'Unbekannte',
945
- GENDER_MALE: 'Mann',
946
- @@ -86,7 +95,7 @@
947
- TIME: 'Zeit',
948
- TIME_FORMAT: 'UU:MM',
949
- VOUCHER_ALREADY_APPLIED: 'Gutschein bereits eingelöst',
950
- - VOUCHER_APPLIED: 'Gutschein bereits eingelöst',
951
- + VOUCHER_APPLIED: 'Gutschein eingelöst',
952
- VOUCHER_EMPTY: 'Leerer Gutscheincode',
953
- VOUCHER_QUANTITY: 'Anzahl der Gutscheine',
954
- VOUCHERS_DISCOUNT: 'Rabatt von Gutschein(en)',
955
- @@ -96,9 +105,13 @@
956
- ATTR_REQUIRED: 'Required',
957
- BOOKING_DISABLED_AGREEMENT: 'You have not agreed to the terms yet',
958
- BOOKING_DISABLED_AMOUNTS_INVALID: 'Programme amounts are invalid',
959
- + BOOKING_DISABLED_CONTACT_FORM_EMPTY: 'Contact form is not filled in',
960
- BOOKING_DISABLED_CONTACT_FORM_INVALID: 'Contact form is not filled in correctly',
961
- - BOOKING_DISABLED_INVALID_DATE: 'No date selected',
962
- - BOOKING_DISABLED_INVALID_TIME: 'No time selected',
963
- + BOOKING_DISABLED_CONTACT_FORM_REQUIRED: 'Contact form is not filled in completely',
964
- + BOOKING_DISABLED_INVALID_DATE: 'Choose a date',
965
- + BOOKING_DISABLED_INVALID_TIME: 'Choose a time',
966
- + BOOKING_DISABLED_NO_PRODUCTS: 'Select at least one product',
967
- + BOOKING_DISABLED_PRODUCTS_BEFORE_DATE: 'Select at least one product before choosing a date',
968
- BOOKING_DISABLED_REQUIRED_PRODUCT: 'Required product not yet selected',
969
- BUTTON_BOOK_NOW: 'Book now',
970
- BUTTON_BUY_NOW: 'Buy now',
971
- @@ -145,14 +158,19 @@
972
- DISCOUNT_INVALID: 'Invalid discount code or voucher',
973
- ERR_AMOUNTS_NO_PACKAGE: 'Option "productAmounts" is set, but "package_id" is not set',
974
- ERR_CONTACT_FORM_EMPTY: 'Contact form is not filled in',
975
- + ERR_DATE_NO_SINGLE_PACKAGE: 'Option "date" requires a single pre-filled package ("package_id")',
976
- + ERR_DATE_PAST: 'Option "date" is a date in the past',
977
- ERR_GENERAL: 'Something went wrong:',
978
- + ERR_INVALID_DATE: 'Option "date" is not a valid ISO 8601 date string (e.g. "2019-06-28")',
979
- ERR_INVALID_ELEMENT: 'Option "element" is not a valid Element',
980
- ERR_INVALID_HOSTNAME: 'Option "recras_hostname" is invalid.',
981
- ERR_INVALID_LOCALE: 'Invalid locale. Valid options are: {LOCALES}',
982
- ERR_INVALID_REDIRECT_URL: 'Invalid redirect URL. Make sure you it starts with http:// or https://',
983
- + ERR_INVALID_TIME: 'Option "time" is not a valid time string (e.g. "16:15")',
984
- ERR_NO_ELEMENT: 'Option "element" not set.',
985
- ERR_NO_FORM: 'Option "form_id" not set.',
986
- ERR_NO_HOSTNAME: 'Option "recras_hostname" not set.',
987
- + ERR_NO_TIMES_FOR_DATE: 'There are no more times available on this date for these quantities. Try a different date.',
988
- ERR_OPTIONS_INVALID: 'Options is not a "RecrasOptions" object',
989
- GENDER_UNKNOWN: 'Unknown',
990
- GENDER_MALE: 'Male',
991
- @@ -179,9 +197,13 @@
992
- ATTR_REQUIRED: 'Vereist',
993
- BOOKING_DISABLED_AGREEMENT: 'Je bent nog niet akkoord met de voorwaarden',
994
- BOOKING_DISABLED_AMOUNTS_INVALID: 'Aantallen in programma zijn ongeldig',
995
- + BOOKING_DISABLED_CONTACT_FORM_EMPTY: 'Contactformulier is niet ingevuld',
996
- BOOKING_DISABLED_CONTACT_FORM_INVALID: 'Contactformulier is niet correct ingevuld',
997
- - BOOKING_DISABLED_INVALID_DATE: 'Geen datum geselecteerd',
998
- - BOOKING_DISABLED_INVALID_TIME: 'Geen tijd geselecteerd',
999
- + BOOKING_DISABLED_CONTACT_FORM_REQUIRED: 'Contactformulier is niet volledig ingevuld',
1000
- + BOOKING_DISABLED_INVALID_DATE: 'Kies een datum',
1001
- + BOOKING_DISABLED_INVALID_TIME: 'Kies een tijd',
1002
- + BOOKING_DISABLED_NO_PRODUCTS: 'Selecteer ten minste één product',
1003
- + BOOKING_DISABLED_PRODUCTS_BEFORE_DATE: 'Selecteer ten minste één product voor je een datum kiest',
1004
- BOOKING_DISABLED_REQUIRED_PRODUCT: 'Vereist product nog niet geselecteerd',
1005
- BUTTON_BOOK_NOW: 'Nu boeken',
1006
- BUTTON_BUY_NOW: 'Nu kopen',
1007
- @@ -228,14 +250,19 @@
1008
- DISCOUNT_INVALID: 'Ongeldige kortingscode of tegoedbon',
1009
- ERR_AMOUNTS_NO_PACKAGE: 'Optie "productAmounts" is ingesteld, maar "package_id" is niet ingesteld',
1010
- ERR_CONTACT_FORM_EMPTY: 'Contactformulier is niet ingevuld',
1011
- + ERR_DATE_NO_SINGLE_PACKAGE: 'Optie "date" vereist een enkel vooraf ingevuld arrangement ("package_id")',
1012
- + ERR_DATE_PAST: 'Optie "date" is een datum in het verleden',
1013
- ERR_GENERAL: 'Er ging iets mis:',
1014
- + ERR_INVALID_DATE: 'Optie "date" is geen geldige ISO 8601-datumstring (bijv. "2019-06-28")',
1015
- ERR_INVALID_ELEMENT: 'Optie "element" is geen geldig Element',
1016
- ERR_INVALID_HOSTNAME: 'Optie "recras_hostname" is ongeldig.',
1017
- ERR_INVALID_LOCALE: 'Ongeldige locale. Geldige opties zijn: {LOCALES}',
1018
- ERR_INVALID_REDIRECT_URL: 'Ongeldige redirect-URL. Zorg ervoor dat deze begint met http:// of https://',
1019
- + ERR_INVALID_TIME: 'Optie "time" is geen geldige tijd-string (bijv. "16:15")',
1020
- ERR_NO_ELEMENT: 'Optie "element" niet ingesteld.',
1021
- ERR_NO_FORM: 'Optie "form_id" niet ingesteld.',
1022
- ERR_NO_HOSTNAME: 'Optie "recras_hostname" niet ingesteld.',
1023
- + ERR_NO_TIMES_FOR_DATE: 'Er zijn geen tijden meer beschikbaar op deze datum voor deze aantallen. Probeer een andere datum.',
1024
- ERR_OPTIONS_INVALID: 'Opties is geen "RecrasOptions"-object',
1025
- GENDER_UNKNOWN: 'Onbekend',
1026
- GENDER_MALE: 'Man',
1027
- Index: src/contactForm.js
1028
- IDEA additional info:
1029
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
1030
- <+>UTF-8
1031
- ===================================================================
1032
- diff --git a/src/contactForm.js b/src/contactForm.js
1033
- --- a/src/contactForm.js (revision d780da01ee0c7b5cc3f074836a047f9edadd2e9f)
1034
- +++ b/src/contactForm.js (date 1659356720919)
1035
- @@ -1,6 +1,5 @@
1036
- class RecrasContactForm {
1037
- constructor(options = {}) {
1038
- - this.datePicker = null;
1039
- this.languageHelper = new RecrasLanguageHelper();
1040
-
1041
- if (!(options instanceof RecrasOptions)) {
1042
- @@ -91,7 +90,7 @@
1043
- if (this.hasCountryField()) {
1044
- waitFor.push(this.getCountryList());
1045
- }
1046
- - if (this.hasDateField()) {
1047
- + if (this.hasBookingDateField() || this.hasRelationDateField()) {
1048
- waitFor.push(RecrasCalendarHelper.loadScript());
1049
- RecrasCSSHelper.loadCSS('pikaday');
1050
- }
1051
- @@ -196,13 +195,18 @@
1052
- }
1053
- return isEmpty;
1054
- }
1055
- + getRelationExtraDateFields() {
1056
- + return this.contactFormFields.filter(
1057
- + field => field.soort_invoer === 'contact.extra' && field.input_type === 'date'
1058
- + );
1059
- + }
1060
-
1061
- hasFieldOfType(identifier) {
1062
- return this.contactFormFields.filter(field => {
1063
- return field.field_identifier === identifier;
1064
- }).length > 0;
1065
- }
1066
- - hasDateField() {
1067
- + hasBookingDateField() {
1068
- return this.hasFieldOfType('boeking.datum');
1069
- }
1070
- hasCountryField() {
1071
- @@ -211,6 +215,9 @@
1072
- hasPackageField() {
1073
- return this.hasFieldOfType('boeking.arrangement');
1074
- }
1075
- + hasRelationDateField() {
1076
- + return this.getRelationExtraDateFields().length > 0;
1077
- + }
1078
-
1079
- isEmpty() {
1080
- let els = this.findElements('.recras-contactform input, .recras-contactform select, .recras-contactform textarea');
1081
- @@ -354,6 +361,36 @@
1082
- });
1083
- html += '</select>';
1084
- return label + html;
1085
- + case 'contact.extra':
1086
- + switch (field.input_type) {
1087
- + case 'number':
1088
- + return label + `<input type="number" ${ fixedAttributes } autocomplete="off">`;
1089
- + case 'date':
1090
- + case 'text':
1091
- + return label + `<input type="text" ${ fixedAttributes }>`;
1092
- + case 'multiplechoice':
1093
- + classes = ['checkboxGroup'];
1094
- + if (field.verplicht) {
1095
- + classes.push('checkboxGroupRequired');
1096
- + }
1097
- +
1098
- + html = `<div class="${ classes.join(' ') }">`;
1099
- + field.mogelijke_keuzes.forEach(choice => {
1100
- + html += `<label><input type="checkbox" name="contactformulier${ idx }" value="${ choice }" data-identifier="${ field.field_identifier }">${ choice }</label>`;
1101
- + });
1102
- + html += '</div>';
1103
- + return label + html;
1104
- + case 'singlechoice':
1105
- + html = `<div class="radioGroup">`;
1106
- + field.mogelijke_keuzes.forEach(choice => {
1107
- + html += `<label><input type="radio" name="contactformulier${ idx }" value="${ choice }" ${ attrRequired } data-identifier="${ field.field_identifier }">${ choice }</label>`;
1108
- + });
1109
- + html += `</div>`;
1110
- + return label + html;
1111
- + default:
1112
- + console.debug('Unknown type', field.input_type, field);
1113
- + return label + `<input type="text" ${ fixedAttributes }>`;
1114
- + }
1115
- case 'contact.website':
1116
- //TODO: type=url ?
1117
- default:
1118
- @@ -371,7 +408,7 @@
1119
- .then(html => {
1120
- this.appendHtml(html);
1121
- this.findElement('.recras-contactform').addEventListener('submit', this.submitForm.bind(this));
1122
- - if (this.hasDateField()) {
1123
- + if (this.hasBookingDateField()) {
1124
- let pikadayOptions = Object.assign(
1125
- RecrasCalendarHelper.defaultOptions(),
1126
- {
1127
- @@ -380,8 +417,21 @@
1128
- numberOfMonths: 1,
1129
- }
1130
- );
1131
- -
1132
- - this.datePicker = new Pikaday(pikadayOptions);
1133
- + new Pikaday(pikadayOptions);
1134
- + }
1135
- + if (this.hasRelationDateField()) {
1136
- + const fields = this.getRelationExtraDateFields();
1137
- + let pikadayOptions = Object.assign(
1138
- + RecrasCalendarHelper.defaultOptions(),
1139
- + {
1140
- + i18n: RecrasCalendarHelper.i18n(this.languageHelper),
1141
- + numberOfMonths: 1,
1142
- + }
1143
- + );
1144
- + for (let field of fields) {
1145
- + pikadayOptions.field = this.findElement(`[data-identifier="${ field.field_identifier }"]`);
1146
- + new Pikaday(pikadayOptions);
1147
- + }
1148
- }
1149
- this.loadingIndicatorHide();
1150
- });
1151
- Index: test/js-unit/recrasContactFormSpec.js
1152
- IDEA additional info:
1153
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
1154
- <+>UTF-8
1155
- ===================================================================
1156
- diff --git a/test/js-unit/recrasContactFormSpec.js b/test/js-unit/recrasContactFormSpec.js
1157
- --- a/test/js-unit/recrasContactFormSpec.js (revision d780da01ee0c7b5cc3f074836a047f9edadd2e9f)
1158
- +++ b/test/js-unit/recrasContactFormSpec.js (date 1659356720919)
1159
- @@ -119,175 +119,200 @@
1160
- expect(html.indexOf('Kids party')).not.toBe(-1);
1161
- });
1162
- });
1163
- + });
1164
-
1165
- - describe('hasFieldOfType', () => {
1166
- - let rc;
1167
- - beforeEach(() => {
1168
- - rc = new RecrasContactForm(new RecrasOptions({
1169
- - element: this.mainEl,
1170
- - form_id: 1,
1171
- - package_id: 7,
1172
- - recras_hostname: 'demo.recras.nl',
1173
- - }));
1174
- - rc.contactFormFields = [];
1175
- - });
1176
- + describe('hasFieldOfType', () => {
1177
- + let rc;
1178
- + beforeEach(() => {
1179
- + rc = new RecrasContactForm(new RecrasOptions({
1180
- + element: document.createElement('div'),
1181
- + form_id: 1,
1182
- + package_id: 7,
1183
- + recras_hostname: 'demo.recras.nl',
1184
- + }));
1185
- + rc.contactFormFields = [];
1186
- + });
1187
-
1188
- - it('works on empty set', () => {
1189
- - expect(rc.hasFieldOfType('foo')).toBe(false);
1190
- - });
1191
- + it('works on empty set', () => {
1192
- + expect(rc.hasFieldOfType('foo')).toBe(false);
1193
- + });
1194
-
1195
- - it('works for general field', () => {
1196
- - rc.contactFormFields.push({
1197
- - field_identifier: 'foo',
1198
- - });
1199
- - expect(rc.hasFieldOfType('foo')).toBe(true);
1200
- - });
1201
- + it('works for general field', () => {
1202
- + rc.contactFormFields.push({
1203
- + field_identifier: 'foo',
1204
- + });
1205
- + expect(rc.hasFieldOfType('foo')).toBe(true);
1206
- + });
1207
-
1208
- - it('works for date field', () => {
1209
- - expect(rc.hasDateField()).toBe(false);
1210
- - rc.contactFormFields.push({
1211
- - field_identifier: 'boeking.datum',
1212
- - });
1213
- - expect(rc.hasDateField()).toBe(true);
1214
- - });
1215
- + it('works for date field', () => {
1216
- + expect(rc.hasBookingDateField()).toBe(false);
1217
- + rc.contactFormFields.push({
1218
- + field_identifier: 'boeking.datum',
1219
- + });
1220
- + expect(rc.hasBookingDateField()).toBe(true);
1221
- + });
1222
-
1223
- - it('works for country field', () => {
1224
- - expect(rc.hasCountryField()).toBe(false);
1225
- - rc.contactFormFields.push({
1226
- - field_identifier: 'contact.landcode',
1227
- - });
1228
- - expect(rc.hasCountryField()).toBe(true);
1229
- - });
1230
- + it('works for country field', () => {
1231
- + expect(rc.hasCountryField()).toBe(false);
1232
- + rc.contactFormFields.push({
1233
- + field_identifier: 'contact.landcode',
1234
- + });
1235
- + expect(rc.hasCountryField()).toBe(true);
1236
- + });
1237
-
1238
- - it('works for package field', () => {
1239
- - expect(rc.hasPackageField()).toBe(false);
1240
- - rc.contactFormFields.push({
1241
- - field_identifier: 'boeking.arrangement',
1242
- - });
1243
- - expect(rc.hasPackageField()).toBe(true);
1244
- - });
1245
- - });
1246
- + it('works for package field', () => {
1247
- + expect(rc.hasPackageField()).toBe(false);
1248
- + rc.contactFormFields.push({
1249
- + field_identifier: 'boeking.arrangement',
1250
- + });
1251
- + expect(rc.hasPackageField()).toBe(true);
1252
- + });
1253
- + });
1254
-
1255
- - describe('sortPackages', () => {
1256
- - let rc;
1257
- - beforeEach(() => {
1258
- - rc = new RecrasContactForm(new RecrasOptions({
1259
- - element: this.mainEl,
1260
- - form_id: 1,
1261
- - package_id: 7,
1262
- - recras_hostname: 'demo.recras.nl',
1263
- - }));
1264
- - });
1265
- + describe('hasRelationDateField', () => {
1266
- + let rc;
1267
- + beforeEach(() => {
1268
- + rc = new RecrasContactForm(new RecrasOptions({
1269
- + element: document.createElement('div'),
1270
- + form_id: 1,
1271
- + package_id: 7,
1272
- + recras_hostname: 'demo.recras.nl',
1273
- + }));
1274
- + rc.contactFormFields = [];
1275
- + });
1276
- +
1277
- + it('works on empty set', () => {
1278
- + expect(rc.hasRelationDateField()).toBe(false);
1279
- + });
1280
- +
1281
- + it('works for relation date field', () => {
1282
- + rc.contactFormFields.push({
1283
- + input_type: 'date',
1284
- + soort_invoer: 'contact.extra',
1285
- + });
1286
- + expect(rc.hasRelationDateField()).toBe(true);
1287
- + });
1288
- + });
1289
- +
1290
- + describe('sortPackages', () => {
1291
- + let rc;
1292
- + beforeEach(() => {
1293
- + rc = new RecrasContactForm(new RecrasOptions({
1294
- + element: document.createElement('div'),
1295
- + form_id: 1,
1296
- + package_id: 7,
1297
- + recras_hostname: 'demo.recras.nl',
1298
- + }));
1299
- + });
1300
-
1301
- - it('sorts by package name first', () => {
1302
- - let packs = [
1303
- - {
1304
- - arrangement: 'BBB',
1305
- - },
1306
- - {
1307
- - arrangement: 'AAA',
1308
- - },
1309
- - {
1310
- - arrangement: 'CCC',
1311
- - },
1312
- - ];
1313
- - let unsorted = JSON.parse(JSON.stringify(packs));
1314
- - let sorted = rc.sortPackages(unsorted);
1315
- - expect(sorted[0]).toEqual(packs[1]);
1316
- - expect(sorted[1]).toEqual(packs[0]);
1317
- - expect(sorted[2]).toEqual(packs[2]);
1318
- - });
1319
- + it('sorts by package name first', () => {
1320
- + let packs = [
1321
- + {
1322
- + arrangement: 'BBB',
1323
- + },
1324
- + {
1325
- + arrangement: 'AAA',
1326
- + },
1327
- + {
1328
- + arrangement: 'CCC',
1329
- + },
1330
- + ];
1331
- + let unsorted = JSON.parse(JSON.stringify(packs));
1332
- + let sorted = rc.sortPackages(unsorted);
1333
- + expect(sorted[0]).toEqual(packs[1]);
1334
- + expect(sorted[1]).toEqual(packs[0]);
1335
- + expect(sorted[2]).toEqual(packs[2]);
1336
- + });
1337
-
1338
- - it('sorts by ID second', () => {
1339
- - let packs = [
1340
- - {
1341
- - arrangement: 'Same',
1342
- - id: 42,
1343
- - },
1344
- - {
1345
- - arrangement: 'Zzz',
1346
- - id: 9,
1347
- - },
1348
- - {
1349
- - arrangement: 'Same',
1350
- - id: 17,
1351
- - },
1352
- - ];
1353
- - let unsorted = JSON.parse(JSON.stringify(packs));
1354
- - let sorted = rc.sortPackages(unsorted);
1355
- - expect(sorted[0]).toEqual(packs[2]);
1356
- - expect(sorted[1]).toEqual(packs[0]);
1357
- - expect(sorted[2]).toEqual(packs[1]);
1358
- - });
1359
- - });
1360
- + it('sorts by ID second', () => {
1361
- + let packs = [
1362
- + {
1363
- + arrangement: 'Same',
1364
- + id: 42,
1365
- + },
1366
- + {
1367
- + arrangement: 'Zzz',
1368
- + id: 9,
1369
- + },
1370
- + {
1371
- + arrangement: 'Same',
1372
- + id: 17,
1373
- + },
1374
- + ];
1375
- + let unsorted = JSON.parse(JSON.stringify(packs));
1376
- + let sorted = rc.sortPackages(unsorted);
1377
- + expect(sorted[0]).toEqual(packs[2]);
1378
- + expect(sorted[1]).toEqual(packs[0]);
1379
- + expect(sorted[2]).toEqual(packs[1]);
1380
- + });
1381
- + });
1382
-
1383
- - describe('getEmptyRequiredFields', () => {
1384
- - let rc;
1385
- + describe('getEmptyRequiredFields', () => {
1386
- + let rc;
1387
-
1388
- - beforeEach(async () => {
1389
- - rc = new RecrasContactForm(new RecrasOptions({
1390
- - element: this.mainEl,
1391
- - form_id: 1,
1392
- - recras_hostname: 'demo.recras.nl',
1393
- - }));
1394
- - await rc.showForm();
1395
- - });
1396
- + beforeEach(async () => {
1397
- + rc = new RecrasContactForm(new RecrasOptions({
1398
- + element: document.createElement('div'),
1399
- + form_id: 1,
1400
- + recras_hostname: 'demo.recras.nl',
1401
- + }));
1402
- + await rc.showForm();
1403
- + });
1404
-
1405
- - it('only returns required fields', () => {
1406
- - const els = rc.getEmptyRequiredFields();
1407
- - expect(els.length).toBeGreaterThan(0);
1408
- - for (const el of els) {
1409
- - expect(el.getAttribute('required')).not.toBeNull();
1410
- - }
1411
- - });
1412
- - });
1413
- + it('only returns required fields', () => {
1414
- + const els = rc.getEmptyRequiredFields();
1415
- + expect(els.length).toBeGreaterThan(0);
1416
- + for (const el of els) {
1417
- + expect(el.getAttribute('required')).not.toBeNull();
1418
- + }
1419
- + });
1420
- + });
1421
-
1422
- - describe('getInvalidFields', () => {
1423
- - let rc;
1424
- + describe('getInvalidFields', () => {
1425
- + let rc;
1426
-
1427
- - beforeEach(async () => {
1428
- - rc = new RecrasContactForm(new RecrasOptions({
1429
- - element: this.mainEl,
1430
- - form_id: 1,
1431
- - recras_hostname: 'demo.recras.nl',
1432
- - }));
1433
- - await rc.showForm();
1434
- - });
1435
- + beforeEach(async () => {
1436
- + rc = new RecrasContactForm(new RecrasOptions({
1437
- + element: document.createElement('div'),
1438
- + form_id: 1,
1439
- + recras_hostname: 'demo.recras.nl',
1440
- + }));
1441
- + await rc.showForm();
1442
- + });
1443
-
1444
- - it('returns invalid fields', () => {
1445
- - let elEmail = rc.findElement('[type="email"]');
1446
- - elEmail.value = 'invalid';
1447
- + it('returns invalid fields', () => {
1448
- + let elEmail = rc.findElement('[type="email"]');
1449
- + elEmail.value = 'invalid';
1450
-
1451
- - let invalid = rc.getInvalidFields();
1452
- - expect(invalid.length).toBe(1);
1453
- - expect(invalid[0]).toBe(elEmail);
1454
- + let invalid = rc.getInvalidFields();
1455
- + expect(invalid.length).toBe(1);
1456
- + expect(invalid[0]).toBe(elEmail);
1457
-
1458
- - elEmail.value = 'info@recras.com';
1459
- + elEmail.value = 'info@recras.com';
1460
-
1461
- - invalid = rc.getInvalidFields();
1462
- - expect(invalid.length).toBe(0);
1463
- - });
1464
- - });
1465
- + invalid = rc.getInvalidFields();
1466
- + expect(invalid.length).toBe(0);
1467
- + });
1468
- + });
1469
-
1470
- - describe('isEmpty', () => {
1471
- - let rc;
1472
- + describe('isEmpty', () => {
1473
- + let rc;
1474
-
1475
- - beforeEach(async () => {
1476
- - rc = new RecrasContactForm(new RecrasOptions({
1477
- - element: this.mainEl,
1478
- - form_id: 5,
1479
- - recras_hostname: 'demo.recras.nl',
1480
- - }));
1481
- - await rc.showForm();
1482
- - });
1483
- + beforeEach(async () => {
1484
- + rc = new RecrasContactForm(new RecrasOptions({
1485
- + element: document.createElement('div'),
1486
- + form_id: 5,
1487
- + recras_hostname: 'demo.recras.nl',
1488
- + }));
1489
- + await rc.showForm();
1490
- + });
1491
-
1492
- - it('returns if form is empty', () => {
1493
- - expect(rc.isEmpty()).toBe(true);
1494
- - let elEmail = rc.findElement('[type="email"]');
1495
- - elEmail.value = 'hi@example.com';
1496
- + it('returns if form is empty', () => {
1497
- + expect(rc.isEmpty()).toBe(true);
1498
- + let elEmail = rc.findElement('[type="email"]');
1499
- + elEmail.value = 'hi@example.com';
1500
-
1501
- - expect(rc.isEmpty()).toBe(false);
1502
- - });
1503
- + expect(rc.isEmpty()).toBe(false);
1504
- });
1505
- });
1506
- });
1507
- Index: test/js-unit/recrasBookingSpec.js
1508
- IDEA additional info:
1509
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
1510
- <+>UTF-8
1511
- ===================================================================
1512
- diff --git a/test/js-unit/recrasBookingSpec.js b/test/js-unit/recrasBookingSpec.js
1513
- --- a/test/js-unit/recrasBookingSpec.js (revision d780da01ee0c7b5cc3f074836a047f9edadd2e9f)
1514
- +++ b/test/js-unit/recrasBookingSpec.js (date 1659356720919)
1515
- @@ -368,9 +368,11 @@
1516
- resolve();
1517
- });
1518
- });
1519
- + this.rb.bookingHasErrors = () => false;
1520
- + this.rb.findElement = () => document.createElement('div');
1521
-
1522
- this.rb.bookingSize = () => 5;
1523
- - this.rb.submitBooking();//
1524
- + this.rb.submitBooking();
1525
- expect(this.rb.postJson).toHaveBeenCalledWith('onlineboeking/reserveer', jasmine.objectContaining({
1526
- betaalmethode: 'factuur',
1527
- }));
1528
- @@ -496,6 +498,40 @@
1529
- // Mocks
1530
- rb.getSetting = mockGetSetting;
1531
- rb.getPackages = () => {
1532
- + const packages = [{
1533
- + id: 26,
1534
- + onlineboeking_contactformulier_id: 4,
1535
- + regels: [
1536
- + {
1537
- + id: 669,
1538
- + max: 8,
1539
- + onlineboeking_aantalbepalingsmethode: "invullen_door_gebruiker",
1540
- + product: {
1541
- + minimum_aantal: 5,
1542
- + vereist_product: [],
1543
- + }
1544
- + },
1545
- + {
1546
- + id: 1337,
1547
- + max: null,
1548
- + onlineboeking_aantalbepalingsmethode: "invullen_door_gebruiker",
1549
- + product: {
1550
- + minimum_aantal: 1,
1551
- + vereist_product: [],
1552
- + }
1553
- + },
1554
- + {
1555
- + id: 420,
1556
- + aantal_personen: 10,
1557
- + max: 80,
1558
- + onlineboeking_aantalbepalingsmethode: "invullen_door_gebruiker",
1559
- + product: {
1560
- + minimum_aantal: 1,
1561
- + vereist_product: [],
1562
- + }
1563
- + },
1564
- + ],
1565
- + }];
1566
- rb.packages = packages;
1567
- return packages;
1568
- };
1569
- @@ -542,6 +578,114 @@
1570
- });
1571
- });
1572
-
1573
- + describe('prefillDateIfPossible', () => {
1574
- + let rb;
1575
- +
1576
- + let mainEl = document.createElement('div');
1577
- + mainEl.id = 'onlinebooking';
1578
- + document.body.appendChild(mainEl);
1579
- +
1580
- + it('does not set date if date is invalid', async () => {
1581
- + rb = new RecrasBooking(new RecrasOptions({
1582
- + element: mainEl,
1583
- + recras_hostname: 'demo.recras.nl',
1584
- + package_id: 7,
1585
- + date: '2050-15-66',
1586
- + }));
1587
- +
1588
- + await rb.promise;
1589
- +
1590
- + expect(rb.prefillDateIfPossible()).toBe(false);
1591
- + });
1592
- +
1593
- + it('does not set date if date is in the past', async () => {
1594
- + rb = new RecrasBooking(new RecrasOptions({
1595
- + element: mainEl,
1596
- + recras_hostname: 'demo.recras.nl',
1597
- + package_id: 7,
1598
- + date: '2019-06-28',
1599
- + }));
1600
- +
1601
- + await rb.promise;
1602
- +
1603
- + expect(rb.prefillDateIfPossible()).toBe(false);
1604
- + });
1605
- +
1606
- + it('does not set date if no package is selected', async () => {
1607
- + rb = new RecrasBooking(new RecrasOptions({
1608
- + element: mainEl,
1609
- + recras_hostname: 'demo.recras.nl',
1610
- + date: '2050-06-28',
1611
- + }));
1612
- +
1613
- + await rb.promise;
1614
- +
1615
- + expect(rb.prefillDateIfPossible()).toBe(false);
1616
- + });
1617
- +
1618
- + it('does not set date if multiple packages are selected', async () => {
1619
- + rb = new RecrasBooking(new RecrasOptions({
1620
- + element: mainEl,
1621
- + recras_hostname: 'demo.recras.nl',
1622
- + package_id: [1, 2, 3],
1623
- + date: '2050-06-28',
1624
- + }));
1625
- +
1626
- + await rb.promise;
1627
- +
1628
- + expect(rb.prefillDateIfPossible()).toBe(false);
1629
- + });
1630
- +
1631
- + it('sets date if date is valid and one package is selected', async () => {
1632
- + rb = new RecrasBooking(new RecrasOptions({
1633
- + element: mainEl,
1634
- + recras_hostname: 'demo.recras.nl',
1635
- + package_id: [7],
1636
- + date: '2050-06-28',
1637
- + }));
1638
- +
1639
- + await rb.promise;
1640
- +
1641
- + expect(rb.prefillDateIfPossible()).toBe(true);
1642
- + });
1643
- + });
1644
- +
1645
- + describe('prefillTimeIfPossible', () => {
1646
- + let rb;
1647
- +
1648
- + let mainEl = document.createElement('div');
1649
- + mainEl.id = 'onlinebooking';
1650
- + document.body.appendChild(mainEl);
1651
- +
1652
- + it('does not set time if time is invalid', async () => {
1653
- + rb = new RecrasBooking(new RecrasOptions({
1654
- + element: mainEl,
1655
- + recras_hostname: 'demo.recras.nl',
1656
- + package_id: 7,
1657
- + date: '2050-06-28',
1658
- + time: '30:60',
1659
- + }));
1660
- +
1661
- + await rb.promise;
1662
- +
1663
- + expect(rb.prefillTimeIfPossible()).toBe(false);
1664
- + });
1665
- +
1666
- + it('sets time if time is valid', async () => {
1667
- + rb = new RecrasBooking(new RecrasOptions({
1668
- + element: mainEl,
1669
- + recras_hostname: 'demo.recras.nl',
1670
- + package_id: [7],
1671
- + date: '2050-06-28',
1672
- + time: '10:00',
1673
- + }));
1674
- +
1675
- + await rb.promise;
1676
- +
1677
- + expect(rb.prefillTimeIfPossible()).toBe(true);
1678
- + });
1679
- + });
1680
- +
1681
- describe('hasAtLeastOneProduct', () => {
1682
- const pck = {
1683
- id: 7,
1684
- Index: src/options.js
1685
- IDEA additional info:
1686
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
1687
- <+>UTF-8
1688
- ===================================================================
1689
- diff --git a/src/options.js b/src/options.js
1690
- --- a/src/options.js (revision d780da01ee0c7b5cc3f074836a047f9edadd2e9f)
1691
- +++ b/src/options.js (date 1659356553941)
1692
- @@ -55,6 +55,12 @@
1693
- getPreFilledAmounts() {
1694
- return this.options.productAmounts;
1695
- }
1696
- + getPreFilledDate() {
1697
- + return this.options.date;
1698
- + }
1699
- + getPreFilledTime() {
1700
- + return this.options.time;
1701
- + }
1702
- getPreviewTimes() {
1703
- return (this.options.previewTimes !== undefined ? this.options.previewTimes : true);
1704
- }
1705
- Index: docs/onlinebooking.html
1706
- IDEA additional info:
1707
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
1708
- <+>UTF-8
1709
- ===================================================================
1710
- diff --git a/docs/onlinebooking.html b/docs/onlinebooking.html
1711
- --- a/docs/onlinebooking.html (revision d780da01ee0c7b5cc3f074836a047f9edadd2e9f)
1712
- +++ b/docs/onlinebooking.html (date 1659356553937)
1713
- @@ -31,6 +31,8 @@
1714
- /*productAmounts: { // Optional, this will pre-fill the amounts form
1715
- 660: 2,
1716
- },*/
1717
- + //date: '2020-06-02', // Optional, this will pre-fill the date if it's available for the selected products
1718
- + //time: '11:15', // Optional, this will pre-fill the time if it's available for the selected date
1719
- analytics: fakeAnalytics,
1720
- };
1721
-
1722
- Index: src/booking.js
1723
- IDEA additional info:
1724
- Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
1725
- <+>UTF-8
1726
- ===================================================================
1727
- diff --git a/src/booking.js b/src/booking.js
1728
- --- a/src/booking.js (revision d780da01ee0c7b5cc3f074836a047f9edadd2e9f)
1729
- +++ b/src/booking.js (date 1659356720919)
1730
- @@ -1,6 +1,6 @@
1731
- /*******************************
1732
- * Recras integration library *
1733
- -* v 1.4.8 *
1734
- +* v 1.6.3 *
1735
- *******************************/
1736
-
1737
- class RecrasBooking {
1738
- @@ -46,6 +46,13 @@
1739
- }
1740
- }
1741
-
1742
- + if (this.options.getPreFilledDate()) {
1743
- + this.prefillDateIfPossible();
1744
- + }
1745
- + if (this.options.getPreFilledTime()) {
1746
- + this.prefillTimeIfPossible();
1747
- + }
1748
- +
1749
- RecrasCSSHelper.loadCSS('global');
1750
- RecrasCSSHelper.loadCSS('booking');
1751
- RecrasCSSHelper.loadCSS('pikaday');
1752
- @@ -74,6 +81,39 @@
1753
- });
1754
- }
1755
-
1756
- + prefillDateIfPossible() {
1757
- + let date = new Date(this.options.getPreFilledDate());
1758
- + if (isNaN(date.getTime())) {
1759
- + console.warn(this.languageHelper.translate('ERR_INVALID_DATE'));
1760
- + return false;
1761
- + }
1762
- +
1763
- + if (date < new Date()) {
1764
- + console.warn(this.languageHelper.translate('ERR_DATE_PAST'));
1765
- + return false;
1766
- + }
1767
- +
1768
- + if (!this.options.isSinglePackage()) {
1769
- + console.warn(this.languageHelper.translate('ERR_DATE_NO_SINGLE_PACKAGE'));
1770
- + return false;
1771
- + }
1772
- +
1773
- + this.prefilledDate = date;
1774
- +
1775
- + return true;
1776
- + }
1777
- +
1778
- + prefillTimeIfPossible() {
1779
- + let time = this.options.getPreFilledTime();
1780
- + if (!time.match(/^(2[0-3]|[01]?[0-9]):([0-5]?[0-9])$/)) {
1781
- + console.warn(this.languageHelper.translate('ERR_INVALID_TIME'));
1782
- + return false;
1783
- + }
1784
- +
1785
- + this.prefilledTime = time;
1786
- + return true;
1787
- + }
1788
- +
1789
- hasAtLeastOneProduct(pack) {
1790
- if (this.shouldShowBookingSize(pack) && this.bookingSize() > 0) {
1791
- return true;
1792
- @@ -286,7 +326,7 @@
1793
- } else if (bookingSize > bsMaximum) {
1794
- this.setMinMaxAmountWarning('bookingsize', bsMaximum, 'maximum');
1795
- }
1796
- - this.maybeDisableBookButton();
1797
- + this.maybeShowInlineErrors();
1798
- }
1799
-
1800
- checkDependencies() {
1801
- @@ -330,7 +370,7 @@
1802
- }
1803
- });
1804
-
1805
- - this.maybeDisableBookButton();
1806
- + this.maybeShowInlineErrors();
1807
- }
1808
-
1809
- checkDiscountAndVoucher() {
1810
- @@ -363,7 +403,12 @@
1811
- }
1812
-
1813
- checkDiscountcode(packageID, date, code) {
1814
- - return this.fetchJson(this.options.getApiBase() + 'onlineboeking/controleerkortingscode?datum=' + date + '&arrangement=' + packageID + '&kortingscode=' + code)
1815
- + return this.fetchJson(
1816
- + this.options.getApiBase() + 'onlineboeking/controleerkortingscode' +
1817
- + '?datum=' + date +
1818
- + '&arrangement=' + packageID +
1819
- + '&kortingscode=' + encodeURIComponent(code)
1820
- + )
1821
- .then(discount => {
1822
- if (discount === false) {
1823
- return false;
1824
- @@ -408,6 +453,46 @@
1825
- });
1826
- }
1827
-
1828
- + contactFormIsEmpty() {
1829
- + let isEmpty = true;
1830
- + let els = this.findElements('.recras-contactform input, .recras-contactform select, .recras-contactform textarea');
1831
- + let formValues = [...els].map(el => el.value);
1832
- + for (let val of formValues) {
1833
- + if (val !== '') {
1834
- + isEmpty = false;
1835
- + }
1836
- + }
1837
- + return isEmpty;
1838
- + }
1839
- +
1840
- + contactFormInvalidFields() {
1841
- + let invalid = [];
1842
- + let required = this.contactFormRequiredFields();
1843
- +
1844
- + let els = this.findElements('.recras-contactform :invalid');
1845
- + for (let el of els) {
1846
- + if (!required.includes(el)) {
1847
- + invalid.push(el);
1848
- + }
1849
- + }
1850
- + return invalid;
1851
- + }
1852
- +
1853
- + contactFormRequiredFields() {
1854
- + let isEmpty = [];
1855
- + let els = this.findElements('.recras-contactform :required');
1856
- + for (let el of els) {
1857
- + if (el.value === undefined || el.value === '') {
1858
- + isEmpty.push(el);
1859
- + }
1860
- + }
1861
- + return isEmpty;
1862
- + }
1863
- +
1864
- + contactFormRequiredIsEmpty() {
1865
- + return this.contactFormRequiredFields().length > 0;
1866
- + }
1867
- +
1868
- contactFormValid() {
1869
- const contactFormIsValid = this.findElement('.recras-contactform').checkValidity();
1870
- const contactFormRequiredCheckboxes = this.contactForm.checkRequiredCheckboxes();
1871
- @@ -669,41 +754,54 @@
1872
- afterEl.insertAdjacentHTML('beforeend', `<span class="recrasLoadingIndicator">${ this.languageHelper.translate('LOADING') }</span>`);
1873
- }
1874
-
1875
- - maybeDisableBookButton() {
1876
- - let button = this.findElement('.bookPackage');
1877
- - if (!button) {
1878
- - return false;
1879
- + bookingErrors() {
1880
- + let bookingDisabledReasons = {};
1881
- +
1882
- + if (!this.hasAtLeastOneProduct(this.selectedPackage)) {
1883
- + bookingDisabledReasons.amountsInvalid = 'BOOKING_DISABLED_NO_PRODUCTS';
1884
- + return bookingDisabledReasons;
1885
- }
1886
- -
1887
- - let bookingDisabledReasons = [];
1888
- + if (!this.amountsValid(this.selectedPackage)) {
1889
- + bookingDisabledReasons.amountsInvalid = 'BOOKING_DISABLED_AMOUNTS_INVALID';
1890
- + return bookingDisabledReasons;
1891
- + }
1892
- if (this.requiresProduct) {
1893
- - bookingDisabledReasons.push('BOOKING_DISABLED_REQUIRED_PRODUCT');
1894
- + bookingDisabledReasons.requiresProduct = 'BOOKING_DISABLED_REQUIRED_PRODUCT';
1895
- }
1896
- - if (!this.amountsValid(this.selectedPackage)) {
1897
- - bookingDisabledReasons.push('BOOKING_DISABLED_AMOUNTS_INVALID');
1898
- +
1899
- + if (!this.selectedDate) {
1900
- + bookingDisabledReasons.dateInvalid = 'BOOKING_DISABLED_INVALID_DATE';
1901
- + return bookingDisabledReasons;
1902
- }
1903
- - if (!this.findElement('.recras-onlinebooking-date').value) {
1904
- - bookingDisabledReasons.push('BOOKING_DISABLED_INVALID_DATE');
1905
- + if (!this.selectedTime) {
1906
- + bookingDisabledReasons.timeInvalid = 'BOOKING_DISABLED_INVALID_TIME';
1907
- + return bookingDisabledReasons;
1908
- }
1909
- - if (!this.findElement('.recras-onlinebooking-time').value) {
1910
- - bookingDisabledReasons.push('BOOKING_DISABLED_INVALID_TIME');
1911
- - }
1912
- - if (!this.contactFormValid()) {
1913
- - bookingDisabledReasons.push('BOOKING_DISABLED_CONTACT_FORM_INVALID');
1914
- +
1915
- + if (this.contactFormIsEmpty()) {
1916
- + bookingDisabledReasons.contactFormInvalid = 'BOOKING_DISABLED_CONTACT_FORM_EMPTY';
1917
- + } else if (this.contactFormRequiredIsEmpty() || !this.contactFormValid()) {
1918
- + // Special case
1919
- + bookingDisabledReasons.contactFormRequired = true;
1920
- + return bookingDisabledReasons;
1921
- }
1922
-
1923
- const agreeEl = this.findElement('#recrasAgreeToAttachments');
1924
- if (agreeEl && !agreeEl.checked) {
1925
- - bookingDisabledReasons.push('BOOKING_DISABLED_AGREEMENT');
1926
- + bookingDisabledReasons.notAgreed = 'BOOKING_DISABLED_AGREEMENT';
1927
- }
1928
- +
1929
- + return bookingDisabledReasons;
1930
- + }
1931
- +
1932
- + bookingHasErrors() {
1933
- + let bookingDisabledReasons = this.bookingErrors();
1934
- + return Object.keys(bookingDisabledReasons).length > 0;
1935
- + }
1936
-
1937
- - if (bookingDisabledReasons.length > 0) {
1938
- - const reasonsList = bookingDisabledReasons.map(reason => this.languageHelper.translate(reason)).join('<li>');
1939
- - this.findElement('#bookingErrors').innerHTML = `<ul><li>${ reasonsList }</ul>`;
1940
- - button.setAttribute('disabled', 'disabled');
1941
- - } else {
1942
- - this.findElement('#bookingErrors').innerHTML = '';
1943
- - button.removeAttribute('disabled');
1944
- + maybeShowInlineErrors() {
1945
- + if (this.bookingHasErrors()) {
1946
- + this.showInlineErrors();
1947
- }
1948
- }
1949
-
1950
- @@ -802,7 +900,15 @@
1951
- return counts;
1952
- }
1953
-
1954
- + removeErrors(parentQS = '') {
1955
- + [...this.findElements(parentQS + '.booking-error')].forEach(el => {
1956
- + el.parentNode.removeChild(el);
1957
- + });
1958
- + }
1959
- removeWarnings() {
1960
- + [...this.findElements('.booking-error:not(#bookingErrors)')].forEach(el => {
1961
- + el.parentNode.removeChild(el);
1962
- + });
1963
- [...this.findElements('.minimum-amount')].forEach(el => {
1964
- el.parentNode.removeChild(el);
1965
- });
1966
- @@ -892,7 +998,10 @@
1967
- this.findElement('.standard-attachments').innerHTML = attachmentHtml;
1968
- const agreeEl = this.findElement('#recrasAgreeToAttachments');
1969
- if (agreeEl) {
1970
- - agreeEl.addEventListener('change', this.maybeDisableBookButton.bind(this));
1971
- + agreeEl.addEventListener('change', () => {
1972
- + this.removeErrors('.standard-attachments ');
1973
- + this.maybeShowInlineErrors();
1974
- + });
1975
- }
1976
- }
1977
-
1978
- @@ -966,15 +1075,14 @@
1979
-
1980
- Promise.all(promises).then(() => {
1981
- let html = `<div class="recras-finalise">
1982
- - <p>${ textPostBooking }</p>
1983
- - <div class="standard-attachments"></div>
1984
- - ${ paymentText }
1985
- - <button type="submit" class="bookPackage" disabled>${ this.languageHelper.translate('BUTTON_BOOK_NOW') }</button>
1986
- - <div class="booking-error" id="bookingErrors"></div>
1987
- - </div>`;
1988
- + <p>${ textPostBooking }</p>
1989
- + <div class="standard-attachments"></div>
1990
- + ${ paymentText }
1991
- + <button type="submit" class="bookPackage">${ this.languageHelper.translate('BUTTON_BOOK_NOW') }</button>
1992
- + </div>`;
1993
- this.appendHtml(html);
1994
- this.findElement('.bookPackage').addEventListener('click', this.submitBooking.bind(this));
1995
- - this.maybeDisableBookButton();
1996
- + this.updateProductAmounts();
1997
- });
1998
- }
1999
-
2000
- @@ -1014,8 +1122,9 @@
2001
- this.eventHelper.sendEvent(RecrasEventHelper.PREFIX_BOOKING, RecrasEventHelper.EVENT_BOOKING_CONTACT_FORM_SHOWN);
2002
-
2003
- [...this.findElements('[name^="contactformulier"]')].forEach(el => {
2004
- - el.addEventListener('input', this.maybeDisableBookButton.bind(this));
2005
- el.addEventListener('input', () => {
2006
- + this.removeErrors('.recras-contactform ');
2007
- + this.maybeShowInlineErrors();
2008
- if (this.contactFormValid()) {
2009
- this.nextSectionActive('.recras-contactform', '.recras-finalise');
2010
- }
2011
- @@ -1024,6 +1133,80 @@
2012
- });
2013
- }
2014
-
2015
- + maybeFillTime(times) {
2016
- + times = times.map(time => RecrasDateHelper.timePartOnly(new Date(time)));
2017
- + this.showTimes(times);
2018
- + this.loadingIndicatorHide();
2019
- +
2020
- + if (!this.prefilledTime) {
2021
- + this.selectSingleTime();
2022
- + return;
2023
- + }
2024
- +
2025
- + if (times.includes(this.prefilledTime)) {
2026
- + this.selectTime(this.prefilledTime);
2027
- + this.selectedDate = RecrasDateHelper.setTimeForDate(this.selectedDate, this.selectedTime);
2028
- + if (this.options.getPreviewTimes() === true) {
2029
- + this.previewTimes();
2030
- + }
2031
- + return;
2032
- + }
2033
- +
2034
- + this.toggleTimeField('show');
2035
- + }
2036
- +
2037
- + calendarOnDateSelect(date, packageId) {
2038
- + this.removeWarnings();
2039
- + this.loadingIndicatorShow(this.findElement('label[for="recras-onlinebooking-time"]'));
2040
- + this.eventHelper.sendEvent(
2041
- + RecrasEventHelper.PREFIX_BOOKING,
2042
- + RecrasEventHelper.EVENT_BOOKING_DATE_SELECTED,
2043
- + RecrasDateHelper.datePartOnly(date)
2044
- + );
2045
- + this.selectedDate = date;
2046
- +
2047
- + if (this.hasAtLeastOneProduct(this.selectedPackage)) {
2048
- + this.getAvailableTimes(packageId, date).then(times => this.maybeFillTime(times));
2049
- + }
2050
- +
2051
- + this.findElement('#discountcode').removeAttribute('disabled');
2052
- + this.maybeShowInlineErrors();
2053
- + }
2054
- +
2055
- + calendarOnDraw(pika, packageId) {
2056
- + if (!this.hasAtLeastOneProduct(this.selectedPackage) || !this.amountsValid(this.selectedPackage) || this.requiresProduct) {
2057
- + const dateEl = this.findElement('.recras-onlinebooking-date');
2058
- + let errorMsg = this.languageHelper.translate('BOOKING_DISABLED_PRODUCTS_BEFORE_DATE');
2059
- + this.removeErrors('.recras-datetime ');
2060
- + dateEl.insertAdjacentHTML(
2061
- + 'afterend',
2062
- + `<div class="booking-error">${ errorMsg }</div>`
2063
- + );
2064
- + dateEl.blur();
2065
- + return false;
2066
- + }
2067
- + let lastMonthYear = pika.calendars[pika.calendars.length - 1];
2068
- + let lastDay = new Date(lastMonthYear.year, lastMonthYear.month, 31);
2069
- +
2070
- + let lastAvailableDay = this.availableDays.reduce((acc, curVal) => {
2071
- + return curVal > acc ? curVal : acc;
2072
- + }, '');
2073
- + if (!lastAvailableDay) {
2074
- + lastAvailableDay = new Date();
2075
- + } else {
2076
- + lastAvailableDay = new Date(lastAvailableDay);
2077
- + }
2078
- + if (lastAvailableDay > lastDay) {
2079
- + return;
2080
- + }
2081
- +
2082
- + let newEndDate = RecrasDateHelper.clone(lastAvailableDay);
2083
- + newEndDate.setFullYear(lastMonthYear.year);
2084
- + newEndDate.setMonth(lastMonthYear.month + 2);
2085
- +
2086
- + this.getAvailableDays(packageId, lastAvailableDay, newEndDate);
2087
- + }
2088
- +
2089
- addDateTimeSelectionHtml() {
2090
- let today = RecrasDateHelper.datePartOnly(new Date());
2091
- let html = `<form class="recras-datetime">
2092
- @@ -1038,10 +1221,28 @@
2093
- </form>`;
2094
- this.appendHtml(html);
2095
- }
2096
- +
2097
- + selectTime(time) {
2098
- + this.eventHelper.sendEvent(RecrasEventHelper.PREFIX_BOOKING, RecrasEventHelper.EVENT_BOOKING_TIME_SELECTED);
2099
- + this.selectedTime = time;
2100
- + this.maybeShowInlineErrors();
2101
- + }
2102
- +
2103
- showDateTimeSelection(pack) {
2104
- this.addDateTimeSelectionHtml();
2105
- this.showDiscountFields();
2106
-
2107
- + if (this.prefilledDate) {
2108
- + this.toggleDateField('hide');
2109
- + this.calendarOnDateSelect(this.prefilledDate, pack.id);
2110
- + }
2111
- + if (this.prefilledTime) {
2112
- + this.toggleTimeField('hide');
2113
- + }
2114
- + if (this.prefilledDate && this.prefilledTime) {
2115
- + this.findElement('.recras-datetime').classList.add('recrasHidden');
2116
- + }
2117
- +
2118
- if (this.options.getPreFilledAmounts()) {
2119
- this.preFillAmounts(this.options.getPreFilledAmounts());
2120
- }
2121
- @@ -1054,53 +1255,15 @@
2122
- },
2123
- field: this.findElement('.recras-onlinebooking-date'),
2124
- i18n: RecrasCalendarHelper.i18n(this.languageHelper),
2125
- - onDraw: (pika) => {
2126
- - let lastMonthYear = pika.calendars[pika.calendars.length - 1];
2127
- - let lastDay = new Date(lastMonthYear.year, lastMonthYear.month, 31);
2128
- -
2129
- - let lastAvailableDay = this.availableDays.reduce((acc, curVal) => {
2130
- - return curVal > acc ? curVal : acc;
2131
- - }, '');
2132
- - if (!lastAvailableDay) {
2133
- - lastAvailableDay = new Date();
2134
- - } else {
2135
- - lastAvailableDay = new Date(lastAvailableDay);
2136
- - }
2137
- - if (lastAvailableDay > lastDay) {
2138
- - return;
2139
- - }
2140
- -
2141
- - let newEndDate = RecrasDateHelper.clone(lastAvailableDay);
2142
- - newEndDate.setFullYear(lastMonthYear.year);
2143
- - newEndDate.setMonth(lastMonthYear.month + 2);
2144
- -
2145
- - this.getAvailableDays(pack.id, lastAvailableDay, newEndDate);
2146
- - },
2147
- - onSelect: (date) => {
2148
- - this.loadingIndicatorShow(this.findElement('label[for="recras-onlinebooking-time"]'));
2149
- - this.eventHelper.sendEvent(
2150
- - RecrasEventHelper.PREFIX_BOOKING,
2151
- - RecrasEventHelper.EVENT_BOOKING_DATE_SELECTED,
2152
- - RecrasDateHelper.datePartOnly(date)
2153
- - );
2154
- - this.selectedDate = date;
2155
- - this.getAvailableTimes(pack.id, date).then(times => {
2156
- - times = times.map(time => RecrasDateHelper.timePartOnly(new Date(time)));
2157
- - this.showTimes(times);
2158
- - this.loadingIndicatorHide();
2159
- - this.selectSingleTime();
2160
- - });
2161
- - this.findElement('#discountcode').removeAttribute('disabled');
2162
- - this.maybeDisableBookButton();
2163
- - },
2164
- + onDraw: (pika) => this.calendarOnDraw(pika, pack.id),
2165
- + onSelect: (date) => this.calendarOnDateSelect(date, pack.id),
2166
- }
2167
- );
2168
-
2169
- this.datePicker = new Pikaday(pikadayOptions);
2170
-
2171
- this.findElement('.recras-onlinebooking-time').addEventListener('change', () => {
2172
- - this.eventHelper.sendEvent(RecrasEventHelper.PREFIX_BOOKING, RecrasEventHelper.EVENT_BOOKING_TIME_SELECTED);
2173
- - this.selectedTime = this.findElement('.recras-onlinebooking-time').value;
2174
- + this.selectTime(this.findElement('.recras-onlinebooking-time').value);
2175
-
2176
- this.nextSectionActive('.recras-datetime', '.recras-discounts');
2177
- this.nextSectionActive(null, '.recras-contactform');
2178
- @@ -1110,7 +1273,8 @@
2179
- this.previewTimes();
2180
- }
2181
-
2182
- - this.maybeDisableBookButton();
2183
- + this.removeErrors('.recras-datetime ');
2184
- + this.maybeShowInlineErrors();
2185
- });
2186
- }
2187
-
2188
- @@ -1193,6 +1357,12 @@
2189
- });
2190
- this.findElement('.recras-onlinebooking-time').innerHTML = html;
2191
- this.findElement('.recras-onlinebooking-time').removeAttribute('disabled');
2192
- + if (times.length === 0) {
2193
- + this.findElement('.recras-datetime').insertAdjacentHTML(
2194
- + 'afterend',
2195
- + `<div class="booking-error">${ this.languageHelper.translate('ERR_NO_TIMES_FOR_DATE') }</div>`
2196
- + );
2197
- + }
2198
- }
2199
-
2200
- clearTimes() {
2201
- @@ -1219,7 +1389,82 @@
2202
- return attachments;
2203
- }
2204
-
2205
- + contactformErrors() {
2206
- + this.removeErrors('.recras-contactform ');
2207
- + for (let el of this.contactFormRequiredFields()) {
2208
- + const labelEl = el.parentNode.querySelector('label');
2209
- + const requiredText = this.languageHelper.translate('CONTACT_FORM_FIELD_REQUIRED', { FIELD_NAME: labelEl.innerText });
2210
- + el.parentNode.insertAdjacentHTML(
2211
- + 'afterend',
2212
- + `<div class="booking-error">${ requiredText }</div>`
2213
- + );
2214
- + }
2215
- + for (let el of this.contactFormInvalidFields()) {
2216
- + const labelEl = el.parentNode.querySelector('label');
2217
- + const invalidText = this.languageHelper.translate('CONTACT_FORM_FIELD_INVALID', { FIELD_NAME: labelEl.innerText });
2218
- + el.parentNode.insertAdjacentHTML(
2219
- + 'afterend',
2220
- + `<div class="booking-error">${ invalidText }</div>`
2221
- + );
2222
- + }
2223
- + }
2224
- +
2225
- + errorAtPosition(key, msg) {
2226
- + let pos;
2227
- + let qs;
2228
- +
2229
- + switch (key) {
2230
- + case 'requiresProduct':
2231
- + case 'amountsInvalid':
2232
- + pos = 'beforeend';
2233
- + qs = '.recras-amountsform';
2234
- + break;
2235
- + case 'dateInvalid':
2236
- + pos = 'afterend';
2237
- + qs = '.recras-onlinebooking-date';
2238
- + break;
2239
- + case 'timeInvalid':
2240
- + pos = 'beforeend';
2241
- + qs = '.recras-datetime';
2242
- + break;
2243
- + case 'contactFormInvalid':
2244
- + pos = 'beforeend';
2245
- + qs = '.recras-contactform';
2246
- + break;
2247
- + case 'notAgreed':
2248
- + pos = 'beforeend';
2249
- + qs = '.standard-attachments';
2250
- + break;
2251
- + case 'contactFormRequired':
2252
- + this.contactformErrors();
2253
- + break;
2254
- + default:
2255
- + pos = 'beforeend';
2256
- + qs = '.bookPackage';
2257
- + break;
2258
- + }
2259
- + const el = this.findElement(qs);
2260
- + if (el) {
2261
- + el.insertAdjacentHTML(
2262
- + pos,
2263
- + `<p class="booking-error">${ this.languageHelper.translate(msg) }</p>`
2264
- + );
2265
- + }
2266
- + }
2267
- +
2268
- + showInlineErrors() {
2269
- + this.removeErrors();
2270
- + let errorMsgs = this.bookingErrors();
2271
- + for (const [key, msg] of Object.entries(errorMsgs)) {
2272
- + this.errorAtPosition(key, msg);
2273
- + }
2274
- + }
2275
- +
2276
- submitBooking() {
2277
- + if (this.bookingHasErrors()) {
2278
- + this.showInlineErrors();
2279
- + return false;
2280
- + }
2281
- let productCounts = this.productCounts().map(line => line.aantal);
2282
- let productSum = productCounts.reduce((a, b) => a + b, 0);
2283
- if (this.bookingSize() === 0 && productSum === 0) {
2284
- @@ -1244,12 +1489,10 @@
2285
- paymentMethod = paymentMethodEl.value;
2286
- }
2287
-
2288
- + let bookButton = this.findElement('.bookPackage');
2289
- this.loadingIndicatorHide();
2290
- - this.loadingIndicatorShow(this.findElement('.bookPackage'));
2291
- - let elem;
2292
- - if (null !== (elem = this.findElement('.bookPackage'))) {
2293
- - elem.setAttribute('disabled', 'disabled');
2294
- - }
2295
- + this.loadingIndicatorShow(bookButton);
2296
- + bookButton.setAttribute('disabled', 'disabled');
2297
-
2298
- let vouchers = Object.keys(this.appliedVouchers).length > 0 ? Object.keys(this.appliedVouchers) : null;
2299
- let bookingParams = {
2300
- @@ -1297,10 +1540,39 @@
2301
- });
2302
- }
2303
-
2304
- + toggleDateField(showHide) {
2305
- + const dateEl = this.findElement('#recras-onlinebooking-date');
2306
- + const labelEl = this.findElement('[for="recras-onlinebooking-date"]');
2307
- +
2308
- + if (showHide === 'hide') {
2309
- + dateEl.classList.add('recrasHidden');
2310
- + labelEl.classList.add('recrasHidden');
2311
- + } else {
2312
- + dateEl.classList.remove('recrasHidden');
2313
- + labelEl.classList.remove('recrasHidden');
2314
- + this.findElement('.recras-datetime').classList.remove('recrasHidden');
2315
- + }
2316
- + }
2317
- +
2318
- + toggleTimeField(showHide) {
2319
- + const timeEl = this.findElement('#recras-onlinebooking-time');
2320
- + const labelEl = this.findElement('[for="recras-onlinebooking-time"]');
2321
- +
2322
- + if (showHide === 'hide') {
2323
- + timeEl.classList.add('recrasHidden');
2324
- + labelEl.classList.add('recrasHidden');
2325
- + } else {
2326
- + timeEl.classList.remove('recrasHidden');
2327
- + labelEl.classList.remove('recrasHidden');
2328
- + this.findElement('.recras-datetime').classList.remove('recrasHidden');
2329
- + }
2330
- + }
2331
- +
2332
- updateProductAmounts() {
2333
- this.loadingIndicatorHide();
2334
- this.availableDays = [];
2335
-
2336
- + this.removeErrors();
2337
- this.removeWarnings();
2338
- this.checkDependencies();
2339
- this.checkMinMaxAmounts();
2340
- @@ -1313,7 +1585,7 @@
2341
-
2342
- let datePickerEl = this.findElement('.recras-onlinebooking-date');
2343
-
2344
- - var thisClass = this;
2345
- + const thisClass = this;
2346
- maxPromise.then(function() {
2347
- let amountErrors = thisClass.findElements(
2348
- '.minimum-amount, .maximum-amount, .recras-product-dependency'
2349
- @@ -1325,23 +1597,51 @@
2350
- }
2351
- thisClass.nextSectionActive('.recras-amountsform', '.recras-datetime');
2352
-
2353
- + if (!thisClass.hasAtLeastOneProduct(thisClass.selectedPackage)) {
2354
- + return;
2355
- + }
2356
- +
2357
- thisClass.loadingIndicatorShow(thisClass.findElement('label[for="recras-onlinebooking-date"]'));
2358
- let startDate = new Date();
2359
- let endDate = new Date();
2360
- endDate.setMonth(endDate.getMonth() + 3);
2361
-
2362
- + if (!thisClass.prefilledDate) {
2363
- + thisClass.getAvailableDaysInPeriod(thisClass.selectedPackage.id, startDate, endDate);
2364
- + return;
2365
- + }
2366
- +
2367
- + let date = thisClass.prefilledDate;
2368
- + startDate = new Date(date);
2369
- + endDate = new Date(date);
2370
- + endDate.setDate(endDate.getDate() + 1);
2371
- +
2372
- thisClass.getAvailableDays(thisClass.selectedPackage.id, startDate, endDate)
2373
- .then(availableDays => {
2374
- - thisClass.loadingIndicatorHide();
2375
- + if (availableDays.includes(RecrasDateHelper.datePartOnly(date))) {
2376
- + thisClass.toggleDateField('hide');
2377
- + thisClass.calendarOnDateSelect(date, thisClass.selectedPackage.id);
2378
- + } else {
2379
- + thisClass.toggleDateField('show');
2380
- + thisClass.getAvailableDaysInPeriod(thisClass.selectedPackage.id, startDate, endDate);
2381
- + }
2382
- + });
2383
- + });
2384
- + }
2385
- +
2386
- + getAvailableDaysInPeriod(packageId, startDate, endDate) {
2387
- + const datePickerEl = this.findElement('.recras-onlinebooking-date');
2388
- + this.getAvailableDays(packageId, startDate, endDate)
2389
- + .then(availableDays => {
2390
- + this.loadingIndicatorHide();
2391
-
2392
- - if (datePickerEl.value && availableDays.indexOf(datePickerEl.value) === -1) {
2393
- - datePickerEl.value = '';
2394
- - thisClass.clearTimes();
2395
- - } else {
2396
- - datePickerEl.removeAttribute('disabled');
2397
- - }
2398
- - });
2399
- - });
2400
- + if (datePickerEl.value && availableDays.indexOf(datePickerEl.value) === -1) {
2401
- + datePickerEl.value = '';
2402
- + this.clearTimes();
2403
- + } else {
2404
- + datePickerEl.removeAttribute('disabled');
2405
- + }
2406
- + });
2407
- }
2408
-
2409
- updateProductPrice(el) {