@clxmedia/clxforms-client 1.1.8 → 1.1.10
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/dist/layout-processor.js
CHANGED
|
@@ -102,13 +102,12 @@ const CLXFormLayoutProcessor = ({ mode, responseData, formRights }) => {
|
|
|
102
102
|
};
|
|
103
103
|
};
|
|
104
104
|
const process = (layout) => {
|
|
105
|
-
var _a;
|
|
106
105
|
if (mode === 'edit') {
|
|
107
106
|
return MockProcessor(layout);
|
|
108
107
|
}
|
|
109
108
|
let isGated = false;
|
|
110
109
|
const isCLXInternalUser = isResponseBooleanTrue('is_clxinternal_user');
|
|
111
|
-
const isGateSatisfied =
|
|
110
|
+
const isGateSatisfied = isResponseBooleanTrue(`cliq_form_gate_satisfied_${layout.form.slug}`);
|
|
112
111
|
let blockedByAi = false;
|
|
113
112
|
const steps = formRights === 'none'
|
|
114
113
|
? []
|
|
@@ -116,21 +115,22 @@ const CLXFormLayoutProcessor = ({ mode, responseData, formRights }) => {
|
|
|
116
115
|
.map(step => stepProcessor(step))
|
|
117
116
|
.filter(step => step.sections.length > 0)
|
|
118
117
|
.reduce((acc, step) => {
|
|
119
|
-
if (isGated && !isGateSatisfied) {
|
|
118
|
+
if (isGated && !isGateSatisfied && !isCLXInternalUser) {
|
|
120
119
|
return acc;
|
|
121
120
|
}
|
|
122
|
-
if (step.has_ai && !isGateSatisfied) {
|
|
121
|
+
if (step.has_ai && !isGateSatisfied && !isCLXInternalUser) {
|
|
123
122
|
blockedByAi = true;
|
|
124
123
|
return acc;
|
|
125
124
|
}
|
|
126
|
-
if (step.is_gate && !isGateSatisfied) {
|
|
125
|
+
if (step.is_gate && !isGateSatisfied && !isCLXInternalUser) {
|
|
127
126
|
isGated = !step.is_complete;
|
|
128
127
|
}
|
|
129
128
|
acc.push(step);
|
|
130
129
|
return acc;
|
|
131
130
|
}, [])
|
|
132
|
-
.filter(step => !step.is_gate || isGateSatisfied);
|
|
133
|
-
|
|
131
|
+
.filter(step => !step.is_gate || isGateSatisfied || isCLXInternalUser);
|
|
132
|
+
const gateSatisfiedEvent = !isGated && !isGateSatisfied;
|
|
133
|
+
return { form: layout.form, steps: blockedByAi ? [] : steps, stats: gatherFormStats(steps), gateSatisfiedEvent };
|
|
134
134
|
};
|
|
135
135
|
return {
|
|
136
136
|
process,
|