@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/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 newSteps = newStepOrder.map((stepId) => ({ id: stepId }));
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@heycater/qualification-funnel",
3
- "version": "1.19.0",
3
+ "version": "1.19.2",
4
4
  "type": "module",
5
5
  "description": "Heycater embedded qualification funnel widget",
6
6
  "main": "dist/index.cjs.js",