diff --git a/frontend/components/global/CrudTable.vue b/frontend/components/global/CrudTable.vue index e94e19ad55d2..caf25a803a27 100644 --- a/frontend/components/global/CrudTable.vue +++ b/frontend/components/global/CrudTable.vue @@ -57,12 +57,12 @@ :buttons="[ { icon: $globals.icons.edit, - text: $t('general.edit'), + text: $tc('general.edit'), event: 'edit', }, { icon: $globals.icons.delete, - text: $t('general.delete'), + text: $tc('general.delete'), event: 'delete', }, ]" @@ -160,6 +160,8 @@ export default defineComponent({ props.bulkActions.forEach((action) => { handlers[action.event] = () => { context.emit(action.event, selected.value); + // clear selection + selected.value = []; }; }); diff --git a/frontend/composables/store/use-food-store.ts b/frontend/composables/store/use-food-store.ts index 079cd088d210..b7c3953e3d22 100644 --- a/frontend/composables/store/use-food-store.ts +++ b/frontend/composables/store/use-food-store.ts @@ -4,7 +4,7 @@ import { usePublicExploreApi } from "../api/api-client"; import { useUserApi } from "~/composables/api"; import { IngredientFood } from "~/lib/api/types/recipe"; -let foodStore: Ref | null = null; +let foodStore: Ref = ref([]); /** * useFoodData returns a template reactive object @@ -39,11 +39,11 @@ export const usePublicFoodStore = function (groupSlug: string) { const actions = { ...usePublicStoreActions(api.foods, foodStore, loading), flushStore() { - foodStore = null; + foodStore = ref([]); }, }; - if (!foodStore) { + if (!foodStore.value) { foodStore = actions.getAll(); } @@ -57,7 +57,7 @@ export const useFoodStore = function () { const actions = { ...useStoreActions(api.foods, foodStore, loading), flushStore() { - foodStore = null; + foodStore.value = []; }, }; diff --git a/frontend/composables/store/use-label-store.ts b/frontend/composables/store/use-label-store.ts index 11a3367d5519..37fc48552fef 100644 --- a/frontend/composables/store/use-label-store.ts +++ b/frontend/composables/store/use-label-store.ts @@ -3,7 +3,7 @@ import { useStoreActions } from "../partials/use-actions-factory"; import { MultiPurposeLabelOut } from "~/lib/api/types/labels"; import { useUserApi } from "~/composables/api"; -let labelStore: Ref | null = null; +let labelStore: Ref = ref([]); export function useLabelData() { const data = reactive({ @@ -33,11 +33,11 @@ export function useLabelStore() { const actions = { ...useStoreActions(api.multiPurposeLabels, labelStore, loading), flushStore() { - labelStore = null; + labelStore.value =[]; }, }; - if (!labelStore) { + if (!labelStore.value) { labelStore = actions.getAll(); } diff --git a/frontend/composables/store/use-unit-store.ts b/frontend/composables/store/use-unit-store.ts index f1deb1e439d6..b2af6e9057d0 100644 --- a/frontend/composables/store/use-unit-store.ts +++ b/frontend/composables/store/use-unit-store.ts @@ -3,7 +3,7 @@ import { useStoreActions } from "../partials/use-actions-factory"; import { useUserApi } from "~/composables/api"; import { IngredientUnit } from "~/lib/api/types/recipe"; -let unitStore: Ref | null = null; +let unitStore: Ref = ref([]); /** * useUnitData returns a template reactive object @@ -40,11 +40,11 @@ export const useUnitStore = function () { const actions = { ...useStoreActions(api.units, unitStore, loading), flushStore() { - unitStore = null; + unitStore.value = []; }, }; - if (!unitStore) { + if (!unitStore.value) { unitStore = actions.getAll(); } diff --git a/frontend/lang/messages/en-US.json b/frontend/lang/messages/en-US.json index 986b53d4b87d..932a49bb3030 100644 --- a/frontend/lang/messages/en-US.json +++ b/frontend/lang/messages/en-US.json @@ -199,7 +199,8 @@ "upload-file": "Upload File", "created-on-date": "Created on: {0}", "unsaved-changes": "You have unsaved changes. Do you want to save before leaving? Okay to save, Cancel to discard changes.", - "clipboard-copy-failure": "Failed to copy to the clipboard." + "clipboard-copy-failure": "Failed to copy to the clipboard.", + "confirm-delete-generic-items": "Are you sure you want to delete the following items?" }, "group": { "are-you-sure-you-want-to-delete-the-group": "Are you sure you want to delete {groupName}?", diff --git a/frontend/pages/group/data/categories.vue b/frontend/pages/group/data/categories.vue index 290e4f79e083..455985b6fd47 100644 --- a/frontend/pages/group/data/categories.vue +++ b/frontend/pages/group/data/categories.vue @@ -49,15 +49,41 @@ + + + +

{{ $t('general.confirm-delete-generic-items') }}

+ + + + + +
+
+