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:
1 parent
9851edf906
commit
3dc601982a
15 files changed
+679
-141
No files matched your search
@@ -395,7 +395,11 @@
|
||||
@if (selected.remainingBalance; as remaining) {
|
||||
·
|
||||
{{
|
||||
tr().planning.details.remainingReasons[remaining.classification]
|
||||
translationService.getRemainingBalanceReason(
|
||||
remaining,
|
||||
displayedPlan(),
|
||||
planningOutcome()?.kind === 'PlanningIncomplete'
|
||||
)
|
||||
}}
|
||||
}
|
||||
</p>
|
||||
@@ -482,9 +486,11 @@
|
||||
@if (selected.remainingBalance; as remaining) {
|
||||
<p>
|
||||
{{
|
||||
tr().planning.details.remainingReasons[
|
||||
remaining.classification
|
||||
]
|
||||
translationService.getRemainingBalanceReason(
|
||||
remaining,
|
||||
displayedPlan(),
|
||||
planningOutcome()?.kind === 'PlanningIncomplete'
|
||||
)
|
||||
}}
|
||||
</p>
|
||||
}
|
||||
|
||||
@@ -105,12 +105,12 @@ export class CalendarYear {
|
||||
protected readonly isCancelling = signal(false);
|
||||
private readonly resultsTitle = viewChild<ElementRef<HTMLElement>>('resultsTitle');
|
||||
protected readonly loadingProgress = signal(0);
|
||||
protected readonly planningOutcome = signal<PlanningOutcome | null>(null);
|
||||
protected readonly planningOutcome = this.userInput.planningOutcomeSignal;
|
||||
protected readonly planningExplanation = signal<PlanningExplanation | null>(null);
|
||||
protected readonly explanationError = signal<PlanningReason | null>(null);
|
||||
protected readonly planningTrace = signal<PlanningTrace | null>(null);
|
||||
protected readonly planningTrace = this.userInput.planningTraceSignal;
|
||||
protected readonly traceLoading = signal(false);
|
||||
protected readonly traceResolved = signal(false);
|
||||
protected readonly traceResolved = this.userInput.traceResolvedSignal;
|
||||
protected readonly selectedPlacementIndex = signal(0);
|
||||
protected readonly planDetailsOpen = signal(false);
|
||||
protected readonly traceOpen = signal(false);
|
||||
@@ -188,14 +188,7 @@ export class CalendarYear {
|
||||
return this.translationService.tr;
|
||||
}
|
||||
|
||||
protected readonly displayedPlan = computed(() => {
|
||||
const outcome = this.planningOutcome();
|
||||
return outcome?.kind === 'Plan'
|
||||
? outcome
|
||||
: outcome?.kind === 'PlanningIncomplete'
|
||||
? outcome.incumbent
|
||||
: undefined;
|
||||
});
|
||||
protected readonly displayedPlan = this.userInput.displayedPlanSignal;
|
||||
|
||||
protected readonly planExplanation = computed(() => {
|
||||
const explanation = this.planningExplanation();
|
||||
@@ -567,6 +560,7 @@ export class CalendarYear {
|
||||
if (version !== this.calculationVersion) return;
|
||||
this.resetCalculationState(horizon);
|
||||
this.activeCalculation = calculation;
|
||||
this.userInput.planningSnapshotSignal.set(calculation.snapshot);
|
||||
this.planningHorizon.set(horizon);
|
||||
this.applyOutcome(outcome);
|
||||
this.loadArtifacts(calculation);
|
||||
@@ -576,6 +570,7 @@ export class CalendarYear {
|
||||
if (version !== this.calculationVersion) return;
|
||||
this.resetCalculationState(horizon);
|
||||
this.activeCalculation = calculation;
|
||||
this.userInput.planningSnapshotSignal.set(calculation.snapshot);
|
||||
this.planningHorizon.set(horizon);
|
||||
this.applyOutcome({
|
||||
kind: 'PlanningIncomplete',
|
||||
@@ -636,6 +631,7 @@ export class CalendarYear {
|
||||
|
||||
private resetCalculationState(horizon: { start: string; end: string }): void {
|
||||
this.activeCalculation = null;
|
||||
this.userInput.planningSnapshotSignal.set(null);
|
||||
this.planningOutcome.set(null);
|
||||
this.planningExplanation.set(null);
|
||||
this.explanationError.set(null);
|
||||
|
||||
Reference in new issue
Block a user