release v2.0.0 #4

Merged
crimsen merged 481 commits from develop into master 2024-01-18 15:15:08 +00:00
5 changed files with 6 additions and 60 deletions
Showing only changes of commit cee6eda585 - Show all commits

View File

@ -4,7 +4,6 @@
title="Preistabelle"
:columns="columns"
:rows="drinks"
:visible-columns="visibleColumn"
dense
:filter="search"
:filter-method="filter"
@ -19,19 +18,6 @@
<min-price-setting />
</q-menu>
</q-btn>
<!--<q-select
v-model="visibleColumn"
multiple
filled
dense
options-dense
display-value="Sichtbarkeit"
emit-value
map-options
:options="[...columns, ...column_calc, ...column_prices]"
option-value="name"
options-cover
/>-->
<q-btn
v-if="!public && !nodetails && editable"
color="primary"
@ -39,9 +25,6 @@
icon="mdi-plus"
@click="newDrink"
>
<!--<q-menu v-model="showNewDrink" anchor="center middle" self="center middle" persistent>
<new-drink @close="showNewDrink = false" />
</q-menu>-->
<q-tooltip> Neues Getränk </q-tooltip>
</q-btn>
</div>
@ -52,7 +35,7 @@
<q-img
style="max-height: 256px"
:src="
props.row.uuid ? `/api/pricelist/picture/${props.row.uuid}?size=256` : 'no-image.svg'
props.row.uuid ? `/api/pricelist/picture/${props.row.uuid}?size=400` : 'no-image.svg'
"
>
<div
@ -163,7 +146,6 @@
<script lang="ts">
import { defineComponent, onBeforeMount, ComputedRef, computed, ref } from 'vue';
import { useMainStore } from 'src/stores';
import { Drink, usePricelistStore, DrinkPriceVolume } from 'src/plugins/pricelist/store';
import MinPriceSetting from 'src/plugins/pricelist/components/MinPriceSetting.vue';
import SearchInput from './SearchInput.vue';
@ -197,23 +179,12 @@ export default defineComponent({
},
},
setup(props) {
const mainStore = useMainStore();
const store = usePricelistStore();
onBeforeMount(() => {
void store.getDrinks();
try {
user.value = mainStore.currentUser.userid;
} catch {
user.value = undefined;
}
if (user.value) {
store.getPriceCalcColumn(user.value);
}
});
const user = ref<string>();
const columns = [
{
@ -369,12 +340,6 @@ export default defineComponent({
field: 'public',
},
];
const visibleColumn = computed({
get: () => store.pricecalc_columns,
set: (val) => {
store.updatePriceCalcColumn(<string>user.value, val);
},
});
const search_keys = computed(() =>
columns.filter(
@ -515,7 +480,6 @@ export default defineComponent({
columns,
column_calc,
column_prices,
visibleColumn,
drinkTypes,
updateDrink,
deleteDrink,

View File

@ -32,6 +32,7 @@ export default defineComponent({
props: {
steps: {
type: Array as PropType<Array<string>>,
default: undefined
},
editable: {
type: Boolean,

View File

@ -101,7 +101,7 @@
</div>
<div class="q-pa-sm">
<ingredients
v-if="!public && !cost_per_volume"
v-if="!public && !costPerVolume"
v-model="volume.ingredients"
:editable="editable"
@update="updateVolume(volume)"
@ -136,8 +136,9 @@ export default defineComponent({
type: Array as PropType<Array<DrinkPriceVolume>>,
required: true,
},
cost_per_volume: {
costPerVolume: {
type: undefined,
default: undefined
},
editable: {
type: Boolean,

View File

@ -125,7 +125,7 @@
<q-card-section :key="key">
<drink-price-volumes
v-model="edit_volumes"
:cost_per_volume="cost_per_volume"
:cost-per-volume="cost_per_volume"
editable
@update="updateVolume"
@delete-volume="deleteVolume"

View File

@ -1,6 +1,5 @@
import { api } from 'src/boot/axios';
import { defineStore } from 'pinia';
import { AxiosResponse } from 'axios';
import {
calc_volume,
calc_cost_per_volume,
@ -66,7 +65,6 @@ export const usePricelistStore = defineStore({
drinkTypes: [] as Array<FG.DrinkType>,
drinks: [] as Array<Drink>,
extraIngredients: [] as Array<FG.ExtraIngredient>,
pricecalc_columns: [] as Array<string>,
min_prices: [] as Array<number>,
tags: [] as Array<FG.Tag>,
}),
@ -199,24 +197,6 @@ export const usePricelistStore = defineStore({
})
.catch((err) => console.warn(err));
},
getPriceCalcColumn(userid: string) {
api
.get(`pricelist/users/${userid}/pricecalc_columns`)
.then(({ data }: AxiosResponse<Array<string>>) => {
if (data.length > 0) {
this.pricecalc_columns = data;
}
})
.catch((err) => console.log(err));
},
updatePriceCalcColumn(userid: string, data: Array<string>) {
api
.put(`pricelist/users/${userid}/pricecalc_columns`, data)
.then(() => {
this.pricecalc_columns = data;
})
.catch((err) => console.log(err));
},
async get_min_prices() {
const { data } = await api.get<Array<number>>('pricelist/settings/min_prices');
this.min_prices = data;