feature/recipe-patch-improvements (#382)

* automated docs update

* recipe rating component

* recipe partial updates - closes #25

* use Vue.delete to update store

* format

* arrow functions

* fix tests

* format

* initial context menu

* localize

* add confirmation dialog

* context menu

* fix bare exception

* update line length

* format all file with prettier

* update changelog

* download as json

* update python dependencies

* update javascript dependencies

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden
2021-05-01 20:46:02 -08:00
committed by GitHub
parent c196445e61
commit be378cb20c
121 changed files with 18942 additions and 4765 deletions

View File

@@ -10,33 +10,16 @@
:top="true"
>
<v-card-text>
<v-text-field
v-model="search"
autocomplete="off"
:label="$t('general.keyword')"
></v-text-field>
<CategoryTagSelector
:tag-selector="false"
v-model="catsToAssign"
:return-object="false"
/>
<CategoryTagSelector
:tag-selector="true"
v-model="tagsToAssign"
:return-object="false"
/>
<v-text-field v-model="search" autocomplete="off" :label="$t('general.keyword')"></v-text-field>
<CategoryTagSelector :tag-selector="false" v-model="catsToAssign" :return-object="false" />
<CategoryTagSelector :tag-selector="true" v-model="tagsToAssign" :return-object="false" />
</v-card-text>
<template slot="card-actions">
<v-btn text color="grey" @click="closeDialog">
{{ $t("general.cancel") }}
</v-btn>
<v-spacer></v-spacer>
<v-btn
color="success"
@click="assignAll"
:loading="loading"
:disabled="results.length < 1"
>
<v-btn color="success" @click="assignAll" :loading="loading" :disabled="results.length < 1">
{{ $t("settings.toolbox.assign-all") }}
</v-btn>
</template>
@@ -122,9 +105,7 @@ export default {
assignAll() {
this.loading = true;
this.results.forEach(async element => {
element.recipeCategory = element.recipeCategory.concat(
this.catsToAssign
);
element.recipeCategory = element.recipeCategory.concat(this.catsToAssign);
element.tags = element.tags.concat(this.tagsToAssign);
await api.recipes.patch(element);
});
@@ -154,9 +135,7 @@ export default {
return [];
}
return this.allRecipes.filter(x => {
return (
this.checkForKeywords(x.name) || this.checkForKeywords(x.description)
);
return this.checkForKeywords(x.name) || this.checkForKeywords(x.description);
});
},
checkForKeywords(str) {
@@ -167,5 +146,4 @@ export default {
};
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>

View File

@@ -4,11 +4,7 @@
ref="deleteDialog"
title-icon="mdi-tag"
color="error"
:title="
$t('general.delete') +
' ' +
(isTags ? $t('tag.tags') : $t('recipe.categories'))
"
:title="$t('general.delete') + ' ' + (isTags ? $t('tag.tags') : $t('recipe.categories'))"
:loading="loading"
modal-width="400"
>
@@ -27,12 +23,7 @@
{{ $t("general.cancel") }}
</v-btn>
<v-spacer></v-spacer>
<v-btn
color="error"
@click="deleteUnused"
:loading="loading"
:disabled="deleteList.length < 1"
>
<v-btn color="error" @click="deleteUnused" :loading="loading" :disabled="deleteList.length < 1">
{{ $t("general.delete") }}
</v-btn>
</template>
@@ -95,5 +86,4 @@ export default {
};
</script>
<style lang="scss" scoped>
</style>
<style lang="scss" scoped></style>

View File

@@ -43,24 +43,14 @@
<BulkAssign isTags="isTags" class="mr-1 mb-1" />
<v-btn
@click="titleCaseAll"
small
color="success"
class="mr-1 mb-1"
:loading="loadingTitleCase"
>
<v-btn @click="titleCaseAll" small color="success" class="mr-1 mb-1" :loading="loadingTitleCase">
{{ $t("settings.toolbox.title-case-all") }}
</v-btn>
<RemoveUnused :isTags="isTags" class="mb-1" />
<v-spacer v-if="!isMobile"> </v-spacer>
<fuse-search-bar
:raw-data="allItems"
@results="filterItems"
:search="searchString"
>
<fuse-search-bar :raw-data="allItems" @results="filterItems" :search="searchString">
<v-text-field
v-model="searchString"
clearable
@@ -79,24 +69,16 @@
<v-card-text>
<v-row>
<v-col
cols="12"
:sm="12"
:md="6"
:lg="4"
:xl="3"
v-for="item in results"
:key="item.id"
>
<v-col cols="12" :sm="12" :md="6" :lg="4" :xl="3" v-for="item in results" :key="item.id">
<v-card>
<v-card-actions>
<v-card-title class="py-1">{{ item.name }}</v-card-title>
<v-spacer></v-spacer>
<v-btn small text color="info" @click="openEditDialog(item)">
{{$t('general.edit')}}
{{ $t("general.edit") }}
</v-btn>
<v-btn small text color="error" @click="deleteItem(item.slug)">
{{$t('general.delete')}}
{{ $t("general.delete") }}
</v-btn>
</v-card-actions>
</v-card>
@@ -149,9 +131,7 @@ export default {
return this.$vuetify.breakpoint.name === "xs";
},
allItems() {
return this.isTags
? this.$store.getters.getAllTags
: this.$store.getters.getAllCategories;
return this.isTags ? this.$store.getters.getAllTags : this.$store.getters.getAllCategories;
},
results() {
if (this.searchString != null && this.searchString.length >= 1) {
@@ -176,7 +156,7 @@ export default {
}
this.renameTarget = {
title:this.$t('general.rename-object', [item.name]),
title: this.$t("general.rename-object", [item.name]),
name: item.name,
slug: item.slug,
newName: "",
@@ -240,4 +220,4 @@ export default {
height: auto !important;
flex-wrap: wrap;
}
</style>
</style>

View File

@@ -1,13 +1,7 @@
<template>
<div>
<v-card flat>
<v-tabs
v-model="tab"
background-color="primary"
centered
dark
icons-and-text
>
<v-tabs v-model="tab" background-color="primary" centered dark icons-and-text>
<v-tabs-slider></v-tabs-slider>
<v-tab>
@@ -43,5 +37,4 @@ export default {
};
</script>
<style>
</style>
<style></style>