mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27: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:
@@ -1,5 +1,4 @@
|
||||
import React, { Suspense, lazy } from "react";
|
||||
import { useBknd } from "ui/client/bknd";
|
||||
import { Suspense, lazy, type ComponentType, type ReactNode } from "react";
|
||||
import { useTheme } from "ui/client/use-theme";
|
||||
import { Route, Router, Switch } from "wouter";
|
||||
import AuthRoutes from "./auth";
|
||||
@@ -10,60 +9,70 @@ import MediaRoutes from "./media";
|
||||
import { Root, RootEmpty } from "./root";
|
||||
import SettingsRoutes from "./settings";
|
||||
import { FlashMessage } from "ui/modules/server/FlashMessage";
|
||||
import { AuthRegister } from "ui/routes/auth/auth.register";
|
||||
import { BkndModalsProvider } from "ui/modals";
|
||||
|
||||
// @ts-ignore
|
||||
const TestRoutes = lazy(() => import("./test"));
|
||||
|
||||
export function Routes() {
|
||||
const { app } = useBknd();
|
||||
export function Routes({
|
||||
BkndWrapper,
|
||||
basePath = "",
|
||||
}: { BkndWrapper: ComponentType<{ children: ReactNode }>; basePath?: string }) {
|
||||
const { theme } = useTheme();
|
||||
|
||||
return (
|
||||
<div id="bknd-admin" className={theme + " antialiased"}>
|
||||
<FlashMessage />
|
||||
<Router base={app.options.basepath}>
|
||||
<Router base={basePath}>
|
||||
<Switch>
|
||||
<Route path="/auth/login" component={AuthLogin} />
|
||||
<Route path="/" nest>
|
||||
<Root>
|
||||
<Switch>
|
||||
<Route path="/test*" nest>
|
||||
<Suspense fallback={null}>
|
||||
<TestRoutes />
|
||||
</Suspense>
|
||||
</Route>
|
||||
<Route path="/auth/register" component={AuthRegister} />
|
||||
|
||||
<Route path="/" component={RootEmpty} />
|
||||
<Route path="/data" nest>
|
||||
<Suspense fallback={null}>
|
||||
<DataRoutes />
|
||||
</Suspense>
|
||||
</Route>
|
||||
<Route path="/flows" nest>
|
||||
<Suspense fallback={null}>
|
||||
<FlowRoutes />
|
||||
</Suspense>
|
||||
</Route>
|
||||
<Route path="/auth" nest>
|
||||
<Suspense fallback={null}>
|
||||
<AuthRoutes />
|
||||
</Suspense>
|
||||
</Route>
|
||||
<Route path="/media" nest>
|
||||
<Suspense fallback={null}>
|
||||
<MediaRoutes />
|
||||
</Suspense>
|
||||
</Route>
|
||||
<Route path="/settings" nest>
|
||||
<Suspense fallback={null}>
|
||||
<SettingsRoutes />
|
||||
</Suspense>
|
||||
</Route>
|
||||
<BkndWrapper>
|
||||
<BkndModalsProvider>
|
||||
<Route path="/" nest>
|
||||
<Root>
|
||||
<Switch>
|
||||
<Route path="/test*" nest>
|
||||
<Suspense fallback={null}>
|
||||
<TestRoutes />
|
||||
</Suspense>
|
||||
</Route>
|
||||
|
||||
<Route path="*" component={NotFound} />
|
||||
</Switch>
|
||||
</Root>
|
||||
</Route>
|
||||
<Route path="/" component={RootEmpty} />
|
||||
<Route path="/data" nest>
|
||||
<Suspense fallback={null}>
|
||||
<DataRoutes />
|
||||
</Suspense>
|
||||
</Route>
|
||||
<Route path="/flows" nest>
|
||||
<Suspense fallback={null}>
|
||||
<FlowRoutes />
|
||||
</Suspense>
|
||||
</Route>
|
||||
<Route path="/auth" nest>
|
||||
<Suspense fallback={null}>
|
||||
<AuthRoutes />
|
||||
</Suspense>
|
||||
</Route>
|
||||
<Route path="/media" nest>
|
||||
<Suspense fallback={null}>
|
||||
<MediaRoutes />
|
||||
</Suspense>
|
||||
</Route>
|
||||
<Route path="/settings" nest>
|
||||
<Suspense fallback={null}>
|
||||
<SettingsRoutes />
|
||||
</Suspense>
|
||||
</Route>
|
||||
|
||||
<Route path="*" component={NotFound} />
|
||||
</Switch>
|
||||
</Root>
|
||||
</Route>
|
||||
</BkndModalsProvider>
|
||||
</BkndWrapper>
|
||||
</Switch>
|
||||
</Router>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user