refactor(planning): remove the original decision trace
CI / policy (push) Successful in 7s
CI / validate (push) Successful in 1m15s
CI / test (push) Successful in 3m18s
CI / benchmark (push) Failing after 5m53s
CI / build (push) Successful in 1m23s
CI / security (push) Successful in 7m6s
CI / policy (pull_request) Successful in 7s
CI / validate (pull_request) Successful in 1m9s
CI / build (pull_request) Successful in 43s
CI / test (pull_request) Successful in 3m19s
CI / images (push) Successful in 3m7s
CI / required (push) Successful in 2s
CI / benchmark (pull_request) Failing after 5m28s
CI / security (pull_request) Successful in 6m37s
CI / images (pull_request) Successful in 3m18s
CI / required (pull_request) Successful in 1s

This commit is contained in:
nessar committed 2026-10-15 20:42:33 +02:00
1 parent ea4256107f
commit d9d9befa12
43 files changed
+729 -8880

No files matched your search

@@ -15,16 +15,6 @@ import { TranslationService } from '../../services/translation-service';
import { isWorkingPlanningDate } from '../../services/declared-non-working-days';
import type { LeaveType } from '../../services/leave-planner.service';
export interface CalendarDayStatus {
kind: 'eligible' | 'ineligible' | 'chosen' | 'evaluated-rejected' | 'pruned' | 'not-examined';
label: string;
reason?: string;
hypotheticalLabel?: string;
hypotheticalReason?: string;
change?: 'added' | 'moved-from' | 'moved-to' | 'removed' | 'shared' | 'unchanged';
changeLabel?: string;
}
export interface DeclarationPreview {
dates: ReadonlySet<string>;
type: LeaveType | null;
@@ -112,9 +102,6 @@ export class CalendarMonth implements OnInit {
@Input()
explainedPeriod?: { start: string; end: string };
@Input()
dateStatuses: Readonly<Record<string, CalendarDayStatus>> = {};
@Output()
readonly dateSelected = new EventEmitter<string>();
@@ -134,10 +121,6 @@ export class CalendarMonth implements OnInit {
);
}
getStatus(day: Date): CalendarDayStatus | undefined {
return this.dateStatuses[this.getDateKey(day)];
}
isInExplainedPeriod(day: Date): boolean {
const date = this.getDateKey(day);
return (
@@ -147,44 +130,6 @@ export class CalendarMonth implements OnInit {
);
}
getStatusMarker(day: Date): string {
switch (this.getStatus(day)?.change) {
case 'added':
return '+';
case 'moved-from':
return '←';
case 'moved-to':
return '→';
case 'removed':
return '−';
case 'shared':
return '≈';
case 'unchanged':
return '=';
}
switch (this.getStatus(day)?.kind) {
case 'chosen':
case 'eligible':
return '✓';
case 'ineligible':
return '×';
case 'evaluated-rejected':
return '−';
case 'pruned':
return '⌁';
case 'not-examined':
return '?';
default:
return '';
}
}
getHypotheticalMarker(status: CalendarDayStatus): string {
return status.hypotheticalLabel === this.translationService.tr().planning.eligible
? '~✓'
: '~×';
}
getDayAriaLabel(day: Date, tooltip: string | null = this.getDayTooltip(day)): string {
const locale = this.translationService.locale();
if (!this.dayFormatter || locale !== this.dayFormatterLocale) {
@@ -252,20 +197,6 @@ export class CalendarMonth implements OnInit {
tooltips.push(
`${this.tr().bookedDays.booked} (${this.declaredTypeLabel(declaredType)}). ${this.tr().bookedDays.fixed}`,
);
const status = this.getStatus(day);
if (status) {
tooltips.push(status.label);
if (status.changeLabel) tooltips.push(status.changeLabel);
if (status.reason) tooltips.push(status.reason);
if (status.hypotheticalLabel)
tooltips.push(
`${this.translationService.tr().planning.counterfactual}: ${status.hypotheticalLabel}`,
);
if (status.hypotheticalReason)
tooltips.push(
`${this.translationService.tr().planning.reason}: ${status.hypotheticalReason}`,
);
}
return tooltips.length > 0 ? tooltips.join(' + ') : null;
}