From 6e6407cb18eff6fd0e1ef33e1a7c1b782e44a067 Mon Sep 17 00:00:00 2001 From: Devosend Date: Thu, 24 Mar 2022 18:14:03 +0800 Subject: [PATCH] [Fix][UI Next][V1.0.0-Alpha] Home white screen bug (#9161) * fix timezone label bug * modify default timezone * support filter for timimg modal --- .../content/components/timezone/index.tsx | 6 +-- .../src/utils/timezone.ts | 49 ++++++++++++++++--- .../src/views/login/use-login.ts | 4 +- .../definition/components/timing-modal.tsx | 1 + 4 files changed, 47 insertions(+), 13 deletions(-) diff --git a/dolphinscheduler-ui-next/src/layouts/content/components/timezone/index.tsx b/dolphinscheduler-ui-next/src/layouts/content/components/timezone/index.tsx index 4d6c0608c..7935974ae 100644 --- a/dolphinscheduler-ui-next/src/layouts/content/components/timezone/index.tsx +++ b/dolphinscheduler-ui-next/src/layouts/content/components/timezone/index.tsx @@ -36,11 +36,11 @@ const Timezone = defineComponent({ const { t } = useI18n() const reload: any = inject('reload') const timezoneStore = useTimezoneStore() - const chooseVal = ref( + const currentTime = props.timezoneOptions.filter( (item: { value: string }) => item.value === timezoneStore.getTimezone - )[0].label - ) + )[0] || {} + const chooseVal = ref(currentTime.label) const currentTimeZone = Intl.DateTimeFormat().resolvedOptions().timeZone const options = [ diff --git a/dolphinscheduler-ui-next/src/utils/timezone.ts b/dolphinscheduler-ui-next/src/utils/timezone.ts index 508b3ee04..245f98c97 100644 --- a/dolphinscheduler-ui-next/src/utils/timezone.ts +++ b/dolphinscheduler-ui-next/src/utils/timezone.ts @@ -400,7 +400,6 @@ export const timezoneList = [ 'Chile/EasterIsland', 'Cuba', 'EET', - 'EST', 'EST5EDT', 'Egypt', 'Eire', @@ -505,11 +504,8 @@ export const timezoneList = [ 'GB', 'GB-Eire', 'GMT', - 'GMT+0', - 'GMT-0', 'GMT0', 'Greenwich', - 'HST', 'Hongkong', 'Iceland', 'Indian/Antananarivo', @@ -530,7 +526,6 @@ export const timezoneList = [ 'Kwajalein', 'Libya', 'MET', - 'MST', 'MST7MDT', 'Mexico/BajaNorte', 'Mexico/BajaSur', @@ -585,9 +580,21 @@ export const timezoneList = [ 'Pacific/Yap', 'Poland', 'Portugal', - 'ROC', 'ROK', 'Singapore', + 'SystemV/AST4', + 'SystemV/AST4ADT', + 'SystemV/CST6', + 'SystemV/CST6CDT', + 'SystemV/EST5', + 'SystemV/EST5EDT', + 'SystemV/HST10', + 'SystemV/MST7', + 'SystemV/MST7MDT', + 'SystemV/PST8', + 'SystemV/PST8PDT', + 'SystemV/YST9', + 'SystemV/YST9YDT', 'Turkey', 'UCT', 'US/Alaska', @@ -607,5 +614,33 @@ export const timezoneList = [ 'Universal', 'W-SU', 'WET', - 'Zulu' + 'Zulu', + 'EST', + 'HST', + 'MST', + 'ACT', + 'AET', + 'AGT', + 'ART', + 'AST', + 'BET', + 'BST', + 'CAT', + 'CNT', + 'CST', + 'CTT', + 'EAT', + 'ECT', + 'IET', + 'IST', + 'JST', + 'MIT', + 'NET', + 'NST', + 'PLT', + 'PNT', + 'PRT', + 'PST', + 'SST', + 'VST' ] diff --git a/dolphinscheduler-ui-next/src/views/login/use-login.ts b/dolphinscheduler-ui-next/src/views/login/use-login.ts index 6647ec163..6fd2080e5 100644 --- a/dolphinscheduler-ui-next/src/views/login/use-login.ts +++ b/dolphinscheduler-ui-next/src/views/login/use-login.ts @@ -40,9 +40,7 @@ export function useLogin(state: any) { const userInfoRes: UserInfoRes = await getUserInfo() await userStore.setUserInfo(userInfoRes) - const timezone = userInfoRes.timeZone - ? userInfoRes.timeZone - : Intl.DateTimeFormat().resolvedOptions().timeZone + const timezone = userInfoRes.timeZone ? userInfoRes.timeZone : 'UTC' await timezoneStore.setTimezone(timezone) const path = routeStore.lastRoute diff --git a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/timing-modal.tsx b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/timing-modal.tsx index b04f2820c..d0bb4a884 100644 --- a/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/timing-modal.tsx +++ b/dolphinscheduler-ui-next/src/views/projects/workflow/definition/components/timing-modal.tsx @@ -305,6 +305,7 @@ export default defineComponent({ -- GitLab