commit 49497fc1cb6db86d3cd3738d4f548c4b4b427db6
parent a2c3c68d2d26f7db9cacd176c03fc05705abecac
Author: Sebastian <sebasjm@gmail.com>
Date: Fri, 23 Aug 2024 10:47:03 -0300
spa is served in the /spa endpoint instead of /webui
Diffstat:
2 files changed, 20 insertions(+), 22 deletions(-)
diff --git a/packages/auditor-backoffice-ui/src/ApplicationReadyRoutes.tsx b/packages/auditor-backoffice-ui/src/ApplicationReadyRoutes.tsx
@@ -19,48 +19,46 @@
* @author Sebastian Javier Marchano (sebasjm)
* @author Nic Eigel
*/
-import {ErrorType, useTranslationContext} from "@gnu-taler/web-util/browser";
-import {createHashHistory} from "history";
-import {Fragment, VNode, h} from "preact";
-import {Route, Router, route} from "preact-router";
-import {useEffect, useErrorBoundary, useState} from "preact/hooks";
-import {InstanceRoutes} from "./InstanceRoutes.js";
+import { useTranslationContext } from "@gnu-taler/web-util/browser";
+import { createHashHistory } from "history";
+import { Fragment, VNode, h } from "preact";
+import { Route, Router } from "preact-router";
+import { useState } from "preact/hooks";
+import { InstanceRoutes } from "./InstanceRoutes.js";
+import { Loading } from "./components/exception/loading.js";
import {
- NotConnectedAppMenu,
- NotYetReadyAppMenu,
- NotificationCard,
+ NotYetReadyAppMenu
} from "./components/menu/index.js";
import { useBackendContext, useBackendTokenContext } from "./context/backend.js";
-import {Settings} from "./paths/settings/index.js";
-import { useBackendConfig, useBackendToken } from "./hooks/backend.js";
-import { Loading } from "./components/exception/loading.js";
+import { useBackendToken } from "./hooks/backend.js";
import { LoginPage } from "./paths/login/index.js";
+import { Settings } from "./paths/settings/index.js";
/**
* Check if admin against /management/instances
* @returns
*/
export function ApplicationReadyRoutes(): VNode {
- const {i18n} = useTranslationContext();
+ const { i18n } = useTranslationContext();
const [unauthorized, setUnauthorized] = useState(false)
const [backendToken, setToken] = useState(false)
- const { url: backendURL} = useBackendContext();
+ const { url: backendURL } = useBackendContext();
const { token } = useBackendTokenContext();
//TODO FIX bearer
const result = useBackendToken();
- if (result.loading) return <Loading/>;
+ if (result.loading) return <Loading />;
if (!result.ok) {
return (
- <LoginPage />
+ <LoginPage />
);
}
const [showSettings, setShowSettings] = useState(false)
if (showSettings) {
return <Fragment>
- <NotYetReadyAppMenu onShowSettings={() => setShowSettings(true)} title="UI Settings"/>
- <Settings onClose={() => setShowSettings(false)}/>
+ <NotYetReadyAppMenu onShowSettings={() => setShowSettings(true)} title="UI Settings" />
+ <Settings onClose={() => setShowSettings(false)} />
</Fragment>
}
@@ -76,8 +74,8 @@ export function ApplicationReadyRoutes(): VNode {
}
function DefaultMainRoute({
- url, //from preact-router
- }: any): VNode {
+ url, //from preact-router
+}: any): VNode {
//TODO
url = "app/#" + url;
diff --git a/packages/auditor-backoffice-ui/src/hooks/index.ts b/packages/auditor-backoffice-ui/src/hooks/index.ts
@@ -14,7 +14,7 @@
GNU Taler; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/
-import {StateUpdater, useState} from "preact/hooks";
+import { StateUpdater, useState } from "preact/hooks";
import { ValueOrFunction } from "../utils/types.js";
export function useBackendURL(
@@ -44,7 +44,7 @@ const calculateRootPath = () => {
* cases and the rootPath will be the auditor backend
* URL where the instances are
*/
- return rootPath.replace("/webui/", "");
+ return rootPath.replace("/spa/", "");
};
export function useSimpleLocalStorage(