fix .env.production

This commit is contained in:
xds
2025-11-07 15:28:01 +03:00
parent 3ab59f0112
commit 500e87a80b
3 changed files with 49 additions and 40 deletions

View File

@@ -3,7 +3,7 @@
import {useSpaceStore} from "@/stores/spaceStore"; import {useSpaceStore} from "@/stores/spaceStore";
import {useToast} from "primevue/usetoast"; import {useToast} from "primevue/usetoast";
import {Divider} from "primevue"; import {Divider} from "primevue";
import {onMounted, ref} from "vue"; import {computed, onMounted, ref} from "vue";
import {Category} from "@/models/category"; import {Category} from "@/models/category";
import {useToolbarStore} from "@/stores/toolbar-store"; import {useToolbarStore} from "@/stores/toolbar-store";
import {useRouter} from "vue-router"; import {useRouter} from "vue-router";
@@ -18,6 +18,12 @@ const router = useRouter()
const categories = ref<Category[]>([]) 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 () => { const fetchData = async () => {
try { try {
@@ -53,52 +59,52 @@ onMounted(async () => {
<div class="flex flex-col w-full !pb-10 gap-6"> <div class="flex flex-col w-full !pb-10 gap-6">
<div class="flex flex-col"> <div class="flex flex-col">
<span>Income categories</span> <span class="!pl-4">Income categories</span>
<div class="flex card flex-col "> <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> 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()" <div v-else v-for="key in incomeCategories.keys()"
:key="categories[key].id" :key="incomeCategories[key].id"
@click="router.push(`/categories/${categories[key].id}/edit`)" @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 "> 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 w-full items-center justify-between">
<div class="flex flex-row items-center gap-2 "> <div class="flex flex-row items-center gap-2 ">
<span class="text-3xl"> {{ categories[key].icon }}</span> <span class="text-3xl"> {{ incomeCategories[key].icon }}</span>
<div class="flex flex-col !font-bold "> {{ categories[key].name }} <div class="flex flex-col !font-bold "> {{ incomeCategories[key].name }}
<div class="flex flex-row text-sm">{{ categories[key].description }} | <div class="flex flex-row text-sm">{{ incomeCategories[key].description }} |
{{ CategoryTypeName[categories[key].type] }} {{ CategoryTypeName[incomeCategories[key].type] }}
</div> </div>
</div> </div>
</div> </div>
<i class="pi pi-angle-right !font-extralight"/> <i class="pi pi-angle-right !font-extralight"/>
</div> </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>
</div> </div>
<div class="flex flex-col"> <div class="flex flex-col">
<span>Expense categories</span> <span class="!pl-4">Expense categories</span>
<div class="flex card "> <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> 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()" <div v-else v-for="key in expenseCategories.keys()"
:key="categories[key].id" :key="expenseCategories[key].id"
@click="router.push(`/categories/${categories[key].id}/edit`)" @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 "> 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 w-full items-center justify-between">
<div class="flex flex-row items-center gap-2 "> <div class="flex flex-row items-center gap-2 ">
<span class="text-3xl"> {{ categories[key].icon }}</span> <span class="text-3xl"> {{ expenseCategories[key].icon }}</span>
<div class="flex flex-col !font-bold "> {{ categories[key].name }} <div class="flex flex-col !font-bold "> {{ expenseCategories[key].name }}
<div class="flex flex-row text-sm">{{ categories[key].description }} | <div class="flex flex-row text-sm">{{ expenseCategories[key].description }} |
{{ CategoryTypeName[categories[key].type] }} {{ CategoryTypeName[expenseCategories[key].type] }}
</div> </div>
</div> </div>
</div> </div>
<i class="pi pi-angle-right !font-extralight"/> <i class="pi pi-angle-right !font-extralight"/>
</div> </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> </div>
</div> </div>

View File

@@ -1,6 +1,6 @@
<script setup lang="ts"> <script setup lang="ts">
import {DatePicker, Divider, InputNumber, SelectButton} from "primevue"; import {DatePicker, Divider, InputNumber} from "primevue";
import ConfirmDialog from "@/components/ConfirmDialog.vue"; import ConfirmDialog from "@/components/ConfirmDialog.vue";
import {useRoute, useRouter} from "vue-router"; import {useRoute, useRouter} from "vue-router";
import {useToolbarStore} from "@/stores/toolbar-store"; import {useToolbarStore} from "@/stores/toolbar-store";
@@ -110,14 +110,14 @@ const fetchData = async () => {
} }
const validateForm = (): boolean => { const validateForm = (): boolean => {
if (!transactionType.value) { // if (!transactionType.value) {
isTypeError.value = true; // isTypeError.value = true;
return false; // return false;
} // }
if (!transactionKind.value) { // if (!transactionKind.value) {
isKindError.value = true; // isKindError.value = true;
return false; // return false;
} // }
if (!transactionCategory.value) { if (!transactionCategory.value) {
isCategoryError.value = true isCategoryError.value = true
return false return false
@@ -141,10 +141,11 @@ const buildUpdate = (): UpdateTransactionDTO => {
if (validateForm()) { if (validateForm()) {
return { return {
type: transactionType.value, type: transactionType.value,
kind: transactionKind.value, kind: transactionDate.value < new Date() ? TransactionKind.INSTANT : TransactionKind.PLANNING,
categoryId: transactionCategory.value.id, categoryId: transactionCategory.value.id,
comment: transactionComment.value, comment: transactionComment.value,
amount: transactionAmount.value, amount: transactionAmount.value,
fees: null,
isDone: isDone.value, isDone: isDone.value,
date: transactionDate.value date: transactionDate.value
} as UpdateTransactionDTO } as UpdateTransactionDTO
@@ -157,7 +158,7 @@ const buildCreate = (): CreateTransactionDTO => {
if (validateForm()) { if (validateForm()) {
return { return {
type: transactionType.value, type: transactionType.value,
kind: transactionKind.value, kind: transactionDate.value < new Date() ? TransactionKind.INSTANT : TransactionKind.PLANNING,
categoryId: transactionCategory.value.id, categoryId: transactionCategory.value.id,
comment: transactionComment.value, comment: transactionComment.value,
amount: transactionAmount.value, amount: transactionAmount.value,
@@ -350,13 +351,13 @@ onMounted(async () => {
<!-- optionValue="value"--> <!-- optionValue="value"-->
<!-- class="!w-full !items-center !justify-center !border-none "/>--> <!-- class="!w-full !items-center !justify-center !border-none "/>-->
<!-- </div>--> <!-- </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> <!-- <span class="text-lg hidden lg:flex">Вид транзакции</span>-->
<SelectButton v-model="transactionKind" :options="optionsKind" optionLabel="label" <!-- <SelectButton v-model="transactionKind" :options="optionsKind" optionLabel="label"-->
optionValue="value" <!-- optionValue="value"-->
class="!w-full !items-center !justify-center !border-none "/> <!-- class="!w-full !items-center !justify-center !border-none "/>-->
</div> <!-- </div>-->
</div> </div>
<div class="flex flex-col w-full justify-items-start"> <div class="flex flex-col w-full justify-items-start">
<label class="!font-semibold text-gray-600 pl-2">Transaction name</label> <label class="!font-semibold text-gray-600 pl-2">Transaction name</label>

View File

@@ -57,6 +57,7 @@ onMounted(async () => {
</script> </script>
<template> <template>
<div v-if="!spaceStore.selectedSpaceId" class="card"> <div v-if="!spaceStore.selectedSpaceId" class="card">
Try to select a space first. Try to select a space first.
</div> </div>
@@ -102,9 +103,10 @@ onMounted(async () => {
class="flex flex-col w-full gap-0 pl-5 items-start justify-items-center font-bold "> 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 w-full items-center justify-between">
<div class="flex flex-row items-center gap-2 "> <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-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> </div>
<div class="flex flex-row gap-2 items-center"> <div class="flex flex-row gap-2 items-center">