This is an automated email from the ASF dual-hosted git repository.
wangyizhi pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/dolphinscheduler.git
The following commit(s) were added to refs/heads/dev by this push:
new f3f1f40 [Feature][UI Next] Fixed menu sidebar display issues (#7872)
f3f1f40 is described below
commit f3f1f40f5769c39ff9c4c52fe9b5d5b6db0714d1
Author: labbomb <[email protected]>
AuthorDate: Fri Jan 7 15:27:02 2022 +0800
[Feature][UI Next] Fixed menu sidebar display issues (#7872)
---
dolphinscheduler-ui-next/src/layouts/content/index.tsx | 2 +-
dolphinscheduler-ui-next/src/layouts/content/use-dataList.ts | 9 ++++++++-
dolphinscheduler-ui-next/src/store/locales/locales.ts | 2 +-
3 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/dolphinscheduler-ui-next/src/layouts/content/index.tsx
b/dolphinscheduler-ui-next/src/layouts/content/index.tsx
index 58397f9..d64e136 100644
--- a/dolphinscheduler-ui-next/src/layouts/content/index.tsx
+++ b/dolphinscheduler-ui-next/src/layouts/content/index.tsx
@@ -54,12 +54,12 @@ const Content = defineComponent({
state.sideMenuOptions =
state.menuOptions.filter((menu: { key: string }) => menu.key ===
key)[0]
.children || []
- state.isShowSide = state.sideMenuOptions.length !== 0
}
const getSideMenuOptions = (item: any) => {
menuStore.setMenuKey(item.key)
genSideMenu(state)
+ state.isShowSide = item.isShowSide
}
return {
diff --git a/dolphinscheduler-ui-next/src/layouts/content/use-dataList.ts
b/dolphinscheduler-ui-next/src/layouts/content/use-dataList.ts
index 64ed045..9421498 100644
--- a/dolphinscheduler-ui-next/src/layouts/content/use-dataList.ts
+++ b/dolphinscheduler-ui-next/src/layouts/content/use-dataList.ts
@@ -77,11 +77,13 @@ export function useDataList() {
label: t('menu.home'),
key: 'home',
icon: renderIcon(HomeOutlined),
+ isShowSide: false
},
{
label: t('menu.project'),
key: 'project',
icon: renderIcon(ProfileOutlined),
+ isShowSide: false,
children: [
{
label: t('menu.workflow_monitoring'),
@@ -122,6 +124,7 @@ export function useDataList() {
label: t('menu.resources'),
key: 'resources',
icon: renderIcon(FolderOutlined),
+ isShowSide: true,
children: [
{
label: t('menu.file_manage'),
@@ -149,11 +152,13 @@ export function useDataList() {
label: t('menu.datasource'),
key: 'datasource',
icon: renderIcon(DatabaseOutlined),
+ isShowSide: false
},
{
label: t('menu.monitor'),
key: 'monitor',
icon: renderIcon(DesktopOutlined),
+ isShowSide: true,
children: [
{
label: t('menu.service_manage'),
@@ -191,6 +196,7 @@ export function useDataList() {
label: t('menu.security'),
key: 'security',
icon: renderIcon(SafetyCertificateOutlined),
+ isShowSide: true,
children: [
{
label: t('menu.tenant_manage'),
@@ -239,11 +245,12 @@ export function useDataList() {
const changeHeaderMenuOptions = (state: any) => {
state.headerMenuOptions = state.menuOptions.map(
- (item: { label: string; key: string; icon: any }) => {
+ (item: { label: string; key: string; icon: any, isShowSide: boolean })
=> {
return {
label: item.label,
key: item.key,
icon: item.icon,
+ isShowSide: item.isShowSide
}
}
)
diff --git a/dolphinscheduler-ui-next/src/store/locales/locales.ts
b/dolphinscheduler-ui-next/src/store/locales/locales.ts
index 4cabc79..203f95b 100644
--- a/dolphinscheduler-ui-next/src/store/locales/locales.ts
+++ b/dolphinscheduler-ui-next/src/store/locales/locales.ts
@@ -19,7 +19,7 @@ import { defineStore } from 'pinia'
import { LocalesStore, Locales } from './types'
export const useLocalesStore = defineStore({
- id: 'language',
+ id: 'locales',
state: (): LocalesStore => ({
locales: 'zh_CN',
}),