You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by mi...@apache.org on 2023/12/21 06:58:45 UTC

(incubator-devlake) branch next updated (68db6e379 -> 1a59e7cdc)

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

mintsweet pushed a change to branch next
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git


 discard 68db6e379 feat(config-ui): integrate external code
     new 1a59e7cdc feat(config-ui): integrate external code

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (68db6e379)
            \
             N -- N -- N   refs/heads/next (1a59e7cdc)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 config-ui/src/app/routrer.tsx | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)


(incubator-devlake) 01/01: feat(config-ui): integrate external code

Posted by mi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

mintsweet pushed a commit to branch next
in repository https://gitbox.apache.org/repos/asf/incubator-devlake.git

commit 1a59e7cdce5228c36cacf1bff1a0a0cf3d13c05e
Author: mintsweet <0x...@gmail.com>
AuthorDate: Mon Oct 23 16:46:24 2023 +1300

    feat(config-ui): integrate external code
---
 config-ui/src/app/routrer.tsx           | 37 ++++++++++++++++++++++++++++++++-
 config-ui/src/app/store.ts              |  6 ++++--
 config-ui/src/components/logo/index.tsx |  4 ++++
 config-ui/src/routes/layout/layout.tsx  | 19 -----------------
 config-ui/src/utils/request.ts          |  4 ++++
 config-ui/vite.config.ts                |  3 +++
 6 files changed, 51 insertions(+), 22 deletions(-)

diff --git a/config-ui/src/app/routrer.tsx b/config-ui/src/app/routrer.tsx
index c3e86021b..006771dac 100644
--- a/config-ui/src/app/routrer.tsx
+++ b/config-ui/src/app/routrer.tsx
@@ -31,6 +31,7 @@ import { Layout, loader as layoutLoader } from '@/routes/layout';
 import { Error, ErrorEnum } from '@/routes/error';
 import { Pipelines, Pipeline } from '@/routes/pipeline';
 import { ApiKeys } from '@/routes/api-keys';
+import { ExtraLayout, UserLayout, Profile, ChangePassword, Account } from '@next';
 
 export const router = createBrowserRouter([
   {
@@ -41,9 +42,43 @@ export const router = createBrowserRouter([
     },
     errorElement: <Error />,
   },
+  {
+    path: 'user',
+    element: (
+      <ExtraLayout>
+        <UserLayout></UserLayout>
+      </ExtraLayout>
+    ),
+    children: [
+      {
+        index: true,
+        element: <Navigate to="profile" />,
+      },
+      {
+        path: 'profile',
+        element: <Profile />,
+      },
+      {
+        path: 'change-password',
+        element: <ChangePassword />,
+      },
+    ],
+  },
+  {
+    path: 'account',
+    element: (
+      <ExtraLayout>
+        <Account />
+      </ExtraLayout>
+    ),
+  },
   {
     path: '/',
-    element: <Layout />,
+    element: (
+      <ExtraLayout>
+        <Layout></Layout>
+      </ExtraLayout>
+    ),
     loader: layoutLoader,
     errorElement: <Error />,
     children: [
diff --git a/config-ui/src/app/store.ts b/config-ui/src/app/store.ts
index b838101b5..02180d094 100644
--- a/config-ui/src/app/store.ts
+++ b/config-ui/src/app/store.ts
@@ -17,11 +17,13 @@
  */
 
 import { configureStore, ThunkAction, Action } from '@reduxjs/toolkit';
-import connectionsSlice from '@/features/connections/slice';
+import connectionSlice from '@/features/connections/slice';
+import userSlice from '@next/user/slice';
 
 export const store = configureStore({
   reducer: {
-    connections: connectionsSlice,
+    connections: connectionSlice,
+    user: userSlice,
   },
 });
 
diff --git a/config-ui/src/components/logo/index.tsx b/config-ui/src/components/logo/index.tsx
index 23362c9e4..0e600a65d 100644
--- a/config-ui/src/components/logo/index.tsx
+++ b/config-ui/src/components/logo/index.tsx
@@ -23,6 +23,10 @@ import LogoImg from '@/images/logo.svg';
 const Wrapper = styled.div`
   display: flex;
   justify-content: center;
+
+  img {
+    max-width: 150px;
+  }
 `;
 
 export const Logo = () => {
diff --git a/config-ui/src/routes/layout/layout.tsx b/config-ui/src/routes/layout/layout.tsx
index eca5c265b..f304695df 100644
--- a/config-ui/src/routes/layout/layout.tsx
+++ b/config-ui/src/routes/layout/layout.tsx
@@ -146,25 +146,6 @@ export const Layout = () => {
                     <img src={APIIcon} alt="api" />
                     <span>API</span>
                   </ExternalLink>
-                  <Navbar.Divider />
-                  <a
-                    href="https://github.com/apache/incubator-devlake"
-                    rel="noreferrer"
-                    target="_blank"
-                    className="navIconLink"
-                  >
-                    <img src={GitHubIcon} alt="github" />
-                    <span>GitHub</span>
-                  </a>
-                  <Navbar.Divider />
-                  <a
-                    href="https://join.slack.com/t/devlake-io/shared_invite/zt-26ulybksw-IDrJYuqY1FrdjlMMJhs53Q"
-                    rel="noreferrer"
-                    target="_blank"
-                  >
-                    <img src={SlackIcon} alt="slack" />
-                    <span>Slack</span>
-                  </a>
                 </Navbar.Group>
               </S.Header>
               <S.Inner>
diff --git a/config-ui/src/utils/request.ts b/config-ui/src/utils/request.ts
index a3d2e5275..6d126ab58 100644
--- a/config-ui/src/utils/request.ts
+++ b/config-ui/src/utils/request.ts
@@ -43,6 +43,10 @@ instance.interceptors.response.use(
       window.location.replace('/db-migrate');
     }
 
+    if (status === 401) {
+      window.location.reload();
+    }
+
     return Promise.reject(error);
   },
 );
diff --git a/config-ui/vite.config.ts b/config-ui/vite.config.ts
index d8416b25e..c91c65493 100644
--- a/config-ui/vite.config.ts
+++ b/config-ui/vite.config.ts
@@ -26,6 +26,8 @@ export default defineConfig({
 
   envPrefix: 'DEVLAKE_',
 
+  publicDir: path.join(__dirname, '../../frontend/public'),
+
   server: {
     port: 4000,
     proxy: {
@@ -40,6 +42,7 @@ export default defineConfig({
   resolve: {
     alias: {
       '@': path.join(__dirname, './src'),
+      '@next': path.join(__dirname, '../../frontend/src'),
     },
   },
 });