diff --git a/src/views/product/list/Empty.vue b/src/views/product/list/Empty.vue new file mode 100644 index 00000000..ca324ebe --- /dev/null +++ b/src/views/product/list/Empty.vue @@ -0,0 +1,92 @@ + + + + + diff --git a/src/views/product/list/ProductList.vue b/src/views/product/list/ProductList.vue index 88a968cb..87f5e61f 100644 --- a/src/views/product/list/ProductList.vue +++ b/src/views/product/list/ProductList.vue @@ -61,40 +61,8 @@ > -
-
- Empty. No {{ productType.plural }} are found. -
- - - - - - +
+
import { ref, reactive, watch, computed, withDefaults } from "vue"; -import { useRouter } from "vue-router"; import { storeToRefs } from "pinia"; import { useStore } from "@/stores/main"; import { useConfigStore } from "@/stores/config"; import TopBar from "./TopBar.vue"; import ProductItemCard from "@/components/product/item-card/ProductItemCard.vue"; +import Empty from "./Empty.vue"; import { useQueryForProductListQuery, ProductSortEnum, } from "@/generated/graphql"; -import ProductTypeDeleteForm from "@/components/product-type/ProductTypeDeleteForm.vue"; - import { useQueryState } from "@/utils/query-state"; // Use any for productItemCard because Component causes an error for unknown reason. @@ -150,9 +116,6 @@ const props = withDefaults( const configStore = useConfigStore(); const disableAdd = computed(() => !configStore.config.productCreationDialog); -const disableDelete = computed(() => !configStore.config.productDeletionDialog); - -const router = useRouter(); const nItemsInitialLoad = ref(10); const first = ref(nItemsInitialLoad.value); @@ -257,25 +220,6 @@ const areAllCardsCollapsed = computed({ }, }); -const deleteDialog = ref(false); - -function onDeleteFormCancelled() { - closeDeleteForm(); -} - -function onDeleteFormFinished() { - closeDeleteForm(); - onDeleted(); -} - -function closeDeleteForm() { - deleteDialog.value = false; -} - -function onDeleted() { - router.push({ name: "Dashboard" }); -} - const loadingMore = ref(false); // Set temporarily to 0 for the error @@ -311,11 +255,4 @@ watch(nApolloMutations, refresh); align-items: baseline; padding: 0 1rem; } -.empty { - margin-top: 16px; - display: grid; - block-size: 100%; - place-items: center; - gap: 24px; -}