@vendure/dashboard 3.3.5-master-202506231131 → 3.3.5-master-202506231200

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vendure/dashboard",
3
3
  "private": false,
4
- "version": "3.3.5-master-202506231131",
4
+ "version": "3.3.5-master-202506231200",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",
@@ -86,8 +86,8 @@
86
86
  "@types/react-dom": "^19.0.4",
87
87
  "@types/react-grid-layout": "^1.3.5",
88
88
  "@uidotdev/usehooks": "^2.4.1",
89
- "@vendure/common": "^3.3.5-master-202506231131",
90
- "@vendure/core": "^3.3.5-master-202506231131",
89
+ "@vendure/common": "^3.3.5-master-202506231200",
90
+ "@vendure/core": "^3.3.5-master-202506231200",
91
91
  "@vitejs/plugin-react": "^4.3.4",
92
92
  "awesome-graphql-client": "^2.1.0",
93
93
  "class-variance-authority": "^0.7.1",
@@ -130,5 +130,5 @@
130
130
  "lightningcss-linux-arm64-musl": "^1.29.3",
131
131
  "lightningcss-linux-x64-musl": "^1.29.1"
132
132
  },
133
- "gitHead": "47318761ef74cfdd0e5452a33f5849b444f405ca"
133
+ "gitHead": "6f49cf141df0d5c95a0a93d908acd95b0979f278"
134
134
  }
@@ -6,6 +6,17 @@ import { DetailPageButton } from "@/index.js";
6
6
  import { ColumnFiltersState, SortingState } from "@tanstack/react-table";
7
7
  import { useState } from "react";
8
8
  import { productVariantListDocument } from "../products.graphql.js";
9
+ import { graphql } from '@/graphql/graphql.js';
10
+
11
+ export const deleteProductVariantDocument = graphql(`
12
+ mutation DeleteProductVariant($id: ID!) {
13
+ deleteProductVariant(id: $id) {
14
+ result
15
+ message
16
+ }
17
+ }
18
+ `);
19
+
9
20
 
10
21
  interface ProductVariantsTableProps {
11
22
  productId: string;
@@ -22,6 +33,7 @@ export function ProductVariantsTable({ productId, registerRefresher }: ProductVa
22
33
  return <PaginatedListDataTable
23
34
  registerRefresher={registerRefresher}
24
35
  listQuery={productVariantListDocument}
36
+ deleteMutation={deleteProductVariantDocument}
25
37
  transformVariables={variables => ({
26
38
  ...variables,
27
39
  productId,
@@ -16,6 +16,17 @@ import {
16
16
  DropdownMenuItem,
17
17
  DropdownMenuTrigger,
18
18
  } from '@/components/ui/dropdown-menu.js';
19
+ import {
20
+ AlertDialog,
21
+ AlertDialogAction,
22
+ AlertDialogCancel,
23
+ AlertDialogContent,
24
+ AlertDialogDescription,
25
+ AlertDialogFooter,
26
+ AlertDialogHeader,
27
+ AlertDialogTitle,
28
+ AlertDialogTrigger,
29
+ } from '@/components/ui/alert-dialog.js';
19
30
  import { DisplayComponent } from '@/framework/component-registry/dynamic-component.js';
20
31
  import { ResultOf } from '@/graphql/graphql.js';
21
32
  import { Trans, useLingui } from '@/lib/trans.js';
@@ -523,12 +534,37 @@ function DeleteMutationRowAction({
523
534
  },
524
535
  });
525
536
  return (
526
- <DropdownMenuItem onClick={() => deleteMutationFn({ id: row.original.id })}>
527
- <div className="flex items-center gap-2 text-destructive">
528
- <TrashIcon className="w-4 h-4 text-destructive" />
529
- <Trans>Delete</Trans>
530
- </div>
531
- </DropdownMenuItem>
537
+ <AlertDialog>
538
+ <AlertDialogTrigger asChild>
539
+ <DropdownMenuItem onSelect={(e) => e.preventDefault()}>
540
+ <div className="flex items-center gap-2 text-destructive">
541
+ <TrashIcon className="w-4 h-4 text-destructive" />
542
+ <Trans>Delete</Trans>
543
+ </div>
544
+ </DropdownMenuItem>
545
+ </AlertDialogTrigger>
546
+ <AlertDialogContent>
547
+ <AlertDialogHeader>
548
+ <AlertDialogTitle>
549
+ <Trans>Confirm deletion</Trans>
550
+ </AlertDialogTitle>
551
+ <AlertDialogDescription>
552
+ <Trans>Are you sure you want to delete this item? This action cannot be undone.</Trans>
553
+ </AlertDialogDescription>
554
+ </AlertDialogHeader>
555
+ <AlertDialogFooter>
556
+ <AlertDialogCancel>
557
+ <Trans>Cancel</Trans>
558
+ </AlertDialogCancel>
559
+ <AlertDialogAction
560
+ onClick={() => deleteMutationFn({ id: row.original.id })}
561
+ className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
562
+ >
563
+ <Trans>Delete</Trans>
564
+ </AlertDialogAction>
565
+ </AlertDialogFooter>
566
+ </AlertDialogContent>
567
+ </AlertDialog>
532
568
  );
533
569
  }
534
570
  /**