@beabee/beabee-common 1.18.0-alpha.8 → 1.18.0-alpha.9
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.
|
@@ -10,7 +10,7 @@ function convertValuesToOptions(values) {
|
|
|
10
10
|
}
|
|
11
11
|
function convertComponentToFilter(component) {
|
|
12
12
|
const baseItem = {
|
|
13
|
-
label: component.label || component.
|
|
13
|
+
label: component.label || component.fullKey,
|
|
14
14
|
nullable: true,
|
|
15
15
|
};
|
|
16
16
|
switch (component.type) {
|
|
@@ -74,16 +74,9 @@ function getCalloutComponents(formSchema) {
|
|
|
74
74
|
}
|
|
75
75
|
exports.getCalloutComponents = getCalloutComponents;
|
|
76
76
|
function getCalloutFilters(formSchema) {
|
|
77
|
-
const items = formSchema
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
.map((c) => {
|
|
81
|
-
return [
|
|
82
|
-
`answers.${slide.id}.${c.key}`,
|
|
83
|
-
convertComponentToFilter(c),
|
|
84
|
-
];
|
|
85
|
-
});
|
|
86
|
-
});
|
|
77
|
+
const items = getCalloutComponents(formSchema)
|
|
78
|
+
.filter((c) => c.input)
|
|
79
|
+
.map((c) => [`answers.${c.fullKey}`, convertComponentToFilter(c)]);
|
|
87
80
|
return Object.fromEntries(items);
|
|
88
81
|
}
|
|
89
82
|
exports.getCalloutFilters = getCalloutFilters;
|
|
@@ -7,7 +7,7 @@ function convertValuesToOptions(values) {
|
|
|
7
7
|
}
|
|
8
8
|
function convertComponentToFilter(component) {
|
|
9
9
|
const baseItem = {
|
|
10
|
-
label: component.label || component.
|
|
10
|
+
label: component.label || component.fullKey,
|
|
11
11
|
nullable: true,
|
|
12
12
|
};
|
|
13
13
|
switch (component.type) {
|
|
@@ -68,16 +68,9 @@ export function getCalloutComponents(formSchema) {
|
|
|
68
68
|
})));
|
|
69
69
|
}
|
|
70
70
|
export function getCalloutFilters(formSchema) {
|
|
71
|
-
const items = formSchema
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
.map((c) => {
|
|
75
|
-
return [
|
|
76
|
-
`answers.${slide.id}.${c.key}`,
|
|
77
|
-
convertComponentToFilter(c),
|
|
78
|
-
];
|
|
79
|
-
});
|
|
80
|
-
});
|
|
71
|
+
const items = getCalloutComponents(formSchema)
|
|
72
|
+
.filter((c) => c.input)
|
|
73
|
+
.map((c) => [`answers.${c.fullKey}`, convertComponentToFilter(c)]);
|
|
81
74
|
return Object.fromEntries(items);
|
|
82
75
|
}
|
|
83
76
|
export function isAddressAnswer(answer) {
|
|
@@ -66,4 +66,4 @@ export type CalloutResponseAnswer = string | boolean | number | null | undefined
|
|
|
66
66
|
/**
|
|
67
67
|
* Answers are grouped by slide key: {[slideId]: {[componentKey]: answer | answer[]}}
|
|
68
68
|
*/
|
|
69
|
-
export type CalloutResponseAnswers = Record<string, Record<string, CalloutResponseAnswer | CalloutResponseAnswer[]
|
|
69
|
+
export type CalloutResponseAnswers = Record<string, Record<string, CalloutResponseAnswer | CalloutResponseAnswer[]> | undefined>;
|