1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-24 07:39:41 +02:00

feature/improve-parser-ux (#789)

* cleanup console.logs

* default to panels open

* feat(frontend):  add ingredient on enter

* feat(frontend):  automatically trigger parser on navigation

* feat(frontend):  prompt user before leaving when in editor

* add deep copy utility

* improve flow of parser

* add tooltip and match disable with disableAmount

* force admin users to have advanced access

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden 2021-11-06 14:32:55 -08:00 committed by GitHub
parent 788e176b16
commit c1ba8dcd86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 462 additions and 140 deletions

View file

@ -38,7 +38,11 @@
item-text="name"
class="mx-1"
placeholder="Choose Unit"
@keyup.enter="handleUnitEnter"
>
<template #no-data>
<div class="caption text-center pb-2">Press Enter to Create</div>
</template>
<template #append-item>
<div class="px-2">
<BaseButton block small @click="createAssignUnit()"></BaseButton>
@ -60,7 +64,11 @@
item-text="name"
class="mx-1 py-0"
placeholder="Choose Food"
@keyup.enter="handleFoodEnter"
>
<template #no-data>
<div class="caption text-center pb-2">Press Enter to Create</div>
</template>
<template #append-item>
<div class="px-2">
<BaseButton block small @click="createAssignFood()"></BaseButton>
@ -132,7 +140,6 @@ export default defineComponent({
workingUnitData.name = unitSearch.value;
await unitActions.createOne();
value.unit = units.value?.find((unit) => unit.name === unitSearch.value);
console.log(value.unit);
}
const state = reactive({
@ -149,7 +156,23 @@ export default defineComponent({
}
}
function handleUnitEnter() {
if (value.unit === null || !value.unit.name.includes(unitSearch.value)) {
console.log("Creating");
createAssignUnit();
}
}
function handleFoodEnter() {
if (value.food === null || !value.food.name.includes(foodSearch.value)) {
console.log("Creating");
createAssignFood();
}
}
return {
handleUnitEnter,
handleFoodEnter,
...toRefs(state),
createAssignFood,
createAssignUnit,