@drawbridge/components 0.1.16 → 0.1.18
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/bridge/form-subdomain-missions.js +54 -47
- package/dist/bridge/form-subdomain-missions.mjs +54 -47
- package/dist/bridge/template-layout.js +1 -1
- package/dist/bridge/template-layout.mjs +1 -1
- package/dist/bridge/template-modal.js +1 -1
- package/dist/bridge/template-modal.mjs +1 -1
- package/dist/dashboard/form-organization-campaign-agreement.js +2 -2
- package/dist/dashboard/form-organization-campaign-agreement.mjs +2 -2
- package/dist/dashboard/form-organization-workflow.js +548 -54
- package/dist/dashboard/form-organization-workflow.mjs +539 -54
- package/dist/dashboard/form-otc.js +7 -4
- package/dist/dashboard/form-otc.mjs +8 -5
- package/dist/dashboard/input-editor.js +56 -12
- package/dist/dashboard/input-editor.mjs +53 -11
- package/dist/dashboard/order-sections.js +23 -12
- package/dist/dashboard/order-sections.mjs +23 -12
- package/dist/dashboard/steps.js +5 -0
- package/dist/dashboard/steps.mjs +5 -0
- package/dist/dashboard/template-socket.js +6 -0
- package/dist/dashboard/template-socket.mjs +6 -0
- package/dist/input-code.js +2 -8
- package/dist/input-code.mjs +2 -8
- package/package.json +3 -3
- package/types/bridge/form-subdomain-missions.d.ts +1 -1
- package/types/dashboard/form-organization-workflow.d.ts +44 -0
- package/types/dashboard/input-editor.d.ts +9 -1
- package/types/dashboard/steps.d.ts +2 -0
- package/types/input-code.d.ts +0 -2
|
@@ -43,10 +43,10 @@ var import_missions = require("@drawbridge/drawbridge-utils/missions");
|
|
|
43
43
|
var import_button = __toESM(require("../shared/button"));
|
|
44
44
|
var import_copy_to_clipboard = __toESM(require("../shared/copy-to-clipboard"));
|
|
45
45
|
var import_error = __toESM(require("../shared/error"));
|
|
46
|
+
var import_form = __toESM(require("../shared/form"));
|
|
46
47
|
var import_check = __toESM(require("../icons/check"));
|
|
47
48
|
var import_chevron_left = __toESM(require("../icons/chevron-left"));
|
|
48
49
|
var import_chevron_right = __toESM(require("../icons/chevron-right"));
|
|
49
|
-
var import_loader = __toESM(require("../icons/loader"));
|
|
50
50
|
var import_input_group = __toESM(require("../input-group"));
|
|
51
51
|
var import_input_code = __toESM(require("../input-code"));
|
|
52
52
|
var import_share_button = __toESM(require("./share-button"));
|
|
@@ -107,7 +107,7 @@ const Back = ({ onClick, style }) => {
|
|
|
107
107
|
reverse: true,
|
|
108
108
|
variant: "link"
|
|
109
109
|
},
|
|
110
|
-
children: "Back
|
|
110
|
+
children: "Back"
|
|
111
111
|
}
|
|
112
112
|
)
|
|
113
113
|
}
|
|
@@ -131,29 +131,54 @@ const Strong = ({ children, className }) => /* @__PURE__ */ (0, import_jsx_runti
|
|
|
131
131
|
children
|
|
132
132
|
}
|
|
133
133
|
);
|
|
134
|
-
const CodeStep = ({
|
|
134
|
+
const CodeStep = ({ busy, error, onSubmit, style }) => {
|
|
135
135
|
const [code, setCode] = (0, import_react.useState)("");
|
|
136
|
-
return /* @__PURE__ */ (0, import_jsx_runtime.
|
|
137
|
-
|
|
136
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
137
|
+
import_form.default,
|
|
138
138
|
{
|
|
139
139
|
...{
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
140
|
+
className: "space-y-6",
|
|
141
|
+
onSubmit: (event) => {
|
|
142
|
+
event.preventDefault();
|
|
143
|
+
onSubmit(code);
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
children: [
|
|
147
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
148
|
+
import_input_group.default,
|
|
143
149
|
{
|
|
144
150
|
...{
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
+
error,
|
|
152
|
+
input: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
153
|
+
import_input_code.default,
|
|
154
|
+
{
|
|
155
|
+
...{
|
|
156
|
+
autoFocus: true,
|
|
157
|
+
disabled: busy,
|
|
158
|
+
onChange: setCode,
|
|
159
|
+
style,
|
|
160
|
+
value: code
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
),
|
|
164
|
+
label: "Verification code",
|
|
165
|
+
style
|
|
151
166
|
}
|
|
152
167
|
}
|
|
153
168
|
),
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
169
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
170
|
+
import_button.default,
|
|
171
|
+
{
|
|
172
|
+
...{
|
|
173
|
+
disabled: code.length !== 6,
|
|
174
|
+
loading: busy,
|
|
175
|
+
style,
|
|
176
|
+
type: "submit"
|
|
177
|
+
},
|
|
178
|
+
children: "Confirm"
|
|
179
|
+
}
|
|
180
|
+
)
|
|
181
|
+
]
|
|
157
182
|
}
|
|
158
183
|
);
|
|
159
184
|
};
|
|
@@ -288,30 +313,14 @@ const FormSubdomainMissions = ({
|
|
|
288
313
|
CodeStep,
|
|
289
314
|
{
|
|
290
315
|
...{
|
|
291
|
-
|
|
316
|
+
busy,
|
|
292
317
|
error,
|
|
293
|
-
|
|
318
|
+
onSubmit: confirm,
|
|
294
319
|
style
|
|
295
320
|
}
|
|
296
321
|
},
|
|
297
322
|
attempt
|
|
298
323
|
),
|
|
299
|
-
busy && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
300
|
-
"div",
|
|
301
|
-
{
|
|
302
|
-
...{
|
|
303
|
-
className: "flex justify-center"
|
|
304
|
-
},
|
|
305
|
-
children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
306
|
-
import_loader.default,
|
|
307
|
-
{
|
|
308
|
-
...{
|
|
309
|
-
className: "w-5 h-5 animate-spin"
|
|
310
|
-
}
|
|
311
|
-
}
|
|
312
|
-
)
|
|
313
|
-
}
|
|
314
|
-
),
|
|
315
324
|
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
316
325
|
"p",
|
|
317
326
|
{
|
|
@@ -403,14 +412,12 @@ const FormSubdomainMissions = ({
|
|
|
403
412
|
children: [
|
|
404
413
|
header("Thank you!"),
|
|
405
414
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Back, { ...{ onClick: back, style } }),
|
|
406
|
-
/* @__PURE__ */ (0, import_jsx_runtime.
|
|
407
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Strong, { children: "Mission accomplished!" }),
|
|
408
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", { children: "Your bonus entries are in. Go back to missions to earn more." })
|
|
409
|
-
] })
|
|
415
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Centre, { children: Number(item == null ? void 0 : item.entries) > 0 && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Strong, { children: "You've earned " + (0, import_missions.entriesText)(item.entries) }) })
|
|
410
416
|
]
|
|
411
417
|
}
|
|
412
418
|
);
|
|
413
|
-
|
|
419
|
+
const finished = screen === "start" && !message && !bonusText(items, completed);
|
|
420
|
+
if (screen === "start" && !finished) {
|
|
414
421
|
const bonus = bonusText(items, completed);
|
|
415
422
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
416
423
|
"div",
|
|
@@ -482,7 +489,7 @@ const FormSubdomainMissions = ({
|
|
|
482
489
|
className: "space-y-6"
|
|
483
490
|
},
|
|
484
491
|
children: [
|
|
485
|
-
header("Earn more entries", { onClick: () => go("start") }),
|
|
492
|
+
finished ? header(title) : header("Earn more entries", { onClick: () => go("start") }),
|
|
486
493
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
487
494
|
"ul",
|
|
488
495
|
{
|
|
@@ -494,9 +501,9 @@ const FormSubdomainMissions = ({
|
|
|
494
501
|
},
|
|
495
502
|
children: items.filter((row) => import_missions.missions[row.type]).map((row, index) => {
|
|
496
503
|
var _a2;
|
|
497
|
-
const
|
|
504
|
+
const done = completed.includes(row.type);
|
|
498
505
|
const opens = screenFor(row.type);
|
|
499
|
-
const Mark =
|
|
506
|
+
const Mark = done ? import_check.default : import_chevron_right.default;
|
|
500
507
|
const content = /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
|
|
501
508
|
"span",
|
|
502
509
|
{
|
|
@@ -508,10 +515,10 @@ const FormSubdomainMissions = ({
|
|
|
508
515
|
"span",
|
|
509
516
|
{
|
|
510
517
|
...{
|
|
511
|
-
className: "flex items-center gap-4 flex-1 min-w-0" + (
|
|
518
|
+
className: "flex items-center gap-4 flex-1 min-w-0" + (done ? " opacity-40" : "")
|
|
512
519
|
},
|
|
513
520
|
children: [
|
|
514
|
-
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Pill, { ...{ style }, children: pillText(row,
|
|
521
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(Pill, { ...{ style }, children: pillText(row, done) }),
|
|
515
522
|
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
516
523
|
"span",
|
|
517
524
|
{
|
|
@@ -524,7 +531,7 @@ const FormSubdomainMissions = ({
|
|
|
524
531
|
]
|
|
525
532
|
}
|
|
526
533
|
),
|
|
527
|
-
(
|
|
534
|
+
(done || opens !== "missions") && /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Pill, { ...{ style }, children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
528
535
|
Mark,
|
|
529
536
|
{
|
|
530
537
|
...{
|
|
@@ -544,7 +551,7 @@ const FormSubdomainMissions = ({
|
|
|
544
551
|
borderColor: "inherit"
|
|
545
552
|
}
|
|
546
553
|
},
|
|
547
|
-
children:
|
|
554
|
+
children: done || opens === "missions" ? content : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
548
555
|
import_button.default,
|
|
549
556
|
{
|
|
550
557
|
...{
|
|
@@ -6,10 +6,10 @@ import { CODE_CHANNELS, COMPLETIONS, entriesText, missions as manifests } from "
|
|
|
6
6
|
import Button from "../shared/button.mjs";
|
|
7
7
|
import CopyToClipboard from "../shared/copy-to-clipboard.mjs";
|
|
8
8
|
import Error from "../shared/error.mjs";
|
|
9
|
+
import Form from "../shared/form.mjs";
|
|
9
10
|
import Check from "../icons/check.mjs";
|
|
10
11
|
import ChevronLeft from "../icons/chevron-left.mjs";
|
|
11
12
|
import ChevronRight from "../icons/chevron-right.mjs";
|
|
12
|
-
import Loader from "../icons/loader.mjs";
|
|
13
13
|
import InputGroup from "../input-group.mjs";
|
|
14
14
|
import InputCode from "../input-code.mjs";
|
|
15
15
|
import ShareButton from "./share-button.mjs";
|
|
@@ -70,7 +70,7 @@ const Back = ({ onClick, style }) => {
|
|
|
70
70
|
reverse: true,
|
|
71
71
|
variant: "link"
|
|
72
72
|
},
|
|
73
|
-
children: "Back
|
|
73
|
+
children: "Back"
|
|
74
74
|
}
|
|
75
75
|
)
|
|
76
76
|
}
|
|
@@ -94,29 +94,54 @@ const Strong = ({ children, className }) => /* @__PURE__ */ jsx(
|
|
|
94
94
|
children
|
|
95
95
|
}
|
|
96
96
|
);
|
|
97
|
-
const CodeStep = ({
|
|
97
|
+
const CodeStep = ({ busy, error, onSubmit, style }) => {
|
|
98
98
|
const [code, setCode] = useState("");
|
|
99
|
-
return /* @__PURE__ */
|
|
100
|
-
|
|
99
|
+
return /* @__PURE__ */ jsxs(
|
|
100
|
+
Form,
|
|
101
101
|
{
|
|
102
102
|
...{
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
103
|
+
className: "space-y-6",
|
|
104
|
+
onSubmit: (event) => {
|
|
105
|
+
event.preventDefault();
|
|
106
|
+
onSubmit(code);
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
children: [
|
|
110
|
+
/* @__PURE__ */ jsx(
|
|
111
|
+
InputGroup,
|
|
106
112
|
{
|
|
107
113
|
...{
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
+
error,
|
|
115
|
+
input: /* @__PURE__ */ jsx(
|
|
116
|
+
InputCode,
|
|
117
|
+
{
|
|
118
|
+
...{
|
|
119
|
+
autoFocus: true,
|
|
120
|
+
disabled: busy,
|
|
121
|
+
onChange: setCode,
|
|
122
|
+
style,
|
|
123
|
+
value: code
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
),
|
|
127
|
+
label: "Verification code",
|
|
128
|
+
style
|
|
114
129
|
}
|
|
115
130
|
}
|
|
116
131
|
),
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
132
|
+
/* @__PURE__ */ jsx(
|
|
133
|
+
Button,
|
|
134
|
+
{
|
|
135
|
+
...{
|
|
136
|
+
disabled: code.length !== 6,
|
|
137
|
+
loading: busy,
|
|
138
|
+
style,
|
|
139
|
+
type: "submit"
|
|
140
|
+
},
|
|
141
|
+
children: "Confirm"
|
|
142
|
+
}
|
|
143
|
+
)
|
|
144
|
+
]
|
|
120
145
|
}
|
|
121
146
|
);
|
|
122
147
|
};
|
|
@@ -251,30 +276,14 @@ const FormSubdomainMissions = ({
|
|
|
251
276
|
CodeStep,
|
|
252
277
|
{
|
|
253
278
|
...{
|
|
254
|
-
|
|
279
|
+
busy,
|
|
255
280
|
error,
|
|
256
|
-
|
|
281
|
+
onSubmit: confirm,
|
|
257
282
|
style
|
|
258
283
|
}
|
|
259
284
|
},
|
|
260
285
|
attempt
|
|
261
286
|
),
|
|
262
|
-
busy && /* @__PURE__ */ jsx(
|
|
263
|
-
"div",
|
|
264
|
-
{
|
|
265
|
-
...{
|
|
266
|
-
className: "flex justify-center"
|
|
267
|
-
},
|
|
268
|
-
children: /* @__PURE__ */ jsx(
|
|
269
|
-
Loader,
|
|
270
|
-
{
|
|
271
|
-
...{
|
|
272
|
-
className: "w-5 h-5 animate-spin"
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
)
|
|
276
|
-
}
|
|
277
|
-
),
|
|
278
287
|
/* @__PURE__ */ jsxs(
|
|
279
288
|
"p",
|
|
280
289
|
{
|
|
@@ -366,14 +375,12 @@ const FormSubdomainMissions = ({
|
|
|
366
375
|
children: [
|
|
367
376
|
header("Thank you!"),
|
|
368
377
|
/* @__PURE__ */ jsx(Back, { ...{ onClick: back, style } }),
|
|
369
|
-
/* @__PURE__ */
|
|
370
|
-
/* @__PURE__ */ jsx(Strong, { children: "Mission accomplished!" }),
|
|
371
|
-
/* @__PURE__ */ jsx("p", { children: "Your bonus entries are in. Go back to missions to earn more." })
|
|
372
|
-
] })
|
|
378
|
+
/* @__PURE__ */ jsx(Centre, { children: Number(item == null ? void 0 : item.entries) > 0 && /* @__PURE__ */ jsx(Strong, { children: "You've earned " + entriesText(item.entries) }) })
|
|
373
379
|
]
|
|
374
380
|
}
|
|
375
381
|
);
|
|
376
|
-
|
|
382
|
+
const finished = screen === "start" && !message && !bonusText(items, completed);
|
|
383
|
+
if (screen === "start" && !finished) {
|
|
377
384
|
const bonus = bonusText(items, completed);
|
|
378
385
|
return /* @__PURE__ */ jsxs(
|
|
379
386
|
"div",
|
|
@@ -445,7 +452,7 @@ const FormSubdomainMissions = ({
|
|
|
445
452
|
className: "space-y-6"
|
|
446
453
|
},
|
|
447
454
|
children: [
|
|
448
|
-
header("Earn more entries", { onClick: () => go("start") }),
|
|
455
|
+
finished ? header(title) : header("Earn more entries", { onClick: () => go("start") }),
|
|
449
456
|
/* @__PURE__ */ jsx(
|
|
450
457
|
"ul",
|
|
451
458
|
{
|
|
@@ -457,9 +464,9 @@ const FormSubdomainMissions = ({
|
|
|
457
464
|
},
|
|
458
465
|
children: items.filter((row) => manifests[row.type]).map((row, index) => {
|
|
459
466
|
var _a2;
|
|
460
|
-
const
|
|
467
|
+
const done = completed.includes(row.type);
|
|
461
468
|
const opens = screenFor(row.type);
|
|
462
|
-
const Mark =
|
|
469
|
+
const Mark = done ? Check : ChevronRight;
|
|
463
470
|
const content = /* @__PURE__ */ jsxs(
|
|
464
471
|
"span",
|
|
465
472
|
{
|
|
@@ -471,10 +478,10 @@ const FormSubdomainMissions = ({
|
|
|
471
478
|
"span",
|
|
472
479
|
{
|
|
473
480
|
...{
|
|
474
|
-
className: "flex items-center gap-4 flex-1 min-w-0" + (
|
|
481
|
+
className: "flex items-center gap-4 flex-1 min-w-0" + (done ? " opacity-40" : "")
|
|
475
482
|
},
|
|
476
483
|
children: [
|
|
477
|
-
/* @__PURE__ */ jsx(Pill, { ...{ style }, children: pillText(row,
|
|
484
|
+
/* @__PURE__ */ jsx(Pill, { ...{ style }, children: pillText(row, done) }),
|
|
478
485
|
/* @__PURE__ */ jsx(
|
|
479
486
|
"span",
|
|
480
487
|
{
|
|
@@ -487,7 +494,7 @@ const FormSubdomainMissions = ({
|
|
|
487
494
|
]
|
|
488
495
|
}
|
|
489
496
|
),
|
|
490
|
-
(
|
|
497
|
+
(done || opens !== "missions") && /* @__PURE__ */ jsx(Pill, { ...{ style }, children: /* @__PURE__ */ jsx(
|
|
491
498
|
Mark,
|
|
492
499
|
{
|
|
493
500
|
...{
|
|
@@ -507,7 +514,7 @@ const FormSubdomainMissions = ({
|
|
|
507
514
|
borderColor: "inherit"
|
|
508
515
|
}
|
|
509
516
|
},
|
|
510
|
-
children:
|
|
517
|
+
children: done || opens === "missions" ? content : /* @__PURE__ */ jsx(
|
|
511
518
|
Button,
|
|
512
519
|
{
|
|
513
520
|
...{
|
|
@@ -393,7 +393,7 @@ const TemplateLayout = ({
|
|
|
393
393
|
},
|
|
394
394
|
[affiliate, data, params, preview, style]
|
|
395
395
|
);
|
|
396
|
-
const leadMission = searchParams.get("
|
|
396
|
+
const leadMission = searchParams.get("open");
|
|
397
397
|
const leadUrl = submissionId ? null : (0, import_url.leadEndpoint)({ code: searchParams.get("m"), slug: params == null ? void 0 : params.slug, subdomain: params == null ? void 0 : params.subdomain, token });
|
|
398
398
|
(0, import_react.useEffect)(
|
|
399
399
|
() => {
|
|
@@ -361,7 +361,7 @@ const TemplateLayout = ({
|
|
|
361
361
|
},
|
|
362
362
|
[affiliate, data, params, preview, style]
|
|
363
363
|
);
|
|
364
|
-
const leadMission = searchParams.get("
|
|
364
|
+
const leadMission = searchParams.get("open");
|
|
365
365
|
const leadUrl = submissionId ? null : leadEndpoint({ code: searchParams.get("m"), slug: params == null ? void 0 : params.slug, subdomain: params == null ? void 0 : params.subdomain, token });
|
|
366
366
|
useEffect(
|
|
367
367
|
() => {
|
|
@@ -158,7 +158,7 @@ const TemplateModal = ({
|
|
|
158
158
|
);
|
|
159
159
|
// @story public-entry/lead-link
|
|
160
160
|
// Opened by the lead's own link while entries are being awarded:
|
|
161
|
-
// the missions panel, at the mission a `&
|
|
161
|
+
// the missions panel, at the mission a `&open=` asked for. With
|
|
162
162
|
// no missions the link opens no panel (template-layout.js).
|
|
163
163
|
case "lead":
|
|
164
164
|
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
|
|
@@ -126,7 +126,7 @@ const TemplateModal = ({
|
|
|
126
126
|
);
|
|
127
127
|
// @story public-entry/lead-link
|
|
128
128
|
// Opened by the lead's own link while entries are being awarded:
|
|
129
|
-
// the missions panel, at the mission a `&
|
|
129
|
+
// the missions panel, at the mission a `&open=` asked for. With
|
|
130
130
|
// no missions the link opens no panel (template-layout.js).
|
|
131
131
|
case "lead":
|
|
132
132
|
return /* @__PURE__ */ jsx(
|
|
@@ -64,7 +64,7 @@ const FormOrganizationCampaignAgreement = ({
|
|
|
64
64
|
params
|
|
65
65
|
}) => {
|
|
66
66
|
const ids = Object.keys(agreements);
|
|
67
|
-
const { control, handleSubmit, formState, reset } = (0, import_form.useForm)({
|
|
67
|
+
const { control, getValues, handleSubmit, formState, reset } = (0, import_form.useForm)({
|
|
68
68
|
defaultValues: Object.fromEntries(ids.map((id) => {
|
|
69
69
|
var _a;
|
|
70
70
|
return [id, ((_a = agreements[id]) == null ? void 0 : _a.values) || {}];
|
|
@@ -106,7 +106,7 @@ const FormOrganizationCampaignAgreement = ({
|
|
|
106
106
|
});
|
|
107
107
|
}
|
|
108
108
|
;
|
|
109
|
-
reset(
|
|
109
|
+
reset(getValues());
|
|
110
110
|
if (response) onSuccess(response);
|
|
111
111
|
} catch (error) {
|
|
112
112
|
onError(error);
|
|
@@ -32,7 +32,7 @@ const FormOrganizationCampaignAgreement = ({
|
|
|
32
32
|
params
|
|
33
33
|
}) => {
|
|
34
34
|
const ids = Object.keys(agreements);
|
|
35
|
-
const { control, handleSubmit, formState, reset } = useForm({
|
|
35
|
+
const { control, getValues, handleSubmit, formState, reset } = useForm({
|
|
36
36
|
defaultValues: Object.fromEntries(ids.map((id) => {
|
|
37
37
|
var _a;
|
|
38
38
|
return [id, ((_a = agreements[id]) == null ? void 0 : _a.values) || {}];
|
|
@@ -74,7 +74,7 @@ const FormOrganizationCampaignAgreement = ({
|
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
76
|
;
|
|
77
|
-
reset(
|
|
77
|
+
reset(getValues());
|
|
78
78
|
if (response) onSuccess(response);
|
|
79
79
|
} catch (error) {
|
|
80
80
|
onError(error);
|