feat: enhance user input component with new styling and functionality

- Added informational styling to warning cards in user input component.
- Improved remaining days details and history display with new computed properties.
- Updated user input service to manage planning outcomes and traces more effectively.
- Enhanced leave planner service to classify remaining balances with detailed reasons.
- Expanded translation service to support new balance reasoning and suggestions.
- Updated translations for multiple languages to reflect new features and terminology.
This commit is contained in:
nessar committed 2026-10-07 21:49:33 +02:00
1 parent 9851edf906
commit 3dc601982a
15 files changed
+679 -141

No files matched your search

+34 -5
View File
@@ -1672,12 +1672,12 @@ describe('planLeave', () => {
});
it.each([
['unavoidable-expiry', '2024-05-31', '2024-01-01'],
['at-risk', '2024-06-10', '2024-06-10'],
['deferred', '2024-07-01', '2024-06-11'],
['unavoidable-expiry', '2024-05-31', '2024-01-01', 'unavoidable-expiry'],
['at-risk', '2024-06-10', '2024-06-10', 'available-after-horizon'],
['deferred', '2024-07-01', '2024-06-11', 'available-after-horizon'],
] as const)(
'classifies a remaining balance as %s',
async (classification, expiryDate, availableFrom) => {
async (classification, expiryDate, availableFrom, reasonCode) => {
const result = isPlan(
await runInNonBrowser({
horizon: { start: '2024-06-01', end: '2024-06-10' },
@@ -1694,7 +1694,36 @@ describe('planLeave', () => {
}),
);
expect(result.remainingBalances[0].classification).toBe(classification);
expect(result.remainingBalances[0].reason.code).toBe(classification);
expect(result.remainingBalances[0].reason.code).toBe(reasonCode);
},
);
it.each([
['no-working-date', '2024-06-08', '2024-06-10', []],
['all-dates-occupied', '2024-06-03', '2024-06-04', [{ date: '2024-06-03', type: 'cp' }]],
['preserved', '2024-06-04', '2024-06-13', [{ date: '2024-06-07', type: 'cp' }]],
] as const)(
'explains a remaining deferred balance as %s without treating it as unavailable',
async (code, start, end, declaredDays) => {
const result = isPlan(
await runInNonBrowser({
horizon: { start, end },
balances: [
{ ...balance('other', 'other', 1, '2025-05-10'), availableFrom: start },
],
declaredDays,
rules: [],
}),
);
expect(result.placements).toEqual([]);
expect(result.remainingBalances).toMatchObject([
{
id: 'other',
quantity: 1,
classification: 'deferred',
reason: { code },
},
]);
},
);