From 7c714c7f0599c6d9794a2fd4ac72fcf3e950b10b Mon Sep 17 00:00:00 2001 From: gakshita Date: Mon, 20 Jan 2025 14:02:03 +0530 Subject: [PATCH 1/4] chore: ln support for inbox constants --- packages/constants/src/inbox.ts | 81 +++++++++++++++++ packages/constants/src/index.ts | 1 + .../i18n/src/locales/en/translations.json | 40 +++++++- .../i18n/src/locales/es/translations.json | 40 +++++++- .../i18n/src/locales/fr/translations.json | 40 +++++++- .../i18n/src/locales/ja/translations.json | 40 +++++++- .../i18n/src/locales/zh-CN/translations.json | 40 +++++++- packages/types/src/inbox.d.ts | 5 +- .../inbox-filter/applied-filters/status.tsx | 6 +- .../inbox/inbox-filter/filters/status.tsx | 6 +- .../inbox/inbox-filter/sorting/order-by.tsx | 16 ++-- .../components/inbox/inbox-issue-status.tsx | 11 ++- .../stickies/layout/stickies-list.tsx | 2 +- web/core/constants/empty-state.tsx | 2 +- web/core/constants/inbox.tsx | 91 ------------------- web/helpers/inbox.helper.ts | 33 +++++++ 16 files changed, 336 insertions(+), 118 deletions(-) create mode 100644 packages/constants/src/inbox.ts delete mode 100644 web/core/constants/inbox.tsx diff --git a/packages/constants/src/inbox.ts b/packages/constants/src/inbox.ts new file mode 100644 index 00000000000..856e341b309 --- /dev/null +++ b/packages/constants/src/inbox.ts @@ -0,0 +1,81 @@ +export const INBOX_STATUS: { + key: string; + title: string; + description: () => string; + textColor: (snoozeDatePassed: boolean) => string; + bgColor: (snoozeDatePassed: boolean) => string; +}[] = [ + { + key: "pending", + title: "inbox_issue.status.pending.title", + description: () => `inbox_issue.status.pending.description`, + textColor: (snoozeDatePassed: boolean = false) => + snoozeDatePassed ? "" : "text-[#AB6400]", + bgColor: (snoozeDatePassed: boolean = false) => + snoozeDatePassed ? "" : "bg-[#FFF7C2]", + }, + { + key: "declined", + title: "inbox_issue.status.declined.title", + description: () => `inbox_issue.status.declined.description`, + textColor: (snoozeDatePassed: boolean = false) => + snoozeDatePassed ? "" : "text-[#CE2C31]", + bgColor: (snoozeDatePassed: boolean = false) => + snoozeDatePassed ? "" : "bg-[#FEEBEC]", + }, + { + key: "snoozed", + title: "inbox_issue.status.snoozed.title", + 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", + title: "inbox_issue.status.accepted.title", + description: () => `inbox_issue.status.accepted.description`, + textColor: (snoozeDatePassed: boolean = false) => + snoozeDatePassed ? "" : "text-[#3E9B4F]", + bgColor: (snoozeDatePassed: boolean = false) => + snoozeDatePassed ? "" : "bg-[#E9F6E9]", + }, + { + key: "duplicate", + title: "inbox_issue.status.duplicate.title", + 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_SOURCE = "inbox_issue.source.in-app"; + +export const INBOX_ISSUE_ORDER_BY_OPTIONS = [ + { + key: "issue__created_at", + label: "inbox_issue.order_by.created_at", + }, + { + key: "issue__updated_at", + label: "inbox_issue.order_by.updated_at", + }, + { + key: "issue__sequence_id", + label: "inbox_issue.order_by.id", + }, +]; + +export const INBOX_ISSUE_SORT_BY_OPTIONS = [ + { + key: "asc", + label: "common.sort.asc", + }, + { + key: "desc", + label: "common.sort.desc", + }, +]; diff --git a/packages/constants/src/index.ts b/packages/constants/src/index.ts index 2b3964ae9fd..dff90ad2158 100644 --- a/packages/constants/src/index.ts +++ b/packages/constants/src/index.ts @@ -14,3 +14,4 @@ export * from "./swr"; export * from "./user"; export * from "./workspace"; export * from "./stickies"; +export * from "./inbox"; diff --git a/packages/i18n/src/locales/en/translations.json b/packages/i18n/src/locales/en/translations.json index 596c3093fa9..9fa6c4a187b 100644 --- a/packages/i18n/src/locales/en/translations.json +++ b/packages/i18n/src/locales/en/translations.json @@ -316,5 +316,43 @@ "change_parent_issue": "Change parent issue", "remove_parent_issue": "Remove parent issue", "add_parent": "Add parent", - "loading_members": "Loading members..." + "loading_members": "Loading members...", + "inbox_issue": { + "status": { + "pending": { + "title": "Pending", + "description": "Pending" + }, + "declined": { + "title": "Declined", + "description": "Declined" + }, + "snoozed": { + "title": "Snoozed", + "description": "Snoozed" + }, + "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" + } + }, + "common": { + "sort": { + "asc": "Ascending", + "desc": "Descending" + } + } } diff --git a/packages/i18n/src/locales/es/translations.json b/packages/i18n/src/locales/es/translations.json index 9f2b98792c2..96f02b594c9 100644 --- a/packages/i18n/src/locales/es/translations.json +++ b/packages/i18n/src/locales/es/translations.json @@ -316,5 +316,43 @@ "remove_parent_issue": "Eliminar problema padre", "add_parent": "Agregar padre", "loading_members": "Cargando miembros...", - "inbox": "bandeja de entrada" + "inbox": "bandeja de entrada", + "inbox_issue": { + "status": { + "pending": { + "title": "Pendiente", + "description": "Pendiente" + }, + "declined": { + "title": "Rechazado", + "description": "Rechazado" + }, + "snoozed": { + "title": "Pospuesto", + "description": "Pospuesto" + }, + "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" + } + }, + "common": { + "sort": { + "asc": "Ascendente", + "desc": "Descendente" + } + } } diff --git a/packages/i18n/src/locales/fr/translations.json b/packages/i18n/src/locales/fr/translations.json index 0eee868e174..93f52416dcf 100644 --- a/packages/i18n/src/locales/fr/translations.json +++ b/packages/i18n/src/locales/fr/translations.json @@ -316,5 +316,43 @@ "remove_parent_issue": "Supprimer le problème parent", "add_parent": "Ajouter un parent", "loading_members": "Chargement des membres...", - "inbox": "Boîte de réception" + "inbox": "Boîte de réception", + "inbox_issue": { + "status": { + "pending": { + "title": "En attente", + "description": "En attente" + }, + "declined": { + "title": "Refusé", + "description": "Refusé" + }, + "snoozed": { + "title": "Reporté", + "description": "Reporté" + }, + "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" + } + }, + "common": { + "sort": { + "asc": "Croissant", + "desc": "Décroissant" + } + } } diff --git a/packages/i18n/src/locales/ja/translations.json b/packages/i18n/src/locales/ja/translations.json index fa2b244cc5e..3b252e163a0 100644 --- a/packages/i18n/src/locales/ja/translations.json +++ b/packages/i18n/src/locales/ja/translations.json @@ -316,5 +316,43 @@ "remove_parent_issue": "親問題を削除", "add_parent": "親問題を追加", "loading_members": "メンバーを読み込んでいます...", - "inbox": "受信箱" + "inbox": "受信箱", + "inbox_issue": { + "status": { + "pending": { + "title": "保留中", + "description": "保留中" + }, + "declined": { + "title": "却下", + "description": "却下" + }, + "snoozed": { + "title": "スヌーズ中", + "description": "スヌーズ中" + }, + "accepted": { + "title": "承認済み", + "description": "承認済み" + }, + "duplicate": { + "title": "重複", + "description": "重複" + } + }, + "source": { + "in-app": "アプリ内" + }, + "order_by": { + "created_at": "作成日時", + "updated_at": "更新日時", + "id": "識別番号" + } + }, + "common": { + "sort": { + "asc": "昇順", + "desc": "降順" + } + } } diff --git a/packages/i18n/src/locales/zh-CN/translations.json b/packages/i18n/src/locales/zh-CN/translations.json index 093027c16b1..2fc6c450a8b 100644 --- a/packages/i18n/src/locales/zh-CN/translations.json +++ b/packages/i18n/src/locales/zh-CN/translations.json @@ -315,5 +315,43 @@ "remove_parent_issue": "移除父问题", "add_parent": "添加父问题", "loading_members": "正在加载成员...", - "inbox": "收件箱" + "inbox": "收件箱", + "inbox_issue": { + "status": { + "pending": { + "title": "待处理", + "description": "待处理" + }, + "declined": { + "title": "已拒绝", + "description": "已拒绝" + }, + "snoozed": { + "title": "已暂停", + "description": "已暂停" + }, + "accepted": { + "title": "已接受", + "description": "已接受" + }, + "duplicate": { + "title": "重复", + "description": "重复" + } + }, + "source": { + "in-app": "应用内" + }, + "order_by": { + "created_at": "创建时间", + "updated_at": "更新时间", + "id": "编号" + } + }, + "common": { + "sort": { + "asc": "升序", + "desc": "降序" + } + } } diff --git a/packages/types/src/inbox.d.ts b/packages/types/src/inbox.d.ts index 5ae6c160e80..9cbd91003c6 100644 --- a/packages/types/src/inbox.d.ts +++ b/packages/types/src/inbox.d.ts @@ -38,10 +38,7 @@ export type TInboxIssueFilter = { // sorting filters export type TInboxIssueSortingKeys = "order_by" | "sort_by"; -export type TInboxIssueSortingOrderByKeys = - | "issue__created_at" - | "issue__updated_at" - | "issue__sequence_id"; +export type TInboxIssueSortingOrderByKeys = "issue__created_at" | "issue__updated_at" | "issue__sequence_id"; export type TInboxIssueSortingSortByKeys = "asc" | "desc"; diff --git a/web/core/components/inbox/inbox-filter/applied-filters/status.tsx b/web/core/components/inbox/inbox-filter/applied-filters/status.tsx index 3232e4a5a21..dcd3cadec03 100644 --- a/web/core/components/inbox/inbox-filter/applied-filters/status.tsx +++ b/web/core/components/inbox/inbox-filter/applied-filters/status.tsx @@ -1,16 +1,18 @@ import { FC } from "react"; import { observer } from "mobx-react"; import { X } from "lucide-react"; +import { useTranslation } from "@plane/i18n"; import { TInboxIssueStatus } from "@plane/types"; // constants import { Tag } from "@plane/ui"; -import { INBOX_STATUS } from "@/constants/inbox"; // hooks +import { INBOX_STATUS } from "@/helpers/inbox.helper"; import { useProjectInbox } from "@/hooks/store"; export const InboxIssueAppliedFiltersStatus: FC = observer(() => { // hooks const { inboxFilters, handleInboxIssueFilters } = useProjectInbox(); + const { t } = useTranslation(); // derived values const filteredValues = inboxFilters?.status || []; const currentOptionDetail = (status: TInboxIssueStatus) => INBOX_STATUS.find((s) => s.status === status) || undefined; @@ -30,7 +32,7 @@ export const InboxIssueAppliedFiltersStatus: FC = observer(() => {
-
{optionDetail?.title}
+
{t(optionDetail?.title)}
{handleFilterValue(optionDetail?.status).length >= 1 && (
= observer((props) => { const { searchQuery } = props; // hooks const { currentTab, inboxFilters, handleInboxIssueFilters } = useProjectInbox(); + const { t } = useTranslation(); // states const [previewEnabled, setPreviewEnabled] = useState(true); // derived values @@ -53,7 +55,7 @@ export const FilterStatus: FC = observer((props) => { isChecked={filterValue?.includes(status.status) ? true : false} onClick={() => handleStatusFilterSelect(status.status)} icon={} - title={status.title} + title={t(status.title)} /> )) ) : ( diff --git a/web/core/components/inbox/inbox-filter/sorting/order-by.tsx b/web/core/components/inbox/inbox-filter/sorting/order-by.tsx index f1282c3c1ad..e1412e0c713 100644 --- a/web/core/components/inbox/inbox-filter/sorting/order-by.tsx +++ b/web/core/components/inbox/inbox-filter/sorting/order-by.tsx @@ -3,9 +3,11 @@ import { FC } from "react"; import { observer } from "mobx-react"; import { ArrowDownWideNarrow, ArrowUpWideNarrow, Check, ChevronDown } from "lucide-react"; +import { INBOX_ISSUE_ORDER_BY_OPTIONS, INBOX_ISSUE_SORT_BY_OPTIONS } from "@plane/constants"; +import { useTranslation } from "@plane/i18n"; +import { TInboxIssueSortingOrderByKeys, TInboxIssueSortingSortByKeys } from "@plane/types"; import { CustomMenu, getButtonStyling } from "@plane/ui"; // constants -import { INBOX_ISSUE_ORDER_BY_OPTIONS, INBOX_ISSUE_SORT_BY_OPTIONS } from "@/constants/inbox"; // helpers import { cn } from "@/helpers/common.helper"; // hooks @@ -14,6 +16,7 @@ import useSize from "@/hooks/use-window-size"; export const InboxIssueOrderByDropdown: FC = observer(() => { // hooks + const { t } = useTranslation(); const windowSize = useSize(); const { inboxSorting, handleInboxIssueSorting } = useProjectInbox(); const orderByDetails = @@ -31,8 +34,7 @@ export const InboxIssueOrderByDropdown: FC = observer(() => { ) : ( )} - {orderByDetails?.label || "Order By"} - + {t(orderByDetails?.label || "inbox_issue.order_by.created_at")}
); @@ -47,9 +49,9 @@ export const InboxIssueOrderByDropdown: FC = observer(() => { handleInboxIssueSorting("order_by", option.key)} + onClick={() => handleInboxIssueSorting("order_by", option.key as TInboxIssueSortingOrderByKeys)} > - {option.label} + {t(option.label)} {inboxSorting?.order_by?.includes(option.key) && } ))} @@ -58,9 +60,9 @@ export const InboxIssueOrderByDropdown: FC = observer(() => { handleInboxIssueSorting("sort_by", option.key)} + onClick={() => handleInboxIssueSorting("sort_by", option.key as TInboxIssueSortingSortByKeys)} > - {option.label} + {t(option.label)} {inboxSorting?.sort_by?.includes(option.key) && } ))} diff --git a/web/core/components/inbox/inbox-issue-status.tsx b/web/core/components/inbox/inbox-issue-status.tsx index f74693f7688..713ab85eeaa 100644 --- a/web/core/components/inbox/inbox-issue-status.tsx +++ b/web/core/components/inbox/inbox-issue-status.tsx @@ -1,10 +1,11 @@ import React from "react"; import { observer } from "mobx-react"; // constants -import { INBOX_STATUS } from "@/constants/inbox"; // helpers +import { useTranslation } from "@plane/i18n"; import { cn } from "@/helpers/common.helper"; // store +import { INBOX_STATUS } from "@/helpers/inbox.helper"; import { IInboxIssueStore } from "@/store/inbox/inbox-issue.store"; type Props = { @@ -15,13 +16,15 @@ type Props = { export const InboxIssueStatus: React.FC = observer((props) => { const { inboxIssue, iconSize = 16, showDescription = false } = props; + //hooks + const { t } = useTranslation(); // derived values const inboxIssueStatusDetail = INBOX_STATUS.find((s) => s.status === inboxIssue.status); const isSnoozedDatePassed = inboxIssue.status === 0 && new Date(inboxIssue.snoozed_till ?? "") < new Date(); if (!inboxIssueStatusDetail || isSnoozedDatePassed) return <>; - const description = inboxIssueStatusDetail.description(new Date(inboxIssue.snoozed_till ?? "")); + const description = t(inboxIssueStatusDetail.description(new Date(inboxIssue.snoozed_till ?? ""))); return (
= observer((props) => {
- {inboxIssue?.status === 0 && inboxIssue?.snoozed_till - ? inboxIssueStatusDetail.description(inboxIssue?.snoozed_till) - : inboxIssueStatusDetail.title} + {inboxIssue?.status === 0 && inboxIssue?.snoozed_till ? description : t(inboxIssueStatusDetail.title)}
{showDescription &&
{description}
} diff --git a/web/core/components/stickies/layout/stickies-list.tsx b/web/core/components/stickies/layout/stickies-list.tsx index 4da6efe7b03..2a743d0cc02 100644 --- a/web/core/components/stickies/layout/stickies-list.tsx +++ b/web/core/components/stickies/layout/stickies-list.tsx @@ -12,13 +12,13 @@ import { Loader } from "@plane/ui"; // components import { EmptyState } from "@/components/empty-state"; // constants +import { StickiesEmptyState } from "@/components/home/widgets/empty-states/stickies"; import { EmptyStateType } from "@/constants/empty-state"; // hooks import { useSticky } from "@/hooks/use-stickies"; import { useStickyOperations } from "../sticky/use-operations"; import { StickyDNDWrapper } from "./sticky-dnd-wrapper"; import { getInstructionFromPayload } from "./sticky.helpers"; -import { StickiesEmptyState } from "@/components/home/widgets/empty-states/stickies"; type TStickiesLayout = { workspaceSlug: string; diff --git a/web/core/constants/empty-state.tsx b/web/core/constants/empty-state.tsx index ef1b9e91829..c2ae08784d7 100644 --- a/web/core/constants/empty-state.tsx +++ b/web/core/constants/empty-state.tsx @@ -1,5 +1,5 @@ -import { EUserPermissions } from "ee/constants/user-permissions"; import { Plus, Shapes } from "lucide-react"; +import { EUserPermissions } from "ee/constants/user-permissions"; export interface EmptyStateDetails { key: EmptyStateType; diff --git a/web/core/constants/inbox.tsx b/web/core/constants/inbox.tsx deleted file mode 100644 index fb0f4ec636e..00000000000 --- a/web/core/constants/inbox.tsx +++ /dev/null @@ -1,91 +0,0 @@ -// icons -import { AlertTriangle, CheckCircle2, Clock, Copy, LucideIcon, XCircle } from "lucide-react"; -// types -import { TInboxIssueSortingOrderByKeys, TInboxIssueSortingSortByKeys, TInboxIssueStatus } from "@plane/types"; -// helpers -import { findHowManyDaysLeft } from "@/helpers/date-time.helper"; -import { EInboxIssueStatus } from "@/helpers/inbox.helper"; - -export const INBOX_STATUS: { - key: string; - status: TInboxIssueStatus; - icon: LucideIcon; - title: string; - description: (snoozedTillDate: Date) => string; - textColor: (snoozeDatePassed: boolean) => string; - bgColor: (snoozeDatePassed: boolean) => string; -}[] = [ - { - key: "pending", - status: EInboxIssueStatus.PENDING, - icon: AlertTriangle, - title: "Pending", - description: () => `Pending`, - textColor: (snoozeDatePassed: boolean = false) => (snoozeDatePassed ? "" : "text-[#AB6400]"), - bgColor: (snoozeDatePassed: boolean = false) => (snoozeDatePassed ? "" : "bg-[#FFF7C2]"), - }, - { - key: "declined", - status: EInboxIssueStatus.DECLINED, - icon: XCircle, - title: "Declined", - description: () => `Declined`, - textColor: (snoozeDatePassed: boolean = false) => (snoozeDatePassed ? "" : "text-[#CE2C31]"), - bgColor: (snoozeDatePassed: boolean = false) => (snoozeDatePassed ? "" : "bg-[#FEEBEC]"), - }, - { - key: "snoozed", - status: EInboxIssueStatus.SNOOZED, - icon: Clock, - title: "Snoozed", - description: (snoozedTillDate: Date = new Date()) => `${findHowManyDaysLeft(snoozedTillDate)} days to go`, - 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", - status: EInboxIssueStatus.ACCEPTED, - icon: CheckCircle2, - title: "Accepted", - description: () => `Accepted`, - textColor: (snoozeDatePassed: boolean = false) => (snoozeDatePassed ? "" : "text-[#3E9B4F]"), - bgColor: (snoozeDatePassed: boolean = false) => (snoozeDatePassed ? "" : "bg-[#E9F6E9]"), - }, - { - key: "duplicate", - status: EInboxIssueStatus.DUPLICATE, - icon: Copy, - title: "Duplicate", - description: () => `Duplicate`, - textColor: (snoozeDatePassed: boolean = false) => (snoozeDatePassed ? "" : "text-custom-text-200"), - bgColor: (snoozeDatePassed: boolean = false) => (snoozeDatePassed ? "" : "bg-gray-500/10"), - }, -]; - -export const INBOX_ISSUE_SOURCE = "in-app"; - -export const INBOX_ISSUE_ORDER_BY_OPTIONS: { key: TInboxIssueSortingOrderByKeys; label: string }[] = [ - { - key: "issue__created_at", - label: "Created at", - }, - { - key: "issue__updated_at", - label: "Updated at", - }, - { - key: "issue__sequence_id", - label: "ID", - }, -]; - -export const INBOX_ISSUE_SORT_BY_OPTIONS: { key: TInboxIssueSortingSortByKeys; label: string }[] = [ - { - key: "asc", - label: "Ascending", - }, - { - key: "desc", - label: "Descending", - }, -]; diff --git a/web/helpers/inbox.helper.ts b/web/helpers/inbox.helper.ts index 52a85b0ba29..acec5784840 100644 --- a/web/helpers/inbox.helper.ts +++ b/web/helpers/inbox.helper.ts @@ -1,4 +1,7 @@ import { subDays } from "date-fns"; +import { AlertTriangle, CheckCircle2, Clock, Copy, LucideIcon, XCircle } from "lucide-react"; +import { INBOX_STATUS as INBOX_STATUS_CONSTANTS } from "@plane/constants"; +import { TInboxIssueStatus } from "@plane/types"; import { renderFormattedPayloadDate } from "./date-time.helper"; export enum EInboxIssueCurrentTab { @@ -71,3 +74,33 @@ export const PAST_DURATION_FILTER_OPTIONS: { value: EPastDurationFilters.LAST_30_DAYS, }, ]; + +const INBOX_STATUS_ICONS = { + pending: AlertTriangle, + declined: XCircle, + snoozed: Clock, + accepted: CheckCircle2, + duplicate: Copy, +}; + +const INBOX_STATUS_KEYS = { + pending: EInboxIssueStatus.PENDING, + declined: EInboxIssueStatus.DECLINED, + snoozed: EInboxIssueStatus.SNOOZED, + accepted: EInboxIssueStatus.ACCEPTED, + duplicate: EInboxIssueStatus.DUPLICATE, +}; + +export const INBOX_STATUS: { + key: string; + status: TInboxIssueStatus; + icon: LucideIcon; + title: string; + description: (snoozedTillDate: Date) => string; + textColor: (snoozeDatePassed: boolean) => string; + bgColor: (snoozeDatePassed: boolean) => string; +}[] = INBOX_STATUS_CONSTANTS.map((s) => ({ + ...s, + icon: INBOX_STATUS_ICONS[s.key as keyof typeof INBOX_STATUS_ICONS], + status: INBOX_STATUS_KEYS[s.key as keyof typeof INBOX_STATUS_KEYS], +})); From 38aa93e6489d04581058fe04013d4042e4c5f2a7 Mon Sep 17 00:00:00 2001 From: gakshita Date: Mon, 20 Jan 2025 16:18:54 +0530 Subject: [PATCH 2/4] fix: snooze duration --- packages/i18n/src/locales/en/translations.json | 2 +- packages/i18n/src/locales/es/translations.json | 2 +- packages/i18n/src/locales/fr/translations.json | 2 +- packages/i18n/src/locales/ja/translations.json | 2 +- packages/i18n/src/locales/zh-CN/translations.json | 2 +- web/core/components/inbox/inbox-issue-status.tsx | 5 ++++- web/helpers/inbox.helper.ts | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/i18n/src/locales/en/translations.json b/packages/i18n/src/locales/en/translations.json index 9fa6c4a187b..b612e445f7e 100644 --- a/packages/i18n/src/locales/en/translations.json +++ b/packages/i18n/src/locales/en/translations.json @@ -329,7 +329,7 @@ }, "snoozed": { "title": "Snoozed", - "description": "Snoozed" + "description": "{days, plural, one{# day} other{# days}} to go" }, "accepted": { "title": "Accepted", diff --git a/packages/i18n/src/locales/es/translations.json b/packages/i18n/src/locales/es/translations.json index 96f02b594c9..3872842b8dc 100644 --- a/packages/i18n/src/locales/es/translations.json +++ b/packages/i18n/src/locales/es/translations.json @@ -329,7 +329,7 @@ }, "snoozed": { "title": "Pospuesto", - "description": "Pospuesto" + "description": "{days, plural, one{# día} other{# días}} restantes" }, "accepted": { "title": "Aceptado", diff --git a/packages/i18n/src/locales/fr/translations.json b/packages/i18n/src/locales/fr/translations.json index 93f52416dcf..b48fa0cfc8b 100644 --- a/packages/i18n/src/locales/fr/translations.json +++ b/packages/i18n/src/locales/fr/translations.json @@ -329,7 +329,7 @@ }, "snoozed": { "title": "Reporté", - "description": "Reporté" + "description": "{days, plural, one{# jour} other{# jours}} restants" }, "accepted": { "title": "Accepté", diff --git a/packages/i18n/src/locales/ja/translations.json b/packages/i18n/src/locales/ja/translations.json index 3b252e163a0..ec848c917db 100644 --- a/packages/i18n/src/locales/ja/translations.json +++ b/packages/i18n/src/locales/ja/translations.json @@ -329,7 +329,7 @@ }, "snoozed": { "title": "スヌーズ中", - "description": "スヌーズ中" + "description": "残り{days}日" }, "accepted": { "title": "承認済み", diff --git a/packages/i18n/src/locales/zh-CN/translations.json b/packages/i18n/src/locales/zh-CN/translations.json index 2fc6c450a8b..5fefacd1f57 100644 --- a/packages/i18n/src/locales/zh-CN/translations.json +++ b/packages/i18n/src/locales/zh-CN/translations.json @@ -328,7 +328,7 @@ }, "snoozed": { "title": "已暂停", - "description": "已暂停" + "description": "还剩{days}天" }, "accepted": { "title": "已接受", diff --git a/web/core/components/inbox/inbox-issue-status.tsx b/web/core/components/inbox/inbox-issue-status.tsx index 713ab85eeaa..b09f7baa1d5 100644 --- a/web/core/components/inbox/inbox-issue-status.tsx +++ b/web/core/components/inbox/inbox-issue-status.tsx @@ -4,6 +4,7 @@ import { observer } from "mobx-react"; // helpers import { useTranslation } from "@plane/i18n"; import { cn } from "@/helpers/common.helper"; +import { findHowManyDaysLeft } from "@/helpers/date-time.helper"; // store import { INBOX_STATUS } from "@/helpers/inbox.helper"; import { IInboxIssueStore } from "@/store/inbox/inbox-issue.store"; @@ -24,7 +25,9 @@ export const InboxIssueStatus: React.FC = observer((props) => { const isSnoozedDatePassed = inboxIssue.status === 0 && new Date(inboxIssue.snoozed_till ?? "") < new Date(); if (!inboxIssueStatusDetail || isSnoozedDatePassed) return <>; - const description = t(inboxIssueStatusDetail.description(new Date(inboxIssue.snoozed_till ?? ""))); + const description = t(inboxIssueStatusDetail.description(), { + days: findHowManyDaysLeft(new Date(inboxIssue.snoozed_till ?? "")), + }); return (
string; + description: () => string; textColor: (snoozeDatePassed: boolean) => string; bgColor: (snoozeDatePassed: boolean) => string; }[] = INBOX_STATUS_CONSTANTS.map((s) => ({ From 593255d4b17368d040f9076c9b1451b8749d95c4 Mon Sep 17 00:00:00 2001 From: gakshita Date: Mon, 20 Jan 2025 17:36:41 +0530 Subject: [PATCH 3/4] fix: enum --- packages/constants/src/inbox.ts | 34 +++++++++++++++++++ packages/types/src/inbox.d.ts | 28 --------------- .../inbox-filter/applied-filters/status.tsx | 6 ++-- .../inbox/inbox-filter/filters/status.tsx | 6 ++-- .../components/inbox/inbox-issue-status.tsx | 5 +-- .../components/inbox/inbox-status-icon.tsx | 24 +++++++++++++ web/core/components/inbox/sidebar/root.tsx | 2 +- .../services/inbox/inbox-issue.service.ts | 3 +- web/core/store/inbox/inbox-issue.store.ts | 3 +- web/core/store/inbox/project-inbox.store.ts | 3 +- web/helpers/inbox.helper.ts | 33 ------------------ 11 files changed, 73 insertions(+), 74 deletions(-) create mode 100644 web/core/components/inbox/inbox-status-icon.tsx diff --git a/packages/constants/src/inbox.ts b/packages/constants/src/inbox.ts index 856e341b309..45a9755dbf9 100644 --- a/packages/constants/src/inbox.ts +++ b/packages/constants/src/inbox.ts @@ -1,5 +1,34 @@ +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; title: string; description: () => string; textColor: (snoozeDatePassed: boolean) => string; @@ -8,6 +37,7 @@ export const INBOX_STATUS: { { key: "pending", title: "inbox_issue.status.pending.title", + status: EInboxIssueStatus.PENDING, description: () => `inbox_issue.status.pending.description`, textColor: (snoozeDatePassed: boolean = false) => snoozeDatePassed ? "" : "text-[#AB6400]", @@ -17,6 +47,7 @@ export const INBOX_STATUS: { { key: "declined", title: "inbox_issue.status.declined.title", + status: EInboxIssueStatus.DECLINED, description: () => `inbox_issue.status.declined.description`, textColor: (snoozeDatePassed: boolean = false) => snoozeDatePassed ? "" : "text-[#CE2C31]", @@ -26,6 +57,7 @@ export const INBOX_STATUS: { { key: "snoozed", title: "inbox_issue.status.snoozed.title", + status: EInboxIssueStatus.SNOOZED, description: () => `inbox_issue.status.snoozed.description`, textColor: (snoozeDatePassed: boolean = false) => snoozeDatePassed ? "text-red-500" : "text-custom-text-400", @@ -35,6 +67,7 @@ export const INBOX_STATUS: { { key: "accepted", title: "inbox_issue.status.accepted.title", + status: EInboxIssueStatus.ACCEPTED, description: () => `inbox_issue.status.accepted.description`, textColor: (snoozeDatePassed: boolean = false) => snoozeDatePassed ? "" : "text-[#3E9B4F]", @@ -44,6 +77,7 @@ export const INBOX_STATUS: { { key: "duplicate", title: "inbox_issue.status.duplicate.title", + status: EInboxIssueStatus.DUPLICATE, description: () => `inbox_issue.status.duplicate.description`, textColor: (snoozeDatePassed: boolean = false) => snoozeDatePassed ? "" : "text-custom-text-200", diff --git a/packages/types/src/inbox.d.ts b/packages/types/src/inbox.d.ts index 9cbd91003c6..30ad0120c81 100644 --- a/packages/types/src/inbox.d.ts +++ b/packages/types/src/inbox.d.ts @@ -2,23 +2,6 @@ import { TPaginationInfo } from "./common"; import { TIssuePriorities } from "./issues"; import { TIssue } from "./issues/base"; -enum EInboxIssueCurrentTab { - OPEN = "open", - CLOSED = "closed", -} - -enum EInboxIssueStatus { - PENDING = -2, - DECLINED = -1, - SNOOZED = 0, - ACCEPTED = 1, - DUPLICATE = 2, -} - -export type TInboxIssueCurrentTab = EInboxIssueCurrentTab; - -export type TInboxIssueStatus = EInboxIssueStatus; - // filters export type TInboxIssueFilterMemberKeys = "assignees" | "created_by"; @@ -75,17 +58,6 @@ export type TInboxDuplicateIssueDetails = { name: string; }; -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 type TInboxIssuePaginationInfo = TPaginationInfo & { total_results: number; }; diff --git a/web/core/components/inbox/inbox-filter/applied-filters/status.tsx b/web/core/components/inbox/inbox-filter/applied-filters/status.tsx index dcd3cadec03..e3ba761f5d8 100644 --- a/web/core/components/inbox/inbox-filter/applied-filters/status.tsx +++ b/web/core/components/inbox/inbox-filter/applied-filters/status.tsx @@ -1,13 +1,13 @@ import { FC } from "react"; import { observer } from "mobx-react"; import { X } from "lucide-react"; +import { INBOX_STATUS, TInboxIssueStatus } from "@plane/constants"; import { useTranslation } from "@plane/i18n"; -import { TInboxIssueStatus } from "@plane/types"; // constants import { Tag } from "@plane/ui"; // hooks -import { INBOX_STATUS } from "@/helpers/inbox.helper"; import { useProjectInbox } from "@/hooks/store"; +import { InboxStatusIcon } from "../../inbox-status-icon"; export const InboxIssueAppliedFiltersStatus: FC = observer(() => { // hooks @@ -30,7 +30,7 @@ export const InboxIssueAppliedFiltersStatus: FC = observer(() => { return (
- +
{t(optionDetail?.title)}
{handleFilterValue(optionDetail?.status).length >= 1 && ( diff --git a/web/core/components/inbox/inbox-filter/filters/status.tsx b/web/core/components/inbox/inbox-filter/filters/status.tsx index 8e00b76292f..4fe5f563de0 100644 --- a/web/core/components/inbox/inbox-filter/filters/status.tsx +++ b/web/core/components/inbox/inbox-filter/filters/status.tsx @@ -1,14 +1,14 @@ import { FC, useState } from "react"; import { observer } from "mobx-react"; // types +import { INBOX_STATUS, TInboxIssueStatus } from "@plane/constants"; import { useTranslation } from "@plane/i18n"; -import { TInboxIssueStatus } from "@plane/types"; // components import { FilterHeader, FilterOption } from "@/components/issues"; // constants // hooks -import { INBOX_STATUS } from "@/helpers/inbox.helper"; import { useProjectInbox } from "@/hooks/store/use-project-inbox"; +import { InboxStatusIcon } from "../../inbox-status-icon"; type Props = { searchQuery: string; @@ -54,7 +54,7 @@ export const FilterStatus: FC = observer((props) => { key={status.key} isChecked={filterValue?.includes(status.status) ? true : false} onClick={() => handleStatusFilterSelect(status.status)} - icon={} + icon={} title={t(status.title)} /> )) diff --git a/web/core/components/inbox/inbox-issue-status.tsx b/web/core/components/inbox/inbox-issue-status.tsx index b09f7baa1d5..96d46025cd5 100644 --- a/web/core/components/inbox/inbox-issue-status.tsx +++ b/web/core/components/inbox/inbox-issue-status.tsx @@ -2,12 +2,13 @@ import React from "react"; import { observer } from "mobx-react"; // constants // helpers +import { INBOX_STATUS } from "@plane/constants"; import { useTranslation } from "@plane/i18n"; import { cn } from "@/helpers/common.helper"; import { findHowManyDaysLeft } from "@/helpers/date-time.helper"; // store -import { INBOX_STATUS } from "@/helpers/inbox.helper"; import { IInboxIssueStore } from "@/store/inbox/inbox-issue.store"; +import { InboxStatusIcon } from "./inbox-status-icon"; type Props = { inboxIssue: IInboxIssueStore; @@ -38,7 +39,7 @@ export const InboxIssueStatus: React.FC = observer((props) => { )} >
- +
{inboxIssue?.status === 0 && inboxIssue?.snoozed_till ? description : t(inboxIssueStatusDetail.title)}
diff --git a/web/core/components/inbox/inbox-status-icon.tsx b/web/core/components/inbox/inbox-status-icon.tsx new file mode 100644 index 00000000000..d1f7b93f8ee --- /dev/null +++ b/web/core/components/inbox/inbox-status-icon.tsx @@ -0,0 +1,24 @@ +import { AlertTriangle, CheckCircle2, Clock, Copy, XCircle } from "lucide-react"; +import { TInboxIssueStatus, EInboxIssueStatus } from "@plane/constants"; + +export const InboxStatusIcon = ({ + type, + size, + className, +}: { + type: TInboxIssueStatus; + size?: number; + className?: string; +}) => { + const icons = { + [EInboxIssueStatus.PENDING]: AlertTriangle, + [EInboxIssueStatus.DECLINED]: XCircle, + [EInboxIssueStatus.SNOOZED]: Clock, + [EInboxIssueStatus.ACCEPTED]: CheckCircle2, + [EInboxIssueStatus.DUPLICATE]: Copy, + }; + + if (type === undefined) return null; + const Icon = icons[type]; + return ; +}; diff --git a/web/core/components/inbox/sidebar/root.tsx b/web/core/components/inbox/sidebar/root.tsx index b8c86e0dee5..060c845b8c8 100644 --- a/web/core/components/inbox/sidebar/root.tsx +++ b/web/core/components/inbox/sidebar/root.tsx @@ -2,7 +2,7 @@ import { FC, useCallback, useEffect, useRef, useState } from "react"; import { observer } from "mobx-react"; -import { TInboxIssueCurrentTab } from "@plane/types"; +import { TInboxIssueCurrentTab } from "@plane/constants"; import { Header, Loader, EHeaderVariant } from "@plane/ui"; // components import { EmptyState } from "@/components/empty-state"; diff --git a/web/core/services/inbox/inbox-issue.service.ts b/web/core/services/inbox/inbox-issue.service.ts index 8837b6e74a3..737065d7003 100644 --- a/web/core/services/inbox/inbox-issue.service.ts +++ b/web/core/services/inbox/inbox-issue.service.ts @@ -1,5 +1,6 @@ // types -import type { TInboxIssue, TIssue, TInboxIssueWithPagination, TInboxForm } from "@plane/types"; +import { TInboxIssue } from "@plane/constants"; +import type { TIssue, TInboxIssueWithPagination, TInboxForm } from "@plane/types"; import { API_BASE_URL } from "@/helpers/common.helper"; import { APIService } from "@/services/api.service"; // helpers diff --git a/web/core/store/inbox/inbox-issue.store.ts b/web/core/store/inbox/inbox-issue.store.ts index 31bb5f591a4..2f72575b142 100644 --- a/web/core/store/inbox/inbox-issue.store.ts +++ b/web/core/store/inbox/inbox-issue.store.ts @@ -1,7 +1,8 @@ import clone from "lodash/clone"; import set from "lodash/set"; import { makeObservable, observable, runInAction, action } from "mobx"; -import { TIssue, TInboxIssue, TInboxIssueStatus, TInboxDuplicateIssueDetails } from "@plane/types"; +import { TInboxIssue, TInboxIssueStatus } from "@plane/constants"; +import { TIssue, TInboxDuplicateIssueDetails } from "@plane/types"; // helpers import { EInboxIssueStatus } from "@/helpers/inbox.helper"; // local db diff --git a/web/core/store/inbox/project-inbox.store.ts b/web/core/store/inbox/project-inbox.store.ts index 4dcb7297734..6ca0f31ba29 100644 --- a/web/core/store/inbox/project-inbox.store.ts +++ b/web/core/store/inbox/project-inbox.store.ts @@ -5,9 +5,8 @@ import set from "lodash/set"; import { action, computed, makeObservable, observable, runInAction } from "mobx"; import { computedFn } from "mobx-utils"; // types +import { TInboxIssue, TInboxIssueCurrentTab } from "@plane/constants"; import { - TInboxIssue, - TInboxIssueCurrentTab, TInboxIssueFilter, TInboxIssueSorting, TInboxIssuePaginationInfo, diff --git a/web/helpers/inbox.helper.ts b/web/helpers/inbox.helper.ts index 3ffa01386e9..52a85b0ba29 100644 --- a/web/helpers/inbox.helper.ts +++ b/web/helpers/inbox.helper.ts @@ -1,7 +1,4 @@ import { subDays } from "date-fns"; -import { AlertTriangle, CheckCircle2, Clock, Copy, LucideIcon, XCircle } from "lucide-react"; -import { INBOX_STATUS as INBOX_STATUS_CONSTANTS } from "@plane/constants"; -import { TInboxIssueStatus } from "@plane/types"; import { renderFormattedPayloadDate } from "./date-time.helper"; export enum EInboxIssueCurrentTab { @@ -74,33 +71,3 @@ export const PAST_DURATION_FILTER_OPTIONS: { value: EPastDurationFilters.LAST_30_DAYS, }, ]; - -const INBOX_STATUS_ICONS = { - pending: AlertTriangle, - declined: XCircle, - snoozed: Clock, - accepted: CheckCircle2, - duplicate: Copy, -}; - -const INBOX_STATUS_KEYS = { - pending: EInboxIssueStatus.PENDING, - declined: EInboxIssueStatus.DECLINED, - snoozed: EInboxIssueStatus.SNOOZED, - accepted: EInboxIssueStatus.ACCEPTED, - duplicate: EInboxIssueStatus.DUPLICATE, -}; - -export const INBOX_STATUS: { - key: string; - status: TInboxIssueStatus; - icon: LucideIcon; - title: string; - description: () => string; - textColor: (snoozeDatePassed: boolean) => string; - bgColor: (snoozeDatePassed: boolean) => string; -}[] = INBOX_STATUS_CONSTANTS.map((s) => ({ - ...s, - icon: INBOX_STATUS_ICONS[s.key as keyof typeof INBOX_STATUS_ICONS], - status: INBOX_STATUS_KEYS[s.key as keyof typeof INBOX_STATUS_KEYS], -})); From 3b0db1bee513b4cbdaf91c6d81192c6d5ba0e33c Mon Sep 17 00:00:00 2001 From: gakshita Date: Wed, 22 Jan 2025 13:49:22 +0530 Subject: [PATCH 4/4] fix: translation keys --- packages/constants/src/inbox.ts | 36 +++++++++---------- .../inbox-filter/applied-filters/status.tsx | 2 +- .../inbox/inbox-filter/filters/status.tsx | 2 +- .../inbox/inbox-filter/sorting/order-by.tsx | 6 ++-- .../components/inbox/inbox-issue-status.tsx | 4 +-- 5 files changed, 24 insertions(+), 26 deletions(-) diff --git a/packages/constants/src/inbox.ts b/packages/constants/src/inbox.ts index 45a9755dbf9..94069b7482f 100644 --- a/packages/constants/src/inbox.ts +++ b/packages/constants/src/inbox.ts @@ -29,16 +29,16 @@ export type TInboxIssue = { export const INBOX_STATUS: { key: string; status: TInboxIssueStatus; - title: string; - description: () => string; + i18n_title: string; + i18n_description: () => string; textColor: (snoozeDatePassed: boolean) => string; bgColor: (snoozeDatePassed: boolean) => string; }[] = [ { key: "pending", - title: "inbox_issue.status.pending.title", + i18n_title: "inbox_issue.status.pending.title", status: EInboxIssueStatus.PENDING, - description: () => `inbox_issue.status.pending.description`, + i18n_description: () => `inbox_issue.status.pending.description`, textColor: (snoozeDatePassed: boolean = false) => snoozeDatePassed ? "" : "text-[#AB6400]", bgColor: (snoozeDatePassed: boolean = false) => @@ -46,9 +46,9 @@ export const INBOX_STATUS: { }, { key: "declined", - title: "inbox_issue.status.declined.title", + i18n_title: "inbox_issue.status.declined.title", status: EInboxIssueStatus.DECLINED, - description: () => `inbox_issue.status.declined.description`, + i18n_description: () => `inbox_issue.status.declined.description`, textColor: (snoozeDatePassed: boolean = false) => snoozeDatePassed ? "" : "text-[#CE2C31]", bgColor: (snoozeDatePassed: boolean = false) => @@ -56,9 +56,9 @@ export const INBOX_STATUS: { }, { key: "snoozed", - title: "inbox_issue.status.snoozed.title", + i18n_title: "inbox_issue.status.snoozed.title", status: EInboxIssueStatus.SNOOZED, - description: () => `inbox_issue.status.snoozed.description`, + i18n_description: () => `inbox_issue.status.snoozed.description`, textColor: (snoozeDatePassed: boolean = false) => snoozeDatePassed ? "text-red-500" : "text-custom-text-400", bgColor: (snoozeDatePassed: boolean = false) => @@ -66,9 +66,9 @@ export const INBOX_STATUS: { }, { key: "accepted", - title: "inbox_issue.status.accepted.title", + i18n_title: "inbox_issue.status.accepted.title", status: EInboxIssueStatus.ACCEPTED, - description: () => `inbox_issue.status.accepted.description`, + i18n_description: () => `inbox_issue.status.accepted.description`, textColor: (snoozeDatePassed: boolean = false) => snoozeDatePassed ? "" : "text-[#3E9B4F]", bgColor: (snoozeDatePassed: boolean = false) => @@ -76,9 +76,9 @@ export const INBOX_STATUS: { }, { key: "duplicate", - title: "inbox_issue.status.duplicate.title", + i18n_title: "inbox_issue.status.duplicate.title", status: EInboxIssueStatus.DUPLICATE, - description: () => `inbox_issue.status.duplicate.description`, + i18n_description: () => `inbox_issue.status.duplicate.description`, textColor: (snoozeDatePassed: boolean = false) => snoozeDatePassed ? "" : "text-custom-text-200", bgColor: (snoozeDatePassed: boolean = false) => @@ -86,30 +86,28 @@ export const INBOX_STATUS: { }, ]; -export const INBOX_ISSUE_SOURCE = "inbox_issue.source.in-app"; - export const INBOX_ISSUE_ORDER_BY_OPTIONS = [ { key: "issue__created_at", - label: "inbox_issue.order_by.created_at", + i18n_label: "inbox_issue.order_by.created_at", }, { key: "issue__updated_at", - label: "inbox_issue.order_by.updated_at", + i18n_label: "inbox_issue.order_by.updated_at", }, { key: "issue__sequence_id", - label: "inbox_issue.order_by.id", + i18n_label: "inbox_issue.order_by.id", }, ]; export const INBOX_ISSUE_SORT_BY_OPTIONS = [ { key: "asc", - label: "common.sort.asc", + i18n_label: "common.sort.asc", }, { key: "desc", - label: "common.sort.desc", + i18n_label: "common.sort.desc", }, ]; diff --git a/web/core/components/inbox/inbox-filter/applied-filters/status.tsx b/web/core/components/inbox/inbox-filter/applied-filters/status.tsx index e3ba761f5d8..257667e03df 100644 --- a/web/core/components/inbox/inbox-filter/applied-filters/status.tsx +++ b/web/core/components/inbox/inbox-filter/applied-filters/status.tsx @@ -32,7 +32,7 @@ export const InboxIssueAppliedFiltersStatus: FC = observer(() => {
-
{t(optionDetail?.title)}
+
{t(optionDetail?.i18n_title)}
{handleFilterValue(optionDetail?.status).length >= 1 && (
= observer((props) => { isChecked={filterValue?.includes(status.status) ? true : false} onClick={() => handleStatusFilterSelect(status.status)} icon={} - title={t(status.title)} + title={t(status.i18n_title)} /> )) ) : ( diff --git a/web/core/components/inbox/inbox-filter/sorting/order-by.tsx b/web/core/components/inbox/inbox-filter/sorting/order-by.tsx index e1412e0c713..d3dabbf8633 100644 --- a/web/core/components/inbox/inbox-filter/sorting/order-by.tsx +++ b/web/core/components/inbox/inbox-filter/sorting/order-by.tsx @@ -34,7 +34,7 @@ export const InboxIssueOrderByDropdown: FC = observer(() => { ) : ( )} - {t(orderByDetails?.label || "inbox_issue.order_by.created_at")} + {t(orderByDetails?.i18n_label || "inbox_issue.order_by.created_at")}
); @@ -51,7 +51,7 @@ export const InboxIssueOrderByDropdown: FC = observer(() => { className="flex items-center justify-between gap-2" onClick={() => handleInboxIssueSorting("order_by", option.key as TInboxIssueSortingOrderByKeys)} > - {t(option.label)} + {t(option.i18n_label)} {inboxSorting?.order_by?.includes(option.key) && } ))} @@ -62,7 +62,7 @@ export const InboxIssueOrderByDropdown: FC = observer(() => { className="flex items-center justify-between gap-2" onClick={() => handleInboxIssueSorting("sort_by", option.key as TInboxIssueSortingSortByKeys)} > - {t(option.label)} + {t(option.i18n_label)} {inboxSorting?.sort_by?.includes(option.key) && } ))} diff --git a/web/core/components/inbox/inbox-issue-status.tsx b/web/core/components/inbox/inbox-issue-status.tsx index 96d46025cd5..bb166a8c949 100644 --- a/web/core/components/inbox/inbox-issue-status.tsx +++ b/web/core/components/inbox/inbox-issue-status.tsx @@ -26,7 +26,7 @@ export const InboxIssueStatus: React.FC = observer((props) => { const isSnoozedDatePassed = inboxIssue.status === 0 && new Date(inboxIssue.snoozed_till ?? "") < new Date(); if (!inboxIssueStatusDetail || isSnoozedDatePassed) return <>; - const description = t(inboxIssueStatusDetail.description(), { + const description = t(inboxIssueStatusDetail.i18n_description(), { days: findHowManyDaysLeft(new Date(inboxIssue.snoozed_till ?? "")), }); @@ -41,7 +41,7 @@ export const InboxIssueStatus: React.FC = observer((props) => {
- {inboxIssue?.status === 0 && inboxIssue?.snoozed_till ? description : t(inboxIssueStatusDetail.title)} + {inboxIssue?.status === 0 && inboxIssue?.snoozed_till ? description : t(inboxIssueStatusDetail.i18n_title)}
{showDescription &&
{description}
}