diff --git a/packages/constants/src/workspace.ts b/packages/constants/src/workspace.ts index d37decf3f2f..8fd77cb572b 100644 --- a/packages/constants/src/workspace.ts +++ b/packages/constants/src/workspace.ts @@ -1,3 +1,6 @@ +import { TStaticViewTypes } from "@plane/types"; +import { EUserWorkspaceRoles } from "./user"; + export const ORGANIZATION_SIZE = [ "Just myself", // TODO: translate "2-10", @@ -74,3 +77,182 @@ export const RESTRICTED_URLS = [ "instances", "instance", ]; + +export const WORKSPACE_SETTINGS = { + general: { + key: "general", + i18n_label: "workspace_settings.settings.general.title", + href: `/settings`, + access: [EUserWorkspaceRoles.ADMIN], + highlight: (pathname: string, baseUrl: string) => + pathname === `${baseUrl}/settings/`, + }, + members: { + key: "members", + i18n_label: "workspace_settings.settings.members.title", + href: `/settings/members`, + access: [EUserWorkspaceRoles.ADMIN], + highlight: (pathname: string, baseUrl: string) => + pathname === `${baseUrl}/settings/members/`, + }, + "billing-and-plans": { + key: "billing-and-plans", + i18n_label: "workspace_settings.settings.billing_and_plans.title", + href: `/settings/billing`, + access: [EUserWorkspaceRoles.ADMIN], + highlight: (pathname: string, baseUrl: string) => + pathname === `${baseUrl}/settings/billing/`, + }, + export: { + key: "export", + i18n_label: "workspace_settings.settings.exports.title", + href: `/settings/exports`, + access: [EUserWorkspaceRoles.ADMIN], + highlight: (pathname: string, baseUrl: string) => + pathname === `${baseUrl}/settings/exports/`, + }, + webhooks: { + key: "webhooks", + i18n_label: "workspace_settings.settings.webhooks.title", + href: `/settings/webhooks`, + access: [EUserWorkspaceRoles.ADMIN], + highlight: (pathname: string, baseUrl: string) => + pathname === `${baseUrl}/settings/webhooks/`, + }, + "api-tokens": { + key: "api-tokens", + i18n_label: "workspace_settings.settings.webhooks.title", + href: `/settings/api-tokens`, + access: [EUserWorkspaceRoles.ADMIN], + highlight: (pathname: string, baseUrl: string) => + pathname === `${baseUrl}/settings/api-tokens/`, + }, +}; + +export const WORKSPACE_SETTINGS_LINKS: { + key: string; + i18n_label: string; + href: string; + access: EUserWorkspaceRoles[]; + highlight: (pathname: string, baseUrl: string) => boolean; +}[] = [ + WORKSPACE_SETTINGS["general"], + WORKSPACE_SETTINGS["members"], + WORKSPACE_SETTINGS["billing-and-plans"], + WORKSPACE_SETTINGS["export"], + WORKSPACE_SETTINGS["webhooks"], + WORKSPACE_SETTINGS["api-tokens"], +]; + +export const ROLE = { + [EUserWorkspaceRoles.GUEST]: "Guest", + [EUserWorkspaceRoles.MEMBER]: "Member", + [EUserWorkspaceRoles.ADMIN]: "Admin", +}; + +export const ROLE_DETAILS = { + [EUserWorkspaceRoles.GUEST]: { + i18n_title: "role_details.guest.title", + i18n_description: "role_details.guest.description", + }, + [EUserWorkspaceRoles.MEMBER]: { + i18n_title: "role_details.member.title", + i18n_description: "role_details.member.description", + }, + [EUserWorkspaceRoles.ADMIN]: { + i18n_title: "role_details.admin.title", + i18n_description: "role_details.admin.description", + }, +}; + +export const USER_ROLES = [ + { + value: "Product / Project Manager", + i18n_label: "user_roles.product_or_project_manager", + }, + { + value: "Development / Engineering", + i18n_label: "user_roles.development_or_engineering", + }, + { + value: "Founder / Executive", + i18n_label: "user_roles.founder_or_executive", + }, + { + value: "Freelancer / Consultant", + i18n_label: "user_roles.freelancer_or_consultant", + }, + { value: "Marketing / Growth", i18n_label: "user_roles.marketing_or_growth" }, + { + value: "Sales / Business Development", + i18n_label: "user_roles.sales_or_business_development", + }, + { + value: "Support / Operations", + i18n_label: "user_roles.support_or_operations", + }, + { + value: "Student / Professor", + i18n_label: "user_roles.student_or_professor", + }, + { value: "Human Resources", i18n_label: "user_roles.human_resources" }, + { value: "Other", i18n_label: "user_roles.other" }, +]; + +export const IMPORTERS_LIST = [ + { + provider: "github", + type: "import", + i18n_title: "importer.github.title", + i18n_description: "importer.github.description", + }, + { + provider: "jira", + type: "import", + i18n_title: "importer.jira.title", + i18n_description: "importer.jira.description", + }, +]; + +export const EXPORTERS_LIST = [ + { + provider: "csv", + type: "export", + i18n_title: "exporter.csv.title", + i18n_description: "exporter.csv.description", + }, + { + provider: "xlsx", + type: "export", + i18n_title: "exporter.excel.title", + i18n_description: "exporter.csv.description", + }, + { + provider: "json", + type: "export", + i18n_title: "exporter.json.title", + i18n_description: "exporter.csv.description", + }, +]; + +export const DEFAULT_GLOBAL_VIEWS_LIST: { + key: TStaticViewTypes; + i18n_label: string; +}[] = [ + { + key: "all-issues", + i18n_label: "default_global_view.all_issues", + }, + { + key: "assigned", + i18n_label: "default_global_view.assigned", + }, + { + key: "created", + i18n_label: "default_global_view.created", + }, + { + key: "subscribed", + i18n_label: "default_global_view.subscribed", + }, +]; diff --git a/packages/i18n/src/locales/en/translations.json b/packages/i18n/src/locales/en/translations.json index 2e779853e9e..b384741ccc5 100644 --- a/packages/i18n/src/locales/en/translations.json +++ b/packages/i18n/src/locales/en/translations.json @@ -683,6 +683,26 @@ "workspace_settings": { "label": "Workspace settings", + "settings": { + "general": { + "title": "General" + }, + "members": { + "title": "Members" + }, + "billing-and-plans": { + "title": "Billing & Plans" + }, + "exports": { + "title": "Exports" + }, + "webhooks": { + "title": "Webhooks" + }, + "api-tokens": { + "title": "API Tokens" + } + }, "empty_state": { "api_tokens": { "title": "No API tokens created", @@ -1111,5 +1131,65 @@ "message": "The sticky could not be removed" } } + }, + + "role_details": { + "guest": { + "title": "Guest", + "description": "External members of organizations can be invited as guests." + }, + "member": { + "title": "Member", + "description": "Ability to read, write, edit, and delete entities inside projects, cycles, and modules" + }, + "admin": { + "title": "Admin", + "description": "All permissions set to true within the workspace." + } + }, + + "user_roles": { + "product_or_project_manager": "Product / Project Manager", + "development_or_engineering": "Development / Engineering", + "founder_or_executive": "Founder / Executive", + "freelancer_or_consultant": "Freelancer / Consultant", + "marketing_or_growth": "Marketing / Growth", + "sales_or_business_development": "Sales / Business Development", + "support_or_operations": "Support / Operations", + "student_or_professor": "Student / Professor", + "human_or_resources": "Human / Resources", + "other": "Other" + }, + + "importer": { + "github": { + "title": "Github", + "description": "Import issues from GitHub repositories and sync them." + }, + "jira": { + "title": "Jira", + "description": "Import issues and epics from Jira projects and epics." + } + }, + + "exporter": { + "csv": { + "title": "CSV", + "description": "Export issues to a CSV file." + }, + "xlsx": { + "title": "Excel", + "description": "Export issues to a Excel file." + }, + "json": { + "title": "JSON", + "description": "Export issues to a JSON file." + } + }, + "default_global_view": { + "all_issues": "All issues", + "assigned": "Assigned", + "created": "Created", + "subscribed": "Subscribed" } } diff --git a/packages/i18n/src/locales/es/translations.json b/packages/i18n/src/locales/es/translations.json index 552f7dab79e..bb113599164 100644 --- a/packages/i18n/src/locales/es/translations.json +++ b/packages/i18n/src/locales/es/translations.json @@ -687,6 +687,26 @@ "workspace_settings": { "label": "Configuración del espacio de trabajo", + "settings": { + "general": { + "title": "General" + }, + "members": { + "title": "Miembros" + }, + "billing-and-plans": { + "title": "Facturación y planes" + }, + "exports": { + "title": "Exportaciones" + }, + "webhooks": { + "title": "Webhooks" + }, + "api-tokens": { + "title": "Tokens API" + } + }, "empty_state": { "api_tokens": { "title": "No se han creado tokens API", @@ -1115,5 +1135,66 @@ "message": "No se pudo eliminar la nota" } } + }, + + "role_details": { + "guest": { + "title": "Invitado", + "description": "Los miembros externos de las organizaciones pueden ser invitados como invitados." + }, + "member": { + "title": "Miembro", + "description": "Capacidad para leer, escribir, editar y eliminar entidades dentro de proyectos, ciclos y módulos" + }, + "admin": { + "title": "Administrador", + "description": "Todos los permisos establecidos como verdaderos dentro del espacio de trabajo." + } + }, + + "user_roles": { + "product_or_project_manager": "Gerente de Producto / Proyecto", + "development_or_engineering": "Desarrollo / Ingeniería", + "founder_or_executive": "Fundador / Ejecutivo", + "freelancer_or_consultant": "Freelancer / Consultor", + "marketing_or_growth": "Marketing / Crecimiento", + "sales_or_business_development": "Ventas / Desarrollo de Negocios", + "support_or_operations": "Soporte / Operaciones", + "student_or_professor": "Estudiante / Profesor", + "human_or_resources": "Recursos Humanos", + "other": "Otro" + }, + + "importer": { + "github": { + "title": "Github", + "description": "Importar problemas desde repositorios de GitHub y sincronizarlos." + }, + "jira": { + "title": "Jira", + "description": "Importar problemas y épicas desde proyectos de Jira." + } + }, + + "exporter": { + "csv": { + "title": "CSV", + "description": "Exportar problemas a un archivo CSV." + }, + "xlsx": { + "title": "Excel", + "description": "Exportar problemas a un archivo Excel." + }, + "json": { + "title": "JSON", + "description": "Exportar problemas a un archivo JSON." + } + }, + + "default_global_view": { + "all_issues": "Todos los problemas", + "assigned": "Asignados", + "created": "Creados", + "subscribed": "Suscritos" } } diff --git a/packages/i18n/src/locales/fr/translations.json b/packages/i18n/src/locales/fr/translations.json index d8bbb024997..22b11f1dbaf 100644 --- a/packages/i18n/src/locales/fr/translations.json +++ b/packages/i18n/src/locales/fr/translations.json @@ -650,7 +650,7 @@ "empty_state": { "all-issues": { "title": "Aucune tâche dans le projet", - "description": "Premier projet terminé ! Maintenant, divisez votre travail en morceaux traçables avec des tâches. Allons-y !", + "description": "Premier projet terminé ! Maintenant, divisez votre travail en morceaux traçables avec des tâches. Allons-y !", "primary_button": { "text": "Créer une nouvelle tâche" } @@ -682,6 +682,26 @@ "workspace_settings": { "label": "Paramètres de l'espace de travail", + "settings": { + "general": { + "title": "Général" + }, + "members": { + "title": "Membres" + }, + "billing-and-plans": { + "title": "Facturation et plans" + }, + "exports": { + "title": "Exportations" + }, + "webhooks": { + "title": "Webhooks" + }, + "api-tokens": { + "title": "Jetons API" + } + }, "empty_state": { "api_tokens": { "title": "Aucun jeton API créé", @@ -746,7 +766,7 @@ "empty_state": { "activity": { "title": "Aucune activité pour le moment", - "description": "Commencez par créer une nouvelle tâche ! Ajoutez des détails et des propriétés à celle-ci. Explorez davantage Plane pour voir votre activité." + "description": "Commencez par créer une nouvelle tâche ! Ajoutez des détails et des propriétés à celle-ci. Explorez davantage Plane pour voir votre activité." }, "assigned": { "title": "Aucune tâche assignée", @@ -813,13 +833,13 @@ "project_issues": { "empty_state": { "no_issues": { - "title": "Créez un problème et assignez-le à quelqu’un, même à vous-même", + "title": "Créez un problème et assignez-le à quelqu'un, même à vous-même", "description": "Considérez les problèmes comme des emplois, des tâches, des actions ou JTBD (travaux à accomplir). Nous aimons ça. Un problème et ses sous-problèmes sont généralement des actions basées sur le temps assignées aux membres de votre équipe. Votre équipe crée, assigne et termine des problèmes pour faire avancer votre projet vers son objectif.", "primary_button": { "text": "Créez votre premier problème", "comic": { "title": "Les problèmes sont les éléments constitutifs de Plane.", - "description": "Redessiner l’interface utilisateur de Plane, Rebrander l’entreprise ou Lancer le nouveau système d’injection de carburant sont des exemples de problèmes qui comportent probablement des sous-problèmes." + "description": "Redessiner l'interface utilisateur de Plane, Rebrander l'entreprise ou Lancer le nouveau système d'injection de carburant sont des exemples de problèmes qui comportent probablement des sous-problèmes." } } }, @@ -1110,5 +1130,66 @@ "message": "Le pense-bête n'a pas pu être supprimé" } } + }, + + "role_details": { + "guest": { + "title": "Invité", + "description": "Les membres externes des organisations peuvent être invités en tant qu'invités." + }, + "member": { + "title": "Membre", + "description": "Capacité à lire, écrire, modifier et supprimer des entités dans les projets, cycles et modules" + }, + "admin": { + "title": "Administrateur", + "description": "Toutes les autorisations définies sur vrai dans l'espace de travail." + } + }, + + "user_roles": { + "product_or_project_manager": "Chef de Produit / Projet", + "development_or_engineering": "Développement / Ingénierie", + "founder_or_executive": "Fondateur / Dirigeant", + "freelancer_or_consultant": "Freelance / Consultant", + "marketing_or_growth": "Marketing / Croissance", + "sales_or_business_development": "Ventes / Développement Commercial", + "support_or_operations": "Support / Opérations", + "student_or_professor": "Étudiant / Professeur", + "human_or_resources": "Ressources Humaines", + "other": "Autre" + }, + + "importer": { + "github": { + "title": "Github", + "description": "Importer des problèmes depuis les dépôts GitHub et les synchroniser." + }, + "jira": { + "title": "Jira", + "description": "Importer des problèmes et des épopées depuis les projets Jira." + } + }, + + "exporter": { + "csv": { + "title": "CSV", + "description": "Exporter les problèmes vers un fichier CSV." + }, + "xlsx": { + "title": "Excel", + "description": "Exporter les problèmes vers un fichier Excel." + }, + "json": { + "title": "JSON", + "description": "Exporter les problèmes vers un fichier JSON." + } + }, + + "default_global_view": { + "all_issues": "Tous les problèmes", + "assigned": "Assignés", + "created": "Créés", + "subscribed": "Abonnés" } } diff --git a/packages/i18n/src/locales/ja/translations.json b/packages/i18n/src/locales/ja/translations.json index ecb7bf4ef32..825f493c622 100644 --- a/packages/i18n/src/locales/ja/translations.json +++ b/packages/i18n/src/locales/ja/translations.json @@ -685,6 +685,26 @@ "workspace_settings": { "label": "ワークスペース設定", + "settings": { + "general": { + "title": "一般" + }, + "members": { + "title": "メンバー" + }, + "billing-and-plans": { + "title": "請求とプラン" + }, + "exports": { + "title": "エクスポート" + }, + "webhooks": { + "title": "Webhooks" + }, + "api-tokens": { + "title": "APIトークン" + } + }, "empty_state": { "api_tokens": { "title": "APIトークンが作成されていません", @@ -1113,5 +1133,66 @@ "message": "付箋を削除できませんでした" } } + }, + + "role_details": { + "guest": { + "title": "ゲスト", + "description": "組織の外部メンバーはゲストとして招待できます。" + }, + "member": { + "title": "メンバー", + "description": "プロジェクト、サイクル、モジュール内のエンティティの読み取り、書き込み、編集、削除が可能" + }, + "admin": { + "title": "管理者", + "description": "ワークスペース内のすべての権限が有効。" + } + }, + + "user_roles": { + "product_or_project_manager": "プロダクト/プロジェクトマネージャー", + "development_or_engineering": "開発/エンジニアリング", + "founder_or_executive": "創業者/エグゼクティブ", + "freelancer_or_consultant": "フリーランス/コンサルタント", + "marketing_or_growth": "マーケティング/グロース", + "sales_or_business_development": "営業/事業開発", + "support_or_operations": "サポート/オペレーション", + "student_or_professor": "学生/教授", + "human_or_resources": "人事", + "other": "その他" + }, + + "importer": { + "github": { + "title": "Github", + "description": "GitHubリポジトリから課題をインポートして同期します。" + }, + "jira": { + "title": "Jira", + "description": "Jiraプロジェクトから課題とエピックをインポートします。" + } + }, + + "exporter": { + "csv": { + "title": "CSV", + "description": "課題をCSVファイルにエクスポートします。" + }, + "xlsx": { + "title": "Excel", + "description": "課題をExcelファイルにエクスポートします。" + }, + "json": { + "title": "JSON", + "description": "課題をJSONファイルにエクスポートします。" + } + }, + + "default_global_view": { + "all_issues": "すべての課題", + "assigned": "割り当て済み", + "created": "作成済み", + "subscribed": "購読済み" } } diff --git a/packages/i18n/src/locales/zh-CN/translations.json b/packages/i18n/src/locales/zh-CN/translations.json index 3602063cb6e..6df5251a886 100644 --- a/packages/i18n/src/locales/zh-CN/translations.json +++ b/packages/i18n/src/locales/zh-CN/translations.json @@ -154,7 +154,47 @@ "stay_ahead_of_blockers_description": "发现项目间的挑战,查看其他视图中不明显的周期依赖关系。", "analytics": "分析", "workspace_invites": "工作区邀请", - "workspace_settings": "工作区设置", + "workspace_settings": { + "label": "工作区设置", + "settings": { + "general": { + "title": "常规" + }, + "members": { + "title": "会员" + }, + "billing-and-plans": { + "title": "账单与计划" + }, + "exports": { + "title": "导出" + }, + "webhooks": { + "title": "网络钩子" + }, + "api-tokens": { + "title": "API 令牌" + } + }, + "empty_state": { + "api_tokens": { + "title": "尚未创建 API 令牌", + "description": "Plane API 可用于将您在 Plane 中的数据与任何外部系统集成。创建令牌即可开始使用。" + }, + "webhooks": { + "title": "尚未添加网络钩子", + "description": "创建网络钩子以接收实时更新并自动执行操作。" + }, + "exports": { + "title": "尚无导出记录", + "description": "每次导出时,您都可以在此处找到参考副本。" + }, + "imports": { + "title": "尚无导入记录", + "description": "在此处查找所有以前的导入记录并下载。" + } + } + }, "enter_god_mode": "进入上帝模式", "workspace_logo": "工作区徽标", "new_issue": "新建问题", @@ -381,10 +421,10 @@ "recents": { "title": "最近", "empty": { - "project": "访问项目后,您的最近项目将显示在这里。", - "page": "访问页面后,您的最近页面将显示在这里。", - "issue": "访问问题后,您的最近问题将显示在这里。", - "default": "您还没有任何最近项目。" + "project": "访问项目后,您的最近项目将显示在这里。", + "page": "访问页面后,您的最近页面将显示在这里。", + "issue": "访问问题后,您的最近问题将显示在这里。", + "default": "您还没有任何最近项目。" }, "filters": { "all": "所有项目", @@ -605,6 +645,68 @@ "activity": "活动" } }, + + "role_details": { + "guest": { + "title": "访客", + "description": "组织的外部成员可以被邀请为访客。" + }, + "member": { + "title": "成员", + "description": "可以在项目、周期和模块内读取、写入、编辑和删除实体" + }, + "admin": { + "title": "管理员", + "description": "工作区内的所有权限都设置为允许。" + } + }, + + "user_roles": { + "product_or_project_manager": "产品/项目经理", + "development_or_engineering": "开发/工程", + "founder_or_executive": "创始人/高管", + "freelancer_or_consultant": "自由职业者/顾问", + "marketing_or_growth": "市场营销/增长", + "sales_or_business_development": "销售/业务发展", + "support_or_operations": "支持/运营", + "student_or_professor": "学生/教授", + "human_or_resources": "人力资源", + "other": "其他" + }, + + "importer": { + "github": { + "title": "Github", + "description": "从 GitHub 仓库导入问题并同步。" + }, + "jira": { + "title": "Jira", + "description": "从 Jira 项目导入问题和史诗。" + } + }, + + "exporter": { + "csv": { + "title": "CSV", + "description": "将问题导出为 CSV 文件。" + }, + "xlsx": { + "title": "Excel", + "description": "将问题导出为 Excel 文件。" + }, + "json": { + "title": "JSON", + "description": "将问题导出为 JSON 文件。" + } + }, + + "default_global_view": { + "all_issues": "所有问题", + "assigned": "已分配", + "created": "已创建", + "subscribed": "已订阅" + }, + "stickies": { "title": "便签", "placeholder": "点击此处输入", diff --git a/web/app/[workspaceSlug]/(projects)/settings/mobile-header-tabs.tsx b/web/app/[workspaceSlug]/(projects)/settings/mobile-header-tabs.tsx index ee3035220c8..a8c02c7c084 100644 --- a/web/app/[workspaceSlug]/(projects)/settings/mobile-header-tabs.tsx +++ b/web/app/[workspaceSlug]/(projects)/settings/mobile-header-tabs.tsx @@ -1,11 +1,12 @@ import { observer } from "mobx-react"; import { useParams, usePathname } from "next/navigation"; +import { WORKSPACE_SETTINGS_LINKS } from "@plane/constants"; +import { useTranslation } from "@plane/i18n"; // hooks import { useUserPermissions } from "@/hooks/store"; import { useAppRouter } from "@/hooks/use-app-router"; // plane web constants import { EUserPermissionsLevel } from "@/plane-web/constants/user-permissions"; -import { WORKSPACE_SETTINGS_LINKS } from "@/plane-web/constants/workspace"; // plane web helpers import { shouldRenderSettingLink } from "@/plane-web/helpers/workspace.helper"; @@ -13,6 +14,7 @@ export const MobileWorkspaceSettingsTabs = observer(() => { const router = useAppRouter(); const { workspaceSlug } = useParams(); const pathname = usePathname(); + const { t } = useTranslation(); // mobx store const { allowPermissions } = useUserPermissions(); @@ -31,7 +33,7 @@ export const MobileWorkspaceSettingsTabs = observer(() => { key={index} onClick={() => router.push(`/${workspaceSlug}${item.href}`)} > - {item.label} + {t(item.i18n_label)} ) )} diff --git a/web/app/[workspaceSlug]/(projects)/settings/sidebar.tsx b/web/app/[workspaceSlug]/(projects)/settings/sidebar.tsx index 6bce5daa325..8dfe7437938 100644 --- a/web/app/[workspaceSlug]/(projects)/settings/sidebar.tsx +++ b/web/app/[workspaceSlug]/(projects)/settings/sidebar.tsx @@ -4,13 +4,14 @@ import React from "react"; import { observer } from "mobx-react"; import Link from "next/link"; import { useParams, usePathname } from "next/navigation"; +import { WORKSPACE_SETTINGS_LINKS } from "@plane/constants"; +import { useTranslation } from "@plane/i18n"; // components import { SidebarNavItem } from "@/components/sidebar"; // hooks import { useUserPermissions } from "@/hooks/store"; // plane web constants import { EUserPermissionsLevel } from "@/plane-web/constants/user-permissions"; -import { WORKSPACE_SETTINGS_LINKS } from "@/plane-web/constants/workspace"; // plane web helpers import { shouldRenderSettingLink } from "@/plane-web/helpers/workspace.helper"; @@ -19,6 +20,7 @@ export const WorkspaceSettingsSidebar = observer(() => { const { workspaceSlug } = useParams(); const pathname = usePathname(); // mobx store + const { t } = useTranslation(); const { allowPermissions } = useUserPermissions(); return ( @@ -36,7 +38,7 @@ export const WorkspaceSettingsSidebar = observer(() => { isActive={link.highlight(pathname, `/${workspaceSlug}`)} className="text-sm font-medium px-4 py-2" > - {link.label} + {t(link.i18n_label)} ) diff --git a/web/app/[workspaceSlug]/(projects)/workspace-views/[globalViewId]/page.tsx b/web/app/[workspaceSlug]/(projects)/workspace-views/[globalViewId]/page.tsx index b75ff3ab179..bf7d78a6da9 100644 --- a/web/app/[workspaceSlug]/(projects)/workspace-views/[globalViewId]/page.tsx +++ b/web/app/[workspaceSlug]/(projects)/workspace-views/[globalViewId]/page.tsx @@ -3,12 +3,13 @@ import { useState } from "react"; import { observer } from "mobx-react"; import { useParams } from "next/navigation"; +// plane imports +import { DEFAULT_GLOBAL_VIEWS_LIST } from "@plane/constants"; // components import { PageHead } from "@/components/core"; import { AllIssueLayoutRoot, GlobalViewsAppliedFiltersRoot } from "@/components/issues"; import { GlobalViewsHeader } from "@/components/workspace"; // constants -import { DEFAULT_GLOBAL_VIEWS_LIST } from "@/constants/workspace"; // hooks import { useWorkspace } from "@/hooks/store"; diff --git a/web/app/[workspaceSlug]/(projects)/workspace-views/page.tsx b/web/app/[workspaceSlug]/(projects)/workspace-views/page.tsx index 7de44258473..87d0cfc58d5 100644 --- a/web/app/[workspaceSlug]/(projects)/workspace-views/page.tsx +++ b/web/app/[workspaceSlug]/(projects)/workspace-views/page.tsx @@ -4,13 +4,15 @@ import React, { useState } from "react"; import { observer } from "mobx-react"; // icons import { Search } from "lucide-react"; +// plane imports +import { DEFAULT_GLOBAL_VIEWS_LIST } from "@plane/constants"; +import { useTranslation } from "@plane/i18n"; // ui import { Input } from "@plane/ui"; // components import { PageHead } from "@/components/core"; import { GlobalDefaultViewListItem, GlobalViewsList } from "@/components/workspace"; // constants -import { DEFAULT_GLOBAL_VIEWS_LIST } from "@/constants/workspace"; // hooks import { useWorkspace } from "@/hooks/store"; @@ -18,6 +20,7 @@ const WorkspaceViewsPage = observer(() => { const [query, setQuery] = useState(""); // store const { currentWorkspace } = useWorkspace(); + const { t } = useTranslation(); // derived values const pageTitle = currentWorkspace?.name ? `${currentWorkspace?.name} - All Views` : undefined; @@ -36,7 +39,7 @@ const WorkspaceViewsPage = observer(() => { />
- {DEFAULT_GLOBAL_VIEWS_LIST.filter((v) => v.label.toLowerCase().includes(query.toLowerCase())).map( + {DEFAULT_GLOBAL_VIEWS_LIST.filter((v) => t(v.i18n_label).toLowerCase().includes(query.toLowerCase())).map( (option) => ( ) diff --git a/web/app/invitations/page.tsx b/web/app/invitations/page.tsx index 705294430d5..fb3eec03bac 100644 --- a/web/app/invitations/page.tsx +++ b/web/app/invitations/page.tsx @@ -8,6 +8,8 @@ import Link from "next/link"; import { useTheme } from "next-themes"; import useSWR, { mutate } from "swr"; import { CheckCircle2 } from "lucide-react"; +// plane imports +import { ROLE } from "@plane/constants"; import { useTranslation } from "@plane/i18n"; // types import type { IWorkspaceMemberInvitation } from "@plane/types"; @@ -18,7 +20,6 @@ import { EmptyState } from "@/components/common"; // constants import { MEMBER_ACCEPTED } from "@/constants/event-tracker"; import { USER_WORKSPACES_LIST } from "@/constants/fetch-keys"; -import { ROLE } from "@/constants/workspace"; // helpers import { truncateText } from "@/helpers/string.helper"; import { getUserRole } from "@/helpers/user.helper"; diff --git a/web/ce/constants/index.ts b/web/ce/constants/index.ts index 329f796ceb9..929114d1a34 100644 --- a/web/ce/constants/index.ts +++ b/web/ce/constants/index.ts @@ -2,5 +2,4 @@ export * from "./ai"; export * from "./estimates"; export * from "./gantt-chart"; export * from "./project"; -export * from "./user-permissions"; -export * from "./workspace"; +export * from "./user-permissions"; \ No newline at end of file diff --git a/web/ce/constants/workspace.ts b/web/ce/constants/workspace.ts deleted file mode 100644 index b976111b559..00000000000 --- a/web/ce/constants/workspace.ts +++ /dev/null @@ -1,72 +0,0 @@ -// icons -import { SettingIcon } from "@/components/icons/attachment"; -import { Props } from "@/components/icons/types"; -import { EUserPermissions } from "./user-permissions"; -// constants - -export const WORKSPACE_SETTINGS = { - general: { - key: "general", - label: "General", - href: `/settings`, - access: [EUserPermissions.ADMIN], - highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/settings/`, - Icon: SettingIcon, - }, - members: { - key: "members", - label: "Members", - href: `/settings/members`, - access: [EUserPermissions.ADMIN], - highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/settings/members/`, - Icon: SettingIcon, - }, - "billing-and-plans": { - key: "billing-and-plans", - label: "Billing and plans", - href: `/settings/billing`, - access: [EUserPermissions.ADMIN], - highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/settings/billing/`, - Icon: SettingIcon, - }, - export: { - key: "export", - label: "Exports", - href: `/settings/exports`, - access: [EUserPermissions.ADMIN], - highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/settings/exports/`, - Icon: SettingIcon, - }, - webhooks: { - key: "webhooks", - label: "Webhooks", - href: `/settings/webhooks`, - access: [EUserPermissions.ADMIN], - highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/settings/webhooks/`, - Icon: SettingIcon, - }, - "api-tokens": { - key: "api-tokens", - label: "API tokens", - href: `/settings/api-tokens`, - access: [EUserPermissions.ADMIN], - highlight: (pathname: string, baseUrl: string) => pathname === `${baseUrl}/settings/api-tokens/`, - Icon: SettingIcon, - }, -}; - -export const WORKSPACE_SETTINGS_LINKS: { - key: string; - label: string; - href: string; - access: EUserPermissions[]; - highlight: (pathname: string, baseUrl: string) => boolean; - Icon: React.FC; -}[] = [ - WORKSPACE_SETTINGS["general"], - WORKSPACE_SETTINGS["members"], - WORKSPACE_SETTINGS["billing-and-plans"], - WORKSPACE_SETTINGS["export"], - WORKSPACE_SETTINGS["webhooks"], - WORKSPACE_SETTINGS["api-tokens"], -]; diff --git a/web/core/components/command-palette/actions/workspace-settings-actions.tsx b/web/core/components/command-palette/actions/workspace-settings-actions.tsx index dee51c1b62a..b223c952ad1 100644 --- a/web/core/components/command-palette/actions/workspace-settings-actions.tsx +++ b/web/core/components/command-palette/actions/workspace-settings-actions.tsx @@ -4,13 +4,15 @@ import { Command } from "cmdk"; // hooks import Link from "next/link"; import { useParams } from "next/navigation"; - +import { WORKSPACE_SETTINGS_LINKS } from "@plane/constants"; +import { useTranslation } from "@plane/i18n"; +// components +import { SettingIcon } from "@/components/icons"; // hooks import { useUserPermissions } from "@/hooks/store"; import { useAppRouter } from "@/hooks/use-app-router"; // plane wev constants import { EUserPermissionsLevel } from "@/plane-web/constants/user-permissions"; -import { WORKSPACE_SETTINGS_LINKS } from "@/plane-web/constants/workspace"; // plane web helpers import { shouldRenderSettingLink } from "@/plane-web/helpers/workspace.helper"; @@ -25,6 +27,7 @@ export const CommandPaletteWorkspaceSettingsActions: React.FC = (props) = // router params const { workspaceSlug } = useParams(); // mobx store + const { t } = useTranslation(); const { allowPermissions } = useUserPermissions(); // derived values @@ -46,8 +49,8 @@ export const CommandPaletteWorkspaceSettingsActions: React.FC = (props) = >
- - {setting.label} + + {t(setting.i18n_label)}
diff --git a/web/core/components/editor/embeds/mentions/user.tsx b/web/core/components/editor/embeds/mentions/user.tsx index 76b8a0f4967..a8e4a4b0b2e 100644 --- a/web/core/components/editor/embeds/mentions/user.tsx +++ b/web/core/components/editor/embeds/mentions/user.tsx @@ -3,10 +3,11 @@ import { observer } from "mobx-react"; import Link from "next/link"; import { useParams } from "next/navigation"; import { usePopper } from "react-popper"; +// plane imports +import { ROLE } from "@plane/constants"; // plane ui import { Avatar } from "@plane/ui"; // constants -import { ROLE } from "@/constants/workspace"; // helpers import { cn } from "@/helpers/common.helper"; import { getFileURL } from "@/helpers/file.helper"; diff --git a/web/core/components/exporter/guide.tsx b/web/core/components/exporter/guide.tsx index 65e77a6f200..828afab0c1c 100644 --- a/web/core/components/exporter/guide.tsx +++ b/web/core/components/exporter/guide.tsx @@ -9,6 +9,7 @@ import useSWR, { mutate } from "swr"; // icons import { MoveLeft, MoveRight, RefreshCw } from "lucide-react"; // plane imports +import { EXPORTERS_LIST } from "@plane/constants"; import { useTranslation } from "@plane/i18n"; import { Button } from "@plane/ui"; // components @@ -17,17 +18,33 @@ import { Exporter, SingleExport } from "@/components/exporter"; import { ImportExportSettingsLoader } from "@/components/ui"; // constants import { EXPORT_SERVICES_LIST } from "@/constants/fetch-keys"; -import { EXPORTERS_LIST } from "@/constants/workspace"; // hooks import { useProject, useUser, useUserPermissions } from "@/hooks/store"; import { useAppRouter } from "@/hooks/use-app-router"; import { useResolvedAssetPath } from "@/hooks/use-resolved-asset-path"; import { EUserPermissions, EUserPermissionsLevel } from "@/plane-web/constants/user-permissions"; +// services images +import CSVLogo from "@/public/services/csv.svg"; +import ExcelLogo from "@/public/services/excel.svg"; +import JSONLogo from "@/public/services/json.svg"; // services import { IntegrationService } from "@/services/integrations"; const integrationService = new IntegrationService(); +const getExporterLogo = (provider: string) => { + switch (provider) { + case "csv": + return CSVLogo; + case "excel": + return ExcelLogo; + case "json": + return JSONLogo; + default: + return ""; + } +}; + const IntegrationGuide = observer(() => { // states const [refreshing, setRefreshing] = useState(false); @@ -91,11 +108,16 @@ const IntegrationGuide = observer(() => {
- {`${service.title} + {`${t(service.i18n_title)}
-

{service.title}

-

{service.description}

+

{t(service.i18n_title)}

+

{t(service.i18n_description)}

diff --git a/web/core/components/integration/guide.tsx b/web/core/components/integration/guide.tsx index e40085fce14..8cf0f3df08b 100644 --- a/web/core/components/integration/guide.tsx +++ b/web/core/components/integration/guide.tsx @@ -8,6 +8,9 @@ import { useParams, useSearchParams } from "next/navigation"; import useSWR, { mutate } from "swr"; // icons import { RefreshCw } from "lucide-react"; +// plane imports +import { IMPORTERS_LIST } from "@plane/constants"; +import { useTranslation } from "@plane/i18n"; // types import { IImporterService } from "@plane/types"; // ui @@ -17,15 +20,28 @@ import { DeleteImportModal, GithubImporterRoot, JiraImporterRoot, SingleImport } import { ImportExportSettingsLoader } from "@/components/ui"; // constants import { IMPORTER_SERVICES_LIST } from "@/constants/fetch-keys"; -import { IMPORTERS_LIST } from "@/constants/workspace"; // hooks import { useUser } from "@/hooks/store"; +// assets +import GithubLogo from "@/public/services/github.png"; +import JiraLogo from "@/public/services/jira.svg"; // services import { IntegrationService } from "@/services/integrations"; // services const integrationService = new IntegrationService(); +const getImporterLogo = (provider: string) => { + switch (provider) { + case "github": + return GithubLogo; + case "jira": + return JiraLogo; + default: + return ""; + } +}; + // FIXME: [Deprecated] Remove this component const IntegrationGuide = observer(() => { // states @@ -39,6 +55,8 @@ const IntegrationGuide = observer(() => { // store hooks const { data: currentUser } = useUser(); + const { t } = useTranslation(); + const { data: importerServices } = useSWR( workspaceSlug ? IMPORTER_SERVICES_LIST(workspaceSlug as string) : null, workspaceSlug ? () => integrationService.getImporterServicesList(workspaceSlug as string) : null @@ -86,11 +104,16 @@ const IntegrationGuide = observer(() => { >
- {`${service.title} + {`${t(service.i18n_title)}
-

{service.title}

-

{service.description}

+

{t(service.i18n_title)}

+

{t(service.i18n_description)}

diff --git a/web/core/components/integration/single-import.tsx b/web/core/components/integration/single-import.tsx index 08a9ebdfc1f..6be8c02c9ab 100644 --- a/web/core/components/integration/single-import.tsx +++ b/web/core/components/integration/single-import.tsx @@ -1,12 +1,15 @@ "use client"; -// ui +import { observer } from "mobx-react"; import { Trash2 } from "lucide-react"; +// plane imports +import { IMPORTERS_LIST } from "@plane/constants"; +import { useTranslation } from "@plane/i18n"; import { IImporterService } from "@plane/types"; import { CustomMenu } from "@plane/ui"; // icons // helpers -import { IMPORTERS_LIST } from "@/constants/workspace"; + import { renderFormattedDate } from "@/helpers/date-time.helper"; // types // constants @@ -17,41 +20,47 @@ type Props = { handleDelete: () => void; }; -export const SingleImport: React.FC = ({ service, refreshing, handleDelete }) => ( -
-
-

- - Import from{" "} - {IMPORTERS_LIST.find((i) => i.provider === service.service)?.title} to{" "} +export const SingleImport: React.FC = observer(({ service, refreshing, handleDelete }) => { + const { t } = useTranslation(); + + const importer = IMPORTERS_LIST.find((i) => i.provider === service.service); + return ( +
+
+

+ {importer && ( + + Import from {t(importer.i18n_title)} to{" "} + + )} {service.project_detail.name} - - - {refreshing ? "Refreshing..." : service.status} - -

-
- {renderFormattedDate(service.created_at)}| - Imported by {service.initiated_by_detail?.display_name} + + {refreshing ? "Refreshing..." : service.status} + +

+
+ {renderFormattedDate(service.created_at)}| + Imported by {service.initiated_by_detail?.display_name} +
+ + + + + Delete import + + +
- - - - - Delete import - - - -
-); + ); +}); diff --git a/web/core/components/issues/issue-layouts/filters/applied-filters/roots/global-view-root.tsx b/web/core/components/issues/issue-layouts/filters/applied-filters/roots/global-view-root.tsx index 7744d48c868..fffd98d4718 100644 --- a/web/core/components/issues/issue-layouts/filters/applied-filters/roots/global-view-root.tsx +++ b/web/core/components/issues/issue-layouts/filters/applied-filters/roots/global-view-root.tsx @@ -6,7 +6,7 @@ import isEmpty from "lodash/isEmpty"; import { observer } from "mobx-react"; import { useParams } from "next/navigation"; // types -import { EIssueFilterType, EIssuesStoreType } from "@plane/constants"; +import { DEFAULT_GLOBAL_VIEWS_LIST,EIssueFilterType, EIssuesStoreType } from "@plane/constants"; import { IIssueFilterOptions, TStaticViewTypes } from "@plane/types"; //ui // components @@ -17,7 +17,6 @@ import { CreateUpdateWorkspaceViewModal } from "@/components/workspace"; // constants import { GLOBAL_VIEW_UPDATED } from "@/constants/event-tracker"; import { EViewAccess } from "@/constants/views"; -import { DEFAULT_GLOBAL_VIEWS_LIST } from "@/constants/workspace"; // helpers import { cn } from "@/helpers/common.helper"; // hooks diff --git a/web/core/components/onboarding/invitations.tsx b/web/core/components/onboarding/invitations.tsx index d5dde220dc7..95f5841ee6f 100644 --- a/web/core/components/onboarding/invitations.tsx +++ b/web/core/components/onboarding/invitations.tsx @@ -1,13 +1,14 @@ "use client"; import React, { useState } from "react"; +// plane imports +import { ROLE } from "@plane/constants"; // types import { IWorkspaceMemberInvitation } from "@plane/types"; // ui import { Button, Checkbox, Spinner } from "@plane/ui"; // constants import { MEMBER_ACCEPTED } from "@/constants/event-tracker"; -import { ROLE } from "@/constants/workspace"; // helpers import { truncateText } from "@/helpers/string.helper"; import { getUserRole } from "@/helpers/user.helper"; diff --git a/web/core/components/onboarding/invite-members.tsx b/web/core/components/onboarding/invite-members.tsx index 27b15610ee6..0eb4f83b9c2 100644 --- a/web/core/components/onboarding/invite-members.tsx +++ b/web/core/components/onboarding/invite-members.tsx @@ -1,6 +1,7 @@ "use client"; import React, { useEffect, useRef, useState } from "react"; +import { observer } from "mobx-react"; import Image from "next/image"; import { useTheme } from "next-themes"; import { @@ -18,13 +19,15 @@ import { import { usePopper } from "react-popper"; import { Check, ChevronDown, Plus, XCircle } from "lucide-react"; import { Listbox } from "@headlessui/react"; +// plane imports +import { ROLE, ROLE_DETAILS } from "@plane/constants"; +import { useTranslation } from "@plane/i18n"; // types import { IUser, IWorkspace } from "@plane/types"; // ui import { Button, Input, Spinner, TOAST_TYPE, setToast } from "@plane/ui"; // constants import { MEMBER_INVITED } from "@/constants/event-tracker"; -import { ROLE, ROLE_DETAILS } from "@/constants/workspace"; // helpers import { getUserRole } from "@/helpers/user.helper"; // hooks @@ -87,7 +90,7 @@ const placeholderEmails = [ "thomas.selfridge@frstflt.com", "albert.zahm@frstflt.com", ]; -const InviteMemberInput: React.FC = (props) => { +const InviteMemberInput: React.FC = observer((props) => { const { control, index, @@ -104,6 +107,8 @@ const InviteMemberInput: React.FC = (props) => { const [referenceElement, setReferenceElement] = useState(null); const [popperElement, setPopperElement] = useState(null); + const { t } = useTranslation(); + const email = watch(`emails.${index}.email`); const emailOnChange = (event: React.ChangeEvent) => { @@ -234,8 +239,8 @@ const InviteMemberInput: React.FC = (props) => { {({ selected }) => (
-
{value.title}
-
{value.description}
+
{t(value.i18n_title)}
+
{t(value.i18n_description)}
{selected && }
@@ -266,7 +271,7 @@ const InviteMemberInput: React.FC = (props) => { )}
); -}; +}); export const InviteMembers: React.FC = (props) => { const { finishOnboarding, totalSteps, workspace } = props; diff --git a/web/core/components/profile/form.tsx b/web/core/components/profile/form.tsx index 4dbbd2693a6..6729c56f5df 100644 --- a/web/core/components/profile/form.tsx +++ b/web/core/components/profile/form.tsx @@ -3,6 +3,8 @@ import { observer } from "mobx-react"; import { Controller, useForm } from "react-hook-form"; import { ChevronDown, CircleUserRound } from "lucide-react"; import { Disclosure, Transition } from "@headlessui/react"; +// plane imports +import { USER_ROLES } from "@plane/constants"; import { useTranslation, SUPPORTED_LANGUAGES } from "@plane/i18n"; import type { IUser, TUserProfile } from "@plane/types"; import { Button, CustomSelect, Input, TOAST_TYPE, setPromiseToast, setToast } from "@plane/ui"; @@ -11,7 +13,6 @@ import { DeactivateAccountModal } from "@/components/account"; import { ImagePickerPopover, UserImageUploadModal } from "@/components/core"; import { TimezoneSelect } from "@/components/global"; // constants -import { USER_ROLES } from "@/constants/workspace"; // helpers import { getFileURL } from "@/helpers/file.helper"; // hooks @@ -356,7 +357,7 @@ export const ProfileForm = observer((props: TProfileFormProps) => { > {USER_ROLES.map((item) => ( - {item.label} + {t(item.i18n_label)} ))} diff --git a/web/core/components/project/send-project-invitation-modal.tsx b/web/core/components/project/send-project-invitation-modal.tsx index 6d821cfefce..912093581cc 100644 --- a/web/core/components/project/send-project-invitation-modal.tsx +++ b/web/core/components/project/send-project-invitation-modal.tsx @@ -6,11 +6,12 @@ import { useParams } from "next/navigation"; import { useForm, Controller, useFieldArray } from "react-hook-form"; import { ChevronDown, Plus, X } from "lucide-react"; import { Dialog, Transition } from "@headlessui/react"; +// plane imports +import { ROLE } from "@plane/constants"; // ui import { Avatar, Button, CustomSelect, CustomSearchSelect, TOAST_TYPE, setToast } from "@plane/ui"; // constants import { PROJECT_MEMBER_ADDED } from "@/constants/event-tracker"; -import { ROLE } from "@/constants/workspace"; // helpers import { getFileURL } from "@/helpers/file.helper"; // hooks diff --git a/web/core/components/project/settings/member-columns.tsx b/web/core/components/project/settings/member-columns.tsx index 4ead03a6483..3eb9ce6a285 100644 --- a/web/core/components/project/settings/member-columns.tsx +++ b/web/core/components/project/settings/member-columns.tsx @@ -3,12 +3,13 @@ import Link from "next/link"; import { Controller, useForm } from "react-hook-form"; import { Trash2 } from "lucide-react"; import { Disclosure } from "@headlessui/react"; +// plane imports +import { ROLE } from "@plane/constants"; // plane types import { IUser, IWorkspaceMember } from "@plane/types"; // plane ui import { CustomSelect, PopoverMenu, TOAST_TYPE, setToast } from "@plane/ui"; // constants -import { ROLE } from "@/constants/workspace"; // helpers import { getFileURL } from "@/helpers/file.helper"; // hooks diff --git a/web/core/components/workspace/send-workspace-invitation-modal.tsx b/web/core/components/workspace/send-workspace-invitation-modal.tsx index 27fb26e89ee..43967aa9b3c 100644 --- a/web/core/components/workspace/send-workspace-invitation-modal.tsx +++ b/web/core/components/workspace/send-workspace-invitation-modal.tsx @@ -6,11 +6,12 @@ import { useParams } from "next/navigation"; import { Controller, useFieldArray, useForm } from "react-hook-form"; import { Plus, X } from "lucide-react"; import { Dialog, Transition } from "@headlessui/react"; +// plane imports +import { ROLE } from "@plane/constants"; import { IWorkspaceBulkInviteFormData } from "@plane/types"; // ui import { Button, CustomSelect, Input } from "@plane/ui"; // constants -import { ROLE } from "@/constants/workspace"; // hooks import { useUserPermissions } from "@/hooks/store"; import { EUserPermissions } from "@/plane-web/constants/user-permissions"; diff --git a/web/core/components/workspace/settings/invitations-list-item.tsx b/web/core/components/workspace/settings/invitations-list-item.tsx index bbbbcd2670f..60a7402cccc 100644 --- a/web/core/components/workspace/settings/invitations-list-item.tsx +++ b/web/core/components/workspace/settings/invitations-list-item.tsx @@ -4,12 +4,13 @@ import { useState, FC } from "react"; import { observer } from "mobx-react"; import { useParams } from "next/navigation"; import { ChevronDown, XCircle } from "lucide-react"; +// plane imports +import { ROLE } from "@plane/constants"; // ui import { CustomSelect, Tooltip, TOAST_TYPE, setToast } from "@plane/ui"; // components import { ConfirmWorkspaceMemberRemove } from "@/components/workspace"; // constants -import { ROLE } from "@/constants/workspace"; // hooks import { useMember, useUserPermissions } from "@/hooks/store"; import { usePlatformOS } from "@/hooks/use-platform-os"; diff --git a/web/core/components/workspace/settings/member-columns.tsx b/web/core/components/workspace/settings/member-columns.tsx index a323dbaf675..ab1513a69a6 100644 --- a/web/core/components/workspace/settings/member-columns.tsx +++ b/web/core/components/workspace/settings/member-columns.tsx @@ -3,12 +3,13 @@ import Link from "next/link"; import { Controller, useForm } from "react-hook-form"; import { Trash2 } from "lucide-react"; import { Disclosure } from "@headlessui/react"; +// plane imports +import { ROLE } from "@plane/constants"; // plane types import { IUser, IWorkspaceMember } from "@plane/types"; // plane ui import { CustomSelect, PopoverMenu, TOAST_TYPE, setToast } from "@plane/ui"; // constants -import { ROLE } from "@/constants/workspace"; // helpers import { getFileURL } from "@/helpers/file.helper"; // hooks diff --git a/web/core/components/workspace/views/default-view-list-item.tsx b/web/core/components/workspace/views/default-view-list-item.tsx index 0d0e627b65a..de64052cfe6 100644 --- a/web/core/components/workspace/views/default-view-list-item.tsx +++ b/web/core/components/workspace/views/default-view-list-item.tsx @@ -1,15 +1,17 @@ import { observer } from "mobx-react"; import Link from "next/link"; import { useParams } from "next/navigation"; +import { useTranslation } from "@plane/i18n"; // helpers import { truncateText } from "@/helpers/string.helper"; -type Props = { view: { key: string; label: string } }; +type Props = { view: { key: string; i18n_label: string } }; export const GlobalDefaultViewListItem: React.FC = observer((props) => { const { view } = props; // router const { workspaceSlug } = useParams(); + const { t } = useTranslation(); return (
@@ -18,7 +20,7 @@ export const GlobalDefaultViewListItem: React.FC = observer((props) => {
-

{truncateText(view.label, 75)}

+

{truncateText(t(view.i18n_label), 75)}

diff --git a/web/core/components/workspace/views/default-view-quick-action.tsx b/web/core/components/workspace/views/default-view-quick-action.tsx index dac8a2202dc..3df11bbdb58 100644 --- a/web/core/components/workspace/views/default-view-quick-action.tsx +++ b/web/core/components/workspace/views/default-view-quick-action.tsx @@ -3,6 +3,8 @@ import { observer } from "mobx-react"; import Link from "next/link"; import { ExternalLink, LinkIcon } from "lucide-react"; +// plane imports +import { useTranslation } from "@plane/i18n"; // ui import { TStaticViewTypes } from "@plane/types"; import { ContextMenu, CustomMenu, TContextMenuItem, TOAST_TYPE, setToast } from "@plane/ui"; @@ -16,13 +18,15 @@ type Props = { globalViewId: string | undefined; view: { key: TStaticViewTypes; - label: string; + i18n_label: string; }; }; export const DefaultWorkspaceViewQuickActions: React.FC = observer((props) => { const { parentRef, globalViewId, view, workspaceSlug } = props; + const { t } = useTranslation(); + const viewLink = `${workspaceSlug}/workspace-views/${view.key}`; const handleCopyText = () => copyUrlToClipboard(viewLink).then(() => { @@ -64,7 +68,7 @@ export const DefaultWorkspaceViewQuickActions: React.FC = observer((props : "border-transparent hover:border-custom-border-200 hover:text-custom-text-400" }`} > - {view.label} + {t(view.i18n_label)} ) : ( = observer((props : "border-transparent hover:border-custom-border-200 hover:text-custom-text-400" }`} > - {view.label} + {t(view.i18n_label)} )} diff --git a/web/core/components/workspace/views/header.tsx b/web/core/components/workspace/views/header.tsx index 559bd6578ca..e5068c9bb87 100644 --- a/web/core/components/workspace/views/header.tsx +++ b/web/core/components/workspace/views/header.tsx @@ -3,6 +3,8 @@ import { observer } from "mobx-react"; import { useParams } from "next/navigation"; // icons import { Plus } from "lucide-react"; +// plane imports +import { DEFAULT_GLOBAL_VIEWS_LIST } from "@plane/constants"; // types import { TStaticViewTypes } from "@plane/types"; // components @@ -14,7 +16,6 @@ import { } from "@/components/workspace"; // constants import { GLOBAL_VIEW_OPENED } from "@/constants/event-tracker"; -import { DEFAULT_GLOBAL_VIEWS_LIST } from "@/constants/workspace"; // store hooks import { useEventTracker, useGlobalView, useUserPermissions } from "@/hooks/store"; import { EUserPermissions, EUserPermissionsLevel } from "@/plane-web/constants/user-permissions"; @@ -48,7 +49,7 @@ const ViewTab = observer((props: { viewId: string }) => { const DefaultViewTab = (props: { tab: { key: TStaticViewTypes; - label: string; + i18n_label: string; }; }) => { const { tab } = props; diff --git a/web/core/constants/workspace.ts b/web/core/constants/workspace.ts deleted file mode 100644 index 3b523ffb4ed..00000000000 --- a/web/core/constants/workspace.ts +++ /dev/null @@ -1,106 +0,0 @@ -// types -import { TStaticViewTypes } from "@plane/types"; -import { EUserPermissions } from "@/plane-web/constants/user-permissions"; -// services images -import CSVLogo from "@/public/services/csv.svg"; -import ExcelLogo from "@/public/services/excel.svg"; -import GithubLogo from "@/public/services/github.png"; -import JiraLogo from "@/public/services/jira.svg"; -import JSONLogo from "@/public/services/json.svg"; - -export const ROLE = { - [EUserPermissions.GUEST]: "Guest", - [EUserPermissions.MEMBER]: "Member", - [EUserPermissions.ADMIN]: "Admin", -}; - -export const ROLE_DETAILS = { - [EUserPermissions.GUEST]: { - title: "Guest", - description: "External members of organizations can be invited as guests.", - }, - [EUserPermissions.MEMBER]: { - title: "Member", - description: "Ability to read, write, edit, and delete entities inside projects, cycles, and modules", - }, - [EUserPermissions.ADMIN]: { - title: "Admin", - description: "All permissions set to true within the workspace.", - }, -}; - -export const USER_ROLES = [ - { value: "Product / Project Manager", label: "Product / Project Manager" }, - { value: "Development / Engineering", label: "Development / Engineering" }, - { value: "Founder / Executive", label: "Founder / Executive" }, - { value: "Freelancer / Consultant", label: "Freelancer / Consultant" }, - { value: "Marketing / Growth", label: "Marketing / Growth" }, - { value: "Sales / Business Development", label: "Sales / Business Development" }, - { value: "Support / Operations", label: "Support / Operations" }, - { value: "Student / Professor", label: "Student / Professor" }, - { value: "Human Resources", label: "Human Resources" }, - { value: "Other", label: "Other" }, -]; - -export const IMPORTERS_LIST = [ - { - provider: "github", - type: "import", - title: "GitHub", - description: "Import issues from GitHub repositories and sync them.", - logo: GithubLogo, - }, - { - provider: "jira", - type: "import", - title: "Jira", - description: "Import issues and epics from Jira projects and epics.", - logo: JiraLogo, - }, -]; - -export const EXPORTERS_LIST = [ - { - provider: "csv", - type: "export", - title: "CSV", - description: "Export issues to a CSV file.", - logo: CSVLogo, - }, - { - provider: "xlsx", - type: "export", - title: "Excel", - description: "Export issues to a Excel file.", - logo: ExcelLogo, - }, - { - provider: "json", - type: "export", - title: "JSON", - description: "Export issues to a JSON file.", - logo: JSONLogo, - }, -]; - -export const DEFAULT_GLOBAL_VIEWS_LIST: { - key: TStaticViewTypes; - label: string; -}[] = [ - { - key: "all-issues", - label: "All issues", - }, - { - key: "assigned", - label: "Assigned", - }, - { - key: "created", - label: "Created", - }, - { - key: "subscribed", - label: "Subscribed", - }, -]; diff --git a/web/ee/constants/workspace.ts b/web/ee/constants/workspace.ts deleted file mode 100644 index b295d6e021f..00000000000 --- a/web/ee/constants/workspace.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "ce/constants/workspace";