You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by ji...@apache.org on 2022/04/07 09:09:09 UTC

[incubator-doris-manager] branch master updated: [fix] fix RequireInitialized route navigate error (#35)

This is an automated email from the ASF dual-hosted git repository.

jiafengzheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris-manager.git


The following commit(s) were added to refs/heads/master by this push:
     new f26a664  [fix] fix RequireInitialized route navigate error (#35)
f26a664 is described below

commit f26a66484443f77f13d8d07486bcf00f07fd8d67
Author: color_cat <co...@gmail.com>
AuthorDate: Thu Apr 7 17:09:04 2022 +0800

    [fix] fix RequireInitialized route navigate error (#35)
    
    fix RequireInitialized route navigate error
---
 frontend/src/components/auths/require-initialized.tsx  | 2 +-
 frontend/src/components/sidebar/sidebar.tsx            | 2 +-
 frontend/src/hooks/use-auth.ts                         | 2 +-
 frontend/src/index.css                                 | 3 +++
 frontend/src/routes/initialize/initialize-set-type.tsx | 1 -
 5 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/frontend/src/components/auths/require-initialized.tsx b/frontend/src/components/auths/require-initialized.tsx
index 8a191b2..29df0eb 100644
--- a/frontend/src/components/auths/require-initialized.tsx
+++ b/frontend/src/components/auths/require-initialized.tsx
@@ -26,7 +26,7 @@ export function RequireInitialized({ children }: { children: JSX.Element }) {
         // trying to go to when they were redirected. This allows us to send them
         // along to that page after they initialize, which is a nicer user experience
         // than dropping them off on the home page.
-        return <Navigate to="initialize" state={{ from: location }} replace />;
+        return <Navigate to="/initialize" state={{ from: location }} replace />;
     }
 
     return children;
diff --git a/frontend/src/components/sidebar/sidebar.tsx b/frontend/src/components/sidebar/sidebar.tsx
index 9399b49..1e29a49 100644
--- a/frontend/src/components/sidebar/sidebar.tsx
+++ b/frontend/src/components/sidebar/sidebar.tsx
@@ -146,7 +146,7 @@ export function Sidebar(props: any) {
                         <Link to={`/space`}>{t`Space List`}</Link>
                     </Menu.Item>
                     {isSuperAdmin && (
-                        <Menu.Item id="aaaa" key="/settings" icon={<SettingOutlined />}>
+                        <Menu.Item id="settings" key="/settings" icon={<SettingOutlined />}>
                             <Link to={`/settings`}>{t`Platform Settings`}</Link>
                         </Menu.Item>
                     )}
diff --git a/frontend/src/hooks/use-auth.ts b/frontend/src/hooks/use-auth.ts
index 36a96ea..aef9988 100644
--- a/frontend/src/hooks/use-auth.ts
+++ b/frontend/src/hooks/use-auth.ts
@@ -43,7 +43,7 @@ export function useAuth() {
                 localStorage.setItem('initialized', 'false');
                 setInitialized(false);
                 if (!pathname.includes('initialize')) {
-                    navigate('initialize');
+                    navigate('/initialize');
                 }
             }
         }
diff --git a/frontend/src/index.css b/frontend/src/index.css
index a19ca45..229bb37 100644
--- a/frontend/src/index.css
+++ b/frontend/src/index.css
@@ -75,6 +75,9 @@ h1,h2,h3,h4,h5,h6 {
   width: 64px !important;
 }
 .ant-layout-sider-trigger {
+  display: flex;
+  justify-content: center;
+  align-items: center;
   color: white;
   text-align: center;
   padding: 12px 0;
diff --git a/frontend/src/routes/initialize/initialize-set-type.tsx b/frontend/src/routes/initialize/initialize-set-type.tsx
index 2a004c5..0effe93 100644
--- a/frontend/src/routes/initialize/initialize-set-type.tsx
+++ b/frontend/src/routes/initialize/initialize-set-type.tsx
@@ -24,7 +24,6 @@ import { InitializeAPI } from './initialize.api';
 import styles from './initialize.less';
 
 export function InitializeSetType() {
-    console.log('hello');
     const [authType, setAuthType] = useState<AuthTypeEnum>(AuthTypeEnum.LOCAL);
     const navigate = useNavigate();
     async function handleSetAuthType() {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org