Skip to content
Open
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ export function buildBudgetTrackingCsv(result: BudgetTrackingResult): string {
}

function csvEscape(value: string): string {
const text = sanitizeCsvFormulaValue(decodeHtmlEntities(value));
// Values are already decoded in the series row mapper; do not decode again.
const text = sanitizeCsvFormulaValue(value);
if (/[",\n\r]/.test(text)) {
return `"${text.replace(/"/g, '""')}"`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,8 @@ export function buildPlannedVsActualMilestonesCsv(
}

function csvEscape(value: string): string {
const text = sanitizeCsvFormulaValue(decodeHtmlEntities(value));
// Values are already decoded in the series row mapper; do not decode again.
const text = sanitizeCsvFormulaValue(value);
if (/[",\n\r]/.test(text)) {
return `"${text.replace(/"/g, '""')}"`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ export function buildPlannedVsActualTasksCsv(result: PlannedVsActualTasksResult)
}

function csvEscape(value: string): string {
const text = sanitizeCsvFormulaValue(decodeHtmlEntities(value));
// Values are already decoded in the series row mapper; do not decode again.
const text = sanitizeCsvFormulaValue(value);
if (/[",\n\r]/.test(text)) {
return `"${text.replace(/"/g, '""')}"`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,8 @@ export function buildProjectHealthCsv(result: ProjectHealthResult): string {
}

function csvEscape(value: string): string {
const text = sanitizeCsvFormulaValue(decodeHtmlEntities(value));
// Values are already decoded in the series row mapper; do not decode again.
const text = sanitizeCsvFormulaValue(value);
if (/[",\n\r]/.test(text)) {
return `"${text.replace(/"/g, '""')}"`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,8 @@ export function buildTimeReportCsv(result: TimeReportResult): string {
}

function csvEscape(value: string): string {
const text = sanitizeCsvFormulaValue(decodeHtmlEntities(value));
// Values are already decoded in the series row mapper; do not decode again.
const text = sanitizeCsvFormulaValue(value);
if (/[",\n\r]/.test(text)) {
return `"${text.replace(/"/g, '""')}"`;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { teamMembersApiService } from '@/api/team-members/teamMembers.api.servic
import { ITeamMemberViewModel } from '@/types/teamMembers/teamMembersGetResponse.types';
import { IRecurringMode, ITaskRecurring } from '@/types/tasks/task-recurring-schedule';
import PlannerMultiFilterDropdown from '@/features/schedule/PlannerMultiFilterDropdown';
import { decodeHtmlEntities } from '@/utils/html-entities';

export interface RecurringTasksFiltersValue {
projectIds?: string[];
Expand Down Expand Up @@ -48,12 +49,12 @@ export const RecurringTasksFilters: React.FC<RecurringTasksFiltersProps> = ({

const projectOptions = (projectsData?.body?.data || []).map(p => ({
value: p.id as string,
label: (p.name || p.id || '') as string,
label: decodeHtmlEntities((p.name || p.id || '') as string),
}));

const memberOptions = members.map(m => ({
value: m.id as string,
label: (m.name || m.email || m.id || '') as string,
label: decodeHtmlEntities((m.name || m.email || m.id || '') as string),
}));

const recurTypeOptions = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,11 @@ export const RecurringTasksTable: React.FC<RecurringTasksTableProps> = ({
);

const priorityFilterOptions = useMemo(
() => priorities.map(p => ({ text: p.name || '', value: p.id || '' })),
() =>
priorities.map(p => ({
text: decodeHtmlEntities(p.name || ''),
value: p.id || '',
})),
[priorities]
);

Expand Down Expand Up @@ -306,7 +310,7 @@ export const RecurringTasksTable: React.FC<RecurringTasksTableProps> = ({
members={assignees.map(assignee => ({
id: assignee.team_member_id,
team_member_id: assignee.team_member_id,
name: assignee.name,
name: decodeHtmlEntities(assignee.name),
avatar_url: assignee.avatar_url,
}))}
maxCount={3}
Expand Down Expand Up @@ -381,7 +385,7 @@ export const RecurringTasksTable: React.FC<RecurringTasksTableProps> = ({
color: '#fff',
}}
>
{record.priority_name}
{decodeHtmlEntities(record.priority_name)}
</span>
);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ import {
chartToPngDataUrl,
chartToSvgMarkup,
} from '@/lib/reporting/chart-export';
import {
analyticsDisplayText,
shortAnalyticsLabel,
} from '@/lib/reporting/analytics-display-text';
import { shortAnalyticsLabel } from '@/lib/reporting/analytics-display-text';
import { InChartEmptyState } from '../states/ReportStateViews';
import type { BudgetTrackingRow } from '@/types/reporting/analytics-budget-tracking.types';

Expand Down Expand Up @@ -113,7 +110,8 @@ export const BudgetTrackingChart = forwardRef<
callbacks: {
title: items => {
const index = items[0]?.dataIndex ?? 0;
return analyticsDisplayText(chartProjects[index]?.project_name);
// Series names are already decoded by the analytics API.
return chartProjects[index]?.project_name ?? '';
},
label: item => {
const label = item.dataset.label ?? '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Flex, Table, Tag, Typography, theme } from '@/shared/antd-imports';
import type { ColumnsType } from 'antd/es/table';
import { useTranslation } from 'react-i18next';
import { getClientTablePagination } from '@/lib/reporting/analytics-table-pagination';
import { analyticsDisplayText } from '@/lib/reporting/analytics-display-text';
import type {
BudgetAlert,
BudgetTrackingRow,
Expand Down Expand Up @@ -50,10 +49,8 @@ export const BudgetTrackingTable: React.FC<BudgetTrackingTableProps> = ({
key: 'project_name',
width: 200,
ellipsis: true,
sorter: (a, b) =>
analyticsDisplayText(a.project_name).localeCompare(
analyticsDisplayText(b.project_name)
),
// Series names are already decoded by the analytics API.
sorter: (a, b) => a.project_name.localeCompare(b.project_name),
render: (name: string, record) => (
<Flex align="center" gap={8}>
<span
Expand All @@ -65,7 +62,7 @@ export const BudgetTrackingTable: React.FC<BudgetTrackingTableProps> = ({
flexShrink: 0,
}}
/>
<Text strong>{analyticsDisplayText(name)}</Text>
<Text strong>{name}</Text>
</Flex>
),
},
Expand All @@ -76,15 +73,9 @@ export const BudgetTrackingTable: React.FC<BudgetTrackingTableProps> = ({
width: 150,
ellipsis: true,
sorter: (a, b) =>
analyticsDisplayText(a.client_name).localeCompare(
analyticsDisplayText(b.client_name)
),
(a.client_name || '').localeCompare(b.client_name || ''),
render: (value: string | null) =>
value ? (
<Text>{analyticsDisplayText(value)}</Text>
) : (
<Text type="secondary">—</Text>
),
value ? <Text>{value}</Text> : <Text type="secondary">—</Text>,
},
{
title: t('btColBudget', { defaultValue: 'Budget' }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ import {
chartToPngDataUrl,
chartToSvgMarkup,
} from '@/lib/reporting/chart-export';
import {
analyticsDisplayText,
shortAnalyticsLabel,
} from '@/lib/reporting/analytics-display-text';
import { shortAnalyticsLabel } from '@/lib/reporting/analytics-display-text';
import { InChartEmptyState } from '../states/ReportStateViews';
import type { PlannedVsActualMilestonesRow } from '@/types/reporting/analytics-planned-vs-actual-milestones.types';

Expand Down Expand Up @@ -96,7 +93,8 @@ export const PvaMilestonesChart = forwardRef<PvaMilestonesChartHandle, PvaMilest
const index = items[0]?.dataIndex ?? 0;
const row = milestones[index];
if (!row) return '';
return `${analyticsDisplayText(row.milestone_name)} · ${analyticsDisplayText(row.project_name)}`;
// Series names are already decoded by the analytics API.
return `${row.milestone_name} · ${row.project_name}`;
},
label: item => {
const value = Number(item.raw ?? 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import type { ColumnsType } from 'antd/es/table';
import { useTranslation } from 'react-i18next';
import dayjs from 'dayjs';
import { getClientTablePagination } from '@/lib/reporting/analytics-table-pagination';
import { analyticsDisplayText } from '@/lib/reporting/analytics-display-text';
import type { PlannedVsActualMilestonesRow } from '@/types/reporting/analytics-planned-vs-actual-milestones.types';

const { Text } = Typography;
Expand Down Expand Up @@ -44,14 +43,10 @@ export const PvaMilestonesTable: React.FC<PvaMilestonesTableProps> = ({
key: 'milestone_name',
width: 250,
ellipsis: true,
sorter: (a, b) =>
analyticsDisplayText(a.milestone_name).localeCompare(
analyticsDisplayText(b.milestone_name)
),
// Series names are already decoded by the analytics API.
sorter: (a, b) => a.milestone_name.localeCompare(b.milestone_name),
render: (name: string) => (
<Text ellipsis={{ tooltip: analyticsDisplayText(name) }}>
{analyticsDisplayText(name)}
</Text>
<Text ellipsis={{ tooltip: name }}>{name}</Text>
),
},
{
Expand All @@ -60,14 +55,9 @@ export const PvaMilestonesTable: React.FC<PvaMilestonesTableProps> = ({
key: 'project_name',
width: 250,
ellipsis: true,
sorter: (a, b) =>
analyticsDisplayText(a.project_name).localeCompare(
analyticsDisplayText(b.project_name)
),
sorter: (a, b) => a.project_name.localeCompare(b.project_name),
render: (name: string) => (
<Text ellipsis={{ tooltip: analyticsDisplayText(name) }}>
{analyticsDisplayText(name)}
</Text>
<Text ellipsis={{ tooltip: name }}>{name}</Text>
),
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ import {
chartToPngDataUrl,
chartToSvgMarkup,
} from '@/lib/reporting/chart-export';
import {
analyticsDisplayText,
shortAnalyticsLabel,
} from '@/lib/reporting/analytics-display-text';
import { shortAnalyticsLabel } from '@/lib/reporting/analytics-display-text';
import { InChartEmptyState } from '../states/ReportStateViews';
import type { PlannedVsActualTasksRow } from '@/types/reporting/analytics-planned-vs-actual-tasks.types';

Expand Down Expand Up @@ -110,7 +107,8 @@ export const PvaTasksChart = forwardRef<PvaTasksChartHandle, PvaTasksChartProps>
callbacks: {
title: items => {
const index = items[0]?.dataIndex ?? 0;
return analyticsDisplayText(projects[index]?.project_name);
// Series names are already decoded by the analytics API.
return projects[index]?.project_name ?? '';
},
label: item => {
const label = item.dataset.label ?? '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { Table, Typography, theme } from '@/shared/antd-imports';
import type { ColumnsType } from 'antd/es/table';
import { useTranslation } from 'react-i18next';
import { getClientTablePagination } from '@/lib/reporting/analytics-table-pagination';
import { analyticsDisplayText } from '@/lib/reporting/analytics-display-text';
import type { PlannedVsActualTasksRow } from '@/types/reporting/analytics-planned-vs-actual-tasks.types';

const { Text } = Typography;
Expand All @@ -30,14 +29,10 @@ export const PvaTasksTable: React.FC<PvaTasksTableProps> = ({ projects, loading
key: 'project_name',
width: 200,
ellipsis: true,
sorter: (a, b) =>
analyticsDisplayText(a.project_name).localeCompare(
analyticsDisplayText(b.project_name)
),
// Series names are already decoded by the analytics API.
sorter: (a, b) => a.project_name.localeCompare(b.project_name),
render: (name: string) => (
<Text ellipsis={{ tooltip: analyticsDisplayText(name) }}>
{analyticsDisplayText(name)}
</Text>
<Text ellipsis={{ tooltip: name }}>{name}</Text>
),
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ import {
chartToPngDataUrl,
chartToSvgMarkup,
} from '@/lib/reporting/chart-export';
import {
analyticsDisplayText,
shortAnalyticsLabel,
} from '@/lib/reporting/analytics-display-text';
import { shortAnalyticsLabel } from '@/lib/reporting/analytics-display-text';
import { InChartEmptyState } from '../states/ReportStateViews';
import type { ProjectHealthRow } from '@/types/reporting/analytics-project-health.types';

Expand Down Expand Up @@ -101,7 +98,8 @@ export const ProjectHealthChart = forwardRef<ProjectHealthChartHandle, ProjectHe
callbacks: {
title: items => {
const index = items[0]?.dataIndex ?? 0;
return analyticsDisplayText(projects[index]?.project_name);
// Series names are already decoded by the analytics API.
return projects[index]?.project_name ?? '';
},
label: item => {
const label = item.dataset.label ?? '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type {
DeliveryConfidenceStatus,
ProjectHealthRow,
} from '@/types/reporting/analytics-project-health.types';
import { decodeHtmlEntities } from '@/utils/html-entities';
import { MetricCalcHint } from '../MetricCalcHint';
import { PROJECT_HEALTH_TONE_COLORS } from './project-health-colors';

Expand Down Expand Up @@ -108,7 +107,7 @@ export const ProjectHealthTable: React.FC<ProjectHealthTableProps> = ({
}}
/>
<Text strong ellipsis style={{ color: token.colorText }}>
{decodeHtmlEntities(name)}
{name}
</Text>
</Flex>
);
Expand Down Expand Up @@ -146,9 +145,9 @@ export const ProjectHealthTable: React.FC<ProjectHealthTableProps> = ({
type="secondary"
ellipsis
style={{ fontSize: 12, maxWidth: '100%' }}
title={decodeHtmlEntities(note)}
title={note}
>
{decodeHtmlEntities(note)}
{note}
</Text>
) : null}
</Flex>
Expand Down Expand Up @@ -256,7 +255,7 @@ export const ProjectHealthTable: React.FC<ProjectHealthTableProps> = ({
ellipsis: true,
render: (value: string | null) =>
value ? (
<Text ellipsis>{decodeHtmlEntities(value)}</Text>
<Text ellipsis>{value}</Text>
) : (
<Text type="secondary">-</Text>
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ import {
chartToPngDataUrl,
chartToSvgMarkup,
} from '@/lib/reporting/chart-export';
import {
analyticsDisplayText,
shortAnalyticsLabel,
} from '@/lib/reporting/analytics-display-text';
import { shortAnalyticsLabel } from '@/lib/reporting/analytics-display-text';
import { InChartEmptyState } from '../states/ReportStateViews';
import type { TimeReportProjectSeries } from '@/types/reporting/analytics-time-report.types';

Expand Down Expand Up @@ -104,7 +101,8 @@ export const TimeReportChart = forwardRef<TimeReportChartHandle, TimeReportChart
callbacks: {
title: items => {
const index = items[0]?.dataIndex ?? 0;
return analyticsDisplayText(projects[index]?.project_name);
// Series names are already decoded by the analytics API.
return projects[index]?.project_name ?? '';
},
label: item => {
const label = item.dataset.label ?? '';
Expand Down
Loading
Loading