From d680ea11ff702de7a8e0e5e242e24c5aa517742f Mon Sep 17 00:00:00 2001 From: qwerty287 Date: Wed, 2 Aug 2023 09:44:58 +0200 Subject: [PATCH 1/9] Improve user settings --- web/components.d.ts | 2 + web/src/assets/locales/en.json | 24 ++-- web/src/components/layout/header/Navbar.vue | 2 +- web/src/components/user/UserAPITab.vue | 80 ++++++++++++ web/src/components/user/UserSettingsTab.vue | 45 +++++++ web/src/router.ts | 18 +-- web/src/views/User.vue | 129 +++++--------------- web/src/views/admin/Admin.vue | 24 ---- web/src/views/org/OrgRepos.vue | 2 +- web/src/views/org/OrgWrapper.vue | 11 +- 10 files changed, 186 insertions(+), 151 deletions(-) create mode 100644 web/src/components/user/UserAPITab.vue create mode 100644 web/src/components/user/UserSettingsTab.vue delete mode 100644 web/src/views/admin/Admin.vue diff --git a/web/components.d.ts b/web/components.d.ts index 0aa7ba65da..b495c7845f 100644 --- a/web/components.d.ts +++ b/web/components.d.ts @@ -101,6 +101,8 @@ declare module '@vue/runtime-core' { Tab: typeof import('./src/components/layout/scaffold/Tab.vue')['default'] Tabs: typeof import('./src/components/layout/scaffold/Tabs.vue')['default'] TextField: typeof import('./src/components/form/TextField.vue')['default'] + UserAPITab: typeof import('./src/components/user/UserAPITab.vue')['default'] + UserSettingsTab: typeof import('./src/components/user/UserSettingsTab.vue')['default'] Warning: typeof import('./src/components/atomic/Warning.vue')['default'] } } diff --git a/web/src/assets/locales/en.json b/web/src/assets/locales/en.json index 2a8f61ff7a..339b7f3771 100644 --- a/web/src/assets/locales/en.json +++ b/web/src/assets/locales/en.json @@ -425,16 +425,24 @@ } }, "user": { - "settings": "User Settings", + "user_settings": "User Settings", + "settings": { + "settings": "Settings", + "language": "Language" + }, + "api": { + "api": "API", + "token": "Personal Access Token", + "shell_setup": "Shell setup", + "api_usage": "Example API Usage", + "cli_usage": "Example CLI Usage", + "dl_cli": "Download CLI", + "shell_setup_before": "do shell setup steps before", + "reset_token": "Reset token", + "swagger_ui": "Sagger UI", + }, "oauth_error": "Error while authenticating against OAuth provider", "internal_error": "Some internal error occurred", "access_denied": "You are not allowed to login", - "token": "Personal Access Token", - "shell_setup": "Shell setup", - "api_usage": "Example API Usage", - "cli_usage": "Example CLI Usage", - "dl_cli": "Download CLI", - "shell_setup_before": "do shell setup steps before", - "reset_token": "Reset token" } } diff --git a/web/src/components/layout/header/Navbar.vue b/web/src/components/layout/header/Navbar.vue index 08eb2e8ffe..f7e1d6438b 100644 --- a/web/src/components/layout/header/Navbar.vue +++ b/web/src/components/layout/header/Navbar.vue @@ -42,7 +42,7 @@ - + diff --git a/web/src/components/user/UserAPITab.vue b/web/src/components/user/UserAPITab.vue new file mode 100644 index 0000000000..8baf5e29a6 --- /dev/null +++ b/web/src/components/user/UserAPITab.vue @@ -0,0 +1,80 @@ + + + diff --git a/web/src/components/user/UserSettingsTab.vue b/web/src/components/user/UserSettingsTab.vue new file mode 100644 index 0000000000..1c4d68160b --- /dev/null +++ b/web/src/components/user/UserSettingsTab.vue @@ -0,0 +1,45 @@ + + + diff --git a/web/src/router.ts b/web/src/router.ts index ea33cc561f..0abee7e0a0 100644 --- a/web/src/router.ts +++ b/web/src/router.ts @@ -131,22 +131,10 @@ const routes: RouteRecordRaw[] = [ }, { path: '/admin', - component: (): Component => import('~/views/RouterView.vue'), + name: 'admin-settings', + component: (): Component => import('~/views/admin/AdminSettings.vue'), + props: true, meta: { authentication: 'required' }, - children: [ - { - path: '', - name: 'admin', - component: (): Component => import('~/views/admin/Admin.vue'), - props: true, - }, - { - path: 'settings', - name: 'admin-settings', - component: (): Component => import('~/views/admin/AdminSettings.vue'), - props: true, - }, - ], }, { diff --git a/web/src/views/User.vue b/web/src/views/User.vue index 8658e626c2..713fa5bf62 100644 --- a/web/src/views/User.vue +++ b/web/src/views/User.vue @@ -1,111 +1,40 @@ diff --git a/web/src/views/admin/Admin.vue b/web/src/views/admin/Admin.vue deleted file mode 100644 index 26747d7616..0000000000 --- a/web/src/views/admin/Admin.vue +++ /dev/null @@ -1,24 +0,0 @@ - - - diff --git a/web/src/views/org/OrgRepos.vue b/web/src/views/org/OrgRepos.vue index 44509d3978..ca96403a87 100644 --- a/web/src/views/org/OrgRepos.vue +++ b/web/src/views/org/OrgRepos.vue @@ -6,7 +6,7 @@ From 6433bd28670393a98d52e1ad36e8e4f07f275f0f Mon Sep 17 00:00:00 2001 From: qwerty287 Date: Thu, 3 Aug 2023 09:01:59 +0200 Subject: [PATCH 3/9] Rename key --- web/src/assets/locales/en.json | 2 +- web/src/components/layout/header/Navbar.vue | 2 +- web/src/views/User.vue | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/web/src/assets/locales/en.json b/web/src/assets/locales/en.json index 339b7f3771..35d6d296df 100644 --- a/web/src/assets/locales/en.json +++ b/web/src/assets/locales/en.json @@ -425,7 +425,7 @@ } }, "user": { - "user_settings": "User Settings", + "settings_title": "User Settings", "settings": { "settings": "Settings", "language": "Language" diff --git a/web/src/components/layout/header/Navbar.vue b/web/src/components/layout/header/Navbar.vue index 522e3c91a4..89e492acec 100644 --- a/web/src/components/layout/header/Navbar.vue +++ b/web/src/components/layout/header/Navbar.vue @@ -44,7 +44,7 @@ - + diff --git a/web/src/views/User.vue b/web/src/views/User.vue index 3a574c3474..3f2e133a1c 100644 --- a/web/src/views/User.vue +++ b/web/src/views/User.vue @@ -1,6 +1,6 @@