@medha-analytics/medha-one-access-react 1.0.9 → 1.0.10

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.js CHANGED
@@ -14400,27 +14400,31 @@ function vb({ className: e, ...t }) {
14400
14400
  }
14401
14401
  //#endregion
14402
14402
  //#region src/components/shared/DataTable.tsx
14403
- function yb({ columns: e, data: t, totalCount: n, isLoading: r = !1, emptyMessage: i = "No results found", onSearchChange: a, onPaginationChange: s, pageSize: l = 20, searchPlaceholder: u = "Search...", toolbar: p, statusFilter: m, onStatusFilterChange: h }) {
14404
- let [v, y] = f({
14403
+ function yb({ columns: e, data: t, totalCount: n, isLoading: r = !1, emptyMessage: i = "No results found", onSearchChange: a, searchValue: s, onPaginationChange: l, pageSize: u = 20, searchPlaceholder: p = "Search...", toolbar: m, statusFilter: h, onStatusFilterChange: v }) {
14404
+ let [y, b] = f({
14405
14405
  pageIndex: 0,
14406
- pageSize: l
14407
- }), [b, x] = f(""), S = d(void 0), C = o((e) => {
14408
- x(e), S.current && clearTimeout(S.current), S.current = setTimeout(() => a?.(e), 400);
14406
+ pageSize: u
14407
+ }), [x, S] = f(s ?? ""), C = d(void 0);
14408
+ c(() => {
14409
+ s !== void 0 && S(s);
14410
+ }, [s]);
14411
+ let w = o((e) => {
14412
+ S(e), C.current && clearTimeout(C.current), C.current = setTimeout(() => a?.(e), 400);
14409
14413
  }, [a]);
14410
14414
  c(() => () => {
14411
- S.current && clearTimeout(S.current);
14415
+ C.current && clearTimeout(C.current);
14412
14416
  }, []), c(() => {
14413
- s?.(v);
14414
- }, [v, s]);
14415
- let w = Cn({
14417
+ l?.(y);
14418
+ }, [y, l]);
14419
+ let T = Cn({
14416
14420
  data: t,
14417
14421
  columns: e,
14418
- pageCount: Math.ceil(n / v.pageSize),
14419
- state: { pagination: v },
14420
- onPaginationChange: y,
14422
+ pageCount: Math.ceil(n / y.pageSize),
14423
+ state: { pagination: y },
14424
+ onPaginationChange: b,
14421
14425
  getCoreRowModel: vn(),
14422
14426
  manualPagination: !0
14423
- }), T = Math.ceil(n / v.pageSize);
14427
+ }), E = Math.ceil(n / y.pageSize);
14424
14428
  return /* @__PURE__ */ _("div", {
14425
14429
  className: "space-y-4",
14426
14430
  children: [
@@ -14430,45 +14434,45 @@ function yb({ columns: e, data: t, totalCount: n, isLoading: r = !1, emptyMessag
14430
14434
  a && /* @__PURE__ */ _("div", {
14431
14435
  className: "relative flex-1 max-w-sm",
14432
14436
  children: [/* @__PURE__ */ g(xe, { className: "absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground" }), /* @__PURE__ */ g(ub, {
14433
- placeholder: u,
14434
- value: b,
14435
- onChange: (e) => C(e.target.value),
14437
+ placeholder: p,
14438
+ value: x,
14439
+ onChange: (e) => w(e.target.value),
14436
14440
  className: "pl-8"
14437
14441
  })]
14438
14442
  }),
14439
- h && /* @__PURE__ */ g("div", {
14443
+ v && /* @__PURE__ */ g("div", {
14440
14444
  className: "flex items-center rounded-md border",
14441
14445
  children: [
14442
14446
  "all",
14443
14447
  "active",
14444
14448
  "inactive"
14445
14449
  ].map((e) => /* @__PURE__ */ g("button", {
14446
- onClick: () => h(e),
14447
- className: H("cursor-pointer px-3 py-1.5 text-xs font-medium capitalize transition-colors first:rounded-l-md last:rounded-r-md", m === e ? "bg-primary text-primary-foreground" : "bg-background text-muted-foreground hover:bg-accent"),
14450
+ onClick: () => v(e),
14451
+ className: H("cursor-pointer px-3 py-1.5 text-xs font-medium capitalize transition-colors first:rounded-l-md last:rounded-r-md", h === e ? "bg-primary text-primary-foreground" : "bg-background text-muted-foreground hover:bg-accent"),
14448
14452
  children: e
14449
14453
  }, e))
14450
14454
  }),
14451
- p && /* @__PURE__ */ g("div", {
14455
+ m && /* @__PURE__ */ g("div", {
14452
14456
  className: "flex items-center gap-2",
14453
- children: p
14457
+ children: m
14454
14458
  })
14455
14459
  ]
14456
14460
  }),
14457
14461
  /* @__PURE__ */ g("div", {
14458
14462
  className: "rounded-md border",
14459
- children: /* @__PURE__ */ _(ib, { children: [/* @__PURE__ */ g(ab, { children: w.getHeaderGroups().map((e) => /* @__PURE__ */ g(sb, { children: e.headers.map((e) => /* @__PURE__ */ g(cb, { children: e.isPlaceholder ? null : yn(e.column.columnDef.header, e.getContext()) }, e.id)) }, e.id)) }), /* @__PURE__ */ g(ob, { children: r ? Array.from({ length: v.pageSize }).map((t, n) => /* @__PURE__ */ g(sb, { children: e.map((e, t) => /* @__PURE__ */ g(lb, { children: /* @__PURE__ */ g(vb, { className: "h-4 w-full animate-pulse" }) }, t)) }, n)) : w.getRowModel().rows.length === 0 ? /* @__PURE__ */ g(sb, { children: /* @__PURE__ */ g(lb, {
14463
+ children: /* @__PURE__ */ _(ib, { children: [/* @__PURE__ */ g(ab, { children: T.getHeaderGroups().map((e) => /* @__PURE__ */ g(sb, { children: e.headers.map((e) => /* @__PURE__ */ g(cb, { children: e.isPlaceholder ? null : yn(e.column.columnDef.header, e.getContext()) }, e.id)) }, e.id)) }), /* @__PURE__ */ g(ob, { children: r ? Array.from({ length: y.pageSize }).map((t, n) => /* @__PURE__ */ g(sb, { children: e.map((e, t) => /* @__PURE__ */ g(lb, { children: /* @__PURE__ */ g(vb, { className: "h-4 w-full animate-pulse" }) }, t)) }, n)) : T.getRowModel().rows.length === 0 ? /* @__PURE__ */ g(sb, { children: /* @__PURE__ */ g(lb, {
14460
14464
  colSpan: e.length,
14461
14465
  className: "h-24 text-center text-muted-foreground",
14462
14466
  children: i
14463
- }) }) : w.getRowModel().rows.map((e) => /* @__PURE__ */ g(sb, { children: e.getVisibleCells().map((e) => /* @__PURE__ */ g(lb, { children: yn(e.column.columnDef.cell, e.getContext()) }, e.id)) }, e.id)) })] })
14467
+ }) }) : T.getRowModel().rows.map((e) => /* @__PURE__ */ g(sb, { children: e.getVisibleCells().map((e) => /* @__PURE__ */ g(lb, { children: yn(e.column.columnDef.cell, e.getContext()) }, e.id)) }, e.id)) })] })
14464
14468
  }),
14465
14469
  n > 0 && /* @__PURE__ */ _("div", {
14466
14470
  className: "flex items-center justify-between",
14467
14471
  children: [/* @__PURE__ */ _("div", {
14468
14472
  className: "flex items-center gap-2 text-sm text-muted-foreground",
14469
14473
  children: [/* @__PURE__ */ g("span", { children: "Rows per page:" }), /* @__PURE__ */ _(db, {
14470
- value: String(v.pageSize),
14471
- onValueChange: (e) => y({
14474
+ value: String(y.pageSize),
14475
+ onValueChange: (e) => b({
14472
14476
  pageIndex: 0,
14473
14477
  pageSize: Number(e)
14474
14478
  }),
@@ -14490,9 +14494,9 @@ function yb({ columns: e, data: t, totalCount: n, isLoading: r = !1, emptyMessag
14490
14494
  /* @__PURE__ */ _("span", {
14491
14495
  className: "text-muted-foreground",
14492
14496
  children: [
14493
- v.pageIndex * v.pageSize + 1,
14497
+ y.pageIndex * y.pageSize + 1,
14494
14498
  "–",
14495
- Math.min((v.pageIndex + 1) * v.pageSize, n),
14499
+ Math.min((y.pageIndex + 1) * y.pageSize, n),
14496
14500
  " of ",
14497
14501
  n
14498
14502
  ]
@@ -14500,21 +14504,21 @@ function yb({ columns: e, data: t, totalCount: n, isLoading: r = !1, emptyMessag
14500
14504
  /* @__PURE__ */ g(qh, {
14501
14505
  variant: "ghost",
14502
14506
  size: "icon",
14503
- onClick: () => y((e) => ({
14507
+ onClick: () => b((e) => ({
14504
14508
  ...e,
14505
14509
  pageIndex: e.pageIndex - 1
14506
14510
  })),
14507
- disabled: v.pageIndex === 0,
14511
+ disabled: y.pageIndex === 0,
14508
14512
  children: /* @__PURE__ */ g(pe, { className: "h-4 w-4" })
14509
14513
  }),
14510
14514
  /* @__PURE__ */ g(qh, {
14511
14515
  variant: "ghost",
14512
14516
  size: "icon",
14513
- onClick: () => y((e) => ({
14517
+ onClick: () => b((e) => ({
14514
14518
  ...e,
14515
14519
  pageIndex: e.pageIndex + 1
14516
14520
  })),
14517
- disabled: v.pageIndex >= T - 1,
14521
+ disabled: y.pageIndex >= E - 1,
14518
14522
  children: /* @__PURE__ */ g(me, { className: "h-4 w-4" })
14519
14523
  })
14520
14524
  ]
@@ -18678,7 +18682,7 @@ function sw(e) {
18678
18682
  let t = G();
18679
18683
  return C({
18680
18684
  queryKey: ["users", e],
18681
- queryFn: async () => (await t.get(`/users/${e}`)).data,
18685
+ queryFn: async () => (await t.get(`/users/${encodeURIComponent(e)}`)).data,
18682
18686
  enabled: !!e
18683
18687
  });
18684
18688
  }
@@ -18703,7 +18707,7 @@ function lw(e) {
18703
18707
  e,
18704
18708
  "groups"
18705
18709
  ],
18706
- queryFn: async () => (await t.get(`/users/${e}/groups`)).data.groups ?? [],
18710
+ queryFn: async () => (await t.get(`/users/${encodeURIComponent(e)}/groups`)).data.groups ?? [],
18707
18711
  enabled: !!e
18708
18712
  });
18709
18713
  }
@@ -18731,7 +18735,7 @@ function fw() {
18731
18735
  let e = G(), t = w();
18732
18736
  return S({
18733
18737
  mutationFn: async (t) => {
18734
- let n = t.id || t.email || "", r = t.first_name ?? "", i = t.last_name ?? "", a = t.email ?? "", o = t.department ?? "", s = t.role ?? "", c = t.manager_id || null, l = {
18738
+ let n = (t.id || t.email || "").trim(), r = t.first_name ?? "", i = t.last_name ?? "", a = t.email ?? "", o = t.department ?? "", s = t.role ?? "", c = t.manager_id || null, l = {
18735
18739
  type: t.type ?? "USER",
18736
18740
  active: t.active ?? !0,
18737
18741
  id: n,
@@ -18762,7 +18766,7 @@ function fw() {
18762
18766
  function pw() {
18763
18767
  let e = G(), t = w();
18764
18768
  return S({
18765
- mutationFn: async (t) => (await e.put(`/users/${t.id}`, t)).data,
18769
+ mutationFn: async (t) => (await e.put(`/users/${encodeURIComponent(t.id)}`, t)).data,
18766
18770
  onSuccess: (e, n) => {
18767
18771
  t.invalidateQueries({ queryKey: ["users"] }), t.invalidateQueries({ queryKey: ["users", n.id] });
18768
18772
  }
@@ -18772,7 +18776,7 @@ function mw() {
18772
18776
  let e = G(), t = w();
18773
18777
  return S({
18774
18778
  mutationFn: async (t) => {
18775
- await e.delete(`/users/${t}`);
18779
+ await e.delete(`/users/${encodeURIComponent(t)}`);
18776
18780
  },
18777
18781
  onSuccess: () => t.invalidateQueries({ queryKey: ["users"] })
18778
18782
  });
@@ -18825,7 +18829,7 @@ function vw(e) {
18825
18829
  let t = G();
18826
18830
  return C({
18827
18831
  queryKey: ["access-rules", e],
18828
- queryFn: async () => hw((await t.get(`/access-rules/${e}`)).data),
18832
+ queryFn: async () => hw((await t.get(`/access-rules/${encodeURIComponent(e)}`)).data),
18829
18833
  enabled: !!e
18830
18834
  });
18831
18835
  }
@@ -18888,7 +18892,7 @@ function Cw(e) {
18888
18892
  "usergroup",
18889
18893
  e
18890
18894
  ],
18891
- queryFn: async () => xw((await t.get(`/access/usergroup/${e}`)).data.resolvedAccess),
18895
+ queryFn: async () => xw((await t.get(`/access/usergroup/${encodeURIComponent(e)}`)).data.resolvedAccess),
18892
18896
  enabled: !!e
18893
18897
  });
18894
18898
  }
@@ -18900,7 +18904,7 @@ function ww(e) {
18900
18904
  "resource",
18901
18905
  e
18902
18906
  ],
18903
- queryFn: async () => xw((await t.get(`/access/resource/${e}`)).data.users_with_access),
18907
+ queryFn: async () => xw((await t.get(`/access/resource/${encodeURIComponent(e)}`)).data.users_with_access),
18904
18908
  enabled: !!e
18905
18909
  });
18906
18910
  }
@@ -18912,7 +18916,7 @@ function Tw(e) {
18912
18916
  "resourcegroup",
18913
18917
  e
18914
18918
  ],
18915
- queryFn: async () => xw((await t.get(`/access/resourcegroup/${e}`)).data.users_with_access),
18919
+ queryFn: async () => xw((await t.get(`/access/resourcegroup/${encodeURIComponent(e)}`)).data.users_with_access),
18916
18920
  enabled: !!e
18917
18921
  });
18918
18922
  }
@@ -18966,7 +18970,7 @@ function Ow() {
18966
18970
  function kw() {
18967
18971
  let e = G(), t = w();
18968
18972
  return S({
18969
- mutationFn: async (t) => (await e.put(`/access-rules/${t.id}`, Dw(t))).data,
18973
+ mutationFn: async (t) => (await e.put(`/access-rules/${encodeURIComponent(t.id)}`, Dw(t))).data,
18970
18974
  onSuccess: (e, n) => {
18971
18975
  t.invalidateQueries({ queryKey: ["access-rules"] }), t.invalidateQueries({ queryKey: ["access-rules", n.id] });
18972
18976
  }
@@ -18976,7 +18980,7 @@ function Aw() {
18976
18980
  let e = G(), t = w();
18977
18981
  return S({
18978
18982
  mutationFn: async (t) => {
18979
- await e.delete(`/access-rules/${t}`);
18983
+ await e.delete(`/access-rules/${encodeURIComponent(t)}`);
18980
18984
  },
18981
18985
  onSuccess: () => t.invalidateQueries({ queryKey: ["access-rules"] })
18982
18986
  });
@@ -19282,7 +19286,7 @@ function Iw(e) {
19282
19286
  let t = G();
19283
19287
  return C({
19284
19288
  queryKey: ["artifacts", e],
19285
- queryFn: async () => (await t.get(`/artifacts/${e}`)).data,
19289
+ queryFn: async () => (await t.get(`/artifacts/${encodeURIComponent(e)}`)).data,
19286
19290
  enabled: !!e
19287
19291
  });
19288
19292
  }
@@ -19300,7 +19304,7 @@ function Rw(e) {
19300
19304
  let t = G();
19301
19305
  return C({
19302
19306
  queryKey: ["artifact-groups", e],
19303
- queryFn: async () => (await t.get(`/artifacts/${e}`)).data,
19307
+ queryFn: async () => (await t.get(`/artifacts/${encodeURIComponent(e)}`)).data,
19304
19308
  enabled: !!e
19305
19309
  });
19306
19310
  }
@@ -19312,7 +19316,7 @@ function zw(e) {
19312
19316
  e,
19313
19317
  "contents"
19314
19318
  ],
19315
- queryFn: async () => (await t.get(`/resourcegroups/${e}/contents`)).data.contents ?? [],
19319
+ queryFn: async () => (await t.get(`/resourcegroups/${encodeURIComponent(e)}/contents`)).data.contents ?? [],
19316
19320
  enabled: !!e
19317
19321
  });
19318
19322
  }
@@ -19324,7 +19328,7 @@ function Bw(e) {
19324
19328
  e,
19325
19329
  "groups"
19326
19330
  ],
19327
- queryFn: async () => (await t.get(`/artifacts/${e}/groups`)).data.groups ?? [],
19331
+ queryFn: async () => (await t.get(`/artifacts/${encodeURIComponent(e)}/groups`)).data.groups ?? [],
19328
19332
  enabled: !!e
19329
19333
  });
19330
19334
  }
@@ -19348,7 +19352,7 @@ function Hw() {
19348
19352
  function Uw() {
19349
19353
  let e = G(), t = w();
19350
19354
  return S({
19351
- mutationFn: async (t) => (await e.put(`/artifacts/${t.id}`, t)).data,
19355
+ mutationFn: async (t) => (await e.put(`/artifacts/${encodeURIComponent(t.id)}`, t)).data,
19352
19356
  onSuccess: (e, n) => {
19353
19357
  t.invalidateQueries({ queryKey: ["artifacts"] }), t.invalidateQueries({ queryKey: ["artifacts", n.id] });
19354
19358
  }
@@ -19358,7 +19362,7 @@ function Ww() {
19358
19362
  let e = G(), t = w();
19359
19363
  return S({
19360
19364
  mutationFn: async (t) => {
19361
- await e.delete(`/artifacts/${t}`);
19365
+ await e.delete(`/artifacts/${encodeURIComponent(t)}`);
19362
19366
  },
19363
19367
  onSuccess: () => t.invalidateQueries({ queryKey: ["artifacts"] })
19364
19368
  });
@@ -19591,7 +19595,7 @@ function Qw(e) {
19591
19595
  let t = G();
19592
19596
  return C({
19593
19597
  queryKey: ["groups", e],
19594
- queryFn: async () => (await t.get(`/users/${e}`)).data,
19598
+ queryFn: async () => (await t.get(`/users/${encodeURIComponent(e)}`)).data,
19595
19599
  enabled: !!e
19596
19600
  });
19597
19601
  }
@@ -19603,7 +19607,7 @@ function $w(e) {
19603
19607
  e,
19604
19608
  "members"
19605
19609
  ],
19606
- queryFn: async () => ((await t.get(`/usergroups/${e}/members`)).data.members ?? []).map((e) => ({
19610
+ queryFn: async () => ((await t.get(`/usergroups/${encodeURIComponent(e)}/members`)).data.members ?? []).map((e) => ({
19607
19611
  id: e.id,
19608
19612
  name: [e.first_name, e.last_name].filter(Boolean).join(" ") || e.id,
19609
19613
  email: e.email,
@@ -19616,7 +19620,7 @@ function eT() {
19616
19620
  let e = G(), t = w();
19617
19621
  return S({
19618
19622
  mutationFn: async (t) => {
19619
- let n = t.id || t.name || "", r = t.description ?? "", i = {
19623
+ let n = (t.id || t.name || "").trim(), r = t.description ?? "", i = {
19620
19624
  id: n,
19621
19625
  type: "USERGROUP",
19622
19626
  active: t.active ?? !0,
@@ -19638,7 +19642,7 @@ function eT() {
19638
19642
  function tT() {
19639
19643
  let e = G(), t = w();
19640
19644
  return S({
19641
- mutationFn: async (t) => (await e.put(`/users/${t.id}`, t)).data,
19645
+ mutationFn: async (t) => (await e.put(`/users/${encodeURIComponent(t.id)}`, t)).data,
19642
19646
  onSuccess: (e, n) => {
19643
19647
  t.invalidateQueries({ queryKey: ["groups"] }), t.invalidateQueries({ queryKey: ["groups", n.id] });
19644
19648
  }
@@ -19648,7 +19652,7 @@ function nT() {
19648
19652
  let e = G(), t = w();
19649
19653
  return S({
19650
19654
  mutationFn: async (t) => {
19651
- await e.delete(`/users/${t}`);
19655
+ await e.delete(`/users/${encodeURIComponent(t)}`);
19652
19656
  },
19653
19657
  onSuccess: () => t.invalidateQueries({ queryKey: ["groups"] })
19654
19658
  });
@@ -19657,7 +19661,7 @@ function rT() {
19657
19661
  let e = G(), t = w();
19658
19662
  return S({
19659
19663
  mutationFn: async ({ groupId: t, userId: n }) => {
19660
- await e.post(`/usergroups/${t}/members`, { user_id: n });
19664
+ await e.post(`/usergroups/${encodeURIComponent(t)}/members`, { user_id: n });
19661
19665
  },
19662
19666
  onSuccess: (e, { groupId: n }) => t.invalidateQueries({ queryKey: [
19663
19667
  "groups",
@@ -19670,7 +19674,7 @@ function iT() {
19670
19674
  let e = G(), t = w();
19671
19675
  return S({
19672
19676
  mutationFn: async ({ groupId: t, userId: n }) => {
19673
- await e.delete(`/usergroups/${t}/members/${n}`);
19677
+ await e.delete(`/usergroups/${encodeURIComponent(t)}/members/${encodeURIComponent(n)}`);
19674
19678
  },
19675
19679
  onSuccess: (e, { groupId: n }) => t.invalidateQueries({ queryKey: [
19676
19680
  "groups",
@@ -20658,18 +20662,29 @@ function yT({ open: e, onClose: t, artifact: n, currentApplication: r, isAdmin:
20658
20662
  //#endregion
20659
20663
  //#region src/components/views/ArtifactsView.tsx
20660
20664
  function bT() {
20661
- let { currentApplication: e, isAdmin: t } = Jy(), [n, r] = f(0), [i, a] = f(20), [o, s] = f(""), [c, l] = f("RESOURCE"), [u, d] = f("all"), [p, m] = f("all"), [h, v] = f(!1), [y, b] = f(), [x, S] = f(), { data: C = [] } = Vw(), w = t ? p === "all" ? void 0 : p : e, { data: T = [], isLoading: E, isError: D, refetch: O } = Pw({
20665
+ let { currentApplication: e, isAdmin: t } = Jy(), [n, r] = f(0), [i, a] = f(20), [o, s] = f(""), [c, l] = f(0), [u, d] = f(20), [p, m] = f(""), [h, v] = f("RESOURCE"), [y, b] = f("all"), [x, S] = f("all"), [C, w] = f(!1), [T, E] = f(), [D, O] = f(), { data: k = [] } = Vw(), A = t ? x === "all" ? void 0 : x : e, j = y === "active" ? !0 : y === "inactive" ? !1 : void 0, { data: M = [], isLoading: ee, isError: N, refetch: te } = Pw({
20662
20666
  skip: n,
20663
20667
  limit: i,
20664
- type: c,
20665
- appName: w,
20666
- activeOnly: u === "active" ? !0 : u === "inactive" ? !1 : void 0,
20668
+ type: "RESOURCE",
20669
+ appName: A,
20670
+ activeOnly: j,
20667
20671
  search: o
20668
- }), { data: k = 0 } = Fw({
20669
- type: c,
20670
- appName: w,
20672
+ }), { data: P = 0 } = Fw({
20673
+ type: "RESOURCE",
20674
+ appName: A,
20671
20675
  search: o
20672
- }), A = Ww(), { data: j = [] } = gT(), M = [
20676
+ }), { data: ne = [], isLoading: re, isError: ie, refetch: ae } = Pw({
20677
+ skip: c,
20678
+ limit: u,
20679
+ type: "RESOURCEGROUP",
20680
+ appName: A,
20681
+ activeOnly: j,
20682
+ search: p
20683
+ }), { data: oe = 0 } = Fw({
20684
+ type: "RESOURCEGROUP",
20685
+ appName: A,
20686
+ search: p
20687
+ }), se = Ww(), { data: ce = [] } = gT(), le = [
20673
20688
  {
20674
20689
  accessorKey: "name",
20675
20690
  header: "Name"
@@ -20700,27 +20715,27 @@ function bT() {
20700
20715
  variant: "ghost",
20701
20716
  size: "icon",
20702
20717
  onClick: () => {
20703
- b(e.original), v(!0);
20718
+ E(e.original), w(!0);
20704
20719
  },
20705
20720
  children: /* @__PURE__ */ g(ye, { className: "h-4 w-4" })
20706
20721
  }), /* @__PURE__ */ g(qh, {
20707
20722
  variant: "ghost",
20708
20723
  size: "icon",
20709
- onClick: () => S(e.original),
20724
+ onClick: () => O(e.original),
20710
20725
  children: /* @__PURE__ */ g(Ce, { className: "h-4 w-4 text-destructive" })
20711
20726
  })]
20712
20727
  })
20713
20728
  }
20714
- ], ee = t ? /* @__PURE__ */ _(db, {
20715
- value: p,
20716
- onValueChange: m,
20729
+ ], F = t ? /* @__PURE__ */ _(db, {
20730
+ value: x,
20731
+ onValueChange: S,
20717
20732
  children: [/* @__PURE__ */ g(pb, {
20718
20733
  className: "h-8 w-40",
20719
20734
  children: /* @__PURE__ */ g(fb, { placeholder: "All applications" })
20720
20735
  }), /* @__PURE__ */ _(mb, { children: [/* @__PURE__ */ g(hb, {
20721
20736
  value: "all",
20722
20737
  children: "All applications"
20723
- }), C.map((e) => /* @__PURE__ */ g(hb, {
20738
+ }), k.map((e) => /* @__PURE__ */ g(hb, {
20724
20739
  value: e,
20725
20740
  children: e
20726
20741
  }, e))] })]
@@ -20731,7 +20746,7 @@ function bT() {
20731
20746
  /* @__PURE__ */ _(Vh, {
20732
20747
  defaultValue: "resources",
20733
20748
  onValueChange: (e) => {
20734
- e === "resources" ? l("RESOURCE") : e === "groups" && l("RESOURCEGROUP");
20749
+ e === "resources" ? v("RESOURCE") : e === "groups" && v("RESOURCEGROUP");
20735
20750
  },
20736
20751
  children: [
20737
20752
  /* @__PURE__ */ _("div", {
@@ -20751,18 +20766,18 @@ function bT() {
20751
20766
  })
20752
20767
  ] }), /* @__PURE__ */ _(qh, {
20753
20768
  onClick: () => {
20754
- b(void 0), v(!0);
20769
+ E(void 0), w(!0);
20755
20770
  },
20756
20771
  children: [
20757
20772
  /* @__PURE__ */ g(ge, { className: "mr-2 h-4 w-4" }),
20758
20773
  " Add ",
20759
- c === "RESOURCE" ? "Artifact" : "Group"
20774
+ h === "RESOURCE" ? "Artifact" : "Group"
20760
20775
  ]
20761
20776
  })]
20762
20777
  }),
20763
20778
  /* @__PURE__ */ g(Gh, {
20764
20779
  value: "resources",
20765
- children: D ? /* @__PURE__ */ _("div", {
20780
+ children: N ? /* @__PURE__ */ _("div", {
20766
20781
  className: "rounded-md border border-destructive/50 p-4 flex items-center justify-between",
20767
20782
  children: [/* @__PURE__ */ g("span", {
20768
20783
  className: "text-sm text-destructive",
@@ -20770,74 +20785,91 @@ function bT() {
20770
20785
  }), /* @__PURE__ */ g(qh, {
20771
20786
  variant: "outline",
20772
20787
  size: "sm",
20773
- onClick: () => O(),
20788
+ onClick: () => te(),
20774
20789
  children: "Retry"
20775
20790
  })]
20776
20791
  }) : /* @__PURE__ */ g(yb, {
20777
- columns: M,
20778
- data: T,
20779
- totalCount: k,
20780
- isLoading: E,
20792
+ columns: le,
20793
+ data: M,
20794
+ totalCount: P,
20795
+ isLoading: ee,
20781
20796
  emptyMessage: "No artifacts found",
20782
20797
  searchPlaceholder: "Search artifacts...",
20798
+ searchValue: o,
20783
20799
  onSearchChange: (e) => {
20784
20800
  s(e), r(0);
20785
20801
  },
20786
20802
  onPaginationChange: (e) => {
20787
20803
  r(e.pageIndex * e.pageSize), a(e.pageSize);
20788
20804
  },
20789
- statusFilter: u,
20805
+ statusFilter: y,
20790
20806
  onStatusFilterChange: (e) => {
20791
- d(e), r(0);
20807
+ b(e), r(0);
20792
20808
  },
20793
- toolbar: ee
20809
+ toolbar: F
20794
20810
  })
20795
20811
  }),
20796
20812
  /* @__PURE__ */ g(Gh, {
20797
20813
  value: "groups",
20798
- children: /* @__PURE__ */ g(yb, {
20799
- columns: M,
20800
- data: T,
20801
- totalCount: k,
20802
- isLoading: E,
20814
+ children: ie ? /* @__PURE__ */ _("div", {
20815
+ className: "rounded-md border border-destructive/50 p-4 flex items-center justify-between",
20816
+ children: [/* @__PURE__ */ g("span", {
20817
+ className: "text-sm text-destructive",
20818
+ children: "Failed to load artifact groups"
20819
+ }), /* @__PURE__ */ g(qh, {
20820
+ variant: "outline",
20821
+ size: "sm",
20822
+ onClick: () => ae(),
20823
+ children: "Retry"
20824
+ })]
20825
+ }) : /* @__PURE__ */ g(yb, {
20826
+ columns: le,
20827
+ data: ne,
20828
+ totalCount: oe,
20829
+ isLoading: re,
20803
20830
  emptyMessage: "No artifact groups found",
20831
+ searchPlaceholder: "Search artifact groups...",
20832
+ searchValue: p,
20833
+ onSearchChange: (e) => {
20834
+ m(e), l(0);
20835
+ },
20804
20836
  onPaginationChange: (e) => {
20805
- r(e.pageIndex * e.pageSize), a(e.pageSize);
20837
+ l(e.pageIndex * e.pageSize), d(e.pageSize);
20806
20838
  },
20807
- statusFilter: u,
20839
+ statusFilter: y,
20808
20840
  onStatusFilterChange: (e) => {
20809
- d(e), r(0);
20841
+ b(e), l(0);
20810
20842
  },
20811
- toolbar: ee
20843
+ toolbar: F
20812
20844
  })
20813
20845
  }),
20814
20846
  /* @__PURE__ */ g(Gh, {
20815
20847
  value: "hierarchy",
20816
20848
  children: /* @__PURE__ */ g(Rb, {
20817
- nodes: j,
20849
+ nodes: ce,
20818
20850
  searchable: !0
20819
20851
  })
20820
20852
  })
20821
20853
  ]
20822
20854
  }),
20823
20855
  /* @__PURE__ */ g(yT, {
20824
- open: h,
20856
+ open: C,
20825
20857
  onClose: () => {
20826
- v(!1), b(void 0);
20858
+ w(!1), E(void 0);
20827
20859
  },
20828
- artifact: y,
20860
+ artifact: T,
20829
20861
  currentApplication: e,
20830
20862
  isAdmin: t
20831
20863
  }),
20832
20864
  /* @__PURE__ */ g(Ab, {
20833
- open: !!x,
20865
+ open: !!D,
20834
20866
  title: "Delete Artifact",
20835
- description: `Delete "${x?.name}"? This cannot be undone.`,
20867
+ description: `Delete "${D?.name}"? This cannot be undone.`,
20836
20868
  confirmLabel: "Delete",
20837
20869
  onConfirm: async () => {
20838
- x && await A.mutateAsync(x.id), S(void 0);
20870
+ D && await se.mutateAsync(D.id), O(void 0);
20839
20871
  },
20840
- onCancel: () => S(void 0)
20872
+ onCancel: () => O(void 0)
20841
20873
  })
20842
20874
  ]
20843
20875
  });