mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-30 17:53:31 -04:00 
			
		
		
		
	feat: Add Suggestion To Use Bulk URL Import (#2852)
* fixed warning * re-arranged menu options * fixed broken link * added bulk url suggestion * simply bulk import url var --------- Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
		| @@ -139,7 +139,7 @@ export default defineComponent({ | |||||||
|       default: false, |       default: false, | ||||||
|     }, |     }, | ||||||
|   }, |   }, | ||||||
|   setup(props, context) { |   setup(_, context) { | ||||||
|     const deleteDialog = ref(false); |     const deleteDialog = ref(false); | ||||||
|  |  | ||||||
|     const { i18n, $globals } = useContext(); |     const { i18n, $globals } = useContext(); | ||||||
|   | |||||||
| @@ -533,6 +533,8 @@ | |||||||
|     "new-recipe-names-must-be-unique": "New recipe names must be unique", |     "new-recipe-names-must-be-unique": "New recipe names must be unique", | ||||||
|     "scrape-recipe": "Scrape Recipe", |     "scrape-recipe": "Scrape Recipe", | ||||||
|     "scrape-recipe-description": "Scrape a recipe by url. Provide the url for the site you want to scrape, and Mealie will attempt to scrape the recipe from that site and add it to your collection.", |     "scrape-recipe-description": "Scrape a recipe by url. Provide the url for the site you want to scrape, and Mealie will attempt to scrape the recipe from that site and add it to your collection.", | ||||||
|  |     "scrape-recipe-have-a-lot-of-recipes": "Have a lot of recipes you want to scrape at once?", | ||||||
|  |     "scrape-recipe-suggest-bulk-importer": "Try out the bulk importer", | ||||||
|     "import-original-keywords-as-tags": "Import original keywords as tags", |     "import-original-keywords-as-tags": "Import original keywords as tags", | ||||||
|     "stay-in-edit-mode": "Stay in Edit mode", |     "stay-in-edit-mode": "Stay in Edit mode", | ||||||
|     "import-from-zip": "Import from Zip", |     "import-from-zip": "Import from Zip", | ||||||
|   | |||||||
| @@ -20,7 +20,7 @@ | |||||||
|  |  | ||||||
|     <AdvancedOnly> |     <AdvancedOnly> | ||||||
|       <v-container class="d-flex justify-center align-center my-4"> |       <v-container class="d-flex justify-center align-center my-4"> | ||||||
|         <a :to="`/group/migrations`"> {{ $t('recipe.looking-for-migrations') }}</a> |         <router-link :to="`/group/migrations`"> {{ $t('recipe.looking-for-migrations') }}</router-link> | ||||||
|       </v-container> |       </v-container> | ||||||
|     </AdvancedOnly> |     </AdvancedOnly> | ||||||
|   </div> |   </div> | ||||||
| @@ -42,6 +42,11 @@ export default defineComponent({ | |||||||
|         text: i18n.tc("recipe.import-with-url"), |         text: i18n.tc("recipe.import-with-url"), | ||||||
|         value: "url", |         value: "url", | ||||||
|       }, |       }, | ||||||
|  |       { | ||||||
|  |         icon: $globals.icons.link, | ||||||
|  |         text: i18n.tc("recipe.bulk-url-import"), | ||||||
|  |         value: "bulk", | ||||||
|  |       }, | ||||||
|       { |       { | ||||||
|         icon: $globals.icons.edit, |         icon: $globals.icons.edit, | ||||||
|         text: i18n.tc("recipe.create-recipe"), |         text: i18n.tc("recipe.create-recipe"), | ||||||
| @@ -52,11 +57,6 @@ export default defineComponent({ | |||||||
|         text: i18n.tc("recipe.import-with-zip"), |         text: i18n.tc("recipe.import-with-zip"), | ||||||
|         value: "zip", |         value: "zip", | ||||||
|       }, |       }, | ||||||
|       { |  | ||||||
|         icon: $globals.icons.link, |  | ||||||
|         text: i18n.tc("recipe.bulk-url-import"), |  | ||||||
|         value: "bulk", |  | ||||||
|       }, |  | ||||||
|       { |       { | ||||||
|         icon: $globals.icons.robot, |         icon: $globals.icons.robot, | ||||||
|         text: i18n.tc("recipe.debug-scraper"), |         text: i18n.tc("recipe.debug-scraper"), | ||||||
|   | |||||||
| @@ -4,7 +4,8 @@ | |||||||
|       <div> |       <div> | ||||||
|         <v-card-title class="headline"> {{ $t('recipe.scrape-recipe') }} </v-card-title> |         <v-card-title class="headline"> {{ $t('recipe.scrape-recipe') }} </v-card-title> | ||||||
|         <v-card-text> |         <v-card-text> | ||||||
|           {{ $t('recipe.scrape-recipe-description') }} |           <p>{{ $t('recipe.scrape-recipe-description') }}</p> | ||||||
|  |           <p>{{ $t('recipe.scrape-recipe-have-a-lot-of-recipes') }} <a :href="bulkImporterTarget">{{ $t('recipe.scrape-recipe-suggest-bulk-importer') }}</a>.</p> | ||||||
|           <v-text-field |           <v-text-field | ||||||
|             v-model="recipeUrl" |             v-model="recipeUrl" | ||||||
|             :label="$t('new-recipe.recipe-url')" |             :label="$t('new-recipe.recipe-url')" | ||||||
| @@ -94,6 +95,8 @@ export default defineComponent({ | |||||||
|     const router = useRouter(); |     const router = useRouter(); | ||||||
|     const tags = useTagStore(); |     const tags = useTagStore(); | ||||||
|  |  | ||||||
|  |     const bulkImporterTarget = computed(() => `/g/${groupSlug.value}/r/create/bulk`); | ||||||
|  |  | ||||||
|     function handleResponse(response: AxiosResponse<string> | null, edit = false, refreshTags = false) { |     function handleResponse(response: AxiosResponse<string> | null, edit = false, refreshTags = false) { | ||||||
|       if (response?.status !== 201) { |       if (response?.status !== 201) { | ||||||
|         state.error = true; |         state.error = true; | ||||||
| @@ -167,6 +170,7 @@ export default defineComponent({ | |||||||
|     } |     } | ||||||
|  |  | ||||||
|     return { |     return { | ||||||
|  |       bulkImporterTarget, | ||||||
|       recipeUrl, |       recipeUrl, | ||||||
|       importKeywordsAsTags, |       importKeywordsAsTags, | ||||||
|       stayInEditMode, |       stayInEditMode, | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user