Merge branch 'develop' into 'devops-production'

Develop

See merge request empatnusabangsa/ppob/ppob-frontend!136
This commit is contained in:
ajat sudrajat 2022-02-04 13:21:27 +00:00
commit e4a857d5ab
6 changed files with 60 additions and 50 deletions

View File

@ -128,7 +128,7 @@ export const ProductComponent = observer((props) => {
), ),
}, },
]; ];
if (store.authentication.userData.role !== "Admin") columns.pop(); //if (store.authentication.userData.role !== "Admin") columns.pop();
//if (store.authentication.userData.role === "Admin Partner") delete columns[2]; //if (store.authentication.userData.role === "Admin Partner") delete columns[2];
if (store.authentication.userData.role === "Admin Partner") delete columns[3]; if (store.authentication.userData.role === "Admin Partner") delete columns[3];
if (store.authentication.userData.role != "Admin Partner") delete columns[4]; if (store.authentication.userData.role != "Admin Partner") delete columns[4];
@ -136,7 +136,7 @@ export const ProductComponent = observer((props) => {
if (store.authentication.userData.role !== "Admin") delete columns[2]; if (store.authentication.userData.role !== "Admin") delete columns[2];
if (store.authentication.userData.role !== "Admin") delete columns[5]; if (store.authentication.userData.role !== "Admin") delete columns[5];
if (store.authentication.userData.role === "Admin Partner") delete columns[7]; if (store.authentication.userData.role === "Admin Partner") delete columns[7];
if (store.authentication.userData.role !== "Admin") delete columns[8]; //if (store.authentication.userData.role !== "Admin") delete columns[8];
//if (store.authentication.userData.role === "Admin Partner") delete columns[5]; //if (store.authentication.userData.role === "Admin Partner") delete columns[5];
const deleteData = async (id) => { const deleteData = async (id) => {
@ -227,9 +227,13 @@ export const ProductComponent = observer((props) => {
store.product.filterSupplier = filterSupplier; store.product.filterSupplier = filterSupplier;
store.product.filterSubCategory = filterSubCategories; store.product.filterSubCategory = filterSubCategories;
modalLoader.setLoading(true); modalLoader.setLoading(true);
// store.authentication.userData.role === "Admin Partner"
// ? await store.product.getData()
// : await store.product.getData()
await store.product.getData(); await store.product.getData();
modalLoader.setLoading(false); modalLoader.setLoading(false);
store.product.visibleModalFilterProduct = false; store.product.visibleModalFilterProduct = false;
//store.product.page=1
}; };
const footerLayoutFilter = [ const footerLayoutFilter = [
@ -477,6 +481,7 @@ export const ProductComponent = observer((props) => {
visible={store.product.visibleModalFilterProduct} visible={store.product.visibleModalFilterProduct}
title={"Filter"} title={"Filter"}
footer={footerLayoutFilter} footer={footerLayoutFilter}
onCancel={async () => { onCancel={async () => {
// setFilterSupplier([]); // setFilterSupplier([]);
// setFilterSubCategories([]); // setFilterSubCategories([]);

View File

@ -412,8 +412,8 @@ export const DetailUser = observer(() => {
Detail User Detail User
</Title> </Title>
<Col <Col
lg={store.authentication.userData.role === "Admin" ? 18 : 13} lg={store.authentication.userData.role === "Admin" ? 18 : 17}
xs={store.authentication.userData.role === "Admin" ? 18 : 13} xs={store.authentication.userData.role === "Admin" ? 18 : 17}
style={{ textAlign: "right" }} style={{ textAlign: "right" }}
> >
<Space <Space

View File

@ -201,6 +201,7 @@ export const Membership = observer(() => {
key: "action", key: "action",
render: (text, record) => ( render: (text, record) => (
<Space size="middle"> <Space size="middle">
{store.authentication.userData.role === "Admin" && (
<Button <Button
onClick={() => { onClick={() => {
setDestination(record?.id); setDestination(record?.id);
@ -210,6 +211,7 @@ export const Membership = observer(() => {
> >
<DownloadOutlined /> Top Up Saldo <DownloadOutlined /> Top Up Saldo
</Button> </Button>
)}
<Button <Button
onClick={async () => { onClick={async () => {
await store.transaction.getDataHistoryTopUp(record.id); await store.transaction.getDataHistoryTopUp(record.id);
@ -226,7 +228,7 @@ export const Membership = observer(() => {
}, },
]; ];
if (store.authentication.userData.role === "Customer Service") columns.pop(); //if (store.authentication.userData.role === "Customer Service") columns.pop();
const routeData = [ const routeData = [
{ {
route: LINKS.HOME, route: LINKS.HOME,

View File

@ -195,6 +195,7 @@ export const Product = observer(() => {
<Button <Button
onClick={() => { onClick={() => {
store.product.visibleModalFilterProduct = true; store.product.visibleModalFilterProduct = true;
store.product.page=0
}} }}
> >
<FilterOutlined /> <FilterOutlined />

View File

@ -215,6 +215,7 @@ export const Product = observer(() => {
style={{ style={{
backgroundColor: "#4e79e7", backgroundColor: "#4e79e7",
color: "#fff", color: "#fff",
marginRight:10
}} }}
onClick={() => { onClick={() => {
form form
@ -231,24 +232,24 @@ export const Product = observer(() => {
> >
Beli Beli
</Button>, </Button>,
<Button // <Button
key="Beli Stag" // key="Beli Stag"
type="primary" // type="primary"
onClick={() => { // onClick={() => {
form // form
.validateFields() // .validateFields()
.then((values) => { // .then((values) => {
console.log(values, "isi form"); // console.log(values, "isi form");
handleBuyStag(values, barang.product_code); // handleBuyStag(values, barang.product_code);
form.resetFields(); // form.resetFields();
}) // })
.catch((info) => { // .catch((info) => {
console.error("Validate Failed:", info); // console.error("Validate Failed:", info);
}); // });
}} // }}
> // >
Beli Staging // Beli Staging
</Button>, // </Button>,
]} ]}
> >
<Form form={form} layout="vertical"> <Form form={form} layout="vertical">

View File

@ -294,6 +294,7 @@ export const Transaction = observer(() => {
style={{ style={{
backgroundColor: "#4e79e7", backgroundColor: "#4e79e7",
color: "#fff", color: "#fff",
marginRight:10
}} }}
onClick={() => { onClick={() => {
form form
@ -310,24 +311,24 @@ export const Transaction = observer(() => {
> >
Beli Beli
</Button>, </Button>,
<Button // <Button
key="Beli Stag" // key="Beli Stag"
type="primary" // type="primary"
onClick={() => { // onClick={() => {
form // form
.validateFields() // .validateFields()
.then((values) => { // .then((values) => {
console.log(values, "isi form"); // console.log(values, "isi form");
handleBuyStag(values, barang.product_code); // handleBuyStag(values, barang.product_code);
form.resetFields(); // form.resetFields();
}) // })
.catch((info) => { // .catch((info) => {
console.error("Validate Failed:", info); // console.error("Validate Failed:", info);
}); // });
}} // }}
> // >
Beli Staging // Beli Staging
</Button>, // </Button>,
]} ]}
> >
<Form form={form} layout="vertical"> <Form form={form} layout="vertical">