@strapi-community/plugin-better-auth-dashboard 1.0.0-alpha.5 → 1.0.0-alpha.7

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.
@@ -7,7 +7,7 @@ import { dashClient } from "@better-auth/infra/client";
7
7
  import { createAuthClient, InferPlugin } from "better-auth/client";
8
8
  import { Cross, Images, Trash, Plus, Pencil } from "@strapi/icons";
9
9
  import { useNotification, useFetchClient } from "@strapi/strapi/admin";
10
- import { g as getMediaLibraryComponent, P as PluginIcon } from "./index-QYGGdXAd.mjs";
10
+ import { g as getMediaLibraryComponent, a as getEditViewSidePanels, P as PluginIcon } from "./index-Y9SjzGQY.mjs";
11
11
  const dashPathMethods = () => ({
12
12
  id: "dash-path-methods",
13
13
  pathMethods: {
@@ -953,6 +953,21 @@ function CustomFieldsSection({
953
953
  )) })
954
954
  ] });
955
955
  }
956
+ function EditViewSidePanels({ model, documentId, document: document2 }) {
957
+ const panels = getEditViewSidePanels(model);
958
+ if (panels.length === 0) return null;
959
+ return /* @__PURE__ */ jsx(Fragment, { children: panels.map(({ id, title, Component }) => /* @__PURE__ */ jsxs(FormSection, { children: [
960
+ /* @__PURE__ */ jsx(SectionLabel, { children: title }),
961
+ /* @__PURE__ */ jsx(
962
+ Component,
963
+ {
964
+ model,
965
+ documentId,
966
+ document: document2
967
+ }
968
+ )
969
+ ] }, id)) });
970
+ }
956
971
  const SYSTEM_FIELDS = /* @__PURE__ */ new Set([
957
972
  "id",
958
973
  "documentId",
@@ -1132,9 +1147,13 @@ function OrganizationDetail({
1132
1147
  body
1133
1148
  );
1134
1149
  },
1135
- onSuccess: () => {
1150
+ onSuccess: async () => {
1151
+ await qc.invalidateQueries({
1152
+ queryKey: ["dash-strapi-org", organizationId]
1153
+ });
1136
1154
  qc.invalidateQueries({ queryKey: ["dash-org", organizationId] });
1137
1155
  qc.invalidateQueries({ queryKey: ["dash-organizations"] });
1156
+ qc.invalidateQueries({ queryKey: ["dash-strapi-org", organizationId] });
1138
1157
  setEditName(void 0);
1139
1158
  setEditSlug(void 0);
1140
1159
  setEditLogo(void 0);
@@ -1463,33 +1482,43 @@ function OrganizationDetail({
1463
1482
  }
1464
1483
  )
1465
1484
  ] }),
1466
- /* @__PURE__ */ jsx(EditSidebar, { children: /* @__PURE__ */ jsxs(FormSection, { children: [
1467
- /* @__PURE__ */ jsx(SectionLabel, { children: "Details" }),
1468
- /* @__PURE__ */ jsxs(
1469
- "div",
1485
+ /* @__PURE__ */ jsxs(EditSidebar, { children: [
1486
+ /* @__PURE__ */ jsxs(FormSection, { children: [
1487
+ /* @__PURE__ */ jsx(SectionLabel, { children: "Details" }),
1488
+ /* @__PURE__ */ jsxs(
1489
+ "div",
1490
+ {
1491
+ style: {
1492
+ display: "grid",
1493
+ gridTemplateColumns: "1fr 1fr",
1494
+ gap: 12
1495
+ },
1496
+ children: [
1497
+ /* @__PURE__ */ jsxs(MetaItem, { style: { gridColumn: "1 / -1" }, children: [
1498
+ /* @__PURE__ */ jsx(MetaKey, { children: "Organization ID" }),
1499
+ /* @__PURE__ */ jsx(MonoChip, { children: org?.id })
1500
+ ] }),
1501
+ /* @__PURE__ */ jsxs(MetaItem, { children: [
1502
+ /* @__PURE__ */ jsx(MetaKey, { children: "Members" }),
1503
+ /* @__PURE__ */ jsx(MetaVal, { children: org?.memberCount ?? 0 })
1504
+ ] }),
1505
+ /* @__PURE__ */ jsxs(MetaItem, { children: [
1506
+ /* @__PURE__ */ jsx(MetaKey, { children: "Created" }),
1507
+ /* @__PURE__ */ jsx(MetaVal, { children: org?.createdAt ? new Date(org.createdAt).toLocaleDateString() : "—" })
1508
+ ] })
1509
+ ]
1510
+ }
1511
+ )
1512
+ ] }),
1513
+ /* @__PURE__ */ jsx(
1514
+ EditViewSidePanels,
1470
1515
  {
1471
- style: {
1472
- display: "grid",
1473
- gridTemplateColumns: "1fr 1fr",
1474
- gap: 12
1475
- },
1476
- children: [
1477
- /* @__PURE__ */ jsxs(MetaItem, { style: { gridColumn: "1 / -1" }, children: [
1478
- /* @__PURE__ */ jsx(MetaKey, { children: "Organization ID" }),
1479
- /* @__PURE__ */ jsx(MonoChip, { children: org?.id })
1480
- ] }),
1481
- /* @__PURE__ */ jsxs(MetaItem, { children: [
1482
- /* @__PURE__ */ jsx(MetaKey, { children: "Members" }),
1483
- /* @__PURE__ */ jsx(MetaVal, { children: org?.memberCount ?? 0 })
1484
- ] }),
1485
- /* @__PURE__ */ jsxs(MetaItem, { children: [
1486
- /* @__PURE__ */ jsx(MetaKey, { children: "Created" }),
1487
- /* @__PURE__ */ jsx(MetaVal, { children: org?.createdAt ? new Date(org.createdAt).toLocaleDateString() : "—" })
1488
- ] })
1489
- ]
1516
+ model: "plugin::better-auth.organization",
1517
+ documentId: strapiOrgQuery.data?.documentId,
1518
+ document: strapiOrgQuery.data ?? void 0
1490
1519
  }
1491
1520
  )
1492
- ] }) })
1521
+ ] })
1493
1522
  ] }) }),
1494
1523
  /* @__PURE__ */ jsx(Tabs.Content, { value: "members", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 5, paddingTop: 6, children: [
1495
1524
  /* @__PURE__ */ jsxs(FormSection, { children: [
@@ -4069,10 +4098,10 @@ function UserDetailDrawer({
4069
4098
  body
4070
4099
  );
4071
4100
  },
4072
- onSuccess: () => {
4101
+ onSuccess: async () => {
4102
+ await qc.invalidateQueries({ queryKey: ["dash-strapi-user", userId] });
4073
4103
  qc.invalidateQueries({ queryKey: ["dash-user", userId] });
4074
4104
  qc.invalidateQueries({ queryKey: ["dash-users"] });
4075
- qc.invalidateQueries({ queryKey: ["dash-strapi-user", userId] });
4076
4105
  setEditName(void 0);
4077
4106
  setEditEmail(void 0);
4078
4107
  setEditEmailVerified(void 0);
@@ -4569,7 +4598,15 @@ function UserDetailDrawer({
4569
4598
  }
4570
4599
  )
4571
4600
  ] })
4572
- ] })
4601
+ ] }),
4602
+ /* @__PURE__ */ jsx(
4603
+ EditViewSidePanels,
4604
+ {
4605
+ model: "plugin::better-auth.user",
4606
+ documentId: strapiUserQuery.data?.documentId,
4607
+ document: strapiUserQuery.data ?? void 0
4608
+ }
4609
+ )
4573
4610
  ] })
4574
4611
  ] }) }),
4575
4612
  /* @__PURE__ */ jsx(Tabs.Content, { value: "security", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 5, paddingTop: 6, children: [
@@ -5684,3 +5721,4 @@ export {
5684
5721
  Root,
5685
5722
  Root as default
5686
5723
  };
5724
+ //# sourceMappingURL=Root-Rol-uNmC.mjs.map