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:
parent
60908e5a88
commit
3b920babe3
25 changed files with 961 additions and 131 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue