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

feat: Add brute strategy to ingredient processor (#744)

* fix UI column width

* words

* update parser to support diff strats

* add new model url

* make button more visible

* fix nutrition error

* feat(backend):  add 'brute' strategy for parsing ingredients

* satisfy linter

* update UI for creation page

* feat(backend):  log 422 errors in detail when not in PRODUCTION

* add strategy selector

Co-authored-by: Hayden <hay-kot@pm.me>
This commit is contained in:
Hayden 2021-10-16 16:06:13 -08:00 committed by GitHub
parent 60908e5a88
commit 3b920babe3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
25 changed files with 961 additions and 131 deletions

View file

@ -7,11 +7,8 @@
<template #title> Recipe Creation </template>
Select one of the various ways to create a recipe
</BasePageTitle>
<v-tabs v-model="tab">
<v-tab href="#url">From URL</v-tab>
<v-tab href="#new">Create</v-tab>
<v-tab href="#zip">Import Zip</v-tab>
</v-tabs>
<BaseOverflowButton v-model="tab" rounded class="mx-2" outlined :items="tabs"> </BaseOverflowButton>
<section>
<v-tabs-items v-model="tab" class="mt-10">
<v-tab-item value="url" eager>
@ -127,7 +124,7 @@
</template>
<script lang="ts">
import { defineComponent, reactive, toRefs, ref, useRouter } from "@nuxtjs/composition-api";
import { defineComponent, reactive, toRefs, ref, useRouter, useContext } from "@nuxtjs/composition-api";
import { useApiSingleton } from "~/composables/use-api";
import { validators } from "~/composables/use-validators";
export default defineComponent({
@ -137,6 +134,27 @@ export default defineComponent({
loading: false,
});
// @ts-ignore - $globals not found in type definition
const { $globals } = useContext();
const tabs = [
{
icon: $globals.icons.edit,
text: "Create Recipe",
value: "new",
},
{
icon: $globals.icons.link,
text: "Import with URL",
value: "url",
},
{
icon: $globals.icons.zip,
text: "Import with .zip",
value: "zip",
},
];
const api = useApiSingleton();
const router = useRouter();
@ -203,6 +221,7 @@ export default defineComponent({
}
return {
tabs,
domCreateByName,
domUrlForm,
newRecipeName,