@rebasepro/auth 0.0.1-canary.bbcb8b4 → 0.0.1-canary.c53f5db

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.es.js CHANGED
@@ -1457,6 +1457,7 @@ function LoginForm({
1457
1457
  {
1458
1458
  type: "submit",
1459
1459
  variant: "filled",
1460
+ color: "primary",
1460
1461
  className: "w-full mt-1",
1461
1462
  size: "large",
1462
1463
  loading: authController.authLoading,
@@ -1578,6 +1579,7 @@ function ForgotPasswordForm({
1578
1579
  {
1579
1580
  type: "submit",
1580
1581
  variant: "filled",
1582
+ color: "primary",
1581
1583
  className: "w-full",
1582
1584
  size: "large",
1583
1585
  loading: authController.authLoading,
@@ -1633,6 +1635,7 @@ function RoleChip({ role }) {
1633
1635
  }
1634
1636
  function UsersView({ userManagement, apiUrl, getAuthToken }) {
1635
1637
  const { users, roles, saveUser, deleteUser, loading } = userManagement;
1638
+ const usersError = "usersError" in userManagement ? userManagement.usersError : void 0;
1636
1639
  const snackbarController = useSnackbarController();
1637
1640
  const { user: loggedInUser } = useAuthController();
1638
1641
  const [dialogOpen, setDialogOpen] = useState(false);
@@ -1709,7 +1712,7 @@ function UsersView({ userManagement, apiUrl, getAuthToken }) {
1709
1712
  return /* @__PURE__ */ jsx(CenteredView, { children: /* @__PURE__ */ jsx(CircularProgress, {}) });
1710
1713
  }
1711
1714
  return /* @__PURE__ */ jsxs(Container, { className: "w-full flex flex-col py-4 gap-4", maxWidth: "6xl", children: [
1712
- !hasAdmin && loggedInUser && /* @__PURE__ */ jsxs("div", { className: "bg-yellow-100 dark:bg-yellow-900 border border-yellow-400 dark:border-yellow-700 rounded p-4 flex items-center justify-between", children: [
1715
+ !hasAdmin && !usersError && loggedInUser && /* @__PURE__ */ jsxs("div", { className: "bg-yellow-100 dark:bg-yellow-900 border border-yellow-400 dark:border-yellow-700 rounded p-4 flex items-center justify-between", children: [
1713
1716
  /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(Typography, { variant: "label", className: "text-yellow-800 dark:text-yellow-200", children: "No admin users exist. You can make yourself an admin." }) }),
1714
1717
  /* @__PURE__ */ jsx(
1715
1718
  Button,
@@ -1752,7 +1755,10 @@ function UsersView({ userManagement, apiUrl, getAuthToken }) {
1752
1755
  return role ? /* @__PURE__ */ jsx(RoleChip, { role }, roleId) : /* @__PURE__ */ jsx("span", { children: roleId }, roleId);
1753
1756
  }) }) })
1754
1757
  ] }, user.uid)),
1755
- users.length === 0 && /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colspan: 4, children: /* @__PURE__ */ jsx(CenteredView, { className: "flex flex-col gap-4 my-8 items-center", children: /* @__PURE__ */ jsx(Typography, { variant: "label", children: "There are no users yet" }) }) }) })
1758
+ users.length === 0 && /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colspan: 4, children: /* @__PURE__ */ jsxs(CenteredView, { className: "flex flex-col gap-4 my-8 items-center", children: [
1759
+ /* @__PURE__ */ jsx(Typography, { variant: "label", children: usersError ? "You don't have permission to view users" : "There are no users yet" }),
1760
+ usersError && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-surface-500", children: "Contact an administrator if you need access to this section." })
1761
+ ] }) }) })
1756
1762
  ] })
1757
1763
  ] }) }),
1758
1764
  /* @__PURE__ */ jsx(
@@ -1909,6 +1915,7 @@ function UserDetailsForm({
1909
1915
  }
1910
1916
  function RolesView({ userManagement, collections = [] }) {
1911
1917
  const { roles, saveRole, deleteRole, loading, allowDefaultRolesCreation } = userManagement;
1918
+ const rolesError = "rolesError" in userManagement ? userManagement.rolesError : void 0;
1912
1919
  const snackbarController = useSnackbarController();
1913
1920
  const [dialogOpen, setDialogOpen] = useState(false);
1914
1921
  const [selectedRole, setSelectedRole] = useState();
@@ -2001,8 +2008,9 @@ function RolesView({ userManagement, collections = [] }) {
2001
2008
  ] }, role.id);
2002
2009
  }),
2003
2010
  roles.length === 0 && /* @__PURE__ */ jsx(TableRow, { children: /* @__PURE__ */ jsx(TableCell, { colspan: 4, children: /* @__PURE__ */ jsxs(CenteredView, { className: "flex flex-col gap-4 my-8 items-center", children: [
2004
- /* @__PURE__ */ jsx(Typography, { variant: "label", children: "You don't have any roles yet." }),
2005
- allowDefaultRolesCreation && /* @__PURE__ */ jsx(Button, { onClick: createDefaultRoles, children: "Create default roles" })
2011
+ /* @__PURE__ */ jsx(Typography, { variant: "label", children: rolesError ? "You don't have permission to view roles" : "You don't have any roles yet." }),
2012
+ rolesError && /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-surface-500", children: "Contact an administrator if you need access to this section." }),
2013
+ !rolesError && allowDefaultRolesCreation && /* @__PURE__ */ jsx(Button, { onClick: createDefaultRoles, children: "Create default roles" })
2006
2014
  ] }) }) })
2007
2015
  ] })
2008
2016
  ] }) }),