From ec5db24b2a172cd0103595a741b124a98249f236 Mon Sep 17 00:00:00 2001 From: Johnny Date: Sun, 21 Dec 2025 21:32:01 +0800 Subject: [PATCH] chore: remove custom style - Deleted the custom_style field from WorkspaceProfile and WorkspaceSetting messages in workspace_service.proto. - Updated the corresponding Go files and gRPC service implementations to reflect the removal of custom_style. - Removed references to custom_style in the API documentation and Swagger definitions. - Adjusted the workspace setting migration logic to exclude custom_style. - Updated README files to remove mentions of custom_style. - Bumped protoc-gen-go and protoc-gen-go-grpc versions in generated files. --- frontend/locales/en.json | 3 +- frontend/locales/fr.json | 3 +- frontend/locales/hu.json | 3 +- frontend/locales/ja.json | 3 +- frontend/locales/ru.json | 3 +- frontend/locales/tr.json | 3 +- frontend/locales/uk.json | 3 +- frontend/locales/zh.json | 3 +- frontend/web/src/App.tsx | 7 - .../WorkspaceGeneralSettingSection.tsx | 20 -- .../types/proto/api/v1/workspace_service.ts | 31 +-- .../types/proto/google/protobuf/descriptor.ts | 225 +++++++++++++++++- .../types/proto/store/workspace_setting.ts | 22 +- proto/api/v1/workspace_service.proto | 4 - proto/gen/api/v1/README.md | 2 - proto/gen/api/v1/auth_service.pb.go | 2 +- proto/gen/api/v1/auth_service_grpc.pb.go | 14 +- proto/gen/api/v1/collection_service.pb.go | 2 +- .../gen/api/v1/collection_service_grpc.pb.go | 16 +- proto/gen/api/v1/common.pb.go | 2 +- proto/gen/api/v1/shortcut_service.pb.go | 2 +- proto/gen/api/v1/shortcut_service_grpc.pb.go | 18 +- proto/gen/api/v1/subscription_service.pb.go | 2 +- .../api/v1/subscription_service_grpc.pb.go | 10 +- proto/gen/api/v1/user_service.pb.go | 2 +- proto/gen/api/v1/user_service_grpc.pb.go | 20 +- proto/gen/api/v1/user_setting_service.pb.go | 2 +- .../api/v1/user_setting_service_grpc.pb.go | 8 +- proto/gen/api/v1/workspace_service.pb.go | 30 +-- proto/gen/api/v1/workspace_service_grpc.pb.go | 10 +- proto/gen/apidocs.swagger.yaml | 6 - proto/gen/store/README.md | 2 - proto/gen/store/activity.pb.go | 2 +- proto/gen/store/collection.pb.go | 2 +- proto/gen/store/common.pb.go | 2 +- proto/gen/store/idp.pb.go | 2 +- proto/gen/store/shortcut.pb.go | 2 +- proto/gen/store/user_setting.pb.go | 2 +- proto/gen/store/workspace_setting.pb.go | 26 +- proto/store/workspace_setting.proto | 3 - server/route/api/v1/workspace_service.go | 15 -- store/db/postgres/workspace_setting.go | 1 - store/db/sqlite/workspace_setting.go | 1 - store/migrator.go | 6 - 44 files changed, 306 insertions(+), 241 deletions(-) diff --git a/frontend/locales/en.json b/frontend/locales/en.json index f80a9f2..a32a1c9 100644 --- a/frontend/locales/en.json +++ b/frontend/locales/en.json @@ -68,7 +68,6 @@ }, "workspace": { "self": "Workspace settings", - "custom-style": "Custom style", "disallow-user-registration": { "self": "Disallow user registration" }, @@ -79,4 +78,4 @@ } } } -} +} \ No newline at end of file diff --git a/frontend/locales/fr.json b/frontend/locales/fr.json index cbc7923..d11037d 100644 --- a/frontend/locales/fr.json +++ b/frontend/locales/fr.json @@ -68,7 +68,6 @@ }, "workspace": { "self": "Paramètres de l'espace de travail", - "custom-style": "Style personnalisé", "enable-user-signup": { "self": "Activer l'inscription des utilisateurs", "description": "Une fois activé, d'autres utilisateurs peuvent s'inscrire." @@ -76,4 +75,4 @@ "default-visibility": "Visibilité par défaut" } } -} +} \ No newline at end of file diff --git a/frontend/locales/hu.json b/frontend/locales/hu.json index 1e3b5a0..73cf00a 100644 --- a/frontend/locales/hu.json +++ b/frontend/locales/hu.json @@ -69,7 +69,6 @@ }, "workspace": { "self": "Munkaterület beállítások", - "custom-style": "Egyéni stílus", "enable-user-signup": { "self": "Felhasználói regisztráció engedélyezése", "description": "Ha engedélyezve van, más felhasználók is regisztrálhatnak." @@ -77,4 +76,4 @@ "default-visibility": "Alapértelmezett láthatóság" } } -} +} \ No newline at end of file diff --git a/frontend/locales/ja.json b/frontend/locales/ja.json index 73d66aa..20ee60b 100644 --- a/frontend/locales/ja.json +++ b/frontend/locales/ja.json @@ -68,7 +68,6 @@ }, "workspace": { "self": "ワークスペースの設定", - "custom-style": "カスタムスタイル", "disallow-user-registration": { "self": "ユーザーの登録を有効にする" }, @@ -79,4 +78,4 @@ } } } -} +} \ No newline at end of file diff --git a/frontend/locales/ru.json b/frontend/locales/ru.json index 2a6fe6b..59ddafe 100644 --- a/frontend/locales/ru.json +++ b/frontend/locales/ru.json @@ -69,7 +69,6 @@ }, "workspace": { "self": "Настройки команды", - "custom-style": "Пользовательский стиль", "enable-user-signup": { "self": "Разрешить регистрацию пользователей", "description": "После включения, другие пользователи смогут зарегистрироваться." @@ -77,4 +76,4 @@ "default-visibility": "Отображение по умолчанию" } } -} +} \ No newline at end of file diff --git a/frontend/locales/tr.json b/frontend/locales/tr.json index 664f780..b8782e9 100644 --- a/frontend/locales/tr.json +++ b/frontend/locales/tr.json @@ -68,7 +68,6 @@ }, "workspace": { "self": "Çalışma alanı ayarları", - "custom-style": "Özel stil", "enable-user-signup": { "self": "Kullanıcı kaydını etkinleştir", "description": "Etkinleştirildiğinde, diğer kullanıcılar kaydolabilir." @@ -76,4 +75,4 @@ "default-visibility": "Varsayılan görünürlük" } } -} +} \ No newline at end of file diff --git a/frontend/locales/uk.json b/frontend/locales/uk.json index e446e0c..007a0bf 100644 --- a/frontend/locales/uk.json +++ b/frontend/locales/uk.json @@ -68,7 +68,6 @@ }, "workspace": { "self": "Налаштування робочого простору", - "custom-style": "Індивідуальний стиль", "disallow-user-registration": { "self": "Заборонити реєстрацію користувача" }, @@ -79,4 +78,4 @@ } } } -} +} \ No newline at end of file diff --git a/frontend/locales/zh.json b/frontend/locales/zh.json index 46bf297..7d4711a 100644 --- a/frontend/locales/zh.json +++ b/frontend/locales/zh.json @@ -68,7 +68,6 @@ }, "workspace": { "self": "系统设置", - "custom-style": "自定义样式", "enable-user-signup": { "self": "启用用户注册", "description": "允许其他用户注册新账号" @@ -76,4 +75,4 @@ "default-visibility": "默认可见性" } } -} +} \ No newline at end of file diff --git a/frontend/web/src/App.tsx b/frontend/web/src/App.tsx index 15d50fc..dd72942 100644 --- a/frontend/web/src/App.tsx +++ b/frontend/web/src/App.tsx @@ -19,13 +19,6 @@ function App() { } }, [workspaceStore.profile]); - useEffect(() => { - const styleEl = document.createElement("style"); - styleEl.innerHTML = workspaceStore.setting.customStyle; - styleEl.setAttribute("type", "text/css"); - document.body.insertAdjacentElement("beforeend", styleEl); - }, [workspaceStore.setting.customStyle]); - useEffect(() => { const hasCustomBranding = workspaceStore.checkFeatureAvailable(FeatureType.CustomeBranding); if (!hasCustomBranding || !workspaceStore.setting.branding) { diff --git a/frontend/web/src/components/setting/WorkspaceGeneralSettingSection.tsx b/frontend/web/src/components/setting/WorkspaceGeneralSettingSection.tsx index b43b1e6..7d45f9d 100644 --- a/frontend/web/src/components/setting/WorkspaceGeneralSettingSection.tsx +++ b/frontend/web/src/components/setting/WorkspaceGeneralSettingSection.tsx @@ -4,7 +4,6 @@ import { useTranslation } from "react-i18next"; import { toast } from "sonner"; import { Button } from "@/components/ui/button"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select"; -import { Textarea } from "@/components/ui/textarea"; import { workspaceServiceClient } from "@/grpcweb"; import { useWorkspaceStore } from "@/stores"; import { FeatureType } from "@/stores/workspace"; @@ -59,13 +58,6 @@ const WorkspaceGeneralSettingSection = () => { setWorkspaceSetting({ ...workspaceSetting, branding: new TextEncoder().encode(base64) }); }; - const handleCustomStyleChange = async (value: string) => { - setWorkspaceSetting({ - ...workspaceSetting, - customStyle: value, - }); - }; - const handleDefaultVisibilityChange = async (value: Visibility) => { setWorkspaceSetting({ ...workspaceSetting, @@ -78,9 +70,6 @@ const WorkspaceGeneralSettingSection = () => { if (!isEqual(originalWorkspaceSetting.current.branding, workspaceSetting.branding)) { updateMask.push("branding"); } - if (!isEqual(originalWorkspaceSetting.current.customStyle, workspaceSetting.customStyle)) { - updateMask.push("custom_style"); - } if (!isEqual(originalWorkspaceSetting.current.defaultVisibility, workspaceSetting.defaultVisibility)) { updateMask.push("default_visibility"); } @@ -155,15 +144,6 @@ const WorkspaceGeneralSettingSection = () => { -
-

{t("settings.workspace.custom-style")}

-