Fix lint errors/warnings
Signed-off-by: William Brawner <me@wbrawner.com>
This commit is contained in:
parent
9893263523
commit
1da4bd2638
7 changed files with 79 additions and 32 deletions
|
@ -7,8 +7,14 @@
|
|||
export default {
|
||||
name: 'ProgressBar',
|
||||
props: {
|
||||
value: Number,
|
||||
max: Number,
|
||||
value: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
max: {
|
||||
type: Number,
|
||||
default: 0,
|
||||
},
|
||||
invertColors: Boolean,
|
||||
},
|
||||
computed: {
|
||||
|
|
|
@ -39,7 +39,10 @@ export default {
|
|||
components: {
|
||||
},
|
||||
props: {
|
||||
budget: {},
|
||||
budget: {
|
||||
default: {},
|
||||
type: () => {},
|
||||
},
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
|
@ -56,8 +59,8 @@ export default {
|
|||
this.user = undefined
|
||||
this.budget.users = this.budget.users.filter(u => u.user !== user)
|
||||
this.budget.users.push({
|
||||
'user': user,
|
||||
'permission': 2,
|
||||
user: user,
|
||||
permission: 2,
|
||||
})
|
||||
},
|
||||
saveBudget() {
|
||||
|
|
|
@ -45,7 +45,10 @@ export default {
|
|||
components: {
|
||||
},
|
||||
props: {
|
||||
category: Object,
|
||||
category: {
|
||||
default: () => {},
|
||||
type: Object,
|
||||
},
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
|
|
|
@ -4,8 +4,17 @@
|
|||
<a class="category-summary" @click="view(category.id)">
|
||||
<div class="category-info">
|
||||
<p class="category-name">{{ category.name }}</p>
|
||||
<p
|
||||
class="category-balance">{{ category.expense ? 'Remaining' : 'Pending' }}: {{ (categoryRemainingBalance(category) / 100).toLocaleString(undefined, {style: 'currency', currency: 'USD'}) }}</p>
|
||||
<p class="category-balance">
|
||||
{{ category.expense ? "Remaining" : "Pending" }}:
|
||||
{{
|
||||
(
|
||||
categoryRemainingBalance(category) / 100
|
||||
).toLocaleString(undefined, {
|
||||
style: "currency",
|
||||
currency: "USD"
|
||||
})
|
||||
}}
|
||||
</p>
|
||||
</div>
|
||||
<ProgressBar
|
||||
:max="category.amount"
|
||||
|
@ -25,8 +34,14 @@ export default {
|
|||
ProgressBar,
|
||||
},
|
||||
props: {
|
||||
budgetId: Number,
|
||||
expense: Boolean,
|
||||
budgetId: {
|
||||
default: 0,
|
||||
type: Number,
|
||||
},
|
||||
expense: {
|
||||
default: true,
|
||||
type: Boolean,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState(['categories', 'currentCategory']),
|
||||
|
@ -67,5 +82,4 @@ export default {
|
|||
justify-content: space-between;
|
||||
padding-bottom: 0.5em;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
|
@ -1,24 +1,31 @@
|
|||
<template>
|
||||
<div>
|
||||
<div v-if="!loading" class="add-edit-transaction">
|
||||
<h2>{{ transaction.id ? 'Edit' : 'Add' }} Transaction</h2>
|
||||
<input v-model="transaction.name"
|
||||
<h2>{{ transaction.id ? "Edit" : "Add" }} Transaction</h2>
|
||||
<input
|
||||
v-model="transaction.name"
|
||||
type="text"
|
||||
placeholder="Name"
|
||||
title="Name">
|
||||
<textarea v-model="transaction.description" placeholder="Description" title="Description" />
|
||||
<input v-model.number="transaction.amount"
|
||||
<textarea
|
||||
v-model="transaction.description"
|
||||
placeholder="Description"
|
||||
title="Description" />
|
||||
<input
|
||||
v-model.number="transaction.amount"
|
||||
type="number"
|
||||
placeholder="Amount"
|
||||
title="Amount">
|
||||
<DatetimePicker :value="transaction.date" type="datetime" />
|
||||
<div class="radio-container">
|
||||
<input id="expense"
|
||||
<input
|
||||
id="expense"
|
||||
v-model="transaction.expense"
|
||||
type="radio"
|
||||
:value="true">
|
||||
<label for="expense">Expense</label>
|
||||
<input id="income"
|
||||
<input
|
||||
id="income"
|
||||
v-model="transaction.expense"
|
||||
type="radio"
|
||||
:value="false">
|
||||
|
@ -29,7 +36,9 @@
|
|||
Select a budget
|
||||
</option>
|
||||
<option v-for="budget in budgets" :key="budget.id" :value="budget.id">
|
||||
{{ budget.name }}
|
||||
{{
|
||||
budget.name
|
||||
}}
|
||||
</option>
|
||||
</select>
|
||||
<select v-model="transaction.categoryId">
|
||||
|
@ -60,7 +69,10 @@ export default {
|
|||
DatetimePicker,
|
||||
},
|
||||
props: {
|
||||
transaction: {},
|
||||
transaction: {
|
||||
default: () => {},
|
||||
type: Object,
|
||||
},
|
||||
},
|
||||
data: function() {
|
||||
return {
|
||||
|
|
|
@ -20,9 +20,18 @@ export default {
|
|||
name: 'TransactionList',
|
||||
components: {},
|
||||
props: {
|
||||
budgetId: 0,
|
||||
categoryId: 0,
|
||||
limit: 0,
|
||||
budgetId: {
|
||||
default: 0,
|
||||
type: Number,
|
||||
},
|
||||
categoryId: {
|
||||
default: 0,
|
||||
type: Number,
|
||||
},
|
||||
limit: {
|
||||
default: 0,
|
||||
type: Number,
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
...mapState(['transactions', 'currentTransaction']),
|
||||
|
|
|
@ -68,7 +68,7 @@ export default new Vuex.Store({
|
|||
if (budget.id) {
|
||||
request = axios.put(OC.generateUrl(`/apps/twigs/api/v1.0/budgets/${budget.id}`), budget)
|
||||
} else {
|
||||
request = axios.post(OC.generateUrl(`/apps/twigs/api/v1.0/budgets`), budget)
|
||||
request = axios.post(OC.generateUrl('/apps/twigs/api/v1.0/budgets'), budget)
|
||||
}
|
||||
request.then(response => {
|
||||
commit('addBudget', response.data)
|
||||
|
@ -140,7 +140,7 @@ export default new Vuex.Store({
|
|||
if (category.id) {
|
||||
request = axios.put(OC.generateUrl(`/apps/twigs/api/v1.0/categories/${category.id}`), category)
|
||||
} else {
|
||||
request = axios.post(OC.generateUrl(`/apps/twigs/api/v1.0/categories`), category)
|
||||
request = axios.post(OC.generateUrl('/apps/twigs/api/v1.0/categories'), category)
|
||||
}
|
||||
request.then(response => {
|
||||
commit('addCategory', response.data)
|
||||
|
@ -180,7 +180,7 @@ export default new Vuex.Store({
|
|||
if (transaction.id) {
|
||||
request = axios.put(OC.generateUrl(`/apps/twigs/api/v1.0/transactions/${transaction.id}`), transaction)
|
||||
} else {
|
||||
request = axios.post(OC.generateUrl(`/apps/twigs/api/v1.0/transactions`), transaction)
|
||||
request = axios.post(OC.generateUrl('/apps/twigs/api/v1.0/transactions'), transaction)
|
||||
}
|
||||
request.then(response => {
|
||||
commit('addTransaction', response.data)
|
||||
|
|
Loading…
Reference in a new issue