mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-17 04:46:05 +00:00
added better error messages if config secret permission is missing
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { notifications } from "@mantine/notifications";
|
||||
import { useRef } from "react";
|
||||
import { TbDots } from "react-icons/tb";
|
||||
import { useBknd } from "ui/client/bknd";
|
||||
import { useBkndAuth } from "ui/client/schema/auth/use-bknd-auth";
|
||||
import { Button } from "ui/components/buttons/Button";
|
||||
import { IconButton } from "ui/components/buttons/IconButton";
|
||||
import { Message } from "ui/components/display/Message";
|
||||
import { Dropdown } from "ui/components/overlay/Dropdown";
|
||||
import * as AppShell from "ui/layouts/AppShell/AppShell";
|
||||
import { Breadcrumbs2 } from "ui/layouts/AppShell/Breadcrumbs2";
|
||||
@@ -12,7 +12,11 @@ import { routes, useNavigate } from "ui/lib/routes";
|
||||
import { AuthRoleForm, type AuthRoleFormRef } from "ui/routes/auth/forms/role.form";
|
||||
|
||||
export function AuthRolesEdit(props) {
|
||||
useBknd({ withSecrets: true });
|
||||
const { hasSecrets } = useBknd({ withSecrets: true });
|
||||
if (!hasSecrets) {
|
||||
return <Message.MissingPermission what="Roles & Permissions" />;
|
||||
}
|
||||
|
||||
return <AuthRolesEditInternal {...props} />;
|
||||
}
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ const EntityContextMenu = ({
|
||||
items={[
|
||||
href && {
|
||||
icon: IconExternalLink,
|
||||
label: "Open in new tab",
|
||||
label: "Open in tab",
|
||||
onClick: () => navigate(href, { target: "_blank" })
|
||||
},
|
||||
separator,
|
||||
|
||||
@@ -2,6 +2,7 @@ import { IconSettings } from "@tabler/icons-react";
|
||||
import { ucFirst } from "core/utils";
|
||||
import { useBknd } from "ui/client/bknd";
|
||||
import { Empty } from "ui/components/display/Empty";
|
||||
import { Message } from "ui/components/display/Message";
|
||||
import { Link } from "ui/components/wouter/Link";
|
||||
import { useBrowserTitle } from "ui/hooks/use-browser-title";
|
||||
import * as AppShell from "ui/layouts/AppShell/AppShell";
|
||||
@@ -44,7 +45,9 @@ function SettingsSidebar() {
|
||||
}
|
||||
|
||||
export default function SettingsRoutes() {
|
||||
useBknd({ withSecrets: true });
|
||||
const b = useBknd({ withSecrets: true });
|
||||
if (!b.hasSecrets) return <Message.MissingPermission what="the settings" />;
|
||||
|
||||
return (
|
||||
<>
|
||||
<SettingsSidebar />
|
||||
|
||||
Reference in New Issue
Block a user