feat: enhance user input and rules panel components

- Updated dark-light mode button styles for improved responsiveness.
- Enhanced rules panel with additional buttons for moving rules up and down, and updated styles for better layout.
- Added active rule count display in the rules panel header.
- Improved user input component layout with section headings and updated button styles.
- Refactored day input component to use grid layout for better alignment and responsiveness.
- Added new translations for user input and rules panel features.
- Implemented tests for new functionality in rules panel and day input components.
- Added application routes test to ensure correct routing configuration.
This commit is contained in:
nessar committed 2026-08-30 19:16:36 +02:00
1 parent 31314f3969
commit 609b3dece9
30 files changed
+870 -382

No files matched your search

@@ -32,15 +32,30 @@ const incomplete: PlanningIncompleteOutcome = {
const plan: PlanOutcome = {
kind: 'Plan',
horizon: { start: '2024-01-01', end: '2025-01-01' },
placements: [],
placements: [
{
date: '2024-05-03',
balanceId: 'cp',
type: 'cp',
ruleIds: [],
supporting: false,
},
{
date: '2024-05-06',
balanceId: 'cp',
type: 'cp',
ruleIds: [],
supporting: false,
},
],
timeOffPeriods: [],
preferences: [],
remainingBalances: [],
metrics: {
unplacedAtRisk: 0,
holidayWeekValue: 0,
nonWorkingDayGain: 0,
longestWorkSequence: 0,
nonWorkingDayGain: 4,
longestWorkSequence: 6,
shortSequenceDeficit: 0,
supportingPlacements: 0,
preferenceSatisfaction: [],
@@ -84,7 +99,7 @@ describe('CalendarYear planning outcome boundary', () => {
expect(userInput.remainingVacationDaysSignal()).toEqual([]);
});
it('keeps a returned incumbent/result visible only when an outcome supplies one', async () => {
it('keeps and summarizes a returned result', async () => {
const calendar = {
getSelectedDatesForYear: vi.fn(() => new SelectedDates()),
getDefaultPlanningHorizon: vi.fn(() => ({ start: '2024-01-01', end: '2025-01-01' })),
@@ -103,7 +118,13 @@ describe('CalendarYear planning outcome boundary', () => {
const fixture = TestBed.createComponent(CalendarYear);
fixture.detectChanges();
await fixture.whenStable();
await new Promise<void>((resolve) => setTimeout(resolve, 0));
fixture.detectChanges();
expect(userInput.remainingVacationDaysSignal()).toEqual([]);
const summaryValues = Array.from(
fixture.nativeElement.querySelectorAll('.plan-summary dd') as NodeListOf<HTMLElement>,
).map((element) => element.textContent?.trim());
expect(summaryValues).toEqual(['2', '4', '6']);
});
it('turns planner rejection into an incomplete error and clears loading', async () => {