Merge branch 'develop' into 'devops-staging'

Develop

See merge request empatnusabangsa/ppob/ppob-frontend!54
This commit is contained in:
ajat sudrajat 2022-01-06 11:42:37 +00:00
commit 10b8dbcafa
4 changed files with 19 additions and 12 deletions

View File

@ -129,13 +129,15 @@ export const ProductComponent = observer((props) => {
},
];
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[4];
if (store.authentication.userData.role !== "Admin") delete columns[6];
if (store.authentication.userData.role !== "Admin") delete columns[2];
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") 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) => {
try {
@ -288,7 +290,10 @@ export const ProductComponent = observer((props) => {
bordered
pagination={{
pageSize: store.product.pageSize,
total: store.product.total_data,
total:
store.authentication.userData.role === "Admin Partner"
? store.product.total_data_partner
: store.product.total_data,
current: store.product.page + 1,
showSizeChanger: true,
simple: false,

View File

@ -233,7 +233,7 @@ export const SubcategoryComponent = observer((props) => {
}}
>
<Form form={form} layout="vertical">
{!idData && (
{idData === "" && (
<Form.Item
name="code"
label="Code"

View File

@ -277,14 +277,14 @@ export const Product = observer(() => {
required: true,
message: "Please input Destination Number!",
},
{
pattern: /^(?:\d*)$/,
message: "Value should contain just number",
},
{
pattern: /^[\d]{10,12}$/,
message: "Value should be 10 - 12 character",
},
// {
// pattern: /^(?:\d*)$/,
// message: "Value should contain just number",
// },
// {
// pattern: /^[\d]{1,12}$/,
// message: "Value should be 1 - 12 character",
// },
]}
>
<Input />

View File

@ -6,6 +6,7 @@ export class Product {
pageSize = 10
data = [];
total_data = 0;
total_data_partner=0;
filterSupplier = null;
filterSubCategory = null;
visibleModalProduct = false;
@ -101,6 +102,7 @@ export class Product {
const response = await http.get(`/product/by-categories?page=${this.pageProductPartner}&pageSize=10&sub-category=${id}`);
console.log(response)
this.dataProductPartner = response.body.data
this.total_data_partner= response?.body?.count ?? 0
} catch (e) {
console.error(e);
}