-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- made landing page be configurable in settings
- Loading branch information
1 parent
01828ac
commit 4fc2d00
Showing
5 changed files
with
71 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<template> | ||
<app-select label="Starting page" v-model="modelValue" v-model:showDropdown="showDropdown" :list="list" :columns="1" v-bind="dynamicAttrs" :has-search="false" /> | ||
</template> | ||
|
||
<script setup> | ||
import Account from '~/models/Account' | ||
import { useFormAttributes } from '~/composables/useFormAttributes' | ||
import Page from '~/models/Page.js' | ||
const attrs = useAttrs() | ||
const { dynamicAttrs } = useFormAttributes(attrs) | ||
const modelValue = defineModel() | ||
const list = Page.typesList() | ||
const showDropdown = ref(null) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { faker } from '@faker-js/faker' | ||
import BaseModel from '~/models/BaseModel' | ||
import AccountTransformer from '~/transformers/AccountTransformer' | ||
import AccountRepository from '~/repository/AccountRepository' | ||
import _, { get } from 'lodash' | ||
import Transaction from '~/models/Transaction' | ||
import { NUMBER_FORMAT } from '~/utils/MathUtils.js' | ||
|
||
export default class Page { | ||
static get types() { | ||
return { | ||
transactionNew: { | ||
name: 'New transaction', | ||
code: 'transaction', | ||
}, | ||
transactionList: { | ||
name: 'Transaction list', | ||
code: 'transactionList', | ||
}, | ||
dashboard: { | ||
name: 'Dashboard', | ||
code: 'dashboard', | ||
}, | ||
} | ||
} | ||
|
||
static typesList() { | ||
return Object.values(this.types) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,25 @@ | ||
<template> | ||
<transaction-create /> | ||
<component :is="startingPage" /> | ||
</template> | ||
|
||
<script setup> | ||
import TransactionCreate from './transactions/[[id]].vue' | ||
import TransactionList from './transactions/list.vue' | ||
import Dashboard from './dashboard.vue' | ||
import Page from '~/models/Page.js' | ||
const profileStore = useProfileStore() | ||
let startingPage = computed(() => { | ||
switch (profileStore.startingPage?.code) { | ||
case Page.types.transactionNew.code: | ||
return markRaw(TransactionCreate) | ||
case Page.types.transactionList.code: | ||
return markRaw(TransactionList) | ||
case Page.types.dashboard.code: | ||
return markRaw(Dashboard) | ||
} | ||
return markRaw(TransactionCreate) | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters