mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-06-01 04:36:12 -04:00
chore: Get Rid of Warnings (#2599)
* ignore unsafe html warnings * remove unused import * re-order attrs * removed unused vars/imports * removed unused import * refactored v-html * removed more unused things
This commit is contained in:
parent
b86c4e5865
commit
bd79c1db2f
@ -1,9 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div v-html="markup"></div>
|
<!-- eslint-disable-next-line vue/no-v-html -->
|
||||||
|
<div v-html="safeMarkup"></div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent } from "@nuxtjs/composition-api";
|
import { computed, defineComponent } from "@nuxtjs/composition-api";
|
||||||
|
import { sanitizeIngredientHTML } from "~/composables/recipes/use-recipe-ingredients";
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
props: {
|
props: {
|
||||||
markup: {
|
markup: {
|
||||||
@ -11,5 +13,11 @@ export default defineComponent({
|
|||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
setup(props) {
|
||||||
|
const safeMarkup = computed(() => sanitizeIngredientHTML(props.markup));
|
||||||
|
return {
|
||||||
|
safeMarkup,
|
||||||
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { computed, defineComponent, toRefs } from "@nuxtjs/composition-api";
|
import { computed, defineComponent } from "@nuxtjs/composition-api";
|
||||||
import { RecipeIngredient } from "~/lib/api/types/group";
|
import { RecipeIngredient } from "~/lib/api/types/group";
|
||||||
import { useParsedIngredientText } from "~/composables/recipes";
|
import { useParsedIngredientText } from "~/composables/recipes";
|
||||||
|
|
||||||
|
@ -10,7 +10,10 @@
|
|||||||
{{ recipe.name }}
|
{{ recipe.name }}
|
||||||
</v-list-item-title>
|
</v-list-item-title>
|
||||||
<v-list-item-subtitle v-if="showDescription">{{ recipe.description }}</v-list-item-subtitle>
|
<v-list-item-subtitle v-if="showDescription">{{ recipe.description }}</v-list-item-subtitle>
|
||||||
<v-list-item-subtitle v-if="listItem && listItemDescriptions[index]" :style="attrs.style.text.subTitle" v-html="listItemDescriptions[index]"/>
|
<v-list-item-subtitle v-if="listItem && listItemDescriptions[index]" :style="attrs.style.text.subTitle">
|
||||||
|
<!-- eslint-disable-next-line vue/no-v-html -->
|
||||||
|
<div v-html="listItemDescriptions[index]"></div>
|
||||||
|
</v-list-item-subtitle>
|
||||||
</v-list-item-content>
|
</v-list-item-content>
|
||||||
<slot :name="'actions-' + recipe.id" :v-bind="{ item: recipe }"> </slot>
|
<slot :name="'actions-' + recipe.id" :v-bind="{ item: recipe }"> </slot>
|
||||||
</v-list-item>
|
</v-list-item>
|
||||||
|
@ -87,7 +87,6 @@ import {
|
|||||||
useRouter,
|
useRouter,
|
||||||
computed,
|
computed,
|
||||||
ref,
|
ref,
|
||||||
useMeta,
|
|
||||||
onMounted,
|
onMounted,
|
||||||
onUnmounted,
|
onUnmounted,
|
||||||
} from "@nuxtjs/composition-api";
|
} from "@nuxtjs/composition-api";
|
||||||
|
@ -14,8 +14,8 @@
|
|||||||
<v-card
|
<v-card
|
||||||
hover
|
hover
|
||||||
:to="$listeners.selected || !recipe ? undefined : `/recipe/${recipe.slug}`"
|
:to="$listeners.selected || !recipe ? undefined : `/recipe/${recipe.slug}`"
|
||||||
@click="$emit('selected')"
|
|
||||||
class="elevation-12"
|
class="elevation-12"
|
||||||
|
@click="$emit('selected')"
|
||||||
>
|
>
|
||||||
<v-card-title class="background">
|
<v-card-title class="background">
|
||||||
<v-row>
|
<v-row>
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
content-class="text-caption"
|
content-class="text-caption"
|
||||||
>
|
>
|
||||||
<template #activator="{ on: onBtn, attrs: attrsBtn }">
|
<template #activator="{ on: onBtn, attrs: attrsBtn }">
|
||||||
<v-btn small class="ml-2" icon @click="displayRecipeRefs = !displayRecipeRefs" v-bind="attrsBtn" v-on="onBtn">
|
<v-btn small class="ml-2" icon v-bind="attrsBtn" v-on="onBtn" @click="displayRecipeRefs = !displayRecipeRefs">
|
||||||
<v-icon>
|
<v-icon>
|
||||||
{{ $globals.icons.potSteam }}
|
{{ $globals.icons.potSteam }}
|
||||||
</v-icon>
|
</v-icon>
|
||||||
|
@ -53,9 +53,9 @@ export default defineComponent({
|
|||||||
default: undefined,
|
default: undefined,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
setup(props, context) {
|
setup(_, context) {
|
||||||
const cropper = ref<Cropper>();
|
const cropper = ref<Cropper>();
|
||||||
const { $globals, $vuetify } = useContext();
|
const { $globals } = useContext();
|
||||||
|
|
||||||
interface Control {
|
interface Control {
|
||||||
color: string;
|
color: string;
|
||||||
|
@ -3,7 +3,7 @@ import { useFraction } from "./use-fraction";
|
|||||||
import { RecipeIngredient } from "~/lib/api/types/recipe";
|
import { RecipeIngredient } from "~/lib/api/types/recipe";
|
||||||
const { frac } = useFraction();
|
const { frac } = useFraction();
|
||||||
|
|
||||||
function sanitizeIngredientHTML(rawHtml: string) {
|
export function sanitizeIngredientHTML(rawHtml: string) {
|
||||||
return DOMPurify.sanitize(rawHtml, {
|
return DOMPurify.sanitize(rawHtml, {
|
||||||
USE_PROFILES: { html: true },
|
USE_PROFILES: { html: true },
|
||||||
ALLOWED_TAGS: ["b", "q", "i", "strong", "sup"],
|
ALLOWED_TAGS: ["b", "q", "i", "strong", "sup"],
|
||||||
|
@ -210,14 +210,12 @@ import { defineComponent, computed, reactive, ref, watch, onMounted } from "@nux
|
|||||||
import { format } from "date-fns";
|
import { format } from "date-fns";
|
||||||
import { SortableEvent } from "sortablejs";
|
import { SortableEvent } from "sortablejs";
|
||||||
import draggable from "vuedraggable";
|
import draggable from "vuedraggable";
|
||||||
import { watchDebounced } from "@vueuse/core";
|
|
||||||
import { MealsByDate } from "./types";
|
import { MealsByDate } from "./types";
|
||||||
import { useMealplans, usePlanTypeOptions, getEntryTypeText } from "~/composables/use-group-mealplan";
|
import { useMealplans, usePlanTypeOptions, getEntryTypeText } from "~/composables/use-group-mealplan";
|
||||||
import RecipeCardImage from "~/components/Domain/Recipe/RecipeCardImage.vue";
|
import RecipeCardImage from "~/components/Domain/Recipe/RecipeCardImage.vue";
|
||||||
import { PlanEntryType } from "~/lib/api/types/meal-plan";
|
import { PlanEntryType } from "~/lib/api/types/meal-plan";
|
||||||
import { useUserApi } from "~/composables/api";
|
import { useUserApi } from "~/composables/api";
|
||||||
import { useGroupSelf } from "~/composables/use-groups";
|
import { useGroupSelf } from "~/composables/use-groups";
|
||||||
import { RecipeSummary } from "~/lib/api/types/recipe";
|
|
||||||
import { useRecipeSearch } from "~/composables/recipes/use-recipe-search";
|
import { useRecipeSearch } from "~/composables/recipes/use-recipe-search";
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
@ -333,7 +331,7 @@ export default defineComponent({
|
|||||||
|
|
||||||
const search = useRecipeSearch(api);
|
const search = useRecipeSearch(api);
|
||||||
const planTypeOptions = usePlanTypeOptions();
|
const planTypeOptions = usePlanTypeOptions();
|
||||||
|
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
await search.trigger();
|
await search.trigger();
|
||||||
});
|
});
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
:rules="[validators.required]"
|
:rules="[validators.required]"
|
||||||
:hint="$t('recipe.new-recipe-names-must-be-unique')"
|
:hint="$t('recipe.new-recipe-names-must-be-unique')"
|
||||||
persistent-hint
|
persistent-hint
|
||||||
v-on:keyup.enter="createByName(newRecipeName)"
|
@keyup.enter="createByName(newRecipeName)"
|
||||||
></v-text-field>
|
></v-text-field>
|
||||||
</v-form>
|
</v-form>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { defineComponent, ref, useAsync, useMeta, useRoute, useRouter } from "@nuxtjs/composition-api";
|
import { defineComponent, useAsync, useMeta, useRoute, useRouter } from "@nuxtjs/composition-api";
|
||||||
import RecipePage from "~/components/Domain/Recipe/RecipePage/RecipePage.vue";
|
import RecipePage from "~/components/Domain/Recipe/RecipePage/RecipePage.vue";
|
||||||
import { usePublicApi } from "~/composables/api/api-client";
|
import { usePublicApi } from "~/composables/api/api-client";
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
import { TranslateResult } from "vue-i18n/types";
|
|
||||||
|
|
||||||
export interface SideBarLink {
|
export interface SideBarLink {
|
||||||
icon: string;
|
icon: string;
|
||||||
to?: string;
|
to?: string;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user