@inspirer-dev/crm-dashboard 1.0.94 → 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.
@@ -99,6 +99,24 @@ export const TRIGGER_PARAMS: TriggerParamDef[] = [
99
99
  placeholder: '250',
100
100
  stageTypes: ['modal', 'side_hint', 'retry'],
101
101
  },
102
+ {
103
+ key: 'depositSuccess',
104
+ label: 'Пополнение депозита',
105
+ description: 'Срабатывает после успешного пополнения; значение = мин. сумма (0 = любая)',
106
+ unit: '₽',
107
+ min: 0,
108
+ placeholder: '0',
109
+ stageTypes: ['modal', 'side_hint'],
110
+ },
111
+ {
112
+ key: 'depositCount',
113
+ label: 'Номер депозита',
114
+ description: 'Срабатывает строго на N-й успешный депозит (точное совпадение)',
115
+ unit: '',
116
+ min: 1,
117
+ placeholder: '2',
118
+ stageTypes: ['modal', 'side_hint'],
119
+ },
102
120
  ];
103
121
 
104
122
  export const STAGE_TYPE_LABELS: Record<string, string> = {
@@ -357,7 +357,13 @@ const TriggerParamsField = forwardRef<HTMLDivElement, TriggerParamsFieldProps>(
357
357
  };
358
358
 
359
359
  const addParamToGroup = (idx: number, key: string) => {
360
- const next = groups.map((g, i) => (i === idx ? { ...g, [key]: null } : g));
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;
366
+ const next = groups.map((g, i) => (i === idx ? { ...g, [key]: defaultValue } : g));
361
367
  update(next);
362
368
  };
363
369
 
@@ -93,6 +93,24 @@ const TRIGGER_PARAMS = [
93
93
  min: 0,
94
94
  placeholder: "250",
95
95
  stageTypes: ["modal", "side_hint", "retry"]
96
+ },
97
+ {
98
+ key: "depositSuccess",
99
+ label: "Пополнение депозита",
100
+ description: "Срабатывает после успешного пополнения; значение = мин. сумма (0 = любая)",
101
+ unit: "₽",
102
+ min: 0,
103
+ placeholder: "0",
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"]
96
114
  }
97
115
  ];
98
116
  const STAGE_TYPE_LABELS = {
@@ -349,7 +367,9 @@ const TriggerParamsField = forwardRef(
349
367
  update(next.length > 0 ? next : [{}]);
350
368
  };
351
369
  const addParamToGroup = (idx, key) => {
352
- const next = groups.map((g, i) => i === idx ? { ...g, [key]: null } : g);
370
+ const defaultOnAdd = { depositSuccess: 0, depositCount: 1 };
371
+ const defaultValue = key in defaultOnAdd ? defaultOnAdd[key] : null;
372
+ const next = groups.map((g, i) => i === idx ? { ...g, [key]: defaultValue } : g);
353
373
  update(next);
354
374
  };
355
375
  const removeParamFromGroup = (idx, key) => {
@@ -97,6 +97,24 @@ const TRIGGER_PARAMS = [
97
97
  min: 0,
98
98
  placeholder: "250",
99
99
  stageTypes: ["modal", "side_hint", "retry"]
100
+ },
101
+ {
102
+ key: "depositSuccess",
103
+ label: "Пополнение депозита",
104
+ description: "Срабатывает после успешного пополнения; значение = мин. сумма (0 = любая)",
105
+ unit: "₽",
106
+ min: 0,
107
+ placeholder: "0",
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"]
100
118
  }
101
119
  ];
102
120
  const STAGE_TYPE_LABELS = {
@@ -353,7 +371,9 @@ const TriggerParamsField = React.forwardRef(
353
371
  update(next.length > 0 ? next : [{}]);
354
372
  };
355
373
  const addParamToGroup = (idx, key) => {
356
- const next = groups.map((g, i) => i === idx ? { ...g, [key]: null } : g);
374
+ const defaultOnAdd = { depositSuccess: 0, depositCount: 1 };
375
+ const defaultValue = key in defaultOnAdd ? defaultOnAdd[key] : null;
376
+ const next = groups.map((g, i) => i === idx ? { ...g, [key]: defaultValue } : g);
357
377
  update(next);
358
378
  };
359
379
  const removeParamFromGroup = (idx, key) => {
@@ -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-BqcFfrh8.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-CKr1VvX0.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.94",
3
+ "version": "1.0.97",
4
4
  "description": "CRM Dashboard and Tools",
5
5
  "strapi": {
6
6
  "name": "crm-dashboard",