|
@@ -9,7 +9,6 @@ import { api } from '@/graphql/api.js';
|
|
|
import { ResultOf } from '@/graphql/graphql.js';
|
|
import { ResultOf } from '@/graphql/graphql.js';
|
|
|
import { useChannel, usePaginatedList } from '@/index.js';
|
|
import { useChannel, usePaginatedList } from '@/index.js';
|
|
|
import { Trans, useLingui } from '@/lib/trans.js';
|
|
import { Trans, useLingui } from '@/lib/trans.js';
|
|
|
-import { Permission } from '@vendure/common/lib/generated-types';
|
|
|
|
|
import { DuplicateBulkAction } from '../../../../common/duplicate-bulk-action.js';
|
|
import { DuplicateBulkAction } from '../../../../common/duplicate-bulk-action.js';
|
|
|
import {
|
|
import {
|
|
|
assignProductsToChannelDocument,
|
|
assignProductsToChannelDocument,
|
|
@@ -52,7 +51,7 @@ export const DeleteProductsBulkAction: BulkActionComponent<any> = ({ selection,
|
|
|
});
|
|
});
|
|
|
return (
|
|
return (
|
|
|
<DataTableBulkActionItem
|
|
<DataTableBulkActionItem
|
|
|
- requiresPermission={[Permission.DeleteCatalog, Permission.DeleteProduct]}
|
|
|
|
|
|
|
+ requiresPermission={['DeleteCatalog', 'DeleteProduct']}
|
|
|
onClick={() => mutate({ ids: selection.map(s => s.id) })}
|
|
onClick={() => mutate({ ids: selection.map(s => s.id) })}
|
|
|
label={<Trans>Delete</Trans>}
|
|
label={<Trans>Delete</Trans>}
|
|
|
confirmationText={<Trans>Are you sure you want to delete {selection.length} products?</Trans>}
|
|
confirmationText={<Trans>Are you sure you want to delete {selection.length} products?</Trans>}
|
|
@@ -79,7 +78,7 @@ export const AssignProductsToChannelBulkAction: BulkActionComponent<any> = ({ se
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
<DataTableBulkActionItem
|
|
<DataTableBulkActionItem
|
|
|
- requiresPermission={[Permission.UpdateCatalog, Permission.UpdateProduct]}
|
|
|
|
|
|
|
+ requiresPermission={['UpdateCatalog', 'UpdateProduct']}
|
|
|
onClick={() => setDialogOpen(true)}
|
|
onClick={() => setDialogOpen(true)}
|
|
|
label={<Trans>Assign to channel</Trans>}
|
|
label={<Trans>Assign to channel</Trans>}
|
|
|
icon={LayersIcon}
|
|
icon={LayersIcon}
|
|
@@ -127,7 +126,7 @@ export const RemoveProductsFromChannelBulkAction: BulkActionComponent<any> = ({
|
|
|
|
|
|
|
|
return (
|
|
return (
|
|
|
<DataTableBulkActionItem
|
|
<DataTableBulkActionItem
|
|
|
- requiresPermission={[Permission.UpdateCatalog, Permission.UpdateProduct]}
|
|
|
|
|
|
|
+ requiresPermission={['UpdateCatalog', 'UpdateProduct']}
|
|
|
onClick={handleRemove}
|
|
onClick={handleRemove}
|
|
|
label={<Trans>Remove from current channel</Trans>}
|
|
label={<Trans>Remove from current channel</Trans>}
|
|
|
confirmationText={
|
|
confirmationText={
|
|
@@ -153,7 +152,7 @@ export const AssignFacetValuesToProductsBulkAction: BulkActionComponent<any> = (
|
|
|
return (
|
|
return (
|
|
|
<>
|
|
<>
|
|
|
<DataTableBulkActionItem
|
|
<DataTableBulkActionItem
|
|
|
- requiresPermission={[Permission.UpdateCatalog, Permission.UpdateProduct]}
|
|
|
|
|
|
|
+ requiresPermission={['UpdateCatalog', 'UpdateProduct']}
|
|
|
onClick={() => setDialogOpen(true)}
|
|
onClick={() => setDialogOpen(true)}
|
|
|
label={<Trans>Edit facet values</Trans>}
|
|
label={<Trans>Edit facet values</Trans>}
|
|
|
icon={TagIcon}
|
|
icon={TagIcon}
|
|
@@ -183,7 +182,7 @@ export const DuplicateProductsBulkAction: BulkActionComponent<any> = ({ selectio
|
|
|
value: 'true',
|
|
value: 'true',
|
|
|
},
|
|
},
|
|
|
]}
|
|
]}
|
|
|
- requiredPermissions={[Permission.UpdateCatalog, Permission.UpdateProduct]}
|
|
|
|
|
|
|
+ requiredPermissions={['UpdateCatalog', 'UpdateProduct']}
|
|
|
entityName="Product"
|
|
entityName="Product"
|
|
|
selection={selection}
|
|
selection={selection}
|
|
|
table={table}
|
|
table={table}
|