From 4e11051d9fccdbdd40abaa630afc130eafef6602 Mon Sep 17 00:00:00 2001
From: Sebastian <sebasjm@gmail.com>
Date: Tue, 10 Oct 2023 07:12:20 -0300
Subject: removing url from login

---
 .../merchant-backoffice-ui/src/Application.tsx     | 32 +++++++---------------
 1 file changed, 10 insertions(+), 22 deletions(-)

(limited to 'packages/merchant-backoffice-ui/src/Application.tsx')

diff --git a/packages/merchant-backoffice-ui/src/Application.tsx b/packages/merchant-backoffice-ui/src/Application.tsx
index c871b1633..82329974f 100644
--- a/packages/merchant-backoffice-ui/src/Application.tsx
+++ b/packages/merchant-backoffice-ui/src/Application.tsx
@@ -26,7 +26,6 @@ import {
   useTranslationContext,
 } from "@gnu-taler/web-util/browser";
 import { Fragment, VNode, h } from "preact";
-import { route } from "preact-router";
 import { useMemo } from "preact/hooks";
 import { ApplicationReadyRoutes } from "./ApplicationReadyRoutes.js";
 import { Loading } from "./components/exception/loading.js";
@@ -41,8 +40,7 @@ import {
 import { ConfigContextProvider } from "./context/config.js";
 import { useBackendConfig } from "./hooks/backend.js";
 import { strings } from "./i18n/strings.js";
-import { ConnectionPage, LoginPage } from "./paths/login/index.js";
-import { LoginToken } from "./declaration.js";
+import { LoginPage } from "./paths/login/index.js";
 
 export function Application(): VNode {
   return (
@@ -60,7 +58,6 @@ export function Application(): VNode {
  * @returns 
  */
 function ApplicationStatusRoutes(): VNode {
-  const { changeBackend, selected: backendSelected } = useBackendContext();
   const result = useBackendConfig();
   const { i18n } = useTranslationContext();
 
@@ -69,15 +66,6 @@ function ApplicationStatusRoutes(): VNode {
     : { currency: "unknown", version: "unknown" };
   const ctx = useMemo(() => ({ currency, version }), [currency, version]);
 
-  if (!backendSelected) {
-    return (
-      <Fragment>
-        <NotConnectedAppMenu title="Welcome!" />
-        <ConnectionPage onConfirm={changeBackend} />
-      </Fragment>
-    );
-  }
-
   if (!result.ok) {
     if (result.loading) return <Loading />;
     if (
@@ -87,7 +75,13 @@ function ApplicationStatusRoutes(): VNode {
       return (
         <Fragment>
           <NotConnectedAppMenu title="Login" />
-          <ConnectionPage onConfirm={changeBackend} />
+          <NotificationCard
+            notification={{
+              message: i18n.str`Checking the /config endpoint got authorization error`,
+              type: "ERROR",
+              description: `The /config endpoint of the backend server should be accesible`,
+            }}
+          />
         </Fragment>
       );
     }
@@ -100,12 +94,11 @@ function ApplicationStatusRoutes(): VNode {
           <NotConnectedAppMenu title="Error" />
           <NotificationCard
             notification={{
-              message: i18n.str`Server not found`,
+              message: i18n.str`Could not find /config enpoint on this URL`,
               type: "ERROR",
-              description: `Check your url`,
+              description: `Check the URL or contact the system administrator.`,
             }}
           />
-          <ConnectionPage onConfirm={changeBackend} />
         </Fragment>
       );
     }
@@ -119,7 +112,6 @@ function ApplicationStatusRoutes(): VNode {
             description: i18n.str`Got message "${result.message}" from ${result.info?.url}`,
           }}
         />
-        <ConnectionPage onConfirm={changeBackend} />
       </Fragment>;
     }
     if (result.type === ErrorType.UNREADABLE) {
@@ -132,7 +124,6 @@ function ApplicationStatusRoutes(): VNode {
             description: i18n.str`Got message "${result.message}" from ${result.info?.url}`,
           }}
         />
-        <ConnectionPage onConfirm={changeBackend} />
       </Fragment>;
     }
     return (
@@ -145,7 +136,6 @@ function ApplicationStatusRoutes(): VNode {
             description: i18n.str`Got message "${result.message}" from ${result.info?.url}`,
           }}
         />
-        <ConnectionPage onConfirm={changeBackend} />
       </Fragment>
     );
   }
@@ -164,9 +154,7 @@ function ApplicationStatusRoutes(): VNode {
           description: i18n.str`Merchant backend server version ${result.data.version} is not compatible with the supported version ${SUPPORTED_VERSION}`,
         }}
       />
-      <ConnectionPage onConfirm={changeBackend} />
     </Fragment>
-
   }
 
   return (
-- 
cgit v1.2.3

