@inspirer-dev/crm-dashboard 1.0.96 → 1.0.97

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.
@@ -108,6 +108,15 @@ export const TRIGGER_PARAMS: TriggerParamDef[] = [
108
108
  placeholder: '0',
109
109
  stageTypes: ['modal', 'side_hint'],
110
110
  },
111
+ {
112
+ key: 'depositCount',
113
+ label: 'Номер депозита',
114
+ description: 'Срабатывает строго на N-й успешный депозит (точное совпадение)',
115
+ unit: '',
116
+ min: 1,
117
+ placeholder: '2',
118
+ stageTypes: ['modal', 'side_hint'],
119
+ },
111
120
  ];
112
121
 
113
122
  export const STAGE_TYPE_LABELS: Record<string, string> = {
@@ -357,10 +357,12 @@ const TriggerParamsField = forwardRef<HTMLDivElement, TriggerParamsFieldProps>(
357
357
  };
358
358
 
359
359
  const addParamToGroup = (idx: number, key: string) => {
360
- // depositSuccess is an event trigger whose value is an optional min amount
361
- // (0 = any). Default it to 0 so just adding it persists (serialize drops
362
- // null), instead of silently requiring the user to type a value.
363
- const defaultValue = key === 'depositSuccess' ? 0 : null;
360
+ // Event triggers carry a value that must persist the moment they're added
361
+ // (serialize drops null), so seed a sensible default instead of silently
362
+ // requiring the user to type one: depositSuccess 0 = "any amount",
363
+ // depositCount 1 = "1st deposit".
364
+ const defaultOnAdd: Record<string, number> = { depositSuccess: 0, depositCount: 1 };
365
+ const defaultValue = key in defaultOnAdd ? defaultOnAdd[key] : null;
364
366
  const next = groups.map((g, i) => (i === idx ? { ...g, [key]: defaultValue } : g));
365
367
  update(next);
366
368
  };
@@ -102,6 +102,15 @@ const TRIGGER_PARAMS = [
102
102
  min: 0,
103
103
  placeholder: "0",
104
104
  stageTypes: ["modal", "side_hint"]
105
+ },
106
+ {
107
+ key: "depositCount",
108
+ label: "Номер депозита",
109
+ description: "Срабатывает строго на N-й успешный депозит (точное совпадение)",
110
+ unit: "",
111
+ min: 1,
112
+ placeholder: "2",
113
+ stageTypes: ["modal", "side_hint"]
105
114
  }
106
115
  ];
107
116
  const STAGE_TYPE_LABELS = {
@@ -358,7 +367,8 @@ const TriggerParamsField = forwardRef(
358
367
  update(next.length > 0 ? next : [{}]);
359
368
  };
360
369
  const addParamToGroup = (idx, key) => {
361
- const defaultValue = key === "depositSuccess" ? 0 : null;
370
+ const defaultOnAdd = { depositSuccess: 0, depositCount: 1 };
371
+ const defaultValue = key in defaultOnAdd ? defaultOnAdd[key] : null;
362
372
  const next = groups.map((g, i) => i === idx ? { ...g, [key]: defaultValue } : g);
363
373
  update(next);
364
374
  };
@@ -106,6 +106,15 @@ const TRIGGER_PARAMS = [
106
106
  min: 0,
107
107
  placeholder: "0",
108
108
  stageTypes: ["modal", "side_hint"]
109
+ },
110
+ {
111
+ key: "depositCount",
112
+ label: "Номер депозита",
113
+ description: "Срабатывает строго на N-й успешный депозит (точное совпадение)",
114
+ unit: "",
115
+ min: 1,
116
+ placeholder: "2",
117
+ stageTypes: ["modal", "side_hint"]
109
118
  }
110
119
  ];
111
120
  const STAGE_TYPE_LABELS = {
@@ -362,7 +371,8 @@ const TriggerParamsField = React.forwardRef(
362
371
  update(next.length > 0 ? next : [{}]);
363
372
  };
364
373
  const addParamToGroup = (idx, key) => {
365
- const defaultValue = key === "depositSuccess" ? 0 : null;
374
+ const defaultOnAdd = { depositSuccess: 0, depositCount: 1 };
375
+ const defaultValue = key in defaultOnAdd ? defaultOnAdd[key] : null;
366
376
  const next = groups.map((g, i) => i === idx ? { ...g, [key]: defaultValue } : g);
367
377
  update(next);
368
378
  };
@@ -155,7 +155,7 @@ const index = {
155
155
  components: {
156
156
  Input: async () => Promise.resolve().then(() => require(
157
157
  /* webpackChunkName: "crm-trigger-params" */
158
- "../_chunks/index-C5C6nrJp.js"
158
+ "../_chunks/index-Bw4JD4Cy.js"
159
159
  ))
160
160
  },
161
161
  options: {
@@ -154,7 +154,7 @@ const index = {
154
154
  components: {
155
155
  Input: async () => import(
156
156
  /* webpackChunkName: "crm-trigger-params" */
157
- "../_chunks/index-nITpyOIQ.mjs"
157
+ "../_chunks/index-B6p8h4bP.mjs"
158
158
  )
159
159
  },
160
160
  options: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inspirer-dev/crm-dashboard",
3
- "version": "1.0.96",
3
+ "version": "1.0.97",
4
4
  "description": "CRM Dashboard and Tools",
5
5
  "strapi": {
6
6
  "name": "crm-dashboard",