Skip to content

Commit

Permalink
chore: ln support workspace projects constants (#6429)
Browse files Browse the repository at this point in the history
* chore: ln support workspace projects constants

* fix: translation key

* fix: removed state translation

* fix: removed state translation
  • Loading branch information
gakshita authored Jan 27, 2025
1 parent ca02b0d commit 2f56caa
Show file tree
Hide file tree
Showing 24 changed files with 314 additions and 90 deletions.
1 change: 1 addition & 0 deletions packages/constants/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export * from "./tab-indices";
export * from "./user";
export * from "./workspace";
export * from "./stickies";
export * from "./project";
export * from "./views";
export * from "./inbox";
export * from "./profile";
Expand Down
82 changes: 50 additions & 32 deletions web/core/constants/project.ts → packages/constants/src/project.ts
Original file line number Diff line number Diff line change
@@ -1,41 +1,59 @@
// icons
import { Globe2, Lock, LucideIcon } from "lucide-react";
import { TProjectAppliedDisplayFilterKeys, TProjectOrderByOptions } from "@plane/types";
import {
TProjectAppliedDisplayFilterKeys,
TProjectOrderByOptions,
} from "@plane/types";

export const NETWORK_CHOICES: {
key: 0 | 2;
label: string;
i18n_label: string;
description: string;
icon: LucideIcon;
}[] = [
{
key: 0,
label: "Private",
description: "Accessible only by invite",
i18n_label: "workspace_projects.network.private.title",
description: "workspace_projects.network.private.description", //"Accessible only by invite",
icon: Lock,
},
{
key: 2,
label: "Public",
description: "Anyone in the workspace except Guests can join",
i18n_label: "workspace_projects.network.public.title",
description: "workspace_projects.network.public.description", //"Anyone in the workspace except Guests can join",
icon: Globe2,
},
];

export const GROUP_CHOICES = {
backlog: "Backlog",
unstarted: "Unstarted",
started: "Started",
completed: "Completed",
cancelled: "Cancelled",
backlog: {
key: "backlog",
i18n_label: "workspace_projects.state.backlog",
},
unstarted: {
key: "unstarted",
i18n_label: "workspace_projects.state.unstarted",
},
started: {
key: "started",
i18n_label: "workspace_projects.state.started",
},
completed: {
key: "completed",
i18n_label: "workspace_projects.state.completed",
},
cancelled: {
key: "cancelled",
i18n_label: "workspace_projects.state.cancelled",
},
};

export const PROJECT_AUTOMATION_MONTHS = [
{ label: "1 month", value: 1 },
{ label: "3 months", value: 3 },
{ label: "6 months", value: 6 },
{ label: "9 months", value: 9 },
{ label: "12 months", value: 12 },
{ i18n_label: "common.months_count", value: 1 },
{ i18n_label: "common.months_count", value: 3 },
{ i18n_label: "common.months_count", value: 6 },
{ i18n_label: "common.months_count", value: 9 },
{ i18n_label: "common.months_count", value: 12 },
];

export const PROJECT_UNSPLASH_COVERS = [
Expand All @@ -59,55 +77,55 @@ export const PROJECT_UNSPLASH_COVERS = [

export const PROJECT_ORDER_BY_OPTIONS: {
key: TProjectOrderByOptions;
label: string;
i18n_label: string;
}[] = [
{
key: "sort_order",
label: "Manual",
i18n_label: "workspace_projects.sort.manual",
},
{
key: "name",
label: "Name",
i18n_label: "workspace_projects.sort.name",
},
{
key: "created_at",
label: "Created date",
i18n_label: "workspace_projects.sort.created_at",
},
{
key: "members_length",
label: "Number of members",
i18n_label: "workspace_projects.sort.members_length",
},
];

export const PROJECT_DISPLAY_FILTER_OPTIONS: {
key: TProjectAppliedDisplayFilterKeys;
label: string;
i18n_label: string;
}[] = [
{
key: "my_projects",
label: "My projects",
i18n_label: "workspace_projects.scope.my_projects",
},
{
key: "archived_projects",
label: "Archived",
i18n_label: "workspace_projects.scope.archived_projects",
},
];

export const PROJECT_ERROR_MESSAGES = {
permissionError: {
title: "You don't have permission to perform this action.",
message: undefined,
i18n_title: "workspace_projects.error.permission",
i18n_message: undefined,
},
cycleDeleteError: {
title: "Error",
message: "Failed to delete cycle",
i18n_title: "error",
i18n_message: "workspace_projects.error.cycle_delete",
},
moduleDeleteError: {
title: "Error",
message: "Failed to delete module",
i18n_title: "error",
i18n_message: "workspace_projects.error.module_delete",
},
issueDeleteError: {
title: "Error",
message: "Failed to delete issue",
i18n_title: "error",
i18n_message: "workspace_projects.error.issue_delete",
},
};
38 changes: 37 additions & 1 deletion packages/i18n/src/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
"change_parent_issue": "Change parent issue",
"remove_parent_issue": "Remove parent issue",
"add_parent": "Add parent",
"loading_members": "Loading members...",
"loading_members": "Loading members...",
"view_link_copied_to_clipboard": "View link copied to clipboard.",
"required": "Required",
"optional": "Optional",
Expand Down Expand Up @@ -669,6 +669,42 @@
},

"workspace_projects": {
"network": {
"private": {
"title": "Private",
"description": "Accessible only by invite"
},
"public": {
"title": "Public",
"description": "Anyone in the workspace except Guests can join"
}
},
"error": {
"permission": "You don't have permission to perform this action.",
"cycle_delete": "Failed to delete cycle",
"module_delete": "Failed to delete module",
"issue_delete": "Failed to delete issue"
},
"state": {
"backlog": "Backlog",
"unstarted": "Unstarted",
"started": "Started",
"completed": "Completed",
"cancelled": "Cancelled"
},
"sort": {
"manual": "Manual",
"name": "Name",
"created_at": "Created date",
"members_length": "Number of members"
},
"scope": {
"my_projects": "My projects",
"archived_projects": "Archived"
},
"common": {
"months_count": "{months, plural, one{# month} other{# months}}"
},
"empty_state": {
"general": {
"title": "No active projects",
Expand Down
36 changes: 36 additions & 0 deletions packages/i18n/src/locales/es/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -672,6 +672,42 @@
},

"workspace_projects": {
"network": {
"private": {
"title": "Privado",
"description": "Accesible solo por invitación"
},
"public": {
"title": "Público",
"description": "Cualquiera en el espacio de trabajo excepto invitados puede unirse"
}
},
"error": {
"permission": "No tienes permiso para realizar esta acción.",
"cycle_delete": "Error al eliminar el ciclo",
"module_delete": "Error al eliminar el módulo",
"issue_delete": "Error al eliminar la incidencia"
},
"state": {
"backlog": "Pendientes",
"unstarted": "Sin comenzar",
"started": "Iniciado",
"completed": "Completado",
"cancelled": "Cancelado"
},
"sort": {
"manual": "Manual",
"name": "Nombre",
"created_at": "Fecha de creación",
"members_length": "Número de miembros"
},
"scope": {
"my_projects": "Mis proyectos",
"archived_projects": "Archivados"
},
"common": {
"months_count": "{months, plural, one{# mes} other{# meses}}"
},
"empty_state": {
"general": {
"title": "No hay proyectos activos",
Expand Down
36 changes: 36 additions & 0 deletions packages/i18n/src/locales/fr/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,42 @@
},

"workspace_projects": {
"network": {
"private": {
"title": "Privé",
"description": "Accessible uniquement sur invitation"
},
"public": {
"title": "Public",
"description": "Tout le monde dans l'espace de travail sauf les invités peut rejoindre"
}
},
"error": {
"permission": "Vous n'avez pas la permission d'effectuer cette action.",
"cycle_delete": "Échec de la suppression du cycle",
"module_delete": "Échec de la suppression du module",
"issue_delete": "Échec de la suppression du problème"
},
"state": {
"backlog": "Backlog",
"unstarted": "Non démarré",
"started": "Démarré",
"completed": "Terminé",
"cancelled": "Annulé"
},
"sort": {
"manual": "Manuel",
"name": "Nom",
"created_at": "Date de création",
"members_length": "Nombre de membres"
},
"scope": {
"my_projects": "Mes projets",
"archived_projects": "Archivés"
},
"common": {
"months_count": "{months, plural, one{# mois} other{# mois}}"
},
"empty_state": {
"general": {
"title": "Aucun projet actif",
Expand Down
38 changes: 37 additions & 1 deletion packages/i18n/src/locales/ja/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@
"change_parent_issue": "親問題を変更",
"remove_parent_issue": "親問題を削除",
"add_parent": "親問題を追加",
"loading_members": "メンバーを読み込んでいます...",
"loading_members": "メンバーを読み込んでいます...",
"view_link_copied_to_clipboard": "表示リンクがクリップボードにコピーされました。",
"required": "必須",
"optional": "任意",
Expand Down Expand Up @@ -670,6 +670,42 @@
},

"workspace_projects": {
"network": {
"private": {
"title": "プライベート",
"description": "招待のみでアクセス可能"
},
"public": {
"title": "パブリック",
"description": "ゲスト以外のワークスペースのメンバーが参加可能"
}
},
"error": {
"permission": "この操作を実行する権限がありません。",
"cycle_delete": "サイクルの削除に失敗しました",
"module_delete": "モジュールの削除に失敗しました",
"issue_delete": "課題の削除に失敗しました"
},
"state": {
"backlog": "バックログ",
"unstarted": "未着手",
"started": "開始済み",
"completed": "完了",
"cancelled": "キャンセル"
},
"sort": {
"manual": "手動",
"name": "名前",
"created_at": "作成日",
"members_length": "メンバー数"
},
"scope": {
"my_projects": "自分のプロジェクト",
"archived_projects": "アーカイブ済み"
},
"common": {
"months_count": "{months, plural, other{#ヶ月}}"
},
"empty_state": {
"general": {
"title": "アクティブなプロジェクトがありません",
Expand Down
39 changes: 38 additions & 1 deletion packages/i18n/src/locales/zh-CN/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@
"add_parent": "添加父问题",
"loading_members": "正在加载成员...",
"inbox": "收件箱",

"show_all": "显示全部",
"show_less": "显示较少",
"no_data_yet": "暂无数据",
Expand Down Expand Up @@ -815,5 +814,43 @@
"message": "无法删除便签"
}
}
},
"workspace_projects": {
"network": {
"private": {
"title": "私有",
"description": "仅限邀请访问"
},
"public": {
"title": "公开",
"description": "除访客外的工作区所有成员都可加入"
}
},
"error": {
"permission": "您没有执行此操作的权限。",
"cycle_delete": "删除周期失败",
"module_delete": "删除模块失败",
"issue_delete": "删除问题失败"
},
"state": {
"backlog": "待办",
"unstarted": "未开始",
"started": "进行中",
"completed": "已完成",
"cancelled": "已取消"
},
"sort": {
"manual": "手动",
"name": "名称",
"created_at": "创建日期",
"members_length": "成员数量"
},
"scope": {
"my_projects": "我的项目",
"archived_projects": "已归档"
},
"common": {
"months_count": "{months, plural, one{#个月} other{#个月}}"
}
}
}
Loading

0 comments on commit 2f56caa

Please sign in to comment.