1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-07-22 06:39:41 +02:00

fix: Sort Food by Label on Data Management Page (#4631)

This commit is contained in:
Michael Genson 2024-12-10 08:10:07 -06:00 committed by GitHub
parent eecda1be4d
commit 02a545dcb5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View file

@ -99,6 +99,8 @@ export interface TableHeaders {
value: string;
show: boolean;
align?: string;
sortable?: boolean;
sort?: (a: any, b: any) => number;
}
export interface BulkAction {

View file

@ -290,6 +290,7 @@ import MultiPurposeLabel from "~/components/Domain/ShoppingList/MultiPurposeLabe
import { useLocales } from "~/composables/use-locales";
import { useFoodStore, useLabelStore } from "~/composables/store";
import { VForm } from "~/types/vuetify";
import { MultiPurposeLabelOut } from "~/lib/api/types/labels";
export default defineComponent({
components: { MultiPurposeLabel, RecipeDataAliasManagerDialog },
@ -325,6 +326,11 @@ export default defineComponent({
text: i18n.tc("shopping-list.label"),
value: "label",
show: true,
sort: (label1: MultiPurposeLabelOut | null, label2: MultiPurposeLabelOut | null) => {
const label1Name = label1?.name || "";
const label2Name = label2?.name || "";
return label1Name.localeCompare(label2Name);
},
},
{
text: i18n.tc("tool.on-hand"),