mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-31 10:13:32 -04:00 
			
		
		
		
	feat: update inline docs on group page to clarify private/public settings (#2190)
This commit is contained in:
		
							
								
								
									
										29
									
								
								frontend/components/global/DocLink.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								frontend/components/global/DocLink.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | |||||||
|  | <template> | ||||||
|  |   <v-btn x-small :href="href" color="primary" target="_blank"> | ||||||
|  |     <v-icon left small> | ||||||
|  |       {{ $globals.icons.folderOutline }} | ||||||
|  |     </v-icon> | ||||||
|  |     {{ $tc("about.docs") }} | ||||||
|  |   </v-btn> | ||||||
|  | </template> | ||||||
|  |  | ||||||
|  | <script lang="ts"> | ||||||
|  | import { computed, defineComponent } from "@nuxtjs/composition-api"; | ||||||
|  |  | ||||||
|  | export default defineComponent({ | ||||||
|  |   props: { | ||||||
|  |     link: { | ||||||
|  |       type: String, | ||||||
|  |       required: true, | ||||||
|  |     }, | ||||||
|  |   }, | ||||||
|  |   setup(props) { | ||||||
|  |     const href = computed(() => { | ||||||
|  |       // TODO: dynamically set docs link based off env | ||||||
|  |       return `https://nightly.mealie.io${props.link}`; | ||||||
|  |     }); | ||||||
|  |  | ||||||
|  |     return { href }; | ||||||
|  |   }, | ||||||
|  | }); | ||||||
|  | </script> | ||||||
| @@ -209,12 +209,19 @@ | |||||||
|     "default-recipe-preferences": "Default Recipe Preferences", |     "default-recipe-preferences": "Default Recipe Preferences", | ||||||
|     "group-preferences": "Group Preferences", |     "group-preferences": "Group Preferences", | ||||||
|     "private-group": "Private Group", |     "private-group": "Private Group", | ||||||
|  |     "private-group-description": "Setting your group to private will default all public view options to default. This overrides an individual recipes public view settings.", | ||||||
|     "allow-users-outside-of-your-group-to-see-your-recipes": "Allow users outside of your group to see your recipes", |     "allow-users-outside-of-your-group-to-see-your-recipes": "Allow users outside of your group to see your recipes", | ||||||
|  |     "allow-users-outside-of-your-group-to-see-your-recipes-description": "When enabled you can use a public share link to share specific recipes without authorizing the user. When disabled, you can only share recipes with users who are in your group or with a pre-generated private link", | ||||||
|     "show-nutrition-information": "Show nutrition information", |     "show-nutrition-information": "Show nutrition information", | ||||||
|  |     "show-nutrition-information-description": "When enabled the nutrition information will be shown on the recipe if available. If there is no nutrition information available, the nutrition information will not be shown", | ||||||
|     "show-recipe-assets": "Show recipe assets", |     "show-recipe-assets": "Show recipe assets", | ||||||
|  |     "show-recipe-assets-description": "When enabled the recipe assets will be shown on the recipe if available", | ||||||
|     "default-to-landscape-view": "Default to landscape view", |     "default-to-landscape-view": "Default to landscape view", | ||||||
|  |     "default-to-landscape-view-description": "When enabled the recipe header section will be shown in landscape view", | ||||||
|     "disable-users-from-commenting-on-recipes": "Disable users from commenting on recipes", |     "disable-users-from-commenting-on-recipes": "Disable users from commenting on recipes", | ||||||
|  |     "disable-users-from-commenting-on-recipes-description": "Hides the comment section on the recipe page and disables commenting", | ||||||
|     "disable-organizing-recipe-ingredients-by-units-and-food": "Disable organizing recipe ingredients by units and food", |     "disable-organizing-recipe-ingredients-by-units-and-food": "Disable organizing recipe ingredients by units and food", | ||||||
|  |     "disable-organizing-recipe-ingredients-by-units-and-food-description": "Hides the Food, Unit, and Amount fields for ingredients and treats ingredients as plain text fields.", | ||||||
|     "general-preferences": "General Preferences", |     "general-preferences": "General Preferences", | ||||||
|     "group-recipe-preferences": "Group Recipe Preferences", |     "group-recipe-preferences": "Group Recipe Preferences", | ||||||
|     "report": "Report" |     "report": "Report" | ||||||
|   | |||||||
| @@ -4,18 +4,27 @@ | |||||||
|       <template #header> |       <template #header> | ||||||
|         <v-img max-height="100" max-width="100" :src="require('~/static/svgs/manage-group-settings.svg')"></v-img> |         <v-img max-height="100" max-width="100" :src="require('~/static/svgs/manage-group-settings.svg')"></v-img> | ||||||
|       </template> |       </template> | ||||||
|       <template #title> {{ $t('profile.group-settings') }} </template> |       <template #title> {{ $t("profile.group-settings") }} </template> | ||||||
|       {{ $t('profile.group-description') }} |       {{ $t("profile.group-description") }} | ||||||
|     </BasePageTitle> |     </BasePageTitle> | ||||||
|  |  | ||||||
|     <section v-if="group"> |     <section v-if="group"> | ||||||
|       <BaseCardSectionTitle class="mt-10" :title="$tc('group.group-preferences')"></BaseCardSectionTitle> |       <BaseCardSectionTitle class="mt-10" :title="$tc('group.group-preferences')"></BaseCardSectionTitle> | ||||||
|       <v-checkbox |       <div class="mb-6"> | ||||||
|         v-model="group.preferences.privateGroup" |         <v-checkbox | ||||||
|         class="mt-n4" |           v-model="group.preferences.privateGroup" | ||||||
|         :label="$t('group.private-group')" |           hide-details | ||||||
|         @change="groupActions.updatePreferences()" |           dense | ||||||
|       ></v-checkbox> |           :label="$t('group.private-group')" | ||||||
|  |           @change="groupActions.updatePreferences()" | ||||||
|  |         /> | ||||||
|  |         <div class="ml-8"> | ||||||
|  |           <p class="text-subtitle-2 my-0 py-0"> | ||||||
|  |             {{ $t("group.private-group-description") }} | ||||||
|  |           </p> | ||||||
|  |           <DocLink class="mt-2" link="/documentation/getting-started/faq/#how-do-private-groups-and-recipes-work" /> | ||||||
|  |         </div> | ||||||
|  |       </div> | ||||||
|       <v-select |       <v-select | ||||||
|         v-model="group.preferences.firstDayOfWeek" |         v-model="group.preferences.firstDayOfWeek" | ||||||
|         :prepend-icon="$globals.icons.calendarWeekBegin" |         :prepend-icon="$globals.icons.calendarWeekBegin" | ||||||
| @@ -29,52 +38,31 @@ | |||||||
|  |  | ||||||
|     <section v-if="group"> |     <section v-if="group"> | ||||||
|       <BaseCardSectionTitle class="mt-10" :title="$tc('group.default-recipe-preferences')"> |       <BaseCardSectionTitle class="mt-10" :title="$tc('group.default-recipe-preferences')"> | ||||||
|         {{ $t('group.default-recipe-preferences-description') }} |         {{ $t("group.default-recipe-preferences-description") }} | ||||||
|       </BaseCardSectionTitle> |       </BaseCardSectionTitle> | ||||||
|  |  | ||||||
|       <v-checkbox |       <div class="preference-container"> | ||||||
|         v-model="group.preferences.recipePublic" |         <div v-for="p in preferencesEditor" :key="p.key"> | ||||||
|         class="mt-n4" |           <v-checkbox | ||||||
|         :label="$t('group.allow-users-outside-of-your-group-to-see-your-recipes')" |             v-model="group.preferences[p.key]" | ||||||
|         @change="groupActions.updatePreferences()" |             hide-details | ||||||
|       ></v-checkbox> |             dense | ||||||
|       <v-checkbox |             :label="p.label" | ||||||
|         v-model="group.preferences.recipeShowNutrition" |             @change="groupActions.updatePreferences()" | ||||||
|         class="mt-n4" |           /> | ||||||
|         :label="$t('group.show-nutrition-information')" |           <p class="ml-8 text-subtitle-2 my-0 py-0"> | ||||||
|         @change="groupActions.updatePreferences()" |             {{ p.description }} | ||||||
|       ></v-checkbox> |           </p> | ||||||
|       <v-checkbox |         </div> | ||||||
|         v-model="group.preferences.recipeShowAssets" |       </div> | ||||||
|         class="mt-n4" |  | ||||||
|         :label="$t('group.show-recipe-assets')" |  | ||||||
|         @change="groupActions.updatePreferences()" |  | ||||||
|       ></v-checkbox> |  | ||||||
|       <v-checkbox |  | ||||||
|         v-model="group.preferences.recipeLandscapeView" |  | ||||||
|         class="mt-n4" |  | ||||||
|         :label="$t('group.default-to-landscape-view')" |  | ||||||
|         @change="groupActions.updatePreferences()" |  | ||||||
|       ></v-checkbox> |  | ||||||
|       <v-checkbox |  | ||||||
|         v-model="group.preferences.recipeDisableComments" |  | ||||||
|         class="mt-n4" |  | ||||||
|         :label="$t('group.disable-users-from-commenting-on-recipes')" |  | ||||||
|         @change="groupActions.updatePreferences()" |  | ||||||
|       ></v-checkbox> |  | ||||||
|       <v-checkbox |  | ||||||
|         v-model="group.preferences.recipeDisableAmount" |  | ||||||
|         class="mt-n4" |  | ||||||
|         :label="$t('group.disable-organizing-recipe-ingredients-by-units-and-food')" |  | ||||||
|         @change="groupActions.updatePreferences()" |  | ||||||
|       ></v-checkbox> |  | ||||||
|     </section> |     </section> | ||||||
|   </v-container> |   </v-container> | ||||||
| </template> | </template> | ||||||
|  |  | ||||||
| <script lang="ts"> | <script lang="ts"> | ||||||
| import { defineComponent, useContext } from "@nuxtjs/composition-api"; | import { computed, defineComponent, useContext } from "@nuxtjs/composition-api"; | ||||||
| import { useGroupSelf } from "~/composables/use-groups"; | import { useGroupSelf } from "~/composables/use-groups"; | ||||||
|  | import { ReadGroupPreferences } from "~/lib/api/types/group"; | ||||||
|  |  | ||||||
| export default defineComponent({ | export default defineComponent({ | ||||||
|   setup() { |   setup() { | ||||||
| @@ -82,6 +70,57 @@ export default defineComponent({ | |||||||
|  |  | ||||||
|     const { i18n } = useContext(); |     const { i18n } = useContext(); | ||||||
|  |  | ||||||
|  |     type Preference = { | ||||||
|  |       key: keyof ReadGroupPreferences; | ||||||
|  |       value: boolean; | ||||||
|  |       label: string; | ||||||
|  |       description: string; | ||||||
|  |     }; | ||||||
|  |  | ||||||
|  |     const preferencesEditor = computed<Preference[]>(() => { | ||||||
|  |       if (!group.value || !group.value.preferences) { | ||||||
|  |         return []; | ||||||
|  |       } | ||||||
|  |       return [ | ||||||
|  |         { | ||||||
|  |           key: "recipePublic", | ||||||
|  |           value: group.value.preferences.recipePublic || false, | ||||||
|  |           label: i18n.t("group.allow-users-outside-of-your-group-to-see-your-recipes"), | ||||||
|  |           description: i18n.t("group.allow-users-outside-of-your-group-to-see-your-recipes-description"), | ||||||
|  |         } as Preference, | ||||||
|  |         { | ||||||
|  |           key: "recipeShowNutrition", | ||||||
|  |           value: group.value.preferences.recipeShowNutrition || false, | ||||||
|  |           label: i18n.t("group.show-nutrition-information"), | ||||||
|  |           description: i18n.t("group.show-nutrition-information-description"), | ||||||
|  |         } as Preference, | ||||||
|  |         { | ||||||
|  |           key: "recipeShowAssets", | ||||||
|  |           value: group.value.preferences.recipeShowAssets || false, | ||||||
|  |           label: i18n.t("group.show-recipe-assets"), | ||||||
|  |           description: i18n.t("group.show-recipe-assets-description"), | ||||||
|  |         } as Preference, | ||||||
|  |         { | ||||||
|  |           key: "recipeLandscapeView", | ||||||
|  |           value: group.value.preferences.recipeLandscapeView || false, | ||||||
|  |           label: i18n.t("group.default-to-landscape-view"), | ||||||
|  |           description: i18n.t("group.default-to-landscape-view-description"), | ||||||
|  |         } as Preference, | ||||||
|  |         { | ||||||
|  |           key: "recipeDisableComments", | ||||||
|  |           value: group.value.preferences.recipeDisableComments || false, | ||||||
|  |           label: i18n.t("group.disable-users-from-commenting-on-recipes"), | ||||||
|  |           description: i18n.t("group.disable-users-from-commenting-on-recipes-description"), | ||||||
|  |         } as Preference, | ||||||
|  |         { | ||||||
|  |           key: "recipeDisableAmount", | ||||||
|  |           value: group.value.preferences.recipeDisableAmount || false, | ||||||
|  |           label: i18n.t("group.disable-organizing-recipe-ingredients-by-units-and-food"), | ||||||
|  |           description: i18n.t("group.disable-organizing-recipe-ingredients-by-units-and-food-description"), | ||||||
|  |         } as Preference, | ||||||
|  |       ]; | ||||||
|  |     }); | ||||||
|  |  | ||||||
|     const allDays = [ |     const allDays = [ | ||||||
|       { |       { | ||||||
|         name: i18n.t("general.sunday"), |         name: i18n.t("general.sunday"), | ||||||
| @@ -117,6 +156,7 @@ export default defineComponent({ | |||||||
|       group, |       group, | ||||||
|       groupActions, |       groupActions, | ||||||
|       allDays, |       allDays, | ||||||
|  |       preferencesEditor, | ||||||
|     }; |     }; | ||||||
|   }, |   }, | ||||||
|   head() { |   head() { | ||||||
| @@ -126,3 +166,12 @@ export default defineComponent({ | |||||||
|   }, |   }, | ||||||
| }); | }); | ||||||
| </script> | </script> | ||||||
|  |  | ||||||
|  | <style lang="css"> | ||||||
|  | .preference-container { | ||||||
|  |   display: flex; | ||||||
|  |   flex-direction: column; | ||||||
|  |   gap: 0.5rem; | ||||||
|  |   max-width: 600px; | ||||||
|  | } | ||||||
|  | </style> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user