fix .env.production
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import {useSpaceStore} from "@/stores/spaceStore";
|
||||
import {useToast} from "primevue/usetoast";
|
||||
import {Divider} from "primevue";
|
||||
import {onMounted, ref} from "vue";
|
||||
import {computed, onMounted, ref} from "vue";
|
||||
import {Category} from "@/models/category";
|
||||
import {useToolbarStore} from "@/stores/toolbar-store";
|
||||
import {useRouter} from "vue-router";
|
||||
@@ -18,6 +18,12 @@ const router = useRouter()
|
||||
|
||||
|
||||
const categories = ref<Category[]>([])
|
||||
const incomeCategories = computed(() => {
|
||||
return categories.value.filter(i => i.type == CategoryType.INCOME)
|
||||
})
|
||||
const expenseCategories = computed(() => {
|
||||
return categories.value.filter(i => i.type == CategoryType.EXPENSE)
|
||||
})
|
||||
|
||||
const fetchData = async () => {
|
||||
try {
|
||||
@@ -53,52 +59,52 @@ onMounted(async () => {
|
||||
|
||||
<div class="flex flex-col w-full !pb-10 gap-6">
|
||||
<div class="flex flex-col">
|
||||
<span>Income categories</span>
|
||||
<span class="!pl-4">Income categories</span>
|
||||
<div class="flex card flex-col ">
|
||||
|
||||
<span v-if="categories.filter(i => i.type == CategoryType.INCOME).length ==0 ">It looks like you haven't create any income category yet. <router-link
|
||||
<span v-if="incomeCategories.length ==0 ">It looks like you haven't create any income category yet. <router-link
|
||||
to="/categories/create" class="!text-blue-400">Try to create some first.</router-link></span>
|
||||
<div v-else v-for="key in categories.filter(i => i.type == CategoryType.INCOME).keys()"
|
||||
:key="categories[key].id"
|
||||
@click="router.push(`/categories/${categories[key].id}/edit`)"
|
||||
<div v-else v-for="key in incomeCategories.keys()"
|
||||
:key="incomeCategories[key].id"
|
||||
@click="router.push(`/categories/${incomeCategories[key].id}/edit`)"
|
||||
class="flex flex-col w-full gap-0 pl-5 items-start justify-items-center font-bold ">
|
||||
<div class="flex flex-row w-full items-center justify-between">
|
||||
<div class="flex flex-row items-center gap-2 ">
|
||||
<span class="text-3xl"> {{ categories[key].icon }}</span>
|
||||
<div class="flex flex-col !font-bold "> {{ categories[key].name }}
|
||||
<div class="flex flex-row text-sm">{{ categories[key].description }} |
|
||||
{{ CategoryTypeName[categories[key].type] }}
|
||||
<span class="text-3xl"> {{ incomeCategories[key].icon }}</span>
|
||||
<div class="flex flex-col !font-bold "> {{ incomeCategories[key].name }}
|
||||
<div class="flex flex-row text-sm">{{ incomeCategories[key].description }} |
|
||||
{{ CategoryTypeName[incomeCategories[key].type] }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<i class="pi pi-angle-right !font-extralight"/>
|
||||
</div>
|
||||
<Divider v-if="key+1 !== categories.length" class="!m-0 !py-3"/>
|
||||
<Divider v-if="key+1 !== incomeCategories.length" class="!m-0 !py-3"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-col">
|
||||
<span>Expense categories</span>
|
||||
<span class="!pl-4">Expense categories</span>
|
||||
<div class="flex card ">
|
||||
|
||||
<span v-if="categories.filter(i => i.type == CategoryType.EXPENSE).length ==0 ">It looks like you haven't create any expense category yet. <router-link
|
||||
<span v-if="expenseCategories.length ==0 ">It looks like you haven't create any expense category yet. <router-link
|
||||
to="/categories/create" class="!text-blue-400">Try to create some first.</router-link></span>
|
||||
<div v-else v-for="key in categories.filter(i => i.type == CategoryType.EXPENSE).keys()"
|
||||
:key="categories[key].id"
|
||||
@click="router.push(`/categories/${categories[key].id}/edit`)"
|
||||
<div v-else v-for="key in expenseCategories.keys()"
|
||||
:key="expenseCategories[key].id"
|
||||
@click="router.push(`/categories/${expenseCategories[key].id}/edit`)"
|
||||
class="flex flex-col w-full gap-0 pl-5 items-start justify-items-center font-bold ">
|
||||
<div class="flex flex-row w-full items-center justify-between">
|
||||
<div class="flex flex-row items-center gap-2 ">
|
||||
<span class="text-3xl"> {{ categories[key].icon }}</span>
|
||||
<div class="flex flex-col !font-bold "> {{ categories[key].name }}
|
||||
<div class="flex flex-row text-sm">{{ categories[key].description }} |
|
||||
{{ CategoryTypeName[categories[key].type] }}
|
||||
<span class="text-3xl"> {{ expenseCategories[key].icon }}</span>
|
||||
<div class="flex flex-col !font-bold "> {{ expenseCategories[key].name }}
|
||||
<div class="flex flex-row text-sm">{{ expenseCategories[key].description }} |
|
||||
{{ CategoryTypeName[expenseCategories[key].type] }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<i class="pi pi-angle-right !font-extralight"/>
|
||||
</div>
|
||||
<Divider v-if="key+1 !== categories.filter(i => i.type == CategoryType.EXPENSE).length" class="!m-0 !py-3"/>
|
||||
<Divider v-if="key+1 !== expenseCategories.length" class="!m-0 !py-3"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import {DatePicker, Divider, InputNumber, SelectButton} from "primevue";
|
||||
import {DatePicker, Divider, InputNumber} from "primevue";
|
||||
import ConfirmDialog from "@/components/ConfirmDialog.vue";
|
||||
import {useRoute, useRouter} from "vue-router";
|
||||
import {useToolbarStore} from "@/stores/toolbar-store";
|
||||
@@ -110,14 +110,14 @@ const fetchData = async () => {
|
||||
}
|
||||
|
||||
const validateForm = (): boolean => {
|
||||
if (!transactionType.value) {
|
||||
isTypeError.value = true;
|
||||
return false;
|
||||
}
|
||||
if (!transactionKind.value) {
|
||||
isKindError.value = true;
|
||||
return false;
|
||||
}
|
||||
// if (!transactionType.value) {
|
||||
// isTypeError.value = true;
|
||||
// return false;
|
||||
// }
|
||||
// if (!transactionKind.value) {
|
||||
// isKindError.value = true;
|
||||
// return false;
|
||||
// }
|
||||
if (!transactionCategory.value) {
|
||||
isCategoryError.value = true
|
||||
return false
|
||||
@@ -141,10 +141,11 @@ const buildUpdate = (): UpdateTransactionDTO => {
|
||||
if (validateForm()) {
|
||||
return {
|
||||
type: transactionType.value,
|
||||
kind: transactionKind.value,
|
||||
kind: transactionDate.value < new Date() ? TransactionKind.INSTANT : TransactionKind.PLANNING,
|
||||
categoryId: transactionCategory.value.id,
|
||||
comment: transactionComment.value,
|
||||
amount: transactionAmount.value,
|
||||
fees: null,
|
||||
isDone: isDone.value,
|
||||
date: transactionDate.value
|
||||
} as UpdateTransactionDTO
|
||||
@@ -157,7 +158,7 @@ const buildCreate = (): CreateTransactionDTO => {
|
||||
if (validateForm()) {
|
||||
return {
|
||||
type: transactionType.value,
|
||||
kind: transactionKind.value,
|
||||
kind: transactionDate.value < new Date() ? TransactionKind.INSTANT : TransactionKind.PLANNING,
|
||||
categoryId: transactionCategory.value.id,
|
||||
comment: transactionComment.value,
|
||||
amount: transactionAmount.value,
|
||||
@@ -350,13 +351,13 @@ onMounted(async () => {
|
||||
<!-- optionValue="value"-->
|
||||
<!-- class="!w-full !items-center !justify-center !border-none "/>-->
|
||||
<!-- </div>-->
|
||||
<div class="card flex flex-col w-full items-center justify-center">
|
||||
<!-- <div class="card flex flex-col w-full items-center justify-center">-->
|
||||
|
||||
<span class="text-lg hidden lg:flex">Вид транзакции</span>
|
||||
<SelectButton v-model="transactionKind" :options="optionsKind" optionLabel="label"
|
||||
optionValue="value"
|
||||
class="!w-full !items-center !justify-center !border-none "/>
|
||||
</div>
|
||||
<!-- <span class="text-lg hidden lg:flex">Вид транзакции</span>-->
|
||||
<!-- <SelectButton v-model="transactionKind" :options="optionsKind" optionLabel="label"-->
|
||||
<!-- optionValue="value"-->
|
||||
<!-- class="!w-full !items-center !justify-center !border-none "/>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
<div class="flex flex-col w-full justify-items-start">
|
||||
<label class="!font-semibold text-gray-600 pl-2">Transaction name</label>
|
||||
|
||||
@@ -57,6 +57,7 @@ onMounted(async () => {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
|
||||
<div v-if="!spaceStore.selectedSpaceId" class="card">
|
||||
Try to select a space first.
|
||||
</div>
|
||||
@@ -102,9 +103,10 @@ onMounted(async () => {
|
||||
class="flex flex-col w-full gap-0 pl-5 items-start justify-items-center font-bold ">
|
||||
<div class="flex flex-row w-full items-center justify-between">
|
||||
<div class="flex flex-row items-center gap-2 ">
|
||||
<span class="text-3xl"> {{ instantTransactions[key].category.icon }}</span>
|
||||
<span v-if="instantTransactions[key].category" class="text-3xl"> {{ instantTransactions[key].category.icon }}</span>
|
||||
<i v-else class="pi pi-question !text-3xl"/>
|
||||
<div class="flex flex-col !font-bold "> {{ instantTransactions[key].comment }}
|
||||
<div class="flex flex-row text-sm">{{ instantTransactions[key].category.name }}</div>
|
||||
<div v-if="instantTransactions[key].category" class="flex flex-row text-sm">{{ instantTransactions[key].category.name }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-row gap-2 items-center">
|
||||
|
||||
Reference in New Issue
Block a user