diff --git a/vue/src/apps/ImportView/ImportView.vue b/vue/src/apps/ImportView/ImportView.vue index 0090ba926..6e6f39b7a 100644 --- a/vue/src/apps/ImportView/ImportView.vue +++ b/vue/src/apps/ImportView/ImportView.vue @@ -18,6 +18,7 @@ Website + Multiple RecipesSingle Recipe + - + + - - + + -
+ Import + + +
@@ -250,10 +243,14 @@ - Import & View - Import & Edit + Import & + View + + Import & Edit - Import & Restart + Import & + Restart Restart @@ -373,13 +370,9 @@ export default { // URL import LS_IMPORT_RECENT: 'import_recent_urls', //TODO use central helper to manage all local storage keys (and maybe even access) website_url: '', - website_url_list: [ - 'https://madamedessert.de/schokoladenpudding-rezept-mit-echter-schokolade/', - 'https://www.essen-und-trinken.de/rezepte/58294-rzpt-schokoladenpudding', - 'https://www.chefkoch.de/rezepte/1825781296124455/Schokoladenpudding-selbst-gemacht.html', - 'test.com', - 'https://bla.com' - ], + website_url_list: 'https://madamedessert.de/schokoladenpudding-rezept-mit-echter-schokolade/\nhttps://www.essen-und-trinken.de/rezepte/58294-rzpt-schokoladenpudding\n' + + 'https://www.chefkoch.de/rezepte/1825781296124455/Schokoladenpudding-selbst-gemacht.html\ntest.com\nhttps://bla.com', + import_multiple: false, recent_urls: [], source_data: '', @@ -563,12 +556,12 @@ export default { */ autoImport: function () { this.collapse_visible.import = true - this.website_url_list.forEach(r => { + this.website_url_list.split('\n').forEach(r => { this.loadRecipe(r, true, undefined).then((recipe_json) => { - this.website_url_list = this.website_url_list.filter(u => u !== r) - this.importRecipe('multi_import', recipe_json) //TODO handle feedback of what was imported and what not + this.importRecipe('multi_import', recipe_json, true) }) }) + this.website_url_list = '' }, /** * Import recipes with uploaded files and app integration @@ -587,14 +580,6 @@ export default { StandardToasts.makeStandardToast(StandardToasts.FAIL_CREATE) }) }, - /** - * Adds Website to url list, prevents duplicates - */ - addWebsiteToURLList: function (url) { - if (this.website_url_list.indexOf(url) === -1 && url !== '') { - this.website_url_list.push(url) - } - }, /** * Handles pasting URLs */