beca-ui 2.0.18-beta.13 → 2.0.18-beta.14

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/beca-ui.js CHANGED
@@ -150665,107 +150665,98 @@ class NetworkService {
150665
150665
  });
150666
150666
  }
150667
150667
  static async requestJson(s) {
150668
- var d, f;
150668
+ var f, p;
150669
150669
  let c, u;
150670
+ const d = axios.defaults.baseURL;
150670
150671
  try {
150671
150672
  if (s.data) {
150672
- for (const [m, h] of Object.entries(s.data))
150673
- if (dayjs.isDayjs(h)) {
150674
- const g = dayjsToPost(h);
150675
- s.data[m] = g;
150673
+ for (const [g, y] of Object.entries(s.data))
150674
+ if (dayjs.isDayjs(y)) {
150675
+ const x = dayjsToPost(y);
150676
+ s.data[g] = x;
150676
150677
  }
150677
150678
  }
150678
- let p;
150679
- if (p || (p = {
150679
+ let m;
150680
+ if (m || (m = {
150680
150681
  headers: s.headers
150681
- }, s.isFile && (p.headers = {
150682
- ...p.headers,
150682
+ }, s.isFile && (m.headers = {
150683
+ ...m.headers,
150683
150684
  "Content-Type": "multipart/form-data"
150684
- })), p.headers = {
150685
+ })), m.headers = {
150685
150686
  Accept: "application/json",
150686
150687
  "Content-Type": "application/json; charset=UTF-8",
150687
- ...p.headers
150688
+ ...m.headers
150688
150689
  }, s.method === "POST" || s.method === "PUT" || s.method === "DELETE") {
150689
150690
  if (!sessionStorage.getItem("X-XSRF-TOKEN")) {
150690
- const m = await fetch("/api/antiforgery/token", {
150691
+ const g = await fetch("/api/antiforgery/token", {
150691
150692
  method: "GET",
150692
- headers: p.headers
150693
+ headers: m.headers
150693
150694
  });
150694
- m.ok && sessionStorage.setItem("X-XSRF-TOKEN", await m.json());
150695
+ g.ok && sessionStorage.setItem("X-XSRF-TOKEN", await g.json());
150695
150696
  }
150696
- p.headers = {
150697
- ...p.headers,
150697
+ m.headers = {
150698
+ ...m.headers,
150698
150699
  "X-XSRF-TOKEN": sessionStorage.getItem("X-XSRF-TOKEN")
150699
150700
  };
150700
150701
  }
150701
- if (location.host === "localhost:6006") {
150702
- s.url = s.url.replace("/v2/", "/"), s.url = s.url.replace("/v1/", "/");
150703
- const m = s.url.split("api/");
150704
- s.url = `https://localhost:7267/api/workflowapi/${m[1]}`, p.headers = {
150705
- ...p.headers,
150706
- ClientId: "duydd1@vntt.com.vn",
150707
- ApiKey: "0UqumTZZJkyVyJHbETyK"
150708
- };
150709
- }
150702
+ location.host.includes("localhost") && (s.url = s.url.replace("/v2/", "/"), s.url = s.url.replace("/v1/", "/"));
150703
+ const h = s.url.split("/api/");
150704
+ s.url = d + h[1];
150710
150705
  try {
150711
150706
  switch (s.method) {
150712
150707
  case "GET":
150713
- let m = localStorage.getItem("locale");
150714
- if (!m) {
150715
- m = "vi";
150716
- let h = "/api/personalProfiles/GetLangOfAccount", g;
150717
- location.host === "localhost:6006" && (h = "https://localhost:7267/api/workflowapi/personalProfiles/GetLangOfAccount", g = {
150718
- ClientId: "duydd1@vntt.com.vn",
150719
- ApiKey: "0UqumTZZJkyVyJHbETyK"
150708
+ let g = localStorage.getItem("locale");
150709
+ if (!g) {
150710
+ g = "vi";
150711
+ let y = d + "personalProfiles/GetLangOfAccount";
150712
+ const S = await axios.get(y, {
150713
+ headers: void 0
150720
150714
  });
150721
- const y = await axios.get(h, {
150722
- headers: g
150723
- });
150724
- if (y.status === 200) {
150725
- const x = y.data;
150726
- localStorage.setItem("locale", x), m = x;
150715
+ if (S.status === 200) {
150716
+ const _ = S.data;
150717
+ localStorage.setItem("locale", _), g = _;
150727
150718
  }
150728
150719
  }
150729
- s.url.includes("?") ? s.url += `&lang=${m}` : s.data ? s.data.lang = m : s.data = { lang: m }, c = await axios.get(processQuery(s.url, s.data), {
150720
+ s.url.includes("?") ? s.url += `&lang=${g}` : s.data ? s.data.lang = g : s.data = { lang: g }, c = await axios.get(processQuery(s.url, s.data), {
150730
150721
  method: "GET",
150731
- headers: p.headers,
150722
+ headers: m.headers,
150732
150723
  signal: s.abortSignal && s.abortSignal()
150733
150724
  });
150734
150725
  break;
150735
150726
  case "POST":
150736
150727
  c = await axios.post(s.url, s.data, {
150737
- headers: p.headers
150728
+ headers: m.headers
150738
150729
  });
150739
150730
  break;
150740
150731
  case "PUT":
150741
150732
  c = await axios.put(s.url, s.data, {
150742
- headers: p.headers
150733
+ headers: m.headers
150743
150734
  });
150744
150735
  break;
150745
150736
  case "PATCH":
150746
150737
  c = await axios.patch(s.url, s.data, {
150747
- headers: p.headers
150738
+ headers: m.headers
150748
150739
  });
150749
150740
  break;
150750
150741
  case "DELETE":
150751
150742
  c = await axios.delete(
150752
150743
  processQuery(s.url, s.data),
150753
150744
  {
150754
- headers: p.headers
150745
+ headers: m.headers
150755
150746
  }
150756
150747
  );
150757
150748
  break;
150758
150749
  }
150759
150750
  u = new Result(
150760
- !s.fullResponse && ((d = c.data.value) == null ? void 0 : d.length) > 0 ? c.data.value : c.data,
150751
+ !s.fullResponse && ((f = c.data.value) == null ? void 0 : f.length) > 0 ? c.data.value : c.data,
150761
150752
  c.data.errors && c.data.errors.length > 0 ? [...c.data.errors] : void 0
150762
150753
  );
150763
- } catch (m) {
150764
- if (m.message !== "Network Error") {
150765
- if (m.message === "Request failed with status code 400" && ((f = m == null ? void 0 : m.response) != null && f.data) && m.response.data.type === "https://tools.ietf.org/html/rfc7231#section-6.5.1")
150754
+ } catch (g) {
150755
+ if (g.message !== "Network Error") {
150756
+ if (g.message === "Request failed with status code 400" && ((p = g == null ? void 0 : g.response) != null && p.data) && g.response.data.type === "https://tools.ietf.org/html/rfc7231#section-6.5.1")
150766
150757
  return sessionStorage.clear(), NetworkService.requestJson(s);
150767
150758
  }
150768
- u = new Result(void 0, m.response.data);
150759
+ u = new Result(void 0, g.response.data);
150769
150760
  }
150770
150761
  u.hasErrors && !s.isNotShowError && showErrors(...u.errors);
150771
150762
  } catch {
@@ -187519,14 +187510,15 @@ var TAG_NAMES = /* @__PURE__ */ ((a) => (a.BASE = "base", a.BODY = "body", a.HEA
187519
187510
  }), uC);
187520
187511
  const win = window, WorkflowForm = (props) => {
187521
187512
  const { t } = useTrans$1(), [form] = Form.useForm(), [chatUrl, setChatUrl] = useState(), [chatViewUrl, setChatViewUrl] = useState(), [note, setNote] = useState(""), masterDetailsRef = useRef([]), dynamicAttachRef = useRef(null), { isMobileApp, isFullscreenApp } = useDevice(), {
187522
- theme,
187523
- locale,
187513
+ theme = "Light",
187514
+ locale = "vi",
187524
187515
  userWorkflowId = 0,
187525
187516
  goBack,
187526
187517
  isRedirect,
187527
187518
  userType,
187528
187519
  navigate,
187529
- workflowType = "Public"
187520
+ workflowType = "Public",
187521
+ apiUrl = "/api/"
187530
187522
  } = props, backRoute = useMemo$1(() => {
187531
187523
  const { search: a } = location, s = a.split("?backRoute=");
187532
187524
  let c;
@@ -187769,9 +187761,9 @@ const win = window, WorkflowForm = (props) => {
187769
187761
  allowSave: !0,
187770
187762
  allowDeleteFileByAdmin: !0,
187771
187763
  allowAddLinking: !0,
187772
- allowEditMasterDetail: masterDetailFormats.map((d) => !0),
187773
- allowAddMasterDetail: masterDetailFormats.map((d) => !0),
187774
- defaultAllowEditMasterDetail: masterDetailFormats.map(
187764
+ allowEditMasterDetail: masterDetailFormats == null ? void 0 : masterDetailFormats.map((d) => !0),
187765
+ allowAddMasterDetail: masterDetailFormats == null ? void 0 : masterDetailFormats.map((d) => !0),
187766
+ defaultAllowEditMasterDetail: masterDetailFormats == null ? void 0 : masterDetailFormats.map(
187775
187767
  (d) => !0
187776
187768
  )
187777
187769
  }), setIsAdmin(!0);
@@ -187846,14 +187838,16 @@ const win = window, WorkflowForm = (props) => {
187846
187838
  icon: /* @__PURE__ */ jsx(SvgCloseSquareOutlinedStyle, { className: "primary-color" }),
187847
187839
  disabled: isAdding || isApproving || isRecalling,
187848
187840
  mobileHidden: !0,
187849
- onClick: () => goBack()
187841
+ onClick: () => {
187842
+ goBack && goBack();
187843
+ }
187850
187844
  }), a;
187851
187845
  };
187852
- useEffect(() => () => {
187846
+ useEffect(() => (axios.defaults.baseURL = apiUrl, () => {
187853
187847
  globalHubConnection && globalHubConnection.current && globalHubConnection.current.stop().then(() => {
187854
187848
  }).catch((a) => {
187855
187849
  });
187856
- }, []), useEffect(() => {
187850
+ }), []), useEffect(() => {
187857
187851
  workflowType !== "Public" && fetchChatUrl();
187858
187852
  }, [userWorkflowId]), useEffect(() => {
187859
187853
  const { search: a } = location, c = new URLSearchParams(a).get("type");
@@ -187895,7 +187889,7 @@ const win = window, WorkflowForm = (props) => {
187895
187889
  }), setMasterDetailFormats(c);
187896
187890
  }
187897
187891
  function mapDropDownValueIntoProperty(a, s) {
187898
- DataServices.mapDropDownValueIntoProperty({
187892
+ DataServices == null || DataServices.mapDropDownValueIntoProperty({
187899
187893
  form,
187900
187894
  data: s,
187901
187895
  choiceName: a,
@@ -188045,31 +188039,32 @@ const win = window, WorkflowForm = (props) => {
188045
188039
  s.success && setUserWorkflowNotes(s.value.items);
188046
188040
  }
188047
188041
  async function fetchUserWorkflowLinking() {
188042
+ var s;
188048
188043
  const a = await UserWorkflowLinkingService.getAll(
188049
188044
  userWorkflowId
188050
188045
  );
188051
188046
  if (a.success) {
188052
- const s = [];
188053
- a.value.items.map((c) => {
188054
- var d, f;
188055
- const u = !c.isOld && c.linkUserWorkflow.userWorkflowStatus === 0 ? (d = c.linkUserWorkflow.workflowStep) == null ? void 0 : d.status : c.linkUserWorkflow.status;
188056
- s.push({
188057
- id: c.linkUserWorkflow.id,
188058
- workflowId: c.linkUserWorkflow.workflowId,
188059
- workflowCode: c.linkUserWorkflow.workflowCode,
188060
- shortContent: stripHtml(c.linkUserWorkflow.shortContent),
188061
- content: stripHtml(c.linkUserWorkflow.content),
188062
- userId: c.linkUserWorkflow.userId,
188063
- user: c.linkUserWorkflow.user,
188064
- workflowTitle: (f = c.linkUserWorkflow.workflow) == null ? void 0 : f.title,
188065
- approver: c.linkUserWorkflow.approver,
188066
- approvalDate: c.approvalDate,
188067
- isOld: c.isOld,
188068
- url: c.url,
188069
- userWorkflowStatus: c.linkUserWorkflow.userWorkflowStatus,
188070
- status: u
188047
+ const c = [];
188048
+ (s = a.value.items) == null || s.map((u) => {
188049
+ var f, p;
188050
+ const d = !u.isOld && u.linkUserWorkflow.userWorkflowStatus === 0 ? (f = u.linkUserWorkflow.workflowStep) == null ? void 0 : f.status : u.linkUserWorkflow.status;
188051
+ c.push({
188052
+ id: u.linkUserWorkflow.id,
188053
+ workflowId: u.linkUserWorkflow.workflowId,
188054
+ workflowCode: u.linkUserWorkflow.workflowCode,
188055
+ shortContent: stripHtml(u.linkUserWorkflow.shortContent),
188056
+ content: stripHtml(u.linkUserWorkflow.content),
188057
+ userId: u.linkUserWorkflow.userId,
188058
+ user: u.linkUserWorkflow.user,
188059
+ workflowTitle: (p = u.linkUserWorkflow.workflow) == null ? void 0 : p.title,
188060
+ approver: u.linkUserWorkflow.approver,
188061
+ approvalDate: u.approvalDate,
188062
+ isOld: u.isOld,
188063
+ url: u.url,
188064
+ userWorkflowStatus: u.linkUserWorkflow.userWorkflowStatus,
188065
+ status: d
188071
188066
  });
188072
- }), setRelatedUserWorkflows(s);
188067
+ }), setRelatedUserWorkflows(c);
188073
188068
  }
188074
188069
  }
188075
188070
  async function fetchMasterDetailFormatForNew(a, s, c) {
@@ -188115,7 +188110,7 @@ const win = window, WorkflowForm = (props) => {
188115
188110
  const a = {
188116
188111
  note: note ?? ""
188117
188112
  }, s = await SendWorkflowService.recall(userWorkflowId, a);
188118
- s.success ? (staticMethods$1.success(t("Recalled successfully")), goBack()) : s.errors && s.errors.forEach((c) => {
188113
+ s.success ? (staticMethods$1.success(t("Recalled successfully")), goBack && goBack()) : s.errors && s.errors.forEach((c) => {
188119
188114
  c.includes("Lỗi") ? staticMethods$1.error(c) : staticMethods$1.error(ErrorMessage());
188120
188115
  });
188121
188116
  }
@@ -188145,7 +188140,7 @@ const win = window, WorkflowForm = (props) => {
188145
188140
  const c = {
188146
188141
  note
188147
188142
  }, u = await SendWorkflowService.approve(userWorkflowId, c);
188148
- u.success ? (staticMethods$1.success("Đã đồng ý"), goBack()) : u.errors && u.errors.forEach((d) => {
188143
+ u.success ? (staticMethods$1.success("Đã đồng ý"), goBack && goBack()) : u.errors && u.errors.forEach((d) => {
188149
188144
  d.includes("Lỗi") ? staticMethods$1.error(d) : staticMethods$1.error(ErrorMessage());
188150
188145
  });
188151
188146
  }
@@ -188189,26 +188184,27 @@ const win = window, WorkflowForm = (props) => {
188189
188184
  s.success && fetchStepFieldsForNew(a, s.value);
188190
188185
  }
188191
188186
  async function fetchStepFieldsForNew(a, s) {
188187
+ var u;
188192
188188
  const c = await WorkflowService.getWorkflowSteps(
188193
188189
  a
188194
188190
  );
188195
188191
  if (c.success) {
188196
- const u = c.value.items.find(
188197
- (d) => d.step === 1
188192
+ const d = c.value.items.find(
188193
+ (f) => f.step === 1
188198
188194
  );
188199
- if (u) {
188200
- const d = Number(u.id), f = await WorkflowService.getStepInfo(
188195
+ if (d) {
188196
+ const f = Number(d.id), p = await WorkflowService.getStepInfo(
188201
188197
  s,
188202
- d
188198
+ f
188203
188199
  );
188204
- if (f.success) {
188205
- const p = {};
188206
- f.rows.map((m) => {
188207
- var h;
188208
- (h = m.row) == null || h.map((g) => {
188209
- p[g.name] = UserCheckListService.getValue(g);
188200
+ if (p.success) {
188201
+ const m = {};
188202
+ (u = p.rows) == null || u.map((h) => {
188203
+ var g;
188204
+ (g = h.row) == null || g.map((y) => {
188205
+ m[y.name] = UserCheckListService.getValue(y);
188210
188206
  });
188211
- }), form.setFieldsValue(p), setRows(f.rows);
188207
+ }), form.setFieldsValue(m), setRows(p.rows);
188212
188208
  }
188213
188209
  }
188214
188210
  }
@@ -188228,7 +188224,7 @@ const win = window, WorkflowForm = (props) => {
188228
188224
  p.stepFields
188229
188225
  );
188230
188226
  let h = [...p.rows];
188231
- h.map((g) => {
188227
+ h == null || h.map((g) => {
188232
188228
  var y;
188233
188229
  (y = g.row) == null || y.map((x) => {
188234
188230
  const S = m.find(
@@ -188265,16 +188261,16 @@ const win = window, WorkflowForm = (props) => {
188265
188261
  }
188266
188262
  }
188267
188263
  async function uploadAttachFiles(a) {
188268
- var s, c;
188264
+ var s, c, u;
188269
188265
  try {
188270
- for (let u = 0; u < attachDataSource.length; u++) {
188271
- const d = attachDataSource[u], f = attachForm.getFieldValue(
188272
- d.key
188266
+ for (let d = 0; d < attachDataSource.length; d++) {
188267
+ const f = attachDataSource[d], p = attachForm.getFieldValue(
188268
+ f.key
188273
188269
  );
188274
- if (f && ((s = f.fileList) == null ? void 0 : s.length) > 0) {
188275
- let p = 0;
188276
- f.fileList.map((g) => {
188277
- if (p += g.size, workflow && p > workflow.maximumSizeTotal * 1048576 && workflow.maximumSizeTotal !== 0 && workflow.maximumSizeTotal !== null)
188270
+ if (p && ((s = p.fileList) == null ? void 0 : s.length) > 0) {
188271
+ let m = 0;
188272
+ (c = p.fileList) == null || c.map((y) => {
188273
+ if (m += y.size, workflow && m > workflow.maximumSizeTotal * 1048576 && workflow.maximumSizeTotal !== 0 && workflow.maximumSizeTotal !== null)
188278
188274
  throw new Error(
188279
188275
  t("Total capacity allowed is", {
188280
188276
  total: workflow == null ? void 0 : workflow.maximumSizeTotal,
@@ -188282,45 +188278,45 @@ const win = window, WorkflowForm = (props) => {
188282
188278
  })
188283
188279
  );
188284
188280
  });
188285
- const m = (c = d.key) == null ? void 0 : c.toString().split("-")[0], h = f.note;
188286
- for (let g = 0; g < f.fileList.length; g++) {
188287
- const y = f.fileList[g];
188288
- if (y.size === 0)
188281
+ const h = (u = f.key) == null ? void 0 : u.toString().split("-")[0], g = p.note;
188282
+ for (let y = 0; y < p.fileList.length; y++) {
188283
+ const x = p.fileList[y];
188284
+ if (x.size === 0)
188289
188285
  throw new Error(t("Uploading files with 0 bytes is not allowed"));
188290
- if (y.name.endsWith(".exe".trim()))
188286
+ if (x.name.endsWith(".exe".trim()))
188291
188287
  throw new Error(
188292
188288
  t("Not allowed file formats", {
188293
188289
  extensions: ".exe"
188294
188290
  })
188295
188291
  );
188296
- if (workflow != null && workflow.allowAttachmentExtensions && !checkValidFilesExtension(y.name))
188292
+ if (workflow != null && workflow.allowAttachmentExtensions && !checkValidFilesExtension(x.name))
188297
188293
  throw new Error(
188298
188294
  t("Allowed file formats", {
188299
188295
  extensions: workflow.allowAttachmentExtensions
188300
188296
  })
188301
188297
  );
188302
188298
  }
188303
- for (let g = 0; g < f.fileList.length; g++) {
188304
- const y = f.fileList[g], x = {
188299
+ for (let y = 0; y < p.fileList.length; y++) {
188300
+ const x = p.fileList[y], S = {
188305
188301
  workflowId,
188306
188302
  userWorkflowId: a,
188307
- checkListId: Number(m),
188308
- name: y.name,
188309
- note: h ?? "",
188303
+ checkListId: Number(h),
188304
+ name: x.name,
188305
+ note: g ?? "",
188310
188306
  path: "",
188311
- type: y.type
188307
+ type: x.type
188312
188308
  };
188313
188309
  if ((await UserCheckListService.uploadFile(
188314
- x,
188315
- y
188310
+ S,
188311
+ x
188316
188312
  )).hasErrors)
188317
188313
  throw new Error();
188318
188314
  }
188319
188315
  }
188320
188316
  }
188321
- } catch (u) {
188322
- const d = u.message ?? t("_ExecutionErrorMessage", { label: t("Upload") });
188323
- return d && d !== "" && staticMethods$1.error(d), !1;
188317
+ } catch (d) {
188318
+ const f = d.message ?? t("_ExecutionErrorMessage", { label: t("Upload") });
188319
+ return f && f !== "" && staticMethods$1.error(f), !1;
188324
188320
  }
188325
188321
  return !0;
188326
188322
  }
@@ -188341,9 +188337,9 @@ const win = window, WorkflowForm = (props) => {
188341
188337
  let _ = m[S];
188342
188338
  if (_ && (Array != null && Array.isArray(_))) {
188343
188339
  let O = "";
188344
- _.length > 0 && _.map((k, A) => {
188340
+ _.length > 0 && (_ == null || _.map((k, A) => {
188345
188341
  O += k, A < _.length - 1 && (O += ";");
188346
- }), _ = O;
188342
+ })), _ = O;
188347
188343
  } else
188348
188344
  _ && typeof _ == "object" && !(Array != null && Array.isArray(_)) && ((E = Object.prototype.hasOwnProperty) != null && E.call(_, "label")) && ((R = Object.prototype.hasOwnProperty) != null && R.call(_, "value")) && (_ = _.value);
188349
188345
  _ === "" && (_ = void 0), g.push({ name: S, value: _ });
@@ -188357,7 +188353,7 @@ const win = window, WorkflowForm = (props) => {
188357
188353
  value: E && JSON.stringify(E)
188358
188354
  });
188359
188355
  });
188360
- const y = DataServices.mapArrays(
188356
+ const y = DataServices == null ? void 0 : DataServices.mapArrays(
188361
188357
  userWorkflowValues,
188362
188358
  g,
188363
188359
  "name",
@@ -188402,21 +188398,23 @@ const win = window, WorkflowForm = (props) => {
188402
188398
  }
188403
188399
  }
188404
188400
  async function onFinish(a) {
188405
- checkValidFiles(!1) && MasterDetailService.validate(masterDetailsRef) && await updateUserWorkflow(a) === !0 && (staticMethods$1.success(t("UpdatedSuccessfully")), goBack());
188401
+ checkValidFiles(!1) && MasterDetailService.validate(masterDetailsRef) && await updateUserWorkflow(a) === !0 && (staticMethods$1.success(t("UpdatedSuccessfully")), goBack && goBack());
188406
188402
  }
188407
188403
  function onFinishFailed() {
188408
188404
  DataServices.checkValidFiles(!1, attachDataSource, attachForm, !1);
188409
188405
  }
188410
188406
  function generateCopyWorkflowsDropdownItems() {
188411
- return (actions == null ? void 0 : actions.copyWorkflows.map((s, c) => ({
188412
- key: c,
188413
- label: /* @__PURE__ */ jsx("a", { target: "_blank", rel: "noopener noreferrer", href: s.url, children: s.title })
188407
+ var s;
188408
+ return ((s = actions == null ? void 0 : actions.copyWorkflows) == null ? void 0 : s.map((c, u) => ({
188409
+ key: u,
188410
+ label: /* @__PURE__ */ jsx("a", { target: "_blank", rel: "noopener noreferrer", href: c.url, children: c.title })
188414
188411
  }))) ?? [];
188415
188412
  }
188416
188413
  function generateRelatedWorkflowsDropdownItems() {
188417
- return (actions == null ? void 0 : actions.relatedWorkflows.map((s, c) => ({
188418
- key: c,
188419
- label: /* @__PURE__ */ jsx("a", { target: "_blank", rel: "noopener noreferrer", href: s.url, children: s.title })
188414
+ var s;
188415
+ return ((s = actions == null ? void 0 : actions.relatedWorkflows) == null ? void 0 : s.map((c, u) => ({
188416
+ key: u,
188417
+ label: /* @__PURE__ */ jsx("a", { target: "_blank", rel: "noopener noreferrer", href: c.url, children: c.title })
188420
188418
  }))) ?? [];
188421
188419
  }
188422
188420
  async function onSaveInDetail() {
@@ -188442,9 +188440,13 @@ const win = window, WorkflowForm = (props) => {
188442
188440
  }
188443
188441
  function checkValidFilesExtension(a) {
188444
188442
  let s = !1;
188445
- return workflow && (workflow != null && workflow.allowAttachmentExtensions && (workflow == null ? void 0 : workflow.allowAttachmentExtensions.length) > 1 && (workflow == null ? void 0 : workflow.allowAttachmentExtensions[(workflow == null ? void 0 : workflow.allowAttachmentExtensions.length) - 1]) === ";" ? workflow == null ? void 0 : workflow.allowAttachmentExtensions.slice(0, -1) : workflow == null ? void 0 : workflow.allowAttachmentExtensions).split(";").map((u) => {
188446
- a.endsWith(u.trim()) && (s = !0);
188447
- }), s;
188443
+ if (workflow) {
188444
+ const c = (workflow != null && workflow.allowAttachmentExtensions && (workflow == null ? void 0 : workflow.allowAttachmentExtensions.length) > 1 && (workflow == null ? void 0 : workflow.allowAttachmentExtensions[(workflow == null ? void 0 : workflow.allowAttachmentExtensions.length) - 1]) === ";" ? workflow == null ? void 0 : workflow.allowAttachmentExtensions.slice(0, -1) : workflow == null ? void 0 : workflow.allowAttachmentExtensions).split(";");
188445
+ c == null || c.map((u) => {
188446
+ a.endsWith(u.trim()) && (s = !0);
188447
+ });
188448
+ }
188449
+ return s;
188448
188450
  }
188449
188451
  const checkValidFiles = (a) => DataServices.checkValidFiles(
188450
188452
  a,
@@ -188462,7 +188464,7 @@ const win = window, WorkflowForm = (props) => {
188462
188464
  const d = {
188463
188465
  note
188464
188466
  };
188465
- (await SendWorkflowService.approve(userWorkflowId, d)).success && (staticMethods$1.success(t("Sent successfully")), goBack());
188467
+ (await SendWorkflowService.approve(userWorkflowId, d)).success && (staticMethods$1.success(t("Sent successfully")), goBack && goBack());
188466
188468
  }
188467
188469
  }
188468
188470
  } catch {
@@ -188606,12 +188608,13 @@ const win = window, WorkflowForm = (props) => {
188606
188608
  workflow.title,
188607
188609
  workflow.titleEN
188608
188610
  ) }),
188609
- /* @__PURE__ */ jsx("div", { className: "custom-div user-mode detail-form", children: /* @__PURE__ */ jsx("div", { className: "form-layout-section section", children: rows.map((a, s) => {
188611
+ /* @__PURE__ */ jsx("div", { className: "custom-div user-mode detail-form", children: /* @__PURE__ */ jsx("div", { className: "form-layout-section section", children: rows == null ? void 0 : rows.map((a, s) => {
188612
+ var d;
188610
188613
  let c = a.row.length;
188611
188614
  const u = a.row.filter(
188612
- (d) => {
188613
- var f;
188614
- return d.hidden === !0 || d.isHide === !0 || ((f = d.styleClass) == null ? void 0 : f.toLowerCase().includes("hidecolumn"));
188615
+ (f) => {
188616
+ var p;
188617
+ return f.hidden === !0 || f.isHide === !0 || ((p = f.styleClass) == null ? void 0 : p.toLowerCase().includes("hidecolumn"));
188615
188618
  }
188616
188619
  );
188617
188620
  return u && (c = c - u.length), /* @__PURE__ */ jsx(
@@ -188635,8 +188638,8 @@ const win = window, WorkflowForm = (props) => {
188635
188638
  ),
188636
188639
  onFinish,
188637
188640
  onFinishFailed,
188638
- onFieldsChange: (d) => {
188639
- handleChangeFields(d);
188641
+ onFieldsChange: (f) => {
188642
+ handleChangeFields(f);
188640
188643
  },
188641
188644
  colon: !1,
188642
188645
  children: /* @__PURE__ */ jsx(
@@ -188645,49 +188648,49 @@ const win = window, WorkflowForm = (props) => {
188645
188648
  gutter: DynamicFormLayout.getGutter(
188646
188649
  c
188647
188650
  ),
188648
- children: a.row.map((d) => {
188649
- var p;
188650
- return d.hidden === !0 || ((p = d.styleClass) == null ? void 0 : p.toLowerCase().includes("hidecolumn")) ? /* @__PURE__ */ jsx(
188651
+ children: (d = a.row) == null ? void 0 : d.map((f) => {
188652
+ var m;
188653
+ return f.hidden === !0 || ((m = f.styleClass) == null ? void 0 : m.toLowerCase().includes("hidecolumn")) ? /* @__PURE__ */ jsx(
188651
188654
  Form.Item,
188652
188655
  {
188653
- name: d.name,
188654
- className: `field_${d.name}`,
188656
+ name: f.name,
188657
+ className: `field_${f.name}`,
188655
188658
  hidden: !0
188656
188659
  },
188657
- d.name
188660
+ f.name
188658
188661
  ) : /* @__PURE__ */ createElement(
188659
188662
  Col,
188660
188663
  {
188661
188664
  ...DynamicFormLayout.dynamicFormColumn(
188662
188665
  c
188663
188666
  ),
188664
- key: d.name,
188667
+ key: f.name,
188665
188668
  className: "div-col-wrap"
188666
188669
  },
188667
- /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("div", { children: actions != null && actions.allowEdit && d.isEdit || actions != null && actions.allowEditResource ? /* @__PURE__ */ jsx(
188670
+ /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx("div", { children: actions != null && actions.allowEdit && f.isEdit || actions != null && actions.allowEditResource ? /* @__PURE__ */ jsx(
188668
188671
  DynamicWorkflowForm,
188669
188672
  {
188670
188673
  form,
188671
188674
  rowLength: c,
188672
- col: d,
188673
- onChange: (m) => d.type === "lookup" && checkFilterFromLookupItems(
188674
- d,
188675
- m
188675
+ col: f,
188676
+ onChange: (h) => f.type === "lookup" && checkFilterFromLookupItems(
188677
+ f,
188678
+ h
188676
188679
  ),
188677
- changeOptionOfCol: (m, h) => {
188680
+ changeOptionOfCol: (h, g) => {
188678
188681
  changeOptionOfCol(
188679
188682
  userWorkflowId,
188680
- h
188683
+ g
188681
188684
  );
188682
188685
  },
188683
- value: d.defaultValue,
188686
+ value: f.defaultValue,
188684
188687
  isMobileApp
188685
188688
  }
188686
188689
  ) : /* @__PURE__ */ jsx("div", { className: "div-wrap", children: /* @__PURE__ */ jsx(
188687
188690
  DynamicFormInfo,
188688
188691
  {
188689
188692
  rowLength: c,
188690
- item: d,
188693
+ item: f,
188691
188694
  isMobileApp
188692
188695
  }
188693
188696
  ) }) }) })
@@ -188702,7 +188705,7 @@ const win = window, WorkflowForm = (props) => {
188702
188705
  s
188703
188706
  );
188704
188707
  }) }) }),
188705
- masterDetailFormats.map((a, s) => {
188708
+ masterDetailFormats == null ? void 0 : masterDetailFormats.map((a, s) => {
188706
188709
  const c = (actions == null ? void 0 : actions.allowEditMasterDetail) && (actions == null ? void 0 : actions.allowEditMasterDetail[s]), u = (actions == null ? void 0 : actions.allowAddMasterDetail) && (actions == null ? void 0 : actions.allowAddMasterDetail[s]);
188707
188710
  return /* @__PURE__ */ jsx(
188708
188711
  MasterDetailTable,
@@ -188769,7 +188772,7 @@ const win = window, WorkflowForm = (props) => {
188769
188772
  value: note
188770
188773
  }
188771
188774
  ),
188772
- userWorkflowNotes.map((a) => /* @__PURE__ */ jsxs("div", { children: [
188775
+ userWorkflowNotes == null ? void 0 : userWorkflowNotes.map((a) => /* @__PURE__ */ jsxs("div", { children: [
188773
188776
  /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("span", { className: "fw-600", children: [
188774
188777
  a.user.fullName,
188775
188778
  /* @__PURE__ */ jsxs("span", { className: "notes", children: [
@@ -2,14 +2,16 @@ import { Theme } from "../MainLayout";
2
2
  import { LANGUAGE } from "../ConfigProvider";
3
3
  type WorkflowType = "Resource" | "Application" | "Workflow" | "Public";
4
4
  export interface WorkflowFormProps {
5
- theme: Theme;
6
- userWorkflowId: number;
5
+ theme?: Theme;
6
+ userWorkflowId?: number;
7
7
  workflowId?: number;
8
- locale: LANGUAGE;
9
- goBack: () => void;
8
+ locale?: LANGUAGE;
9
+ goBack?: () => void;
10
10
  isRedirect?: boolean;
11
11
  userType?: string;
12
- workflowType: WorkflowType;
12
+ workflowType?: WorkflowType;
13
+ /** Example: http://localhost:3000/api/ */
14
+ apiUrl: string;
13
15
  navigate?: (url: string, options?: {
14
16
  replace?: boolean;
15
17
  state?: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "beca-ui",
3
- "version": "2.0.18-beta.13",
3
+ "version": "2.0.18-beta.14",
4
4
  "description": "Becawork UI",
5
5
  "license": "MIT",
6
6
  "author": {