Clarify activity card due tones: overdue as عقب افتاده, done as انجام شده, and today in warning yellow.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -142,7 +142,12 @@ function toCard(item: ActivityDto, stageId: string): PipelineDeal {
|
|||||||
title: item.title,
|
title: item.title,
|
||||||
description: [activityTypeView(item).name, party].filter(Boolean).join(' · '),
|
description: [activityTypeView(item).name, party].filter(Boolean).join(' · '),
|
||||||
amount: null,
|
amount: null,
|
||||||
date: item.dueAt ? formatRelativeDayLabel(item.dueAt) : 'بدون موعد',
|
date:
|
||||||
|
item.status === 'done'
|
||||||
|
? 'انجام شده'
|
||||||
|
: item.dueAt
|
||||||
|
? formatRelativeDayLabel(item.dueAt)
|
||||||
|
: 'بدون موعد',
|
||||||
dateIso: item.dueAt ?? undefined,
|
dateIso: item.dueAt ?? undefined,
|
||||||
initials: initialsFromTitle(party || item.title),
|
initials: initialsFromTitle(party || item.title),
|
||||||
stageId,
|
stageId,
|
||||||
@@ -152,6 +157,7 @@ function toCard(item: ActivityDto, stageId: string): PipelineDeal {
|
|||||||
ownerId: item.assignee?.id ?? null,
|
ownerId: item.assignee?.id ?? null,
|
||||||
assigneeIds: (item.assignees ?? []).map((a) => a.id),
|
assigneeIds: (item.assignees ?? []).map((a) => a.id),
|
||||||
priority: item.priority,
|
priority: item.priority,
|
||||||
|
activityStatus: item.status,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -103,9 +103,11 @@ function onTitleClick() {
|
|||||||
else emit('open', props.deal.id);
|
else emit('open', props.deal.id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** موعد: عقبافتاده قرمز · امروز سبز · آینده خاکستری */
|
/** موعد: انجامشده سبز · عقبافتاده قرمز · امروز زرد · آینده خاکستری */
|
||||||
const dueTone = computed<'overdue' | 'today' | 'upcoming' | 'none'>(() => {
|
const dueTone = computed<'done' | 'overdue' | 'today' | 'upcoming' | 'none'>(() => {
|
||||||
if (!props.copy.quickView || !props.deal.dateIso) return 'none';
|
if (!props.copy.quickView) return 'none';
|
||||||
|
if (props.deal.activityStatus === 'done') return 'done';
|
||||||
|
if (!props.deal.dateIso) return 'none';
|
||||||
const due = new Date(props.deal.dateIso);
|
const due = new Date(props.deal.dateIso);
|
||||||
if (Number.isNaN(due.getTime())) return 'none';
|
if (Number.isNaN(due.getTime())) return 'none';
|
||||||
const days = calendarDaysBetween(new Date(), due);
|
const days = calendarDaysBetween(new Date(), due);
|
||||||
@@ -115,8 +117,9 @@ const dueTone = computed<'overdue' | 'today' | 'upcoming' | 'none'>(() => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const dueToneColor = computed(() => {
|
const dueToneColor = computed(() => {
|
||||||
|
if (dueTone.value === 'done') return token.value.colorSuccess;
|
||||||
if (dueTone.value === 'overdue') return token.value.colorError;
|
if (dueTone.value === 'overdue') return token.value.colorError;
|
||||||
if (dueTone.value === 'today') return token.value.colorSuccess;
|
if (dueTone.value === 'today') return token.value.colorWarning;
|
||||||
return token.value.colorTextSecondary;
|
return token.value.colorTextSecondary;
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -283,7 +286,13 @@ const cardStyle = computed(() => ({
|
|||||||
+{{ extraAssignees }}
|
+{{ extraAssignees }}
|
||||||
</a-tag>
|
</a-tag>
|
||||||
<a-tooltip :title="dateHint">
|
<a-tooltip :title="dateHint">
|
||||||
<a-typography-text type="secondary" :style="{ fontSize: `${token.fontSizeSM}px` }">
|
<a-typography-text
|
||||||
|
:type="dueTone === 'none' ? 'secondary' : undefined"
|
||||||
|
:style="{
|
||||||
|
fontSize: `${token.fontSizeSM}px`,
|
||||||
|
color: dueTone !== 'none' ? dueToneColor : undefined,
|
||||||
|
}"
|
||||||
|
>
|
||||||
<CalendarOutlined :style="{ marginInlineEnd: '4px' }" />
|
<CalendarOutlined :style="{ marginInlineEnd: '4px' }" />
|
||||||
{{ deal.date }}
|
{{ deal.date }}
|
||||||
</a-typography-text>
|
</a-typography-text>
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ export function formatRelativeContact(iso: string | null | undefined): string {
|
|||||||
return `${toFaDigits(days)} روز پیش`;
|
return `${toFaDigits(days)} روز پیش`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** تاریخ نسبی تقویمی برای کارتها: امروز / ۳ روز پیش / ۵ روز مانده */
|
/** تاریخ نسبی تقویمی برای کارتها: امروز / ۳ روز عقب افتاده / ۵ روز مانده */
|
||||||
export function formatRelativeDayLabel(iso: string | null | undefined): string {
|
export function formatRelativeDayLabel(iso: string | null | undefined): string {
|
||||||
if (!iso) return '—';
|
if (!iso) return '—';
|
||||||
const d = new Date(iso);
|
const d = new Date(iso);
|
||||||
@@ -234,7 +234,7 @@ export function formatRelativeDayLabel(iso: string | null | undefined): string {
|
|||||||
const daysAhead = calendarDaysBetween(new Date(), d);
|
const daysAhead = calendarDaysBetween(new Date(), d);
|
||||||
if (daysAhead === 0) return 'امروز';
|
if (daysAhead === 0) return 'امروز';
|
||||||
if (daysAhead > 0) return `${toFaDigits(daysAhead)} روز مانده`;
|
if (daysAhead > 0) return `${toFaDigits(daysAhead)} روز مانده`;
|
||||||
return `${toFaDigits(-daysAhead)} روز پیش`;
|
return `${toFaDigits(-daysAhead)} روز عقب افتاده`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** فعالیت بعدی: امروز ۱۶:۳۰ / فردا ۱۰:۰۰ / ۲۴ مرداد ۱۱:۲۰ */
|
/** فعالیت بعدی: امروز ۱۶:۳۰ / فردا ۱۰:۰۰ / ۲۴ مرداد ۱۱:۲۰ */
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { currencySuffix } from '@/lib/money';
|
|||||||
import { matchesSearch } from '@/lib/search';
|
import { matchesSearch } from '@/lib/search';
|
||||||
import type {
|
import type {
|
||||||
ActivityPriority,
|
ActivityPriority,
|
||||||
|
ActivityStatus,
|
||||||
DealActivityCue,
|
DealActivityCue,
|
||||||
DealActivitySummaryDto,
|
DealActivitySummaryDto,
|
||||||
} from '@mento/shared';
|
} from '@mento/shared';
|
||||||
@@ -32,6 +33,8 @@ export type PipelineDeal = {
|
|||||||
searchFields?: Array<string | null | undefined>;
|
searchFields?: Array<string | null | undefined>;
|
||||||
/** اولویت فعالیت؛ فقط روی کارت فعالیت نشان داده میشود */
|
/** اولویت فعالیت؛ فقط روی کارت فعالیت نشان داده میشود */
|
||||||
priority?: ActivityPriority;
|
priority?: ActivityPriority;
|
||||||
|
/** وضعیت فعالیت (برای کارت کانبان فعالیت: انجامشده و …) */
|
||||||
|
activityStatus?: ActivityStatus;
|
||||||
/** نشانگر وضعیت فعالیت معامله روی دکمهٔ تقویم */
|
/** نشانگر وضعیت فعالیت معامله روی دکمهٔ تقویم */
|
||||||
activityCue?: DealActivityCue;
|
activityCue?: DealActivityCue;
|
||||||
/** خلاصه فعالیتها برای پاپآپ دکمهٔ تقویم */
|
/** خلاصه فعالیتها برای پاپآپ دکمهٔ تقویم */
|
||||||
|
|||||||
Reference in New Issue
Block a user