@heycater/qualification-funnel 1.19.0 → 1.19.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/dist/heycater-funnel.iife.js +2 -2
- package/dist/index.cjs.js +2 -2
- package/dist/index.esm.js +14 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -7551,7 +7551,11 @@ function handleServiceTypeChange(state, answer) {
|
|
|
7551
7551
|
return state;
|
|
7552
7552
|
}
|
|
7553
7553
|
const newStepOrder = getStepOrderForServiceType(serviceType);
|
|
7554
|
-
const
|
|
7554
|
+
const existingSteps = state.qualification.steps;
|
|
7555
|
+
const newSteps = newStepOrder.map((stepId) => {
|
|
7556
|
+
const existingStep = existingSteps.find((s3) => s3.id === stepId);
|
|
7557
|
+
return existingStep ? { ...existingStep } : { id: stepId };
|
|
7558
|
+
});
|
|
7555
7559
|
return {
|
|
7556
7560
|
...state,
|
|
7557
7561
|
qualification: {
|
|
@@ -8415,6 +8419,7 @@ function answerDefaultValue(question, state, actions) {
|
|
|
8415
8419
|
}
|
|
8416
8420
|
}
|
|
8417
8421
|
function isDataInStorageInvalid(data) {
|
|
8422
|
+
var _a2, _b;
|
|
8418
8423
|
try {
|
|
8419
8424
|
const validator = yup.object({
|
|
8420
8425
|
qualification: yup.object({
|
|
@@ -8427,6 +8432,14 @@ function isDataInStorageInvalid(data) {
|
|
|
8427
8432
|
})
|
|
8428
8433
|
});
|
|
8429
8434
|
validator.validateSync(data);
|
|
8435
|
+
const cityItems = cityQuestion.getItems({});
|
|
8436
|
+
if (cityItems.length === 1) {
|
|
8437
|
+
const storedData = data;
|
|
8438
|
+
const cityStep2 = (_b = (_a2 = storedData.qualification) == null ? void 0 : _a2.steps) == null ? void 0 : _b.find((s3) => s3.id === "city");
|
|
8439
|
+
if (cityStep2 && !cityStep2.disabled) {
|
|
8440
|
+
return true;
|
|
8441
|
+
}
|
|
8442
|
+
}
|
|
8430
8443
|
return false;
|
|
8431
8444
|
} catch {
|
|
8432
8445
|
return true;
|