mirror of
https://github.com/hay-kot/mealie.git
synced 2025-07-15 01:23:57 -07:00
feat: bulk recipe settings update (#1557)
* extract switches from menu component * implement bulk updater for settings * fix browser cache api calls issue * add frontend for bulk settings modifications
This commit is contained in:
parent
5cfff75dbe
commit
7adcc86d03
10 changed files with 168 additions and 66 deletions
51
frontend/components/Domain/Recipe/RecipeSettingsSwitches.vue
Normal file
51
frontend/components/Domain/Recipe/RecipeSettingsSwitches.vue
Normal file
|
@ -0,0 +1,51 @@
|
|||
<template>
|
||||
<div>
|
||||
<v-switch
|
||||
v-for="(_, key) in value"
|
||||
:key="key"
|
||||
v-model="value[key]"
|
||||
xs
|
||||
dense
|
||||
:disabled="key == 'locked' && !isOwner"
|
||||
class="my-1"
|
||||
:label="labels[key]"
|
||||
hide-details
|
||||
></v-switch>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts">
|
||||
import { defineComponent, useContext } from "@nuxtjs/composition-api";
|
||||
import { RecipeSettings } from "~/types/api-types/recipe";
|
||||
|
||||
export default defineComponent({
|
||||
props: {
|
||||
value: {
|
||||
type: Object as () => RecipeSettings,
|
||||
required: true,
|
||||
},
|
||||
isOwner: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
},
|
||||
},
|
||||
setup() {
|
||||
const { i18n } = useContext();
|
||||
const labels: Record<keyof RecipeSettings, string> = {
|
||||
public: i18n.tc("recipe.public-recipe"),
|
||||
showNutrition: i18n.tc("recipe.show-nutrition-values"),
|
||||
showAssets: i18n.tc("asset.show-assets"),
|
||||
landscapeView: i18n.tc("recipe.landscape-view-coming-soon"),
|
||||
disableComments: i18n.tc("recipe.disable-comments"),
|
||||
disableAmount: i18n.tc("recipe.disable-amount"),
|
||||
locked: i18n.tc("recipe.locked"),
|
||||
};
|
||||
|
||||
return {
|
||||
labels,
|
||||
};
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
Loading…
Add table
Add a link
Reference in a new issue