chore: update application configuration and UI components for improved styling and functionality

This commit is contained in:
Jennie Robinson Faber 2025-08-16 08:13:35 +01:00
parent 0af6b17792
commit 37ab8d7bab
54 changed files with 23293 additions and 1666 deletions

View file

@ -22,8 +22,11 @@ export const useSessionStore = defineStore("session", () => {
// Session rationale text
const rationale = ref("");
// Current session period
const currentSession = ref("2024-01");
// Current session period - use current month/year
const currentDate = new Date();
const currentYear = currentDate.getFullYear();
const currentMonth = String(currentDate.getMonth() + 1).padStart(2, '0');
const currentSession = ref(`${currentYear}-${currentMonth}`);
// Saved distribution records
const savedRecords = ref([]);
@ -111,6 +114,29 @@ export const useSessionStore = defineStore("session", () => {
Object.assign(availableAmounts.value, amounts);
}
function resetSession() {
// Reset checklist
Object.keys(checklist.value).forEach((key) => {
checklist.value[key] = false;
});
// Reset allocations
Object.keys(draftAllocations.value).forEach((key) => {
draftAllocations.value[key] = 0;
});
// Reset other values
rationale.value = "";
savedRecords.value = [];
// Reset available amounts
availableAmounts.value = {
surplus: 0,
deferredOwed: 0,
savingsNeeded: 0,
};
}
return {
checklist,
draftAllocations,
@ -128,5 +154,6 @@ export const useSessionStore = defineStore("session", () => {
loadSession,
setCurrentSession,
updateAvailableAmounts,
resetSession,
};
});