From 36d96d62b73e217ce2c002645962c58c17a5a2af Mon Sep 17 00:00:00 2001 From: shuai Date: Fri, 6 Jan 2023 18:44:04 +0800 Subject: [PATCH 1/8] fix: lables nesting error --- .../Detail/components/ContentLoader/index.tsx | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/ui/src/pages/Questions/Detail/components/ContentLoader/index.tsx b/ui/src/pages/Questions/Detail/components/ContentLoader/index.tsx index 7999e532..b3cd31a4 100644 --- a/ui/src/pages/Questions/Detail/components/ContentLoader/index.tsx +++ b/ui/src/pages/Questions/Detail/components/ContentLoader/index.tsx @@ -14,47 +14,47 @@ const Index: FC = () => {

-

-
-
-
-

-

-
-
-
-
From e670a6fbece5be5600a087cce9353f96c236196d Mon Sep 17 00:00:00 2001 From: "haitao(lj)" Date: Fri, 6 Jan 2023 18:44:29 +0800 Subject: [PATCH 2/8] fix(Comment): Block data submission when comment value is empty --- ui/src/components/Comment/index.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ui/src/components/Comment/index.tsx b/ui/src/components/Comment/index.tsx index 1c3191aa..24abb22e 100644 --- a/ui/src/components/Comment/index.tsx +++ b/ui/src/components/Comment/index.tsx @@ -100,6 +100,9 @@ const Comment = ({ objectId, mode, commentId }) => { const users = matchedUsers(item.value); const userNames = unionBy(users.map((user) => user.userName)); const html = marked.parse(parseUserInfo(item.value)); + if (!item.value || !html) { + return; + } const params = { object_id: objectId, original_text: item.value, From 5758868106d753b080e68bb61effa00ae08390a0 Mon Sep 17 00:00:00 2001 From: "haitao(lj)" Date: Mon, 9 Jan 2023 14:42:49 +0800 Subject: [PATCH 3/8] fix(settings/seo): set `font-monospace` className for robots field --- ui/src/pages/Admin/Seo/index.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/src/pages/Admin/Seo/index.tsx b/ui/src/pages/Admin/Seo/index.tsx index 32744dc7..66625e8b 100644 --- a/ui/src/pages/Admin/Seo/index.tsx +++ b/ui/src/pages/Admin/Seo/index.tsx @@ -38,6 +38,7 @@ const Index: FC = () => { 'ui:widget': 'textarea', 'ui:options': { rows: 10, + className: 'font-monospace', }, }, }; From c0cf0e6861eb443633036d53a28ca2b0cedc0a28 Mon Sep 17 00:00:00 2001 From: "haitao(lj)" Date: Mon, 9 Jan 2023 15:21:25 +0800 Subject: [PATCH 4/8] fix(siteName): Use dynamic site names on registration and login pages --- i18n/en_US.yaml | 2 +- ui/src/components/Footer/index.tsx | 4 +--- ui/src/components/Header/index.tsx | 3 +-- ui/src/pages/Users/Login/index.tsx | 14 ++++++++++---- ui/src/pages/Users/Register/index.tsx | 7 +++++-- ui/src/stores/siteInfo.ts | 6 +++++- 6 files changed, 23 insertions(+), 13 deletions(-) diff --git a/i18n/en_US.yaml b/i18n/en_US.yaml index 476bc2a2..35d0f40f 100644 --- a/i18n/en_US.yaml +++ b/i18n/en_US.yaml @@ -607,7 +607,7 @@ ui: msg: empty: Cannot be empty. login: - page_title: Welcome to Answer + page_title: Welcome to {{site_name}} info_sign: Don't have an account? <1>Sign up info_login: Already have an account? <1>Log in agreements: By registering, you agree to the <1>privacy policy and <3>terms of service. diff --git a/ui/src/components/Footer/index.tsx b/ui/src/components/Footer/index.tsx index eb31feec..578576ce 100644 --- a/ui/src/components/Footer/index.tsx +++ b/ui/src/components/Footer/index.tsx @@ -5,12 +5,10 @@ import { Trans } from 'react-i18next'; import dayjs from 'dayjs'; import { siteInfoStore } from '@/stores'; -import { DEFAULT_SITE_NAME } from '@/common/constants'; const Index = () => { const fullYear = dayjs().format('YYYY'); - const siteName = - siteInfoStore((state) => state.siteInfo.name) || DEFAULT_SITE_NAME; + const siteName = siteInfoStore((state) => state.siteInfo.name); const cc = `${fullYear} ${siteName}`; return (