mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-01 04:10:06 -05:00
quick import
This commit is contained in:
@@ -32,10 +32,9 @@
|
|||||||
<v-alert variant="tonal" v-if="importResponse.duplicates && importResponse.duplicates.length > 0">
|
<v-alert variant="tonal" v-if="importResponse.duplicates && importResponse.duplicates.length > 0">
|
||||||
<v-alert-title>{{ $t('Duplicate') }}</v-alert-title>
|
<v-alert-title>{{ $t('Duplicate') }}</v-alert-title>
|
||||||
{{ $t('DuplicateFoundInfo') }}
|
{{ $t('DuplicateFoundInfo') }}
|
||||||
<v-chip-group>
|
<v-list>
|
||||||
<v-chip :to="{name: 'view_recipe', params: {id: r.id}}" v-for="r in importResponse.duplicates" :key="r.id"> {{ r.name }}</v-chip>
|
<v-list-item :to="{name: 'view_recipe', params: {id: r.id}}" v-for="r in importResponse.duplicates" :key="r.id"> {{ r.name }} (#{{r.id}})</v-list-item>
|
||||||
</v-chip-group>
|
</v-list>
|
||||||
<v-btn color="primary" class="float-right" @click="stepper = '2'">{{ $t('Continue') }}</v-btn>
|
|
||||||
</v-alert>
|
</v-alert>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
</v-card>
|
</v-card>
|
||||||
@@ -187,7 +186,10 @@
|
|||||||
<v-btn @click="stepper = (parseInt(stepper) - 1).toString()">Zurück</v-btn>
|
<v-btn @click="stepper = (parseInt(stepper) - 1).toString()">Zurück</v-btn>
|
||||||
</template>
|
</template>
|
||||||
<template #next>
|
<template #next>
|
||||||
<v-btn @click="stepper = (parseInt(stepper) + 1).toString()" :disabled="Object.keys(importResponse).length == 0" v-if="stepper != '5'">{{$t('Next')}}</v-btn>
|
<v-btn @click="createRecipeFromImport()" color="success" :disabled="false" v-if="stepper == '1'">{{$t('Import')}}</v-btn>
|
||||||
|
<v-btn @click="stepper = (parseInt(stepper) + 1).toString()" :disabled="Object.keys(importResponse).length == 0" v-if="stepper != '5'">
|
||||||
|
{{stepper == '1' ? $t('Edit') : $t('Next')}}
|
||||||
|
</v-btn>
|
||||||
<v-btn @click="createRecipeFromImport()" color="success" :disabled="false" v-if="stepper == '5'">{{$t('Import')}}</v-btn>
|
<v-btn @click="createRecipeFromImport()" color="success" :disabled="false" v-if="stepper == '5'">{{$t('Import')}}</v-btn>
|
||||||
</template>
|
</template>
|
||||||
</v-stepper-actions>
|
</v-stepper-actions>
|
||||||
@@ -237,10 +239,6 @@ function loadRecipeFromUrl() {
|
|||||||
loading.value = true
|
loading.value = true
|
||||||
api.apiRecipeFromSourceCreate({recipeFromSource: {url: importUrl.value}}).then(r => {
|
api.apiRecipeFromSourceCreate({recipeFromSource: {url: importUrl.value}}).then(r => {
|
||||||
importResponse.value = r
|
importResponse.value = r
|
||||||
if (r.duplicates.length == 0) {
|
|
||||||
// automatically continue only if no duplicates were found
|
|
||||||
stepper.value = "2"
|
|
||||||
}
|
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
useMessageStore().addError(ErrorMessageType.FETCH_ERROR, err)
|
useMessageStore().addError(ErrorMessageType.FETCH_ERROR, err)
|
||||||
}).finally(() => {
|
}).finally(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user