@deenruv/admin-dashboard 1.0.17-dev.39 → 1.0.17-dev.40
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.
|
@@ -81,6 +81,7 @@ export const FacetsDetailView = () => {
|
|
|
81
81
|
base.setField('code', currentTranslationValue.name.toLowerCase().replace(/\s+/g, '-'));
|
|
82
82
|
}
|
|
83
83
|
}, [currentTranslationValue?.name, editMode]);
|
|
84
|
+
const channelBulkActions = EntityChannelManagementBulkAction(tableId);
|
|
84
85
|
return (_jsx("main", { className: "my-4", children: _jsxs("div", { className: "flex flex-col gap-3", children: [_jsx(CustomCard, { title: t('facets:details.basicInfo'), icon: _jsx(CardIcons.basic, {}), color: "green", children: _jsxs("div", { className: "flex gap-8 p-0 pt-2", children: [_jsx("div", { className: "basis-full md:basis-1/2 xl:basis-1/3", children: _jsx(Input, { label: t('facets:table.name'), value: currentTranslationValue?.name ?? '', onChange: (e) => setTranslationField('name', e.target.value), errors: base.formState.errors?.translations?.message
|
|
85
86
|
? [base.formState.errors.translations.message]
|
|
86
87
|
: undefined, required: true }) }), _jsx("div", { className: "basis-full md:basis-1/2 xl:basis-1/3", children: _jsx(Input, { label: t('facets:table.code'), value: base.watch('code') ?? '', onChange: (e) => base.setField('code', e.target.value), errors: base.formState.errors?.code?.message ? [base.formState.errors.code.message] : undefined, required: true }) }), _jsxs("div", { className: "basis-full md:basis-1/2 xl:basis-1/3", children: [_jsx(Label, { children: t('facets:table.isPrivate') }), _jsxs("div", { className: "mt-2 flex gap-3", children: [_jsx(Switch, { checked: base.watch('isPrivate') ?? false, onCheckedChange: (e) => base.setField('isPrivate', e) }), _jsx("p", { children: base.watch('isPrivate') ? t('facets:table.isPrivate') : t('facets:table.public') })] })] })] }) }), _jsx(DetailViewMarker, { position: 'facets-detail-view' }), _jsx(EntityCustomFields, { entityName: "facet", id: id, hideButton: true, onChange: (customFields, translations) => {
|
|
@@ -92,7 +93,7 @@ export const FacetsDetailView = () => {
|
|
|
92
93
|
: { customFields: {} } }), entity && editMode && (_jsx(CustomCard, { title: t('facets:details.facetValues'), icon: _jsx(CardIcons.tag, {}), color: "teal", upperRight: _jsx(AddFacetValueDialog, { open: open, setOpen: setOpen, facetId: entity.id, facetValueId: facetValueIdInModal, onFacetValueChange: () => {
|
|
93
94
|
setAdditionalData({ ...additionalData, refetchList: true });
|
|
94
95
|
setFacetValueIdInModal(null);
|
|
95
|
-
} }), children: _jsx(DetailList, { entityName: "FacetValue", hideColumns: ['customFields', 'createdAt', 'updatedAt'], additionalBulkActions: [...
|
|
96
|
+
} }), children: _jsx(DetailList, { entityName: "FacetValue", hideColumns: ['customFields', 'createdAt', 'updatedAt'], additionalBulkActions: [...channelBulkActions], fetch: fetchFacetValues, onRemove: onRemove, route: {
|
|
96
97
|
edit: (id) => {
|
|
97
98
|
setFacetValueIdInModal(id);
|
|
98
99
|
setOpen(true);
|
|
@@ -8,6 +8,7 @@ import { useShallow } from 'zustand/react/shallow';
|
|
|
8
8
|
import { toast } from 'sonner';
|
|
9
9
|
import { OrderLineActionModal } from './OrderLineActionModal/index.js';
|
|
10
10
|
import { CustomComponent } from './CustomComponent.js';
|
|
11
|
+
import { getOrderLineImagePreview } from './OrderLineImage.logic.js';
|
|
11
12
|
import { OrderLineCustomFields } from './OrderLineCustomFields.js';
|
|
12
13
|
import { SpecialLineItem } from './SpecialLineItem.js';
|
|
13
14
|
export const ProductsCard = () => {
|
|
@@ -299,9 +300,7 @@ export const ProductsCard = () => {
|
|
|
299
300
|
else {
|
|
300
301
|
addToOrder(payload.variant, payload.quantity, payload.customFields);
|
|
301
302
|
}
|
|
302
|
-
} })), _jsx("div", { className: "rounded-lg border-0 border-border shadow-sm", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { noHover: true, className: "hover:bg-transparent", children: [_jsx(TableHead, { className: "py-3 font-semibold", children: t('create.product', 'Product') }), _jsx(TableHead, { className: "py-3 font-semibold", children: t('create.sku', 'SKU') }), _jsx(TableHead, { className: "py-3 font-semibold", children: t('create.customFields', 'Custom Fields') }), _jsx(TableHead, { className: "py-3 font-semibold", children: t('create.price', 'Price') }), _jsx(TableHead, { className: "py-3 font-semibold", children: t('create.priceWithTax', 'Price with Tax') }), _jsx(TableHead, { className: "py-3 font-semibold", children: t('create.quantity', 'Quantity') }), _jsx(TableHead, { className: "py-3 font-semibold", children: t('create.perUnit', 'Per Unit') }), (mode === 'create' || mode === 'update') && (_jsx(TableHead, { className: "py-3 text-right font-semibold", children: t('create.actions', 'Actions') }))] }) }), _jsx(TableBody, { children: currentOrder.lines.length ? (_jsxs(_Fragment, { children: [currentOrder.lines.map((line) => (_jsxs(TableRow, { className: "hover:bg-muted/20", children: [_jsx(TableCell, { className: "py-3", children: _jsxs("div", { className: "flex w-max items-center gap-3", children: [_jsx(ImageWithPreview, { imageClassName: "aspect-square w-12 h-12 rounded-md object-cover border border-border", src: line.productVariant.
|
|
303
|
-
line.productVariant.product?.featuredAsset?.preview ||
|
|
304
|
-
'/placeholder.svg' }), _jsx("div", { className: "font-medium text-primary", children: line.productVariant.product.name })] }) }), _jsx(TableCell, { className: "min-w-[200px] py-3 font-mono text-sm text-muted-foreground", children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Tag, { className: "size-4 text-blue-500 dark:text-blue-400" }), line.productVariant.sku] }) }), _jsx(TableCell, { className: "py-3", children: _jsx(OrderLineCustomFields, { line: line, order: currentOrder, mode: mode }) }), _jsx(TableCell, { className: "py-3 font-medium", children: priceFormatter(line.linePrice, line.productVariant.currencyCode) }), _jsx(TableCell, { className: "py-3 font-medium", children: priceFormatter(line.linePriceWithTax, line.productVariant.currencyCode) }), _jsx(TableCell, { className: "py-3 text-center font-semibold", children: renderLineQuantity(line.id, line.quantity) }), _jsx(TableCell, { className: "py-3", children: _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { children: priceFormatter(line.unitPrice, line.productVariant.currencyCode) }), _jsxs("span", { className: "text-sm text-muted-foreground", children: ["(", priceFormatter(line.unitPriceWithTax, line.productVariant.currencyCode), ")"] })] }) }), (mode === 'create' || mode === 'update') && (_jsx(TableCell, { className: "py-3 text-right", children: _jsxs("div", { className: "flex items-center justify-end gap-3", children: [_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { className: "flex size-8 items-center justify-center rounded-md hover:bg-muted", children: _jsx(EllipsisVertical, { className: "size-5" }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsx(DropdownMenuLabel, { children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Edit, { className: "size-4 text-blue-500" }), t('editOptions', 'Edit Options')] }) }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { disabled: isLineAddedInModify(line.id), onClick: () => !isLineAddedInModify(line.id) && setOrderLineAction({ line }), className: cn('flex cursor-pointer justify-between', {
|
|
303
|
+
} })), _jsx("div", { className: "rounded-lg border-0 border-border shadow-sm", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsxs(TableRow, { noHover: true, className: "hover:bg-transparent", children: [_jsx(TableHead, { className: "py-3 font-semibold", children: t('create.product', 'Product') }), _jsx(TableHead, { className: "py-3 font-semibold", children: t('create.sku', 'SKU') }), _jsx(TableHead, { className: "py-3 font-semibold", children: t('create.customFields', 'Custom Fields') }), _jsx(TableHead, { className: "py-3 font-semibold", children: t('create.price', 'Price') }), _jsx(TableHead, { className: "py-3 font-semibold", children: t('create.priceWithTax', 'Price with Tax') }), _jsx(TableHead, { className: "py-3 font-semibold", children: t('create.quantity', 'Quantity') }), _jsx(TableHead, { className: "py-3 font-semibold", children: t('create.perUnit', 'Per Unit') }), (mode === 'create' || mode === 'update') && (_jsx(TableHead, { className: "py-3 text-right font-semibold", children: t('create.actions', 'Actions') }))] }) }), _jsx(TableBody, { children: currentOrder.lines.length ? (_jsxs(_Fragment, { children: [currentOrder.lines.map((line) => (_jsxs(TableRow, { className: "hover:bg-muted/20", children: [_jsx(TableCell, { className: "py-3", children: _jsxs("div", { className: "flex w-max items-center gap-3", children: [_jsx(ImageWithPreview, { imageClassName: "aspect-square w-12 h-12 rounded-md object-cover border border-border", src: getOrderLineImagePreview(line) }), _jsx("div", { className: "font-medium text-primary", children: line.productVariant.product.name })] }) }), _jsx(TableCell, { className: "min-w-[200px] py-3 font-mono text-sm text-muted-foreground", children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Tag, { className: "size-4 text-blue-500 dark:text-blue-400" }), line.productVariant.sku] }) }), _jsx(TableCell, { className: "py-3", children: _jsx(OrderLineCustomFields, { line: line, order: currentOrder, mode: mode }) }), _jsx(TableCell, { className: "py-3 font-medium", children: priceFormatter(line.linePrice, line.productVariant.currencyCode) }), _jsx(TableCell, { className: "py-3 font-medium", children: priceFormatter(line.linePriceWithTax, line.productVariant.currencyCode) }), _jsx(TableCell, { className: "py-3 text-center font-semibold", children: renderLineQuantity(line.id, line.quantity) }), _jsx(TableCell, { className: "py-3", children: _jsxs("div", { className: "flex flex-col", children: [_jsx("span", { children: priceFormatter(line.unitPrice, line.productVariant.currencyCode) }), _jsxs("span", { className: "text-sm text-muted-foreground", children: ["(", priceFormatter(line.unitPriceWithTax, line.productVariant.currencyCode), ")"] })] }) }), (mode === 'create' || mode === 'update') && (_jsx(TableCell, { className: "py-3 text-right", children: _jsxs("div", { className: "flex items-center justify-end gap-3", children: [_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { className: "flex size-8 items-center justify-center rounded-md hover:bg-muted", children: _jsx(EllipsisVertical, { className: "size-5" }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsx(DropdownMenuLabel, { children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Edit, { className: "size-4 text-blue-500" }), t('editOptions', 'Edit Options')] }) }), _jsx(DropdownMenuSeparator, {}), _jsxs(DropdownMenuItem, { disabled: isLineAddedInModify(line.id), onClick: () => !isLineAddedInModify(line.id) && setOrderLineAction({ line }), className: cn('flex cursor-pointer justify-between', {
|
|
305
304
|
'text-muted-foreground': isLineAddedInModify(line.id),
|
|
306
305
|
}), children: [_jsx("span", { children: t('orderLineActionModal.actionType.quantity-price', 'Adjust Quantity & Price') }), isLineAddedInModify(line.id) && (_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, children: _jsx(InfoIcon, { className: "size-4 text-muted-foreground" }) }), _jsx(TooltipContent, { children: _jsx("p", { children: t('modify.disclaimer', 'Cannot modify items added in previous sessions') }) })] }) }))] })] })] }), (mode === 'create' || isLineAddedInModify(line.id)) && (_jsx("button", { className: "flex size-8 items-center justify-center rounded-md text-red-500 hover:bg-red-50 hover:text-red-600", onClick: () => removeLineItem(line.id), children: _jsx(Trash2, { className: "size-4" }) }))] }) }))] }, line.id))), currentOrder?.surcharges.map((surcharge) => (_jsxs(TableRow, { className: "bg-muted/10 hover:bg-muted/20", children: [_jsx(TableCell, { className: "py-3 font-medium text-primary", children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Package, { className: "size-4 text-blue-500 dark:text-blue-400" }), surcharge.description] }) }), _jsx(TableCell, { className: "min-w-[200px] py-3 font-mono text-sm text-muted-foreground", children: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Tag, { className: "size-4 text-blue-500 dark:text-blue-400" }), surcharge.sku] }) }), _jsx(TableCell, { className: "py-3" }), _jsx(TableCell, { className: "py-3 font-medium text-nowrap", children: priceFormatter(surcharge.price, order.currencyCode) }), _jsx(TableCell, { className: "py-3 font-medium text-nowrap", children: priceFormatter(surcharge.priceWithTax, order.currencyCode) }), _jsx(TableCell, { className: "py-3" }), _jsx(TableCell, { className: "py-3 font-medium", children: priceFormatter(surcharge.priceWithTax, order.currencyCode) }), (mode === 'create' || mode === 'update') && _jsx(TableCell, { className: "py-3" })] }, surcharge.sku)))] })) : (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: 8, children: _jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center", children: [_jsx("div", { className: "mb-4 rounded-full bg-blue-100 p-3 dark:bg-blue-900/30", children: _jsx(ShoppingCart, { className: "size-6 text-blue-500 dark:text-blue-400" }) }), _jsx("span", { className: "text-lg font-medium text-muted-foreground", children: t('create.noItems', 'No products in this order') }), mode !== 'view' && (_jsx("span", { className: "mt-2 text-sm text-muted-foreground", children: t('create.searchPlaceholder', 'Use the search above to add products') }))] }) }) })) })] }) }), _jsx("div", { className: "mt-6 border-t pt-4", children: _jsx("div", { className: "rounded-lg border bg-card p-4 shadow-sm", children: _jsxs("div", { className: "space-y-2", children: [_jsxs("div", { className: "flex justify-between", children: [_jsx("span", { className: "text-base font-semibold", children: t('total') }), _jsx("span", { className: "text-base font-bold text-primary", children: priceFormatter(currentOrder?.totalWithTax || 0, currentOrder?.currencyCode) })] }), _jsx("div", { className: "mt-2 text-xs text-muted-foreground", children: _jsxs("div", { className: "flex items-center gap-1", children: [_jsx(InfoIcon, { className: "size-3" }), _jsx("span", { children: t('totalItems', {
|
|
307
306
|
value: currentOrder?.lines.reduce((acc, line) => acc + line.quantity, 0) || 0,
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const ADMIN_DASHBOARD_VERSION = '1.0.17-dev.
|
|
1
|
+
export const ADMIN_DASHBOARD_VERSION = '1.0.17-dev.40';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deenruv/admin-dashboard",
|
|
3
|
-
"version": "1.0.17-dev.
|
|
3
|
+
"version": "1.0.17-dev.40",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"style": "dist/index.css",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -80,10 +80,10 @@
|
|
|
80
80
|
"yup": "^1.7.1",
|
|
81
81
|
"zod": "^4.4.3",
|
|
82
82
|
"zustand": "^5.0.14",
|
|
83
|
-
"@deenruv/admin-dashboard": "1.0.17-dev.
|
|
84
|
-
"@deenruv/admin-types": "1.0.17-dev.
|
|
85
|
-
"@deenruv/
|
|
86
|
-
"@deenruv/
|
|
83
|
+
"@deenruv/admin-dashboard": "1.0.17-dev.40",
|
|
84
|
+
"@deenruv/admin-types": "1.0.17-dev.40",
|
|
85
|
+
"@deenruv/deenruv-examples-plugin": "1.0.17-dev.40",
|
|
86
|
+
"@deenruv/react-ui-devkit": "1.0.17-dev.40"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@tailwindcss/typography": "^0.5.20",
|