You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by ro...@apache.org on 2024/10/16 08:45:13 UTC

(incubator-answer) branch test updated (c1178705 -> 88b52d86)

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

robin0716 pushed a change to branch test
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git


 discard c1178705 fix: Optimize badge animation effect
 discard 02e933f1 update: tag styles change
 discard 8b00327c fix: set default theme color constance
 discard bfeae75c fix: Personal homepage interface request error
 discard 8d86140b fix: badge detail params change
 discard 67685533 fix: badges allow 404
 discard d55383f7 fix: badge modal set zindex attribute
 discard 2d1cd38c fix: update axios to latest version,fix github security CVE-2024-28849
 discard 168715c8 fix: fix rendering issue in badge list
 discard 9269d708 fix: change badges detail item key
 discard bee0148f fix: badge detail delete loader
 discard 9a026ee4 fix: badge list style
    omit 23729505 refactor(ui): LinkedQuestions component to handle empty data
    omit 1e82b043 Fix line87
    omit 2fd6ac37 Fix err
    omit 73c7a229 Fix importer
    omit 5aad9e95 Add importer service
    omit 4c9e37fa Add importer plugin type
    omit 9f912b38 refactor(utils): Refactor plugin registration in Plugins class
    omit dc41218c refactor(ui): Update linked question UI text
    omit fe60e5e5 perf: optimize question linked display processing
    omit 74368ec9 perf: optimize question link processing
    omit 62b9104a fix: support short id
    omit b328a2b4 style: use ReplaceAll instead of Replace
    omit ab920ac0 perf: skip link addition for same question id
    omit 6f576c29 feat: add title to question linked page
    omit d0d275a6 style: move questionLink function to common service
    omit f575aa9b docs: add Apache License headers to source files
    omit 3eb9822c feat(question): support linking question
    omit bd0d9fda docs: regenerate docs
    omit 18c802ae change i18n strings
    omit 3e91f03b change minimum username length to 2 instead of 4
    omit 057f66cf style: Improve the display of personal page when there is no information
    omit ad477136 refactor(ui): update pluginKit refresh method
    omit df507a9d refactor(pluginKit): remove unused loadPlugins function
    omit 59080727 refactor(ui): update pre-install script in package.json
    omit 95b9af55 refactor(pluginKit): update addPluginToIndexTs function to include pluginFolder parameter
    omit 84a49321 chore(ui): update pre-install script in package.json
    omit dc61ab7e refactor(pluginKit): update plugin registration process
    omit 9479f1f8 chore(ui): Dynamically import plugins
    omit 62d2d2a8 refactor(pluginKit): improve plugin registration process
    omit 500c774f fix: Some contents of en_us.yaml have newline errors
    omit a0f24b3c refactor(pluginKit): update useRender hooks to include request parameter
    omit 0db889af fix: fix typo in plugin
     add 3c8aa03f fix(badge): fixed badge description translation
     add fa509526 fix(badge): fixed badge description translation
     add 6fb7131e Merge branch 'dev' into test
     add 462e1d04 Merge branch 'dev' into test
     add 66eb2d1c Merge branch 'dev' into test
     add e7eecc05 fix: badge list style
     add e24a7181 fix: badge detail delete loader
     add b927953f fix: change badges detail item key
     add eb595aad fix: fix rendering issue in badge list
     add cfbe458e fix: update axios to latest version,fix github security CVE-2024-28849
     add 7ff80389 fix: badge modal set zindex attribute
     add db80f630 Merge branch 'feat/1.4.1/badge-style' into test
     add 88dabcc4 fix: badges allow 404
     add 3cf4cd62 fix: badge detail params change
     add 36983898 fix: Personal homepage interface request error
     add b9064e3e fix: set default theme color constance
     add 106aeab1 refactor(pluginKit): update useRender hooks to include request parameter
     add 5ffa5583 Merge branch 'test' of github.com:answerdev/answer into test
     new f8fd872b update: tag styles change
     new 6817fafc refactor(gomod): replace pinyin dependency
     new 0cff10b1 Merge branch 'dev' into test
     new 88b52d86 fix: Optimize badge animation effect

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   (c1178705)
            \
             N -- N -- N   refs/heads/test (88b52d86)

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 4 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:
 cmd/wire_gen.go                                    |   4 +-
 docs/docs.go                                       |  87 +---------
 docs/swagger.json                                  |  87 +---------
 docs/swagger.yaml                                  |  52 ------
 i18n/af_ZA.yaml                                    |   4 +-
 i18n/ar_SA.yaml                                    |   4 +-
 i18n/az_AZ.yaml                                    |   4 +-
 i18n/bal_BA.yaml                                   |   4 +-
 i18n/ban_ID.yaml                                   |   4 +-
 i18n/bn_BD.yaml                                    |   4 +-
 i18n/bs_BA.yaml                                    |   4 +-
 i18n/ca_ES.yaml                                    |   4 +-
 i18n/cs_CZ.yaml                                    |   4 +-
 i18n/cy_GB.yaml                                    |   4 +-
 i18n/da_DK.yaml                                    |   4 +-
 i18n/de_DE.yaml                                    |   4 +-
 i18n/el_GR.yaml                                    |   4 +-
 i18n/en_US.yaml                                    |  25 +--
 i18n/es_ES.yaml                                    |   4 +-
 i18n/fa_IR.yaml                                    |   4 +-
 i18n/fi_FI.yaml                                    |   4 +-
 i18n/fr_FR.yaml                                    |   6 +-
 i18n/he_IL.yaml                                    |   4 +-
 i18n/hi_IN.yaml                                    |   4 +-
 i18n/hu_HU.yaml                                    |   4 +-
 i18n/hy_AM.yaml                                    |   4 +-
 i18n/id_ID.yaml                                    |   4 +-
 i18n/it_IT.yaml                                    |   4 +-
 i18n/ja_JP.yaml                                    |   4 +-
 i18n/ko_KR.yaml                                    |   2 +-
 i18n/nl_NL.yaml                                    |   4 +-
 i18n/no_NO.yaml                                    |   4 +-
 i18n/pl_PL.yaml                                    |   4 +-
 i18n/pt_BR.yaml                                    |   2 +-
 i18n/pt_PT.yaml                                    |   4 +-
 i18n/ro_RO.yaml                                    |   4 +-
 i18n/ru_RU.yaml                                    |   4 +-
 i18n/sk_SK.yaml                                    |   4 +-
 i18n/sq_AL.yaml                                    |   4 +-
 i18n/sr_SP.yaml                                    |   4 +-
 i18n/sv_SE.yaml                                    |   4 +-
 i18n/te_IN.yaml                                    |   4 +-
 i18n/tr_TR.yaml                                    |   4 +-
 i18n/uk_UA.yaml                                    |   4 +-
 i18n/vi_VN.yaml                                    |   4 +-
 i18n/zh_CN.yaml                                    |  10 +-
 i18n/zh_TW.yaml                                    |   4 +-
 internal/controller/question_controller.go         |  22 ---
 internal/entity/question_link_entity.go            |  44 -----
 internal/migrations/init_data.go                   |   1 -
 internal/migrations/migrations.go                  |   1 -
 internal/migrations/v23.go                         |  31 ----
 internal/repo/answer/answer_repo.go                |  18 --
 internal/repo/question/question_repo.go            | 167 -------------------
 internal/router/answer_api_router.go               |   1 -
 internal/schema/question_schema.go                 |  14 --
 internal/schema/user_schema.go                     |   2 +-
 internal/service/answer_common/answer.go           |   1 -
 internal/service/content/answer_service.go         |  36 +---
 internal/service/content/question_service.go       |  69 +-------
 internal/service/importer/importer_service.go      | 172 -------------------
 .../service/plugin_common/plugin_common_service.go |   8 -
 internal/service/question_common/question.go       | 113 -------------
 pkg/checker/question_link.go                       | 132 ---------------
 pkg/checker/question_link_test.go                  | 184 ---------------------
 pkg/checker/username.go                            |   2 +-
 plugin/embed.go                                    |   2 +-
 plugin/importer.go                                 |  62 -------
 plugin/plugin.go                                   |   4 -
 plugin/render.go                                   |   2 +-
 plugin/search.go                                   |   2 +-
 ui/package.json                                    |   2 +-
 ui/scripts/importPlugins.js                        |  68 --------
 ui/scripts/{loadPlugins.js => plugin.js}           |  47 ++++--
 ui/scripts/preinstall.js                           |   2 +-
 ui/src/components/QuestionList/index.tsx           |   2 +-
 ui/src/pages/Admin/Plugins/Installed/index.tsx     |   2 +-
 .../Detail/components/LinkedQuestions/index.tsx    | 105 ------------
 ui/src/pages/Questions/Detail/components/index.tsx |   2 -
 ui/src/pages/Questions/Detail/index.tsx            |   3 -
 ui/src/pages/Questions/Linked/index.tsx            | 127 --------------
 .../Users/Personal/components/Overview/index.tsx   |  45 +++--
 .../Users/Register/components/SignUpForm/index.tsx |   4 +-
 ui/src/router/routes.ts                            |   4 -
 ui/src/services/common.ts                          |  17 --
 ui/src/utils/pluginKit/index.ts                    |  38 ++---
 86 files changed, 181 insertions(+), 1804 deletions(-)
 delete mode 100644 internal/entity/question_link_entity.go
 delete mode 100644 internal/migrations/v23.go
 delete mode 100644 internal/service/importer/importer_service.go
 delete mode 100644 pkg/checker/question_link.go
 delete mode 100644 pkg/checker/question_link_test.go
 delete mode 100644 plugin/importer.go
 delete mode 100644 ui/scripts/importPlugins.js
 rename ui/scripts/{loadPlugins.js => plugin.js} (67%)
 delete mode 100644 ui/src/pages/Questions/Detail/components/LinkedQuestions/index.tsx
 delete mode 100644 ui/src/pages/Questions/Linked/index.tsx


(incubator-answer) 02/04: refactor(gomod): replace pinyin dependency

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

robin0716 pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git

commit 6817fafcca55343070f0b677c2692a258eda0796
Author: LinkinStars <li...@foxmail.com>
AuthorDate: Thu Sep 26 16:25:00 2024 +0800

    refactor(gomod): replace pinyin dependency
---
 docs/release/LICENSE                                          |  2 +-
 ...Chain-Zhang-pinyin.txt => LICENSE-mozillazg-go-pinyin.txt} |  4 ++--
 go.mod                                                        |  2 +-
 go.sum                                                        |  4 ++--
 internal/service/user_common/user.go                          |  9 ++-------
 pkg/htmltext/htmltext.go                                      | 11 +++--------
 6 files changed, 11 insertions(+), 21 deletions(-)

diff --git a/docs/release/LICENSE b/docs/release/LICENSE
index 26c12b2b..65e5642d 100644
--- a/docs/release/LICENSE
+++ b/docs/release/LICENSE
@@ -246,7 +246,7 @@ The following components are provided under the MIT License. See project link fo
    (MIT License) react-router (https://github.com/remix-run/react-router) [link](./licenses/LICENSE-remix-run-react-router.txt)
    (MIT License) swr (https://github.com/vercel/swr) [link](./licenses/LICENSE-vercel-swr.txt)
    (MIT License) zustand (https://github.com/pmndrs/zustand) [link](./licenses/LICENSE-pmndrs-zustand.txt)
-   (MIT License) Chain-Zhang-pinyin (https://github.com/Chain-Zhang/pinyin) [link](./licenses/LICENSE-Chain-Zhang-pinyin.txt)
+   (MIT License) mozillazg-go-pinyin (https://github.com/mozillazg/go-pinyin) [link](./licenses/LICENSE-mozillazg-go-pinyin.txt)
    (MIT License) Machiel-slugify (https://github.com/Machiel/slugify) [link](./licenses/LICENSE-Machiel-slugify.txt)
    (MIT License) Masterminds-semver (https://github.com/Masterminds/semver) [link](./licenses/LICENSE-Masterminds-semver.txt)
    (MIT License) anargu-gin-brotli (https://github.com/anargu/gin-brotli) [link](./licenses/LICENSE-anargu-gin-brotli.txt)
diff --git a/docs/release/licenses/LICENSE-Chain-Zhang-pinyin.txt b/docs/release/licenses/LICENSE-mozillazg-go-pinyin.txt
similarity index 95%
rename from docs/release/licenses/LICENSE-Chain-Zhang-pinyin.txt
rename to docs/release/licenses/LICENSE-mozillazg-go-pinyin.txt
index c98d6a49..8a7780fc 100644
--- a/docs/release/licenses/LICENSE-Chain-Zhang-pinyin.txt
+++ b/docs/release/licenses/LICENSE-mozillazg-go-pinyin.txt
@@ -1,6 +1,6 @@
-MIT License
+The MIT License (MIT)
 
-Copyright (c) 2019 Chain Zhang
+Copyright (c) 2016 mozillazg
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
diff --git a/go.mod b/go.mod
index 615b0f73..84689ef9 100644
--- a/go.mod
+++ b/go.mod
@@ -20,7 +20,6 @@ module github.com/apache/incubator-answer
 go 1.22.0
 
 require (
-	github.com/Chain-Zhang/pinyin v0.1.3
 	github.com/Machiel/slugify v1.0.1
 	github.com/Masterminds/semver/v3 v3.3.0
 	github.com/anargu/gin-brotli v0.0.0-20220116052358-12bf532d5267
@@ -41,6 +40,7 @@ require (
 	github.com/jinzhu/now v1.1.5
 	github.com/lib/pq v1.10.9
 	github.com/microcosm-cc/bluemonday v1.0.27
+	github.com/mozillazg/go-pinyin v0.20.0
 	github.com/ory/dockertest/v3 v3.11.0
 	github.com/robfig/cron/v3 v3.0.1
 	github.com/scottleedavis/go-exif-remove v0.0.0-20230314195146-7e059d593405
diff --git a/go.sum b/go.sum
index 1a2ab6fc..c8e314f1 100644
--- a/go.sum
+++ b/go.sum
@@ -8,8 +8,6 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25
 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
 github.com/BurntSushi/toml v1.0.0 h1:dtDWrepsVPfW9H/4y7dDgFc2MBUSeJhlaDtK13CxFlU=
 github.com/BurntSushi/toml v1.0.0/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=
-github.com/Chain-Zhang/pinyin v0.1.3 h1:RzErNyNwVa8z2sOLCuXSOtVdY/AsARb8mBzI2p2qtnE=
-github.com/Chain-Zhang/pinyin v0.1.3/go.mod h1:5iHpt9p4znrnaP59/hfPMnAojajkDxQaP9io+tRMPho=
 github.com/KyleBanks/depth v1.2.1 h1:5h8fQADFrWtarTdtDudMmGsC7GPbOAu6RVB3ffsVFHc=
 github.com/KyleBanks/depth v1.2.1/go.mod h1:jzSb9d0L43HxTQfT+oSA1EEp2q+ne2uh6XgeJcm8brE=
 github.com/LinkinStars/go-i18n/v2 v2.2.2 h1:ZfjpzbW13dv6btv3RALKZkpN9A+7K1JA//2QcNeWaxU=
@@ -241,6 +239,8 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJ
 github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
 github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
 github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
+github.com/mozillazg/go-pinyin v0.20.0 h1:BtR3DsxpApHfKReaPO1fCqF4pThRwH9uwvXzm+GnMFQ=
+github.com/mozillazg/go-pinyin v0.20.0/go.mod h1:iR4EnMMRXkfpFVV5FMi4FNB6wGq9NV6uDWbUuPhP4Yc=
 github.com/ncruces/go-strftime v0.1.9 h1:bY0MQC28UADQmHmaF5dgpLmImcShSi2kHU9XLdhx/f4=
 github.com/ncruces/go-strftime v0.1.9/go.mod h1:Fwc5htZGVVkseilnfgOVb9mKy6w1naJmn9CehxcKcls=
 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
diff --git a/internal/service/user_common/user.go b/internal/service/user_common/user.go
index a10c4766..7980044e 100644
--- a/internal/service/user_common/user.go
+++ b/internal/service/user_common/user.go
@@ -26,7 +26,6 @@ import (
 	"github.com/apache/incubator-answer/internal/base/constant"
 	"github.com/apache/incubator-answer/pkg/converter"
 
-	"github.com/Chain-Zhang/pinyin"
 	"github.com/apache/incubator-answer/internal/base/reason"
 	"github.com/apache/incubator-answer/internal/entity"
 	"github.com/apache/incubator-answer/internal/schema"
@@ -35,6 +34,7 @@ import (
 	"github.com/apache/incubator-answer/internal/service/siteinfo_common"
 	"github.com/apache/incubator-answer/pkg/checker"
 	"github.com/apache/incubator-answer/pkg/random"
+	"github.com/mozillazg/go-pinyin"
 	"github.com/segmentfault/pacman/errors"
 	"github.com/segmentfault/pacman/log"
 )
@@ -181,12 +181,7 @@ func (us *UserCommon) FormatUserBasicInfo(ctx context.Context, userInfo *entity.
 func (us *UserCommon) MakeUsername(ctx context.Context, displayName string) (username string, err error) {
 	// Chinese processing
 	if has := checker.IsChinese(displayName); has {
-		str, err := pinyin.New(displayName).Split("").Mode(pinyin.WithoutTone).Convert()
-		if err != nil {
-			return "", errors.BadRequest(reason.UsernameInvalid)
-		} else {
-			displayName = str
-		}
+		displayName = strings.Join(pinyin.LazyConvert(displayName, nil), "")
 	}
 
 	username = strings.ReplaceAll(displayName, " ", "-")
diff --git a/pkg/htmltext/htmltext.go b/pkg/htmltext/htmltext.go
index a72f9b5c..77ca2fba 100644
--- a/pkg/htmltext/htmltext.go
+++ b/pkg/htmltext/htmltext.go
@@ -27,12 +27,11 @@ import (
 	"strings"
 	"unicode/utf8"
 
-	"github.com/Chain-Zhang/pinyin"
 	"github.com/Machiel/slugify"
-	strip "github.com/grokify/html-strip-tags-go"
-
 	"github.com/apache/incubator-answer/pkg/checker"
 	"github.com/apache/incubator-answer/pkg/converter"
+	strip "github.com/grokify/html-strip-tags-go"
+	"github.com/mozillazg/go-pinyin"
 )
 
 // ClearText clear HTML, get the clear text
@@ -97,11 +96,7 @@ func convertChinese(content string) string {
 	if !has {
 		return content
 	}
-	str, err := pinyin.New(content).Split("-").Mode(pinyin.WithoutTone).Convert()
-	if err != nil {
-		return content
-	}
-	return str
+	return strings.Join(pinyin.LazyConvert(content, nil), "-")
 }
 
 func cutLongTitle(title string) string {


(incubator-answer) 04/04: fix: Optimize badge animation effect

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

robin0716 pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git

commit 88b52d86aba4be37ebc385a7df9c6455022a9b6e
Author: shuai <li...@sifou.com>
AuthorDate: Wed Oct 9 16:30:42 2024 +0800

    fix: Optimize badge animation effect
---
 ui/src/components/Modal/BadgeModal.tsx | 43 +++++++++++++++++++++++++++-------
 ui/src/utils/animateGift.ts            |  4 +++-
 2 files changed, 37 insertions(+), 10 deletions(-)

diff --git a/ui/src/components/Modal/BadgeModal.tsx b/ui/src/components/Modal/BadgeModal.tsx
index c0cf4cc3..9c77e9d4 100644
--- a/ui/src/components/Modal/BadgeModal.tsx
+++ b/ui/src/components/Modal/BadgeModal.tsx
@@ -66,19 +66,15 @@ const BadgeModal: FC<BadgeModalProps> = ({ badge, visible }) => {
     navigate(url);
   };
 
-  useEffect(() => {
+  const initAnimation = () => {
     const DURATION = 8000;
     const LENGTH = 200;
     const bgNode = document.documentElement || document.body;
+    const parentNode = document.getElementById('badgeModal')?.parentNode;
 
-    if (visible) {
-      const badgeModalNode = document.getElementById('badgeModal');
-      const paranetNode = badgeModalNode?.parentNode;
-
-      badgeModalNode?.setAttribute('style', 'z-index: 1');
-
+    if (parentNode) {
       bg1 = new AnimateGift({
-        elm: paranetNode,
+        elm: parentNode,
         width: bgNode.clientWidth,
         height: bgNode.clientHeight,
         length: LENGTH,
@@ -88,7 +84,7 @@ const BadgeModal: FC<BadgeModalProps> = ({ badge, visible }) => {
 
       timeout = setTimeout(() => {
         bg2 = new AnimateGift({
-          elm: paranetNode,
+          elm: parentNode,
           width: window.innerWidth,
           height: window.innerHeight,
           length: LENGTH,
@@ -96,6 +92,35 @@ const BadgeModal: FC<BadgeModalProps> = ({ badge, visible }) => {
         });
       }, DURATION / 2);
     }
+  };
+
+  const destroyAnimation = () => {
+    console.log('destroyAnimation');
+    clearTimeout(timeout);
+    bg1?.destroy();
+    bg2?.destroy();
+  };
+
+  useEffect(() => {
+    if (visible) {
+      initAnimation();
+    } else {
+      destroyAnimation();
+    }
+
+    const handleVisibilityChange = () => {
+      if (document.visibilityState === 'visible') {
+        initAnimation();
+      } else {
+        destroyAnimation();
+      }
+    };
+    document.addEventListener('visibilitychange', handleVisibilityChange);
+
+    return () => {
+      document.removeEventListener('visibilitychange', handleVisibilityChange);
+      destroyAnimation();
+    };
   }, [visible]);
 
   return (
diff --git a/ui/src/utils/animateGift.ts b/ui/src/utils/animateGift.ts
index c53b2f76..70137eca 100644
--- a/ui/src/utils/animateGift.ts
+++ b/ui/src/utils/animateGift.ts
@@ -178,6 +178,8 @@ export default class Confetti {
   }
 
   destroy() {
-    this.parent.removeChild(this.canvas);
+    if (this.parent.contains(this.canvas)) {
+      this.parent.removeChild(this.canvas);
+    }
   }
 }


(incubator-answer) 01/04: update: tag styles change

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

robin0716 pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git

commit f8fd872bde03d71dd34af1c779deb82e186738c3
Author: shuai <li...@sifou.com>
AuthorDate: Thu Sep 26 11:15:52 2024 +0800

    update: tag styles change
---
 ui/src/common/color.scss                   | 24 ++++++------------------
 ui/src/components/CustomizeTheme/index.tsx | 24 ------------------------
 ui/src/index.scss                          | 23 ++++++++---------------
 3 files changed, 14 insertions(+), 57 deletions(-)

diff --git a/ui/src/common/color.scss b/ui/src/common/color.scss
index 1a96b31d..16a7a297 100644
--- a/ui/src/common/color.scss
+++ b/ui/src/common/color.scss
@@ -110,31 +110,19 @@
 
   /** tag **/
   .badge-tag {
-    background: rgba($blue-900, 0.5);
-    color: $blue-300;
-    &:hover {
-      color: $blue-300;
-      background: $blue-900;
-    }
-  }
-  .badge-tag-required {
     background: $gray-800;
-    color:$gray-300;
-    border: 1px solid $gray-600;
+    color: $gray-300;
     &:hover {
-      color: $gray-300;
-      background: $gray-700;
+      background: $gray-600;
     }
   }
+
   .badge-tag-reserved {
-    color: $orange-300;
-    background: rgba($orange-900, 0.5);
-    border: 1px solid $orange-900;
+    color: $orange-200;
+    background: $orange-800;
     &:hover {
-      color: $orange-300;
-      background: rgba($orange-900, 1);
+      background: $orange-700;
     }
   }
 
-
 }
diff --git a/ui/src/components/CustomizeTheme/index.tsx b/ui/src/components/CustomizeTheme/index.tsx
index b142540b..46e3dd57 100644
--- a/ui/src/components/CustomizeTheme/index.tsx
+++ b/ui/src/components/CustomizeTheme/index.tsx
@@ -143,31 +143,7 @@ const Index: FC = () => {
               .link-primary:hover, .link-primary:focus {
                 color: ${shadeColor(primaryColor, 0.8).hex()}!important;
               }
-              .badge-tag:not(.badge-tag-reserved, .badge-tag-required) {
-                background-color: rgba(${tintColor(primaryColor, 0.2)
-                  .rgb()
-                  .array()
-                  .join(',')}, .5);
-                color: ${shadeColor(primaryColor, 0.6).hex()}
-              }
-              .badge-tag:not(.badge-tag-reserved, .badge-tag-required):hover {
-                 background-color: ${tintColor(primaryColor, 0.2).hex()};
-              }
 
-              [data-bs-theme="dark"] .badge-tag:not(.badge-tag-reserved):not(.badge-tag-required) {
-                background-color: rgba(${shadeColor(primaryColor, 0.2)
-                  .rgb()
-                  .array()
-                  .join(',')}, .5) !important;
-                color: ${tintColor(primaryColor, 0.4).hex()} !important;
-              }
-              [data-bs-theme="dark"] .badge-tag:not(.badge-tag-reserved, .badge-tag-required):hover {
-                background-color: rgba(${tintColor(
-                  primaryColor,
-                  0.4,
-                ).hex()}, 0.8) !important;
-                color: ${tintColor(primaryColor, 0.6).hex()} !important;
-              }
             `}
         </style>
       )}
diff --git a/ui/src/index.scss b/ui/src/index.scss
index 6d3ade05..6da6d336 100644
--- a/ui/src/index.scss
+++ b/ui/src/index.scss
@@ -87,33 +87,26 @@ img[src=""] {
 .badge-tag {
   display: inline-block;
   font-size: 14px;
-  background: rgba($blue-100, 0.5);
+  background: $gray-200;
   padding: 0 7px 1px;
-  color: $blue-700;
+  color: $gray-700;
+  font-weight: 400;
   border: 1px solid transparent;
   &:hover {
-    color: $blue-700;
-    background: $blue-100;
+    background: $gray-300;
   }
 }
 
 .badge-tag-required {
-  background: $gray-200;
-  color: $gray-700;
-  border: 1px solid $gray-400;
-  &:hover {
-    color: $gray-700;
-    background: $gray-300;
-  }
+  font-weight: 700;
 }
 
 .badge-tag-reserved {
-  background: rgba($orange-100, 0.5);
+  background: $orange-100;
   color: $orange-700;
-  border: 1px solid $orange-100;
+  border: 1px solid transparent;
   &:hover {
-    color: $orange-700;
-    background: rgba($orange-100, 1);
+    background: $orange-200;
   }
 }
 


(incubator-answer) 03/04: Merge branch 'dev' into test

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

robin0716 pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git

commit 0cff10b177f63dc81754f0bb0ef338bd0586b517
Merge: 6817fafc d6fa819f
Author: LinkinStars <li...@foxmail.com>
AuthorDate: Fri Sep 27 14:03:08 2024 +0800

    Merge branch 'dev' into test
    
    # Conflicts:
    #       go.sum

 go.mod |   2 +-
 go.sum | 530 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 527 insertions(+), 5 deletions(-)