mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 20:37:21 +00:00
Fix Release 0.11.1 (#150)
* fix strategy forms handling, add register route and hidden fields Refactored strategy forms to include hidden fields for type and name. Added a registration route with necessary adjustments to the admin controller and routes. Corrected field handling within relevant forms and components. * fix admin access permissions and refactor routing structure display a fixed error for unmet permissions when retrieving the schema. moved auth routes outside of BkndProvider and reorganized remaining routes to include BkndWrapper. * fix: properly type BkndWrapper * bump fix release version * ModuleManager: update diff checking and AppData validation Revised diff handling includes validation of diffs, reverting changes on failure, and enforcing module constraints with onBeforeUpdate hooks. Introduced `validateDiffs` and backup of stable configs. Applied changes in related modules, tests, and UI layer to align with updated diff logic. * fix: cli: running from config file were using invalid args * fix: cli: improve sequence of onBuilt trigger to allow custom routes from cli * fix e2e tests
This commit is contained in:
@@ -5,6 +5,8 @@ import { useApi } from "ui/client";
|
||||
import { type TSchemaActions, getSchemaActions } from "./schema/actions";
|
||||
import { AppReduced } from "./utils/AppReduced";
|
||||
import type { AppTheme } from "ui/client/use-theme";
|
||||
import { Message } from "ui/components/display/Message";
|
||||
import { useNavigate } from "ui/lib/routes";
|
||||
|
||||
export type BkndAdminOptions = {
|
||||
logo_return_path?: string;
|
||||
@@ -101,7 +103,6 @@ export function BkndProvider({
|
||||
fallback: true,
|
||||
} as any);
|
||||
|
||||
|
||||
startTransition(() => {
|
||||
const commit = () => {
|
||||
setSchema(newSchema);
|
||||
@@ -109,7 +110,7 @@ export function BkndProvider({
|
||||
setFetched(true);
|
||||
set_local_version((v) => v + 1);
|
||||
fetching.current = Fetching.None;
|
||||
}
|
||||
};
|
||||
|
||||
if ("startViewTransition" in document) {
|
||||
document.startViewTransition(commit);
|
||||
@@ -139,22 +140,24 @@ export function BkndProvider({
|
||||
value={{ ...schema, actions, requireSecrets, app, options: app.options, hasSecrets }}
|
||||
key={local_version}
|
||||
>
|
||||
{/*{error && (
|
||||
<Alert.Exception className="gap-2">
|
||||
<IconAlertHexagon />
|
||||
You attempted to load system configuration with secrets without having proper
|
||||
permission.
|
||||
<a href={schema.config.server.admin.basepath || "/"}>
|
||||
<Button variant="red">Reload</Button>
|
||||
</a>
|
||||
</Alert.Exception>
|
||||
)}*/}
|
||||
|
||||
{children}
|
||||
{error ? <AccessDenied /> : children}
|
||||
</BkndContext.Provider>
|
||||
);
|
||||
}
|
||||
|
||||
function AccessDenied() {
|
||||
const [navigate] = useNavigate();
|
||||
return (
|
||||
<Message.MissingPermission
|
||||
what="the Admin UI"
|
||||
primary={{
|
||||
children: "Login",
|
||||
onClick: () => navigate("/auth/login"),
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export function useBknd({ withSecrets }: { withSecrets?: boolean } = {}): BkndContext {
|
||||
const ctx = useContext(BkndContext);
|
||||
if (withSecrets) ctx.requireSecrets();
|
||||
|
||||
Reference in New Issue
Block a user