diff --git a/apps/app/components/core/filters/issues-view-filter.tsx b/apps/app/components/core/filters/issues-view-filter.tsx index 4452bfb61..67b2423ec 100644 --- a/apps/app/components/core/filters/issues-view-filter.tsx +++ b/apps/app/components/core/filters/issues-view-filter.tsx @@ -270,9 +270,16 @@ export const IssuesFilterView: React.FC = () => { if (key === "estimate" && !isEstimateActive) return null; if ( - (issueView === "spreadsheet" && key === "attachment_count") || - (issueView === "spreadsheet" && key === "link") || - (issueView === "spreadsheet" && key === "sub_issue_count") + issueView === "spreadsheet" && + (key === "attachment_count" || + key === "link" || + key === "sub_issue_count") + ) + return null; + + if ( + issueView !== "spreadsheet" && + (key === "created_on" || key === "updated_on") ) return null; diff --git a/apps/app/components/core/spreadsheet-view/single-issue.tsx b/apps/app/components/core/spreadsheet-view/single-issue.tsx index ada1e3689..579dcb698 100644 --- a/apps/app/components/core/spreadsheet-view/single-issue.tsx +++ b/apps/app/components/core/spreadsheet-view/single-issue.tsx @@ -42,6 +42,7 @@ import { import { ICurrentUserResponse, IIssue, ISubIssueResponse, Properties, UserAuth } from "types"; // helper import { copyTextToClipboard } from "helpers/string.helper"; +import { renderLongDetailDateFormat } from "helpers/date-time.helper"; type Props = { issue: IIssue; @@ -345,6 +346,16 @@ export const SingleSpreadsheetIssue: React.FC<Props> = ({ /> </div> )} + {properties.created_on && ( + <div className="flex items-center text-xs cursor-default text-brand-secondary text-center p-2 group-hover:bg-brand-surface-2 border-brand-base"> + {renderLongDetailDateFormat(issue.created_at)} + </div> + )} + {properties.updated_on && ( + <div className="flex items-center text-xs cursor-default text-brand-secondary text-center p-2 group-hover:bg-brand-surface-2 border-brand-base"> + {renderLongDetailDateFormat(issue.updated_at)} + </div> + )} </div> ); }; diff --git a/apps/app/components/core/spreadsheet-view/spreadsheet-columns.tsx b/apps/app/components/core/spreadsheet-view/spreadsheet-columns.tsx index a0f404fba..b05a5e82b 100644 --- a/apps/app/components/core/spreadsheet-view/spreadsheet-columns.tsx +++ b/apps/app/components/core/spreadsheet-view/spreadsheet-columns.tsx @@ -123,7 +123,9 @@ export const SpreadsheetColumns: React.FC<Props> = ({ columnData, gridTemplateCo <Icon iconName="east" className="text-sm" /> <span>Z</span> </> - ) : col.propertyName === "due_date" ? ( + ) : col.propertyName === "due_date" || + col.propertyName === "created_on" || + col.propertyName === "updated_on" ? ( <> <span className="relative flex items-center h-6 w-6"> <Icon diff --git a/apps/app/constants/spreadsheet.ts b/apps/app/constants/spreadsheet.ts index b55cbdb23..371fb50a3 100644 --- a/apps/app/constants/spreadsheet.ts +++ b/apps/app/constants/spreadsheet.ts @@ -59,4 +59,20 @@ export const SPREADSHEET_COLUMN = [ ascendingOrder: "estimate_point", descendingOrder: "-estimate_point", }, + { + propertyName: "created_on", + colName: "Created On", + colSize: "144px", + icon: CalendarDaysIcon, + ascendingOrder: "-created_at", + descendingOrder: "created_at", + }, + { + propertyName: "updated_on", + colName: "Updated On", + colSize: "144px", + icon: CalendarDaysIcon, + ascendingOrder: "-updated_at", + descendingOrder: "updated_at", + }, ]; diff --git a/apps/app/helpers/date-time.helper.ts b/apps/app/helpers/date-time.helper.ts index ac49dc3ed..b513b38da 100644 --- a/apps/app/helpers/date-time.helper.ts +++ b/apps/app/helpers/date-time.helper.ts @@ -18,6 +18,13 @@ export const renderShortNumericDateFormat = (date: string | Date) => month: "short", }); +export const renderLongDetailDateFormat = (date: string | Date) => + new Date(date).toLocaleDateString("en-UK", { + day: "numeric", + month: "long", + year: "numeric", + }); + export const findHowManyDaysLeft = (date: string | Date) => { const today = new Date(); const eventDate = new Date(date); diff --git a/apps/app/hooks/use-issue-properties.tsx b/apps/app/hooks/use-issue-properties.tsx index 163dcdcd2..443adf4f0 100644 --- a/apps/app/hooks/use-issue-properties.tsx +++ b/apps/app/hooks/use-issue-properties.tsx @@ -18,6 +18,8 @@ const initialValues: Properties = { attachment_count: false, link: false, estimate: false, + created_on: false, + updated_on: false, }; const useIssuesProperties = (workspaceSlug?: string, projectId?: string) => { @@ -96,6 +98,8 @@ const useIssuesProperties = (workspaceSlug?: string, projectId?: string) => { attachment_count: properties.attachment_count, link: properties.link, estimate: properties.estimate, + created_on: properties.created_on, + updated_on: properties.updated_on, }; return [newProperties, updateIssueProperties] as const; diff --git a/apps/app/hooks/use-my-issues-filter.tsx b/apps/app/hooks/use-my-issues-filter.tsx index 8c5d3eaa5..46554aa43 100644 --- a/apps/app/hooks/use-my-issues-filter.tsx +++ b/apps/app/hooks/use-my-issues-filter.tsx @@ -19,6 +19,8 @@ const initialValues: Properties = { attachment_count: false, link: false, estimate: false, + created_on: false, + updated_on: false, }; const useMyIssuesProperties = (workspaceSlug?: string) => { @@ -92,6 +94,8 @@ const useMyIssuesProperties = (workspaceSlug?: string) => { attachment_count: properties.attachment_count, link: properties.link, estimate: properties.estimate, + created_on: properties.created_on, + updated_on: properties.updated_on, }; return [newProperties, updateIssueProperties] as const; diff --git a/apps/app/types/issues.d.ts b/apps/app/types/issues.d.ts index aac0ec4eb..0792bcd6d 100644 --- a/apps/app/types/issues.d.ts +++ b/apps/app/types/issues.d.ts @@ -188,6 +188,8 @@ export type Properties = { link: boolean; attachment_count: boolean; estimate: boolean; + created_on: boolean; + updated_on: boolean; }; export interface IIssueLabels { diff --git a/apps/app/types/workspace.d.ts b/apps/app/types/workspace.d.ts index ee0458bfe..6d468c637 100644 --- a/apps/app/types/workspace.d.ts +++ b/apps/app/types/workspace.d.ts @@ -45,6 +45,8 @@ export type Properties = { link: boolean; attachment_count: boolean; estimate: boolean; + created_on: boolean; + updated_on: boolean; }; export interface IWorkspaceMember {