Skip to content

feat: Add Suggestion To Use Bulk URL Import #2852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/components/Domain/Recipe/RecipeActionMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default defineComponent({
default: false,
},
},
setup(props, context) {
setup(_, context) {
const deleteDialog = ref(false);

const { i18n, $globals } = useContext();
Expand Down
2 changes: 2 additions & 0 deletions frontend/lang/messages/en-US.json
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,8 @@
"new-recipe-names-must-be-unique": "New recipe names must be unique",
"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-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",
"stay-in-edit-mode": "Stay in Edit mode",
"import-from-zip": "Import from Zip",
Expand Down
12 changes: 6 additions & 6 deletions frontend/pages/g/_groupSlug/r/create.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

<AdvancedOnly>
<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>
</AdvancedOnly>
</div>
Expand All @@ -42,6 +42,11 @@ export default defineComponent({
text: i18n.tc("recipe.import-with-url"),
value: "url",
},
{
icon: $globals.icons.link,
text: i18n.tc("recipe.bulk-url-import"),
value: "bulk",
},
{
icon: $globals.icons.edit,
text: i18n.tc("recipe.create-recipe"),
Expand All @@ -52,11 +57,6 @@ export default defineComponent({
text: i18n.tc("recipe.import-with-zip"),
value: "zip",
},
{
icon: $globals.icons.link,
text: i18n.tc("recipe.bulk-url-import"),
value: "bulk",
},
{
icon: $globals.icons.robot,
text: i18n.tc("recipe.debug-scraper"),
Expand Down
9 changes: 8 additions & 1 deletion frontend/pages/g/_groupSlug/r/create/url.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
<div>
<v-card-title class="headline"> {{ $t('recipe.scrape-recipe') }} </v-card-title>
<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-model="recipeUrl"
:label="$t('new-recipe.recipe-url')"
Expand Down Expand Up @@ -94,6 +95,11 @@ export default defineComponent({
const router = useRouter();
const tags = useTagStore();

const bulkImporterTarget = computed(() => {
const urlIndex = route.value.fullPath.lastIndexOf("/url");
return route.value.fullPath.slice(0, urlIndex) + "/bulk";
});

function handleResponse(response: AxiosResponse<string> | null, edit = false, refreshTags = false) {
if (response?.status !== 201) {
state.error = true;
Expand Down Expand Up @@ -167,6 +173,7 @@ export default defineComponent({
}

return {
bulkImporterTarget,
recipeUrl,
importKeywordsAsTags,
stayInEditMode,
Expand Down