refactor: replace Wizard with CoopBuilder in navigation, enhance budget store structure, and streamline template components for improved user experience
This commit is contained in:
parent
eede87a273
commit
f67b138d95
33 changed files with 4970 additions and 2451 deletions
|
|
@ -87,6 +87,31 @@ export const useStreamsStore = defineStore(
|
|||
}
|
||||
}
|
||||
|
||||
// Initialize with fixture data if empty
|
||||
async function initializeWithFixtures() {
|
||||
if (streams.value.length === 0) {
|
||||
const { useFixtures } = await import('~/composables/useFixtures');
|
||||
const fixtures = useFixtures();
|
||||
const { revenueStreams } = await fixtures.loadStreams();
|
||||
|
||||
revenueStreams.forEach(stream => {
|
||||
upsertStream(stream);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Load realistic demo data (for better user experience)
|
||||
async function loadDemoData() {
|
||||
resetStreams();
|
||||
const { useFixtures } = await import('~/composables/useFixtures');
|
||||
const fixtures = useFixtures();
|
||||
const { revenueStreams } = await fixtures.loadStreams();
|
||||
|
||||
revenueStreams.forEach(stream => {
|
||||
upsertStream(stream);
|
||||
});
|
||||
}
|
||||
|
||||
// Reset function
|
||||
function resetStreams() {
|
||||
streams.value = [];
|
||||
|
|
@ -102,6 +127,8 @@ export const useStreamsStore = defineStore(
|
|||
// Wizard actions
|
||||
upsertStream,
|
||||
resetStreams,
|
||||
initializeWithFixtures,
|
||||
loadDemoData,
|
||||
// Legacy actions
|
||||
addStream,
|
||||
updateStream,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue