@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.
@@ -22,6 +22,7 @@ export type ProcessedCLXFormLayout = {
22
22
  form: CLXForm;
23
23
  steps: ProcessedCLXFormStep[];
24
24
  stats?: FormStats;
25
+ gateSatisfiedEvent?: boolean;
25
26
  };
26
27
  export type FilteredCLXFormLayout = ProcessedCLXFormLayout & {
27
28
  usedSlugs: Set<string>;
@@ -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 = isCLXInternalUser || isResponseBooleanTrue((_a = layout.form.settings) === null || _a === void 0 ? void 0 : _a.gateSatisfiedResponseSlug);
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
- return { form: layout.form, steps: blockedByAi ? [] : steps, stats: gatherFormStats(steps) };
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,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@clxmedia/clxforms-client",
3
- "version": "1.1.8",
3
+ "version": "1.1.10",
4
4
  "description": "CLXperience Forms Client",
5
5
  "author": "Brandon Thompson <brandont@clxmedia.com>",
6
6
  "license": "MIT",