@mindful-web/marko-web-identity-x 1.30.0 → 1.31.2
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.
- package/browser/custom-column.vue +39 -2
- package/components/access.marko.js +2 -2
- package/components/comment-stream.marko.js +2 -2
- package/components/context.marko.js +2 -2
- package/components/form-access.marko.js +2 -2
- package/components/form-authenticate.marko.js +2 -2
- package/components/form-change-email.marko.js +2 -2
- package/components/form-login.marko.js +2 -2
- package/components/form-logout.marko.js +2 -2
- package/components/form-profile.marko.js +2 -2
- package/components/form-register.marko.js +2 -2
- package/components/identify.marko.js +2 -2
- package/components/non-auth-identify.marko.js +2 -2
- package/components/subscribe.marko.js +2 -2
- package/package.json +2 -2
- package/utils/generate-required-field-payload.js +22 -13
|
@@ -138,6 +138,15 @@
|
|
|
138
138
|
:value="customField.answer"
|
|
139
139
|
@input="onCustomBooleanChange(customField.id, $event)"
|
|
140
140
|
/>
|
|
141
|
+
<custom-text
|
|
142
|
+
v-else-if="type === 'custom-text' && customField"
|
|
143
|
+
:id="fieldId"
|
|
144
|
+
:class-name="className"
|
|
145
|
+
:label="label"
|
|
146
|
+
:required="required"
|
|
147
|
+
:value="customField.value"
|
|
148
|
+
@change="onCustomTextChange(customField, $event)"
|
|
149
|
+
/>
|
|
141
150
|
<pre v-else>
|
|
142
151
|
label: {{ label }}
|
|
143
152
|
key: {{ fieldKey }}
|
|
@@ -156,6 +165,7 @@ import City from './form/fields/city.vue';
|
|
|
156
165
|
import CountryCode from './form/fields/country.vue';
|
|
157
166
|
import CustomBoolean from './form/fields/custom-boolean.vue';
|
|
158
167
|
import CustomSelect from './form/fields/custom-select.vue';
|
|
168
|
+
import CustomText from './form/fields/custom-text.vue';
|
|
159
169
|
import FamilyName from './form/fields/family-name.vue';
|
|
160
170
|
import FormLabel from './form/common/form-label.vue';
|
|
161
171
|
import GivenName from './form/fields/given-name.vue';
|
|
@@ -177,6 +187,7 @@ export default {
|
|
|
177
187
|
CountryCode,
|
|
178
188
|
CustomSelect,
|
|
179
189
|
CustomBoolean,
|
|
190
|
+
CustomText,
|
|
180
191
|
FamilyName,
|
|
181
192
|
FormLabel,
|
|
182
193
|
GivenName,
|
|
@@ -208,7 +219,7 @@ export default {
|
|
|
208
219
|
type: String,
|
|
209
220
|
required: true,
|
|
210
221
|
validator(value) {
|
|
211
|
-
return ['built-in', 'custom-select', 'custom-boolean'].includes(value);
|
|
222
|
+
return ['built-in', 'custom-select', 'custom-boolean', 'custom-text'].includes(value);
|
|
212
223
|
},
|
|
213
224
|
},
|
|
214
225
|
required: {
|
|
@@ -266,7 +277,20 @@ export default {
|
|
|
266
277
|
*/
|
|
267
278
|
customField() {
|
|
268
279
|
const { fieldId, user, type } = this;
|
|
269
|
-
|
|
280
|
+
|
|
281
|
+
let key = 'customSelectFieldAnswers';
|
|
282
|
+
|
|
283
|
+
switch (type) {
|
|
284
|
+
case 'custom-text':
|
|
285
|
+
key = 'customTextFieldAnswers';
|
|
286
|
+
break;
|
|
287
|
+
case 'custom-boolean':
|
|
288
|
+
key = 'customBooleanFieldAnswers';
|
|
289
|
+
break;
|
|
290
|
+
// ... more cases
|
|
291
|
+
default:
|
|
292
|
+
// Code to execute if no case matches the expression
|
|
293
|
+
}
|
|
270
294
|
const found = user[key].find((ans) => ans.id === fieldId);
|
|
271
295
|
return found;
|
|
272
296
|
},
|
|
@@ -341,6 +365,19 @@ export default {
|
|
|
341
365
|
field.answers.push(...ids.map((id) => ({ id })));
|
|
342
366
|
}
|
|
343
367
|
},
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
*
|
|
371
|
+
*/
|
|
372
|
+
onCustomTextChange(field, $event) {
|
|
373
|
+
// hack to prevent on focus out with no value from resetting value
|
|
374
|
+
// @todo find a better solution!!!
|
|
375
|
+
const value = $event === '' && field.value !== '' ? field.value : $event;
|
|
376
|
+
this.customField.value = $event;
|
|
377
|
+
// eslint-disable-next-line max-len
|
|
378
|
+
const customTextFieldAnswers = this.user.customTextFieldAnswers.map((obj) => (obj.id === field.id ? { ...obj, value, hasAnswered: value !== '' } : obj));
|
|
379
|
+
this.user.customTextFieldAnswers = customTextFieldAnswers;
|
|
380
|
+
},
|
|
344
381
|
},
|
|
345
382
|
};
|
|
346
383
|
</script>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
-
marko_componentType = "/@mindful-web/marko-web-identity-x$1.
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-identity-x$1.31.2/components/access.marko",
|
|
6
6
|
marko_component = require("./access.marko"),
|
|
7
7
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
8
8
|
module_objectPath_module = require("@mindful-web/object-path"),
|
|
@@ -53,7 +53,7 @@ marko_template._ = marko_renderer(render, {
|
|
|
53
53
|
}, marko_component);
|
|
54
54
|
|
|
55
55
|
marko_template.meta = {
|
|
56
|
-
id: "/@mindful-web/marko-web-identity-x$1.
|
|
56
|
+
id: "/@mindful-web/marko-web-identity-x$1.31.2/components/access.marko",
|
|
57
57
|
component: "./access.marko",
|
|
58
58
|
tags: [
|
|
59
59
|
"@mindful-web/marko-core/components/resolve.marko"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
-
marko_componentType = "/@mindful-web/marko-web-identity-x$1.
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-identity-x$1.31.2/components/comment-stream.marko",
|
|
6
6
|
marko_component = require("./comment-stream.marko"),
|
|
7
7
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
8
8
|
module_objectPath_module = require("@mindful-web/object-path"),
|
|
@@ -77,7 +77,7 @@ marko_template._ = marko_renderer(render, {
|
|
|
77
77
|
}, marko_component);
|
|
78
78
|
|
|
79
79
|
marko_template.meta = {
|
|
80
|
-
id: "/@mindful-web/marko-web-identity-x$1.
|
|
80
|
+
id: "/@mindful-web/marko-web-identity-x$1.31.2/components/comment-stream.marko",
|
|
81
81
|
component: "./comment-stream.marko",
|
|
82
82
|
tags: [
|
|
83
83
|
"@mindful-web/marko-web/components/browser-component.marko",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
-
marko_componentType = "/@mindful-web/marko-web-identity-x$1.
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-identity-x$1.31.2/components/context.marko",
|
|
6
6
|
marko_component = require("./context.marko"),
|
|
7
7
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
8
8
|
marko_dynamicTag = require("marko/dist/runtime/helpers/dynamic-tag"),
|
|
@@ -49,7 +49,7 @@ marko_template._ = marko_renderer(render, {
|
|
|
49
49
|
}, marko_component);
|
|
50
50
|
|
|
51
51
|
marko_template.meta = {
|
|
52
|
-
id: "/@mindful-web/marko-web-identity-x$1.
|
|
52
|
+
id: "/@mindful-web/marko-web-identity-x$1.31.2/components/context.marko",
|
|
53
53
|
component: "./context.marko",
|
|
54
54
|
tags: [
|
|
55
55
|
"@mindful-web/marko-core/components/resolve.marko"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
-
marko_componentType = "/@mindful-web/marko-web-identity-x$1.
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-identity-x$1.31.2/components/form-access.marko",
|
|
6
6
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
7
7
|
module_defaultValue = require("@mindful-web/marko-core/utils/default-value"),
|
|
8
8
|
defaultValue = module_defaultValue.default || module_defaultValue,
|
|
@@ -114,7 +114,7 @@ marko_template._ = marko_renderer(render, {
|
|
|
114
114
|
});
|
|
115
115
|
|
|
116
116
|
marko_template.meta = {
|
|
117
|
-
id: "/@mindful-web/marko-web-identity-x$1.
|
|
117
|
+
id: "/@mindful-web/marko-web-identity-x$1.31.2/components/form-access.marko",
|
|
118
118
|
tags: [
|
|
119
119
|
"@mindful-web/marko-web/components/browser-component.marko"
|
|
120
120
|
]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
-
marko_componentType = "/@mindful-web/marko-web-identity-x$1.
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-identity-x$1.31.2/components/form-authenticate.marko",
|
|
6
6
|
marko_component = require("./form-authenticate.marko"),
|
|
7
7
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
8
8
|
module_objectPath_module = require("@mindful-web/object-path"),
|
|
@@ -68,7 +68,7 @@ marko_template._ = marko_renderer(render, {
|
|
|
68
68
|
}, marko_component);
|
|
69
69
|
|
|
70
70
|
marko_template.meta = {
|
|
71
|
-
id: "/@mindful-web/marko-web-identity-x$1.
|
|
71
|
+
id: "/@mindful-web/marko-web-identity-x$1.31.2/components/form-authenticate.marko",
|
|
72
72
|
component: "./form-authenticate.marko",
|
|
73
73
|
tags: [
|
|
74
74
|
"@mindful-web/marko-web/components/browser-component.marko",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
-
marko_componentType = "/@mindful-web/marko-web-identity-x$1.
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-identity-x$1.31.2/components/form-change-email.marko",
|
|
6
6
|
marko_component = require("./form-change-email.marko"),
|
|
7
7
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
8
8
|
module_objectPath_module = require("@mindful-web/object-path"),
|
|
@@ -59,7 +59,7 @@ marko_template._ = marko_renderer(render, {
|
|
|
59
59
|
}, marko_component);
|
|
60
60
|
|
|
61
61
|
marko_template.meta = {
|
|
62
|
-
id: "/@mindful-web/marko-web-identity-x$1.
|
|
62
|
+
id: "/@mindful-web/marko-web-identity-x$1.31.2/components/form-change-email.marko",
|
|
63
63
|
component: "./form-change-email.marko",
|
|
64
64
|
tags: [
|
|
65
65
|
"@mindful-web/marko-web/components/browser-component.marko",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
-
marko_componentType = "/@mindful-web/marko-web-identity-x$1.
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-identity-x$1.31.2/components/form-login.marko",
|
|
6
6
|
marko_component = require("./form-login.marko"),
|
|
7
7
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
8
8
|
module_objectPath_module = require("@mindful-web/object-path"),
|
|
@@ -87,7 +87,7 @@ marko_template._ = marko_renderer(render, {
|
|
|
87
87
|
}, marko_component);
|
|
88
88
|
|
|
89
89
|
marko_template.meta = {
|
|
90
|
-
id: "/@mindful-web/marko-web-identity-x$1.
|
|
90
|
+
id: "/@mindful-web/marko-web-identity-x$1.31.2/components/form-login.marko",
|
|
91
91
|
component: "./form-login.marko",
|
|
92
92
|
tags: [
|
|
93
93
|
"@mindful-web/marko-web/components/browser-component.marko",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
-
marko_componentType = "/@mindful-web/marko-web-identity-x$1.
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-identity-x$1.31.2/components/form-logout.marko",
|
|
6
6
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
7
7
|
module_defaultValue = require("@mindful-web/marko-core/utils/default-value"),
|
|
8
8
|
defaultValue = module_defaultValue.default || module_defaultValue,
|
|
@@ -29,7 +29,7 @@ marko_template._ = marko_renderer(render, {
|
|
|
29
29
|
});
|
|
30
30
|
|
|
31
31
|
marko_template.meta = {
|
|
32
|
-
id: "/@mindful-web/marko-web-identity-x$1.
|
|
32
|
+
id: "/@mindful-web/marko-web-identity-x$1.31.2/components/form-logout.marko",
|
|
33
33
|
tags: [
|
|
34
34
|
"@mindful-web/marko-web/components/browser-component.marko"
|
|
35
35
|
]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
-
marko_componentType = "/@mindful-web/marko-web-identity-x$1.
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-identity-x$1.31.2/components/form-profile.marko",
|
|
6
6
|
marko_component = require("./form-profile.marko"),
|
|
7
7
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
8
8
|
module_objectPath_module = require("@mindful-web/object-path"),
|
|
@@ -73,7 +73,7 @@ marko_template._ = marko_renderer(render, {
|
|
|
73
73
|
}, marko_component);
|
|
74
74
|
|
|
75
75
|
marko_template.meta = {
|
|
76
|
-
id: "/@mindful-web/marko-web-identity-x$1.
|
|
76
|
+
id: "/@mindful-web/marko-web-identity-x$1.31.2/components/form-profile.marko",
|
|
77
77
|
component: "./form-profile.marko",
|
|
78
78
|
tags: [
|
|
79
79
|
"@mindful-web/marko-web/components/browser-component.marko",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
-
marko_componentType = "/@mindful-web/marko-web-identity-x$1.
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-identity-x$1.31.2/components/form-register.marko",
|
|
6
6
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
7
7
|
marko_assign = require("marko/dist/runtime/helpers/assign"),
|
|
8
8
|
marko_web_identity_x_form_login_template = require("./form-login.marko"),
|
|
@@ -25,7 +25,7 @@ marko_template._ = marko_renderer(render, {
|
|
|
25
25
|
});
|
|
26
26
|
|
|
27
27
|
marko_template.meta = {
|
|
28
|
-
id: "/@mindful-web/marko-web-identity-x$1.
|
|
28
|
+
id: "/@mindful-web/marko-web-identity-x$1.31.2/components/form-register.marko",
|
|
29
29
|
tags: [
|
|
30
30
|
"./form-login.marko"
|
|
31
31
|
]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
-
marko_componentType = "/@mindful-web/marko-web-identity-x$1.
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-identity-x$1.31.2/components/identify.marko",
|
|
6
6
|
marko_component = require("./identify.marko"),
|
|
7
7
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
8
8
|
module_objectPath_module = require("@mindful-web/object-path"),
|
|
@@ -50,7 +50,7 @@ marko_template._ = marko_renderer(render, {
|
|
|
50
50
|
}, marko_component);
|
|
51
51
|
|
|
52
52
|
marko_template.meta = {
|
|
53
|
-
id: "/@mindful-web/marko-web-identity-x$1.
|
|
53
|
+
id: "/@mindful-web/marko-web-identity-x$1.31.2/components/identify.marko",
|
|
54
54
|
component: "./identify.marko",
|
|
55
55
|
tags: [
|
|
56
56
|
"@mindful-web/marko-web-gtm/components/push.marko",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
-
marko_componentType = "/@mindful-web/marko-web-identity-x$1.
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-identity-x$1.31.2/components/non-auth-identify.marko",
|
|
6
6
|
marko_component = require("./non-auth-identify.marko"),
|
|
7
7
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
8
8
|
marko_dynamicTag = require("marko/dist/runtime/helpers/dynamic-tag"),
|
|
@@ -45,7 +45,7 @@ marko_template._ = marko_renderer(render, {
|
|
|
45
45
|
}, marko_component);
|
|
46
46
|
|
|
47
47
|
marko_template.meta = {
|
|
48
|
-
id: "/@mindful-web/marko-web-identity-x$1.
|
|
48
|
+
id: "/@mindful-web/marko-web-identity-x$1.31.2/components/non-auth-identify.marko",
|
|
49
49
|
component: "./non-auth-identify.marko",
|
|
50
50
|
tags: [
|
|
51
51
|
"@mindful-web/marko-core/components/resolve.marko"
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
|
|
4
4
|
var marko_template = module.exports = require("marko/dist/html").t(__filename),
|
|
5
|
-
marko_componentType = "/@mindful-web/marko-web-identity-x$1.
|
|
5
|
+
marko_componentType = "/@mindful-web/marko-web-identity-x$1.31.2/components/subscribe.marko",
|
|
6
6
|
marko_component = require("./subscribe.marko"),
|
|
7
7
|
marko_renderer = require("marko/dist/runtime/components/renderer"),
|
|
8
8
|
module_objectPath_module = require("@mindful-web/object-path"),
|
|
@@ -73,7 +73,7 @@ marko_template._ = marko_renderer(render, {
|
|
|
73
73
|
}, marko_component);
|
|
74
74
|
|
|
75
75
|
marko_template.meta = {
|
|
76
|
-
id: "/@mindful-web/marko-web-identity-x$1.
|
|
76
|
+
id: "/@mindful-web/marko-web-identity-x$1.31.2/components/subscribe.marko",
|
|
77
77
|
component: "./subscribe.marko",
|
|
78
78
|
tags: [
|
|
79
79
|
"@mindful-web/marko-web/components/browser-component.marko",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindful-web/marko-web-identity-x",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.31.2",
|
|
4
4
|
"description": "Marko Wrapper for IdentityX",
|
|
5
5
|
"repository": "https://github.com/parameter1/mindful-web/tree/main/packages/marko-web-identity-x",
|
|
6
6
|
"author": "Josh Worden <josh@parameter1.com>",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
"publishConfig": {
|
|
38
38
|
"access": "public"
|
|
39
39
|
},
|
|
40
|
-
"gitHead": "
|
|
40
|
+
"gitHead": "b939602557484645950c536d00366b76e9ea8fca"
|
|
41
41
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const { get } = require('@mindful-web/object-path');
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
// eslint-disable-next-line max-len
|
|
4
|
+
const hasAnswered = (ans) => ans && ans.hasAnswered && (ans.value || (ans.answers && ans.answers.length));
|
|
4
5
|
|
|
5
6
|
const hasMappedAnswers = (map) => (id) => {
|
|
6
7
|
const ans = map.get(id);
|
|
@@ -30,15 +31,15 @@ module.exports = ({ appUser, body, definitions }) => {
|
|
|
30
31
|
return set;
|
|
31
32
|
}, new Set())];
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
const requiredCustomTexts = [...definitions.reduce((set, def) => {
|
|
35
|
+
if (def.type === 'custom-text') set.add(def.id);
|
|
36
|
+
return set;
|
|
37
|
+
}, new Set())];
|
|
37
38
|
|
|
38
39
|
const userCustomFieldAnswers = new Map([
|
|
39
40
|
// ...(get(appUser, 'customBooleanFieldAnswers') || []).map((a) => [a.field.id, a]),
|
|
40
41
|
...(get(appUser, 'customSelectFieldAnswers') || []).map((a) => [a.field.id, a]),
|
|
41
|
-
|
|
42
|
+
...(get(appUser, 'customTextFieldAnswers') || []).map((a) => [a.field.id, a]),
|
|
42
43
|
]);
|
|
43
44
|
|
|
44
45
|
const customFieldAnswers = new Map([
|
|
@@ -46,8 +47,8 @@ module.exports = ({ appUser, body, definitions }) => {
|
|
|
46
47
|
// ...(get(body, 'customBooleanFieldAnswers') || [])
|
|
47
48
|
// .filter(hasAnswered).map((a) => [a.field.id, a]),
|
|
48
49
|
...(get(body, 'customSelectFieldAnswers') || []).filter(hasAnswered).map((a) => [a.field.id, a]),
|
|
49
|
-
|
|
50
|
-
|
|
50
|
+
...(get(body, 'customTextFieldAnswers') || [])
|
|
51
|
+
.filter(hasAnswered).map((a) => [a.field.id, a]),
|
|
51
52
|
]);
|
|
52
53
|
|
|
53
54
|
const appUserHasAllRequiredFields = [
|
|
@@ -58,9 +59,9 @@ module.exports = ({ appUser, body, definitions }) => {
|
|
|
58
59
|
// (id) => userCustomFieldAnswers.has(id) && userCustomFieldAnswers.get(id).hasAnswered,
|
|
59
60
|
// ),
|
|
60
61
|
requiredCustomSelects.every(hasMappedAnswers(userCustomFieldAnswers)),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
requiredCustomTexts.every(
|
|
63
|
+
(id) => userCustomFieldAnswers.has(id) && userCustomFieldAnswers.get(id).hasAnswered,
|
|
64
|
+
),
|
|
64
65
|
].every((v) => v);
|
|
65
66
|
|
|
66
67
|
const hasAllRequiredFields = [
|
|
@@ -69,7 +70,7 @@ module.exports = ({ appUser, body, definitions }) => {
|
|
|
69
70
|
),
|
|
70
71
|
// requiredCustomBooleans.every(hasMappedAnswers(customFieldAnswers)),
|
|
71
72
|
requiredCustomSelects.every(hasMappedAnswers(customFieldAnswers)),
|
|
72
|
-
|
|
73
|
+
requiredCustomTexts.every(hasMappedAnswers(customFieldAnswers)),
|
|
73
74
|
].every((v) => v);
|
|
74
75
|
|
|
75
76
|
const payload = {
|
|
@@ -89,7 +90,15 @@ module.exports = ({ appUser, body, definitions }) => {
|
|
|
89
90
|
...(writeInValues && { writeInValues }),
|
|
90
91
|
};
|
|
91
92
|
}),
|
|
92
|
-
|
|
93
|
+
customTextFieldAnswers: requiredCustomTexts
|
|
94
|
+
.filter(hasMappedAnswers(customFieldAnswers))
|
|
95
|
+
.map((id) => {
|
|
96
|
+
const answer = customFieldAnswers.get(id);
|
|
97
|
+
return {
|
|
98
|
+
fieldId: answer.field.id,
|
|
99
|
+
value: answer.value,
|
|
100
|
+
};
|
|
101
|
+
}), // @todo
|
|
93
102
|
};
|
|
94
103
|
|
|
95
104
|
return {
|