Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: ln support for inbox constants #6432

Merged
merged 10 commits into from
Jan 27, 2025
Merged
113 changes: 113 additions & 0 deletions packages/constants/src/inbox.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
import { TInboxDuplicateIssueDetails, TIssue } from "@plane/types";

export enum EInboxIssueCurrentTab {
OPEN = "open",
CLOSED = "closed",
}

export enum EInboxIssueStatus {
PENDING = -2,
DECLINED = -1,
SNOOZED = 0,
ACCEPTED = 1,
DUPLICATE = 2,
}

export type TInboxIssueCurrentTab = EInboxIssueCurrentTab;
export type TInboxIssueStatus = EInboxIssueStatus;
export type TInboxIssue = {
id: string;
status: TInboxIssueStatus;
snoozed_till: Date | null;
duplicate_to: string | undefined;
source: string;
issue: TIssue;
created_by: string;
duplicate_issue_detail: TInboxDuplicateIssueDetails | undefined;
};

export const INBOX_STATUS: {
key: string;
status: TInboxIssueStatus;
i18n_title: string;
i18n_description: () => string;
textColor: (snoozeDatePassed: boolean) => string;
bgColor: (snoozeDatePassed: boolean) => string;
}[] = [
{
key: "pending",
i18n_title: "inbox_issue.status.pending.title",
status: EInboxIssueStatus.PENDING,
i18n_description: () => `inbox_issue.status.pending.description`,
textColor: (snoozeDatePassed: boolean = false) =>
snoozeDatePassed ? "" : "text-[#AB6400]",
bgColor: (snoozeDatePassed: boolean = false) =>
snoozeDatePassed ? "" : "bg-[#FFF7C2]",
gakshita marked this conversation as resolved.
Show resolved Hide resolved
},
{
key: "declined",
i18n_title: "inbox_issue.status.declined.title",
status: EInboxIssueStatus.DECLINED,
i18n_description: () => `inbox_issue.status.declined.description`,
textColor: (snoozeDatePassed: boolean = false) =>
snoozeDatePassed ? "" : "text-[#CE2C31]",
bgColor: (snoozeDatePassed: boolean = false) =>
snoozeDatePassed ? "" : "bg-[#FEEBEC]",
},
{
key: "snoozed",
i18n_title: "inbox_issue.status.snoozed.title",
status: EInboxIssueStatus.SNOOZED,
i18n_description: () => `inbox_issue.status.snoozed.description`,
textColor: (snoozeDatePassed: boolean = false) =>
snoozeDatePassed ? "text-red-500" : "text-custom-text-400",
bgColor: (snoozeDatePassed: boolean = false) =>
snoozeDatePassed ? "bg-red-500/10" : "bg-[#E0E1E6]",
},
{
key: "accepted",
i18n_title: "inbox_issue.status.accepted.title",
status: EInboxIssueStatus.ACCEPTED,
i18n_description: () => `inbox_issue.status.accepted.description`,
textColor: (snoozeDatePassed: boolean = false) =>
snoozeDatePassed ? "" : "text-[#3E9B4F]",
bgColor: (snoozeDatePassed: boolean = false) =>
snoozeDatePassed ? "" : "bg-[#E9F6E9]",
},
{
key: "duplicate",
i18n_title: "inbox_issue.status.duplicate.title",
status: EInboxIssueStatus.DUPLICATE,
i18n_description: () => `inbox_issue.status.duplicate.description`,
textColor: (snoozeDatePassed: boolean = false) =>
snoozeDatePassed ? "" : "text-custom-text-200",
bgColor: (snoozeDatePassed: boolean = false) =>
snoozeDatePassed ? "" : "bg-gray-500/10",
},
];

export const INBOX_ISSUE_ORDER_BY_OPTIONS = [
{
key: "issue__created_at",
i18n_label: "inbox_issue.order_by.created_at",
},
{
key: "issue__updated_at",
i18n_label: "inbox_issue.order_by.updated_at",
},
{
key: "issue__sequence_id",
i18n_label: "inbox_issue.order_by.id",
},
];

export const INBOX_ISSUE_SORT_BY_OPTIONS = [
{
key: "asc",
i18n_label: "common.sort.asc",
},
{
key: "desc",
i18n_label: "common.sort.desc",
},
];
1 change: 1 addition & 0 deletions packages/constants/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@ export * from "./swr";
export * from "./user";
export * from "./workspace";
export * from "./stickies";
export * from "./inbox";
export * from "./profile";
37 changes: 37 additions & 0 deletions packages/i18n/src/locales/en/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,10 @@
"start_date": "Start date",
"due_date": "Due date"
},
"sort": {
"asc": "Ascending",
"desc": "Descending"
},
"comments": "Comments",
"updates": "Updates"
},
Expand Down Expand Up @@ -460,6 +464,39 @@
}
},

"inbox_issue": {
"status": {
"pending": {
"title": "Pending",
"description": "Pending"
},
"declined": {
"title": "Declined",
"description": "Declined"
},
"snoozed": {
"title": "Snoozed",
"description": "{days, plural, one{# day} other{# days}} to go"
},
"accepted": {
"title": "Accepted",
"description": "Accepted"
},
"duplicate": {
"title": "Duplicate",
"description": "Duplicate"
}
},
"source": {
"in-app": "in-app"
},
"order_by": {
"created_at": "Created at",
"updated_at": "Updated at",
"id": "ID"
}
},

"workspace_dashboard": {
"empty_state": {
"general": {
Expand Down
37 changes: 37 additions & 0 deletions packages/i18n/src/locales/es/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -362,6 +362,10 @@
"start_date": "Fecha de inicio",
"due_date": "Fecha de vencimiento"
},
"sort": {
"asc": "Ascendente",
"desc": "Descendente"
},
"comments": "Comentarios",
"updates": "Actualizaciones"
},
Expand Down Expand Up @@ -459,6 +463,39 @@
}
},

"inbox_issue": {
"status": {
"pending": {
"title": "Pendiente",
"description": "Pendiente"
},
"declined": {
"title": "Rechazado",
"description": "Rechazado"
},
"snoozed": {
"title": "Pospuesto",
"description": "{days, plural, one{# día} other{# días}} restantes"
},
"accepted": {
"title": "Aceptado",
"description": "Aceptado"
},
"duplicate": {
"title": "Duplicado",
"description": "Duplicado"
}
},
"source": {
"in-app": "en la aplicación"
},
"order_by": {
"created_at": "Creado el",
"updated_at": "Actualizado el",
"id": "Identificador"
}
},

"workspace_dashboard": {
"empty_state": {
"general": {
Expand Down
39 changes: 38 additions & 1 deletion packages/i18n/src/locales/fr/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,10 @@
"start_date": "Date de début",
"due_date": "Date d'échéance"
},
"sort": {
"asc": "Croissant",
"desc": "Décroissant"
},
"comments": "Commentaires",
"updates": "Mises à jour"
},
Expand Down Expand Up @@ -447,7 +451,7 @@
}
}
},

"view": {
"create": {
"label": "Créer une vue"
Expand All @@ -457,6 +461,39 @@
}
},

"inbox_issue": {
"status": {
"pending": {
"title": "En attente",
"description": "En attente"
},
"declined": {
"title": "Refusé",
"description": "Refusé"
},
"snoozed": {
"title": "Reporté",
"description": "{days, plural, one{# jour} other{# jours}} restants"
},
"accepted": {
"title": "Accepté",
"description": "Accepté"
},
"duplicate": {
"title": "Doublon",
"description": "Doublon"
}
},
"source": {
"in-app": "dans l'application"
},
"order_by": {
"created_at": "Créé le",
"updated_at": "Mis à jour le",
"id": "Identifiant"
}
},

"workspace_dashboard": {
"empty_state": {
"general": {
Expand Down
37 changes: 37 additions & 0 deletions packages/i18n/src/locales/ja/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,10 @@
"start_date": "開始日",
"due_date": "期限日"
},
"sort": {
"asc": "昇順",
"desc": "降順"
},
"comments": "コメント",
"updates": "更新"
},
Expand Down Expand Up @@ -460,6 +464,39 @@
}
},

"inbox_issue": {
"status": {
"pending": {
"title": "保留中",
"description": "保留中"
},
"declined": {
"title": "却下",
"description": "却下"
},
"snoozed": {
"title": "スヌーズ中",
"description": "残り{days}日"
},
"accepted": {
"title": "承認済み",
"description": "承認済み"
},
"duplicate": {
"title": "重複",
"description": "重複"
}
},
"source": {
"in-app": "アプリ内"
},
"order_by": {
"created_at": "作成日時",
"updated_at": "更新日時",
"id": "識別番号"
}
},

"workspace_dashboard": {
"empty_state": {
"general": {
Expand Down
38 changes: 38 additions & 0 deletions packages/i18n/src/locales/zh-CN/translations.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@
"add_parent": "添加父问题",
"loading_members": "正在加载成员...",
"inbox": "收件箱",

"common": {
"all": "全部",
"states": "状态",
Expand Down Expand Up @@ -362,6 +363,10 @@
"start_date": "开始日期",
"due_date": "截止日期"
},
"sort": {
"asc": "升序",
"desc": "降序"
},
"comments": "评论",
"updates": "更新"
},
Expand Down Expand Up @@ -455,6 +460,39 @@
}
},

"inbox_issue": {
"status": {
"pending": {
"title": "待处理",
"description": "待处理"
},
"declined": {
"title": "已拒绝",
"description": "已拒绝"
},
"snoozed": {
"title": "已暂停",
"description": "还剩{days}天"
},
"accepted": {
"title": "已接受",
"description": "已接受"
},
"duplicate": {
"title": "重复",
"description": "重复"
}
},
"source": {
"in-app": "应用内"
},
"order_by": {
"created_at": "创建时间",
"updated_at": "更新时间",
"id": "编号"
}
},

"user_profile": {
"title": "你的工作",
"work": "工作",
Expand Down
Loading
Loading