Bug Fixing
This commit is contained in:
@@ -195,9 +195,11 @@ export const CategoryComponent = observer((props) => {
|
||||
margin: 0,
|
||||
}}
|
||||
>
|
||||
<Button onClick={() => handleEditButton(item)}>
|
||||
Edit
|
||||
</Button>
|
||||
{store.authentication.userData.role === "Admin" && (
|
||||
<Button onClick={() => handleEditButton(item)}>
|
||||
Edit
|
||||
</Button>
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
</List.Item>
|
||||
|
||||
@@ -213,7 +213,12 @@ export const ProductComponent = observer((props) => {
|
||||
store.product.filterSubCategory = null;
|
||||
setFilterSupplier([]);
|
||||
setFilterSubCategories([]);
|
||||
await store.product.getData();
|
||||
store.authentication.userData.role === "Admin Partner"
|
||||
? await store.product.getProductPartner(
|
||||
store.authentication.profileData.id
|
||||
)
|
||||
: await store.product.getData();
|
||||
//await store.product.getData();
|
||||
store.product.visibleModalFilterProduct = false;
|
||||
};
|
||||
|
||||
@@ -221,17 +226,24 @@ export const ProductComponent = observer((props) => {
|
||||
store.product.filterSubCategory = null;
|
||||
store.product.filterSupplier = null;
|
||||
store.product.visibleModalFilterProduct = false;
|
||||
await store.product.getData();
|
||||
store.authentication.userData.role === "Admin Partner"
|
||||
? await store.product.getProductPartner(
|
||||
store.authentication.profileData.id
|
||||
)
|
||||
: await store.product.getData();
|
||||
//await store.product.getData();
|
||||
};
|
||||
|
||||
const handleSubmitFilter = async () => {
|
||||
store.product.filterSupplier = filterSupplier;
|
||||
store.product.filterSubCategory = filterSubCategories;
|
||||
modalLoader.setLoading(true);
|
||||
// store.authentication.userData.role === "Admin Partner"
|
||||
// ? await store.product.getData()
|
||||
// : await store.product.getData()
|
||||
await store.product.getData();
|
||||
store.authentication.userData.role === "Admin Partner"
|
||||
? await store.product.getProductPartner(
|
||||
store.authentication.profileData.id
|
||||
)
|
||||
: await store.product.getData();
|
||||
//await store.product.getData();
|
||||
modalLoader.setLoading(false);
|
||||
store.product.visibleModalFilterProduct = false;
|
||||
//store.product.page=1
|
||||
@@ -273,16 +285,19 @@ export const ProductComponent = observer((props) => {
|
||||
{store.ui.mediaQuery.isDesktop && (
|
||||
<Table
|
||||
style={
|
||||
store.authentication.userData.role === "Admin"
|
||||
? {
|
||||
cursor: "pointer",
|
||||
textAlign: "center",
|
||||
width: store.ui.mediaQuery.isMobile ? 250 : "",
|
||||
}
|
||||
: {
|
||||
textAlign: "center",
|
||||
width: store.ui.mediaQuery.isMobile ? 250 : "",
|
||||
}
|
||||
// store.authentication.userData.role === "Admin"
|
||||
// ? {
|
||||
{
|
||||
cursor: "pointer",
|
||||
textAlign: "center",
|
||||
width: store.ui.mediaQuery.isMobile ? 250 : "",
|
||||
}
|
||||
|
||||
// }
|
||||
// : {
|
||||
// textAlign: "center",
|
||||
// width: store.ui.mediaQuery.isMobile ? 250 : "",
|
||||
// }
|
||||
}
|
||||
columns={columns}
|
||||
dataSource={
|
||||
@@ -290,9 +305,7 @@ export const ProductComponent = observer((props) => {
|
||||
? store.product.dataProductPartner
|
||||
: store.product.data
|
||||
}
|
||||
onRow={
|
||||
store.authentication.userData.role === "Admin" ? handleClickRow : ""
|
||||
}
|
||||
onRow={handleClickRow}
|
||||
pagination={{
|
||||
pageSize: store.product.pageSize,
|
||||
total:
|
||||
@@ -322,7 +335,12 @@ export const ProductComponent = observer((props) => {
|
||||
store.product.pageSize = pageSize;
|
||||
store.product.page = page - 1;
|
||||
modalLoader.setLoading(true);
|
||||
await store.product.getData();
|
||||
store.authentication.userData.role === "Admin Partner"
|
||||
? await store.product.getProductPartner(
|
||||
store.authentication.profileData.id
|
||||
)
|
||||
: await store.product.getData();
|
||||
//await store.product.getData();
|
||||
modalLoader.setLoading(false);
|
||||
},
|
||||
pageSize: store.product.pageSize,
|
||||
@@ -357,6 +375,19 @@ export const ProductComponent = observer((props) => {
|
||||
{/* <small>Harga Beli : {item.current_price_price}</small>
|
||||
<br /> */}
|
||||
<small>Harga Jual : {item.mark_up_price}</small>
|
||||
<br />
|
||||
<Button
|
||||
onClick={async () => {
|
||||
history.push(
|
||||
LINKS.PRODUCT_DETAIL.replace(
|
||||
":id",
|
||||
item.product_id
|
||||
)
|
||||
);
|
||||
}}
|
||||
>
|
||||
Detail
|
||||
</Button>
|
||||
</p>
|
||||
<p></p>
|
||||
</div>
|
||||
@@ -457,8 +488,8 @@ export const ProductComponent = observer((props) => {
|
||||
rules={[{ required: true, message: "Please select Status!" }]}
|
||||
>
|
||||
<Select placeholder="Select Sub Category" allowClear>
|
||||
<Option value="ACTIVE">ACTIVE</Option>
|
||||
<Option value="INACTIVE">INACTIVE</Option>
|
||||
<Option value="ACTIVE">AKTIF</Option>
|
||||
<Option value="INACTIVE">INAKTIF</Option>
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
@@ -482,7 +513,6 @@ export const ProductComponent = observer((props) => {
|
||||
visible={store.product.visibleModalFilterProduct}
|
||||
title={"Filter"}
|
||||
footer={footerLayoutFilter}
|
||||
|
||||
onCancel={async () => {
|
||||
// setFilterSupplier([]);
|
||||
// setFilterSubCategories([]);
|
||||
|
||||
@@ -68,7 +68,7 @@ export const SubcategoryComponent = observer((props) => {
|
||||
];
|
||||
|
||||
if (store.authentication.userData.role === "Customer Service") columns.pop();
|
||||
|
||||
|
||||
const handleCancel = () => {
|
||||
setIdData("");
|
||||
store.subcategory.visibleModalSubcategory = false;
|
||||
@@ -150,7 +150,7 @@ export const SubcategoryComponent = observer((props) => {
|
||||
itemLayout="horizontal"
|
||||
position={"top"}
|
||||
pagination={{
|
||||
onChange: async (page,pageSize) => {
|
||||
onChange: async (page, pageSize) => {
|
||||
store.subcategory.pageSize = pageSize;
|
||||
store.subcategory.page = page - 1;
|
||||
modalLoader.setLoading(true);
|
||||
@@ -200,9 +200,11 @@ export const SubcategoryComponent = observer((props) => {
|
||||
margin: 0,
|
||||
}}
|
||||
>
|
||||
<Button onClick={() => handleEditButton(item)}>
|
||||
Edit
|
||||
</Button>
|
||||
{store.authentication.userData.role === "Admin" && (
|
||||
<Button onClick={() => handleEditButton(item)}>
|
||||
Edit
|
||||
</Button>
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
</List.Item>
|
||||
@@ -254,19 +256,19 @@ export const SubcategoryComponent = observer((props) => {
|
||||
<Input />
|
||||
</Form.Item>
|
||||
{/* {!idData && ( */}
|
||||
<Form.Item
|
||||
name="categoryId"
|
||||
label="Categories"
|
||||
rules={[{ required: true, message: "Please input category id!" }]}
|
||||
>
|
||||
<Select placeholder="Select Category" allowClear>
|
||||
{store.category.data.map((item) => (
|
||||
<Option value={item.id} key={item.id} defaultValue={item.name}>
|
||||
{item.name}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name="categoryId"
|
||||
label="Categories"
|
||||
rules={[{ required: true, message: "Please input category id!" }]}
|
||||
>
|
||||
<Select placeholder="Select Category" allowClear>
|
||||
{store.category.data.map((item) => (
|
||||
<Option value={item.id} key={item.id} defaultValue={item.name}>
|
||||
{item.name}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
</Form.Item>
|
||||
{/* )} */}
|
||||
</Form>
|
||||
</Modal>
|
||||
|
||||
Reference in New Issue
Block a user