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,
|
||||
description: [activityTypeView(item).name, party].filter(Boolean).join(' · '),
|
||||
amount: null,
|
||||
date: item.dueAt ? formatRelativeDayLabel(item.dueAt) : 'بدون موعد',
|
||||
date:
|
||||
item.status === 'done'
|
||||
? 'انجام شده'
|
||||
: item.dueAt
|
||||
? formatRelativeDayLabel(item.dueAt)
|
||||
: 'بدون موعد',
|
||||
dateIso: item.dueAt ?? undefined,
|
||||
initials: initialsFromTitle(party || item.title),
|
||||
stageId,
|
||||
@@ -152,6 +157,7 @@ function toCard(item: ActivityDto, stageId: string): PipelineDeal {
|
||||
ownerId: item.assignee?.id ?? null,
|
||||
assigneeIds: (item.assignees ?? []).map((a) => a.id),
|
||||
priority: item.priority,
|
||||
activityStatus: item.status,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -103,9 +103,11 @@ function onTitleClick() {
|
||||
else emit('open', props.deal.id);
|
||||
}
|
||||
|
||||
/** موعد: عقبافتاده قرمز · امروز سبز · آینده خاکستری */
|
||||
const dueTone = computed<'overdue' | 'today' | 'upcoming' | 'none'>(() => {
|
||||
if (!props.copy.quickView || !props.deal.dateIso) return 'none';
|
||||
/** موعد: انجامشده سبز · عقبافتاده قرمز · امروز زرد · آینده خاکستری */
|
||||
const dueTone = computed<'done' | 'overdue' | 'today' | 'upcoming' | '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);
|
||||
if (Number.isNaN(due.getTime())) return 'none';
|
||||
const days = calendarDaysBetween(new Date(), due);
|
||||
@@ -115,8 +117,9 @@ const dueTone = computed<'overdue' | 'today' | 'upcoming' | 'none'>(() => {
|
||||
});
|
||||
|
||||
const dueToneColor = computed(() => {
|
||||
if (dueTone.value === 'done') return token.value.colorSuccess;
|
||||
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;
|
||||
});
|
||||
|
||||
@@ -283,7 +286,13 @@ const cardStyle = computed(() => ({
|
||||
+{{ extraAssignees }}
|
||||
</a-tag>
|
||||
<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' }" />
|
||||
{{ deal.date }}
|
||||
</a-typography-text>
|
||||
|
||||
Reference in New Issue
Block a user