amp-workflow-ui 0.1.17 → 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/index.mjs CHANGED
@@ -604,7 +604,8 @@ function SendBackDialog({
604
604
  openModal,
605
605
  closeModal,
606
606
  header,
607
- workflowLogId
607
+ workflowLogId,
608
+ onSuccess
608
609
  }) {
609
610
  const { userInfo, api } = useWorkflowContext();
610
611
  const [comment, setComment] = useState("");
@@ -711,6 +712,7 @@ function SendBackDialog({
711
712
  setFileName("");
712
713
  setLoading(false);
713
714
  closeModal && closeModal();
715
+ onSuccess && onSuccess();
714
716
  }
715
717
  };
716
718
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -855,7 +857,8 @@ function ApproveDialog({
855
857
  closeModal,
856
858
  header,
857
859
  workflowLogId,
858
- statusId
860
+ statusId,
861
+ onSuccess
859
862
  }) {
860
863
  const { userInfo, api } = useWorkflowContext();
861
864
  const theme = useTheme();
@@ -907,6 +910,7 @@ function ApproveDialog({
907
910
  setComment("");
908
911
  setLoading(false);
909
912
  closeModal && closeModal();
913
+ onSuccess && onSuccess();
910
914
  }
911
915
  };
912
916
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1016,7 +1020,8 @@ function RejectDialog({
1016
1020
  header,
1017
1021
  workflowLogId,
1018
1022
  statusId,
1019
- rejection_reason_master
1023
+ rejection_reason_master,
1024
+ onSuccess
1020
1025
  }) {
1021
1026
  const { userInfo, api } = useWorkflowContext();
1022
1027
  const theme = useTheme();
@@ -1108,6 +1113,7 @@ function RejectDialog({
1108
1113
  setRejectReasons("");
1109
1114
  setLoading(false);
1110
1115
  closeModal && closeModal();
1116
+ onSuccess && onSuccess();
1111
1117
  }
1112
1118
  };
1113
1119
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -1234,7 +1240,8 @@ function OnHoldDialog({
1234
1240
  closeModal,
1235
1241
  header,
1236
1242
  workflowLogId,
1237
- statusId
1243
+ statusId,
1244
+ onSuccess
1238
1245
  }) {
1239
1246
  const { userInfo, api } = useWorkflowContext();
1240
1247
  const theme = useTheme();
@@ -1286,6 +1293,7 @@ function OnHoldDialog({
1286
1293
  setComment("");
1287
1294
  closeModal && closeModal();
1288
1295
  setLoading(false);
1296
+ onSuccess && onSuccess();
1289
1297
  }
1290
1298
  };
1291
1299
  return /* @__PURE__ */ jsxs(Fragment, { children: [
@@ -2253,7 +2261,16 @@ function ApprovalWorkflow({
2253
2261
  openModal: !!sendDialog,
2254
2262
  closeModal: () => setSendDialog(null),
2255
2263
  header: "Send Back",
2256
- workflowLogId: sendDialog || ""
2264
+ workflowLogId: sendDialog || "",
2265
+ onSuccess: () => {
2266
+ var _a2, _b2;
2267
+ return fetchData(
2268
+ selectedOption,
2269
+ 1,
2270
+ (_a2 = tabs[selectedOption]) == null ? void 0 : _a2.search,
2271
+ (_b2 = tabs[selectedOption]) == null ? void 0 : _b2.filters
2272
+ );
2273
+ }
2257
2274
  }
2258
2275
  ),
2259
2276
  /* @__PURE__ */ jsx(
@@ -2263,7 +2280,16 @@ function ApprovalWorkflow({
2263
2280
  closeModal: () => setApproveTarget(null),
2264
2281
  header: "Approve",
2265
2282
  workflowLogId: (_m = approveTarget == null ? void 0 : approveTarget.split("|")) == null ? void 0 : _m[0],
2266
- statusId: (_n = approveTarget == null ? void 0 : approveTarget.split("|")) == null ? void 0 : _n[1]
2283
+ statusId: (_n = approveTarget == null ? void 0 : approveTarget.split("|")) == null ? void 0 : _n[1],
2284
+ onSuccess: () => {
2285
+ var _a2, _b2;
2286
+ return fetchData(
2287
+ selectedOption,
2288
+ 1,
2289
+ (_a2 = tabs[selectedOption]) == null ? void 0 : _a2.search,
2290
+ (_b2 = tabs[selectedOption]) == null ? void 0 : _b2.filters
2291
+ );
2292
+ }
2267
2293
  }
2268
2294
  ),
2269
2295
  /* @__PURE__ */ jsx(
@@ -2274,7 +2300,16 @@ function ApprovalWorkflow({
2274
2300
  header: "Reject",
2275
2301
  workflowLogId: (_o = rejectTarget == null ? void 0 : rejectTarget.split("|")) == null ? void 0 : _o[0],
2276
2302
  statusId: (_p = rejectTarget == null ? void 0 : rejectTarget.split("|")) == null ? void 0 : _p[1],
2277
- rejection_reason_master: (_q = rejectTarget == null ? void 0 : rejectTarget.split("|")) == null ? void 0 : _q[2]
2303
+ rejection_reason_master: (_q = rejectTarget == null ? void 0 : rejectTarget.split("|")) == null ? void 0 : _q[2],
2304
+ onSuccess: () => {
2305
+ var _a2, _b2;
2306
+ return fetchData(
2307
+ selectedOption,
2308
+ 1,
2309
+ (_a2 = tabs[selectedOption]) == null ? void 0 : _a2.search,
2310
+ (_b2 = tabs[selectedOption]) == null ? void 0 : _b2.filters
2311
+ );
2312
+ }
2278
2313
  }
2279
2314
  ),
2280
2315
  /* @__PURE__ */ jsx(
@@ -2284,7 +2319,16 @@ function ApprovalWorkflow({
2284
2319
  closeModal: () => setOnHoldTarget(null),
2285
2320
  header: "On Hold",
2286
2321
  workflowLogId: (_r = onHoldTarget == null ? void 0 : onHoldTarget.split("|")) == null ? void 0 : _r[0],
2287
- statusId: (_s = onHoldTarget == null ? void 0 : onHoldTarget.split("|")) == null ? void 0 : _s[1]
2322
+ statusId: (_s = onHoldTarget == null ? void 0 : onHoldTarget.split("|")) == null ? void 0 : _s[1],
2323
+ onSuccess: () => {
2324
+ var _a2, _b2;
2325
+ return fetchData(
2326
+ selectedOption,
2327
+ 1,
2328
+ (_a2 = tabs[selectedOption]) == null ? void 0 : _a2.search,
2329
+ (_b2 = tabs[selectedOption]) == null ? void 0 : _b2.filters
2330
+ );
2331
+ }
2288
2332
  }
2289
2333
  ),
2290
2334
  /* @__PURE__ */ jsxs(