mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
Merge branch 'bugfix/FE/ISSUE/build-error' into 'feat/FE/US-33/TASK-40-slicing-ui-for-master-data-forms'
[FIX/FE][ISSUE] Fix Issue for Next.js Build See merge request mbugroup/lti-web-client!4
This commit is contained in:
@@ -189,6 +189,8 @@ const MainDrawer = ({
|
||||
);
|
||||
|
||||
const traverseMenuTitle = (menu: typeof activeMenu) => {
|
||||
if (!menu) return;
|
||||
|
||||
const hasSubmenu = menu?.submenu && menu?.submenu.length > 0;
|
||||
|
||||
if (!title) {
|
||||
@@ -197,7 +199,7 @@ const MainDrawer = ({
|
||||
title += ' - ' + menu?.title;
|
||||
}
|
||||
|
||||
if (!hasSubmenu) return;
|
||||
if (!hasSubmenu || !menu.submenu) return;
|
||||
|
||||
const activeSubmenu = menu.submenu?.find((item) =>
|
||||
isPathActive(pathname, item.link)
|
||||
|
||||
@@ -192,7 +192,7 @@ const AreasTable = () => {
|
||||
} else {
|
||||
updateFilter('nameSort', isNameSorted.desc ? 'desc' : 'asc');
|
||||
}
|
||||
}, [sorting]);
|
||||
}, [sorting, updateFilter]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -231,7 +231,7 @@ const KandangsTable = () => {
|
||||
updateSortingFilter('nameSort', nameSortFilter);
|
||||
updateSortingFilter('locationSort', locationSortFilter);
|
||||
updateSortingFilter('picSort', picSortFilter);
|
||||
}, [sorting]);
|
||||
}, [sorting, updateSortingFilter]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -230,7 +230,7 @@ const LocationsTable = () => {
|
||||
updateSortingFilter('nameSort', nameSortFilter);
|
||||
updateSortingFilter('addressSort', addressSortFilter);
|
||||
updateSortingFilter('areaSort', areaSortFilter);
|
||||
}, [sorting]);
|
||||
}, [sorting, updateSortingFilter]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -66,7 +66,12 @@ const RowOptionsMenu = ({
|
||||
color='error'
|
||||
className='text-error hover:text-inherit'
|
||||
>
|
||||
<Icon icon='mdi:delete-outline' width={16} height={16} className='justify-start text-sm' />
|
||||
<Icon
|
||||
icon='mdi:delete-outline'
|
||||
width={16}
|
||||
height={16}
|
||||
className='justify-start text-sm'
|
||||
/>
|
||||
Delete
|
||||
</Button>
|
||||
</div>
|
||||
@@ -96,7 +101,9 @@ const ProductCategoryTable = () => {
|
||||
|
||||
const deleteModal = useModal();
|
||||
|
||||
const [selectedProductCategory, setSelectedProductCategory] = useState<ProductCategory | undefined>(undefined);
|
||||
const [selectedProductCategory, setSelectedProductCategory] = useState<
|
||||
ProductCategory | undefined
|
||||
>(undefined);
|
||||
const [isDeleteLoading, setIsDeleteLoading] = useState(false);
|
||||
|
||||
const [sorting, setSorting] = useState<SortingState>([]);
|
||||
@@ -186,7 +193,7 @@ const ProductCategoryTable = () => {
|
||||
} else {
|
||||
updateFilter('nameSort', isNameSorted.desc ? 'desc' : 'asc');
|
||||
}
|
||||
}, [sorting]);
|
||||
}, [sorting, updateFilter]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -221,18 +228,30 @@ const ProductCategoryTable = () => {
|
||||
</div>
|
||||
</div>
|
||||
<Table<ProductCategory>
|
||||
data={isResponseSuccess(productCategories) ? productCategories?.data : []}
|
||||
data={
|
||||
isResponseSuccess(productCategories) ? productCategories?.data : []
|
||||
}
|
||||
columns={productCategoryColumns}
|
||||
pageSize={tableFilterState.pageSize}
|
||||
page={isResponseSuccess(productCategories) ? productCategories?.meta?.page : 0}
|
||||
totalItems={isResponseSuccess(productCategories) ? productCategories?.meta?.total_results : 0}
|
||||
page={
|
||||
isResponseSuccess(productCategories)
|
||||
? productCategories?.meta?.page
|
||||
: 0
|
||||
}
|
||||
totalItems={
|
||||
isResponseSuccess(productCategories)
|
||||
? productCategories?.meta?.total_results
|
||||
: 0
|
||||
}
|
||||
onPageChange={setPage}
|
||||
isLoading={isLoading}
|
||||
sorting={sorting}
|
||||
setSorting={setSorting}
|
||||
className={{
|
||||
containerClassName: cn({
|
||||
'mb-20': isResponseSuccess(productCategories) && productCategories?.data?.length === 0,
|
||||
'mb-20':
|
||||
isResponseSuccess(productCategories) &&
|
||||
productCategories?.data?.length === 0,
|
||||
}),
|
||||
tableWrapperClassName: 'overflow-x-auto min-h-full!',
|
||||
tableClassName: 'font-inter w-full table-auto min-h-full!',
|
||||
@@ -263,4 +282,4 @@ const ProductCategoryTable = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default ProductCategoryTable;
|
||||
export default ProductCategoryTable;
|
||||
|
||||
@@ -116,7 +116,9 @@ const ProductsTable = () => {
|
||||
);
|
||||
|
||||
const deleteModal = useModal();
|
||||
const [selectedProduct, setSelectedProduct] = useState<Product | undefined>(undefined);
|
||||
const [selectedProduct, setSelectedProduct] = useState<Product | undefined>(
|
||||
undefined
|
||||
);
|
||||
const [isDeleteLoading, setIsDeleteLoading] = useState(false);
|
||||
const [sorting, setSorting] = useState<SortingState>([]);
|
||||
|
||||
@@ -153,12 +155,14 @@ const ProductsTable = () => {
|
||||
{
|
||||
accessorKey: 'product_price',
|
||||
header: 'Harga Produk',
|
||||
cell: (props) => props.row.original.product_price?.toLocaleString() ?? '-',
|
||||
cell: (props) =>
|
||||
props.row.original.product_price?.toLocaleString() ?? '-',
|
||||
},
|
||||
{
|
||||
accessorKey: 'selling_price',
|
||||
header: 'Harga Jual',
|
||||
cell: (props) => props.row.original.selling_price?.toLocaleString() ?? '-',
|
||||
cell: (props) =>
|
||||
props.row.original.selling_price?.toLocaleString() ?? '-',
|
||||
},
|
||||
{
|
||||
accessorKey: 'tax',
|
||||
@@ -261,13 +265,15 @@ const ProductsTable = () => {
|
||||
const nameSortFilter = sorting.find((sortItem) => sortItem.id === 'name');
|
||||
const skuSortFilter = sorting.find((sortItem) => sortItem.id === 'sku');
|
||||
const brandSortFilter = sorting.find((sortItem) => sortItem.id === 'brand');
|
||||
const categorySortFilter = sorting.find((sortItem) => sortItem.id === 'product_category');
|
||||
const categorySortFilter = sorting.find(
|
||||
(sortItem) => sortItem.id === 'product_category'
|
||||
);
|
||||
|
||||
updateSortingFilter('nameSort', nameSortFilter);
|
||||
updateSortingFilter('skuSort', skuSortFilter);
|
||||
updateSortingFilter('brandSort', brandSortFilter);
|
||||
updateSortingFilter('categorySort', categorySortFilter);
|
||||
}, [sorting]);
|
||||
}, [sorting, updateSortingFilter]);
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -347,4 +353,4 @@ const ProductsTable = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export default ProductsTable;
|
||||
export default ProductsTable;
|
||||
|
||||
@@ -192,7 +192,7 @@ const UomsTable = () => {
|
||||
} else {
|
||||
updateFilter('nameSort', isNameSorted.desc ? 'desc' : 'asc');
|
||||
}
|
||||
}, [sorting]);
|
||||
}, [sorting, updateFilter]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
@@ -270,7 +270,7 @@ const WarehousesTable = () => {
|
||||
updateSortingFilter('areaSort', areaSortFilter);
|
||||
updateSortingFilter('locationSort', locationSortFilter);
|
||||
updateSortingFilter('kandangSort', kandangSortFilter);
|
||||
}, [sorting]);
|
||||
}, [sorting, updateSortingFilter]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user