Merge branch 'develop' into 'devops-staging'
Develop See merge request empatnusabangsa/ppob/ppob-frontend!61
This commit is contained in:
commit
ac037c2afd
|
@ -487,26 +487,28 @@ export const ProductComponent = observer((props) => {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={24}>
|
{store.authentication.userData.role === "Admin" && (
|
||||||
<Title level={5} type={"secondary"} strong>
|
<Col span={24}>
|
||||||
Filter Supplier
|
<Title level={5} type={"secondary"} strong>
|
||||||
</Title>
|
Filter Supplier
|
||||||
<Select
|
</Title>
|
||||||
mode={"multiple"}
|
<Select
|
||||||
placeholder="Choose Supplier"
|
mode={"multiple"}
|
||||||
onChange={(val) => {
|
placeholder="Choose Supplier"
|
||||||
setFilterSupplier(val);
|
onChange={(val) => {
|
||||||
}}
|
setFilterSupplier(val);
|
||||||
style={{ marginBottom: "20px", width: "100%" }}
|
}}
|
||||||
value={filterSupplier}
|
style={{ marginBottom: "20px", width: "100%" }}
|
||||||
>
|
value={filterSupplier}
|
||||||
{store.supplier.data.map((item) => (
|
>
|
||||||
<Option value={item.id} key={item.id}>
|
{store.supplier.data.map((item) => (
|
||||||
{item.name}
|
<Option value={item.id} key={item.id}>
|
||||||
</Option>
|
{item.name}
|
||||||
))}
|
</Option>
|
||||||
</Select>
|
))}
|
||||||
</Col>
|
</Select>
|
||||||
|
</Col>
|
||||||
|
)}
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
<Title level={5} type={"secondary"} strong>
|
<Title level={5} type={"secondary"} strong>
|
||||||
Filter Sub-Categories
|
Filter Sub-Categories
|
||||||
|
|
|
@ -126,15 +126,22 @@ export const DesktopLayout = observer(() => {
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Menu>
|
<Menu>
|
||||||
{store.authentication.userData.role === "Admin" ||
|
{store.authentication.userData.role === "Admin" && (
|
||||||
(store.authentication.userData.role === "Admin Partner" && (
|
<Menu.Item key="home">
|
||||||
<Menu.Item key="home">
|
<Link to={LINKS.HOME}>
|
||||||
<Link to={LINKS.HOME}>
|
<HomeOutlined />
|
||||||
<HomeOutlined />
|
<span>Beranda</span>
|
||||||
<span>Beranda</span>
|
</Link>
|
||||||
</Link>
|
</Menu.Item>
|
||||||
</Menu.Item>
|
)}
|
||||||
))}
|
{store.authentication.userData.role === "Admin Partner" && (
|
||||||
|
<Menu.Item key="home">
|
||||||
|
<Link to={LINKS.HOME}>
|
||||||
|
<HomeOutlined />
|
||||||
|
<span>Beranda</span>
|
||||||
|
</Link>
|
||||||
|
</Menu.Item>
|
||||||
|
)}
|
||||||
{store.authentication.userData.role === "Admin" && (
|
{store.authentication.userData.role === "Admin" && (
|
||||||
<Menu.Item key="membership">
|
<Menu.Item key="membership">
|
||||||
<Link to={LINKS.MEMBERSHIP}>
|
<Link to={LINKS.MEMBERSHIP}>
|
||||||
|
|
|
@ -304,11 +304,19 @@ export const DetailUser = observer(() => {
|
||||||
id: store.membership.dataDetail.id,
|
id: store.membership.dataDetail.id,
|
||||||
name: store.membership.dataDetail.userDetail.name,
|
name: store.membership.dataDetail.userDetail.name,
|
||||||
username: store.membership.dataDetail.username,
|
username: store.membership.dataDetail.username,
|
||||||
|
identity_number: store.membership.dataDetail.userDetail.identity_number,
|
||||||
|
image_identity: store.membership.dataDetail?.userDetail.image_identity,
|
||||||
|
image_store: store.membership.dataDetail?.userDetail.image_store,
|
||||||
phone_number:
|
phone_number:
|
||||||
store.membership.dataDetail.userDetail.phone_number,
|
store.membership.dataDetail.userDetail.phone_number,
|
||||||
roleId: store.membership.dataDetail.roles.id,
|
roleId: store.membership.dataDetail.roles.id,
|
||||||
isChangePassword: false,
|
isChangePassword: false,
|
||||||
|
|
||||||
});
|
});
|
||||||
|
console.log(store.membership.dataDetail.userDetail.identity_number)
|
||||||
|
console.log(store.membership.dataDetail.userDetail.id)
|
||||||
|
console.log(store.membership.dataDetail.userDetail.image_identity)
|
||||||
|
console.log(store.membership.dataDetail.username)
|
||||||
setVisibleModal(true);
|
setVisibleModal(true);
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
@ -392,36 +400,96 @@ export const DetailUser = observer(() => {
|
||||||
: "Inaktif"}
|
: "Inaktif"}
|
||||||
</Text>
|
</Text>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
{store.authentication.userData.role === "Sales" && (
|
||||||
<Text strong>Foto Identitas</Text>
|
<Row>
|
||||||
</Col>
|
<Col span={12}>
|
||||||
<Col span={12}>
|
<Text strong>Foto Identitas</Text>
|
||||||
<Text strong>Foto Toko</Text>
|
</Col>
|
||||||
</Col>
|
<Col span={12}>
|
||||||
<Col span={12}>
|
<Text strong>Foto Toko</Text>
|
||||||
<Text>
|
</Col>
|
||||||
<Image
|
<Col span={12}>
|
||||||
src={
|
<Text>
|
||||||
store.authentication.dataProfit.userDetail?.image_identity
|
<Image
|
||||||
? `${appConfig.apiUrl}/config/image/${store.authentication.dataProfit.userDetail?.image_identity}`
|
src={
|
||||||
: "https://st4.depositphotos.com/14953852/24787/v/600/depositphotos_247872612-stock-illustration-no-image-available-icon-vector.jpg"
|
store.authentication.dataProfit.profileData
|
||||||
}
|
?.image_identity
|
||||||
style={{ width: "10vw" }}
|
? `${appConfig.apiUrl}/config/image/${store.authentication.dataProfit.userDetail?.image_identity}`
|
||||||
/>
|
: "https://st4.depositphotos.com/14953852/24787/v/600/depositphotos_247872612-stock-illustration-no-image-available-icon-vector.jpg"
|
||||||
</Text>
|
}
|
||||||
</Col>
|
style={{ width: "10vw" }}
|
||||||
<Col span={12}>
|
/>
|
||||||
<Text>
|
</Text>
|
||||||
<Image
|
</Col>
|
||||||
src={
|
<Col span={12}>
|
||||||
store.authentication.dataProfit.userDetail?.image_store
|
<Text>
|
||||||
? `${appConfig.apiUrl}/config/image/${store.authentication.dataProfit.userDetail?.image_store}`
|
<Image
|
||||||
: "https://st4.depositphotos.com/14953852/24787/v/600/depositphotos_247872612-stock-illustration-no-image-available-icon-vector.jpg"
|
src={
|
||||||
}
|
store.authentication.dataProfit.profileData
|
||||||
style={{ width: "10vw" }}
|
?.image_store
|
||||||
/>
|
? `${appConfig.apiUrl}/config/image/${store.authentication.dataProfit.userDetail?.image_store}`
|
||||||
</Text>
|
: "https://st4.depositphotos.com/14953852/24787/v/600/depositphotos_247872612-stock-illustration-no-image-available-icon-vector.jpg"
|
||||||
</Col>
|
}
|
||||||
|
style={{ width: "10vw" }}
|
||||||
|
/>
|
||||||
|
</Text>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
)}
|
||||||
|
{store.authentication.userData.role === "Admin" && (
|
||||||
|
<Row>
|
||||||
|
<Col span={12}>
|
||||||
|
<Text strong>Foto Identitas</Text>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Text strong>Foto Toko</Text>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Text>
|
||||||
|
<Image
|
||||||
|
src={
|
||||||
|
store.authentication.dataProfit.profileData?.image_identity
|
||||||
|
? "https://st4.depositphotos.com/14953852/24787/v/600/depositphotos_247872612-stock-illustration-no-image-available-icon-vector.jpg"
|
||||||
|
: `${appConfig.apiUrl}/config/image/${store.authentication.dataProfit.userDetail?.image_identity}`}
|
||||||
|
style={{ width: "10vw" }}
|
||||||
|
/>
|
||||||
|
</Text>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Text>
|
||||||
|
<Image
|
||||||
|
src={
|
||||||
|
store.authentication.dataProfit.profileData
|
||||||
|
?.image_store
|
||||||
|
?"https://st4.depositphotos.com/14953852/24787/v/600/depositphotos_247872612-stock-illustration-no-image-available-icon-vector.jpg"
|
||||||
|
: `${appConfig.apiUrl}/config/image/${store.authentication.dataProfit.userDetail?.image_store}` }
|
||||||
|
style={{ width: "10vw" }}
|
||||||
|
/>
|
||||||
|
</Text>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
)}
|
||||||
|
{store.authentication.userData.role === "Supervisor" && (
|
||||||
|
<Row>
|
||||||
|
<Col span={12}>
|
||||||
|
<Text strong>Foto Identitas</Text>
|
||||||
|
</Col>
|
||||||
|
<Col span={12}></Col>
|
||||||
|
<Col span={12}>
|
||||||
|
<Text>
|
||||||
|
<Image
|
||||||
|
src={
|
||||||
|
store.authentication.dataProfit.profileData
|
||||||
|
?.image_identity
|
||||||
|
? `${appConfig.apiUrl}/config/image/${store.authentication.profileData.userDetail?.image_identity}`
|
||||||
|
: "https://st4.depositphotos.com/14953852/24787/v/600/depositphotos_247872612-stock-illustration-no-image-available-icon-vector.jpg"
|
||||||
|
}
|
||||||
|
style={{ width: "10vw" }}
|
||||||
|
/>
|
||||||
|
</Text>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
)}
|
||||||
</Row>
|
</Row>
|
||||||
</Col>
|
</Col>
|
||||||
<Col lg={12} xs={24}>
|
<Col lg={12} xs={24}>
|
||||||
|
|
|
@ -259,7 +259,13 @@ export const Membership = observer(() => {
|
||||||
setConfirmLoading(true);
|
setConfirmLoading(true);
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
try {
|
try {
|
||||||
await store.membership.update(initialData.id, data);
|
console.log(data, "edit data");
|
||||||
|
const request = {
|
||||||
|
...data,
|
||||||
|
image_identity: image,
|
||||||
|
image_store: imageStore,
|
||||||
|
};
|
||||||
|
await store.membership.update(initialData.id, request);
|
||||||
message.success(
|
message.success(
|
||||||
initialData.isChangePassword
|
initialData.isChangePassword
|
||||||
? "Success Change Member Password"
|
? "Success Change Member Password"
|
||||||
|
@ -520,8 +526,8 @@ export const Membership = observer(() => {
|
||||||
visible={visibleModal}
|
visible={visibleModal}
|
||||||
confirmLoading={confirmLoading}
|
confirmLoading={confirmLoading}
|
||||||
initialData={initialData}
|
initialData={initialData}
|
||||||
onCreate={async (data,image,imageStore) => {
|
onCreate={async (data, image, imageStore) => {
|
||||||
onSubmit(data,image,imageStore);
|
onSubmit(data, image, imageStore);
|
||||||
}}
|
}}
|
||||||
onCancel={async () => {
|
onCancel={async () => {
|
||||||
setInitialData({});
|
setInitialData({});
|
||||||
|
|
|
@ -256,7 +256,7 @@ export const Profile = observer(() => {
|
||||||
{store.authentication.profileData.superior?.username}
|
{store.authentication.profileData.superior?.username}
|
||||||
</Text>
|
</Text>
|
||||||
</Col>
|
</Col>
|
||||||
{store.authentication.userData.role === "Sales" && (
|
{store.authentication.userData.role === "Retail" && (
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Text strong>Foto Identitas</Text>
|
<Text strong>Foto Identitas</Text>
|
||||||
|
@ -292,14 +292,12 @@ export const Profile = observer(() => {
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
)}
|
)}
|
||||||
{store.authentication.userData.role === "Supervisor" && (
|
{/* {store.authentication.userData.role === "Supervisor" && (
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Text strong>Foto Identitas</Text>
|
<Text strong>Foto Identitas</Text>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
<Col span={12}></Col>
|
||||||
<Text strong>Foto Toko</Text>
|
|
||||||
</Col>
|
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Text>
|
<Text>
|
||||||
<Image
|
<Image
|
||||||
|
@ -313,21 +311,8 @@ export const Profile = observer(() => {
|
||||||
/>
|
/>
|
||||||
</Text>
|
</Text>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={12}>
|
|
||||||
<Text>
|
|
||||||
<Image
|
|
||||||
src={
|
|
||||||
store.authentication.dataProfit.profileData
|
|
||||||
?.image_store
|
|
||||||
? `${appConfig.apiUrl}/config/image/${store.authentication.profileData.userDetail?.image_store}`
|
|
||||||
: "https://st4.depositphotos.com/14953852/24787/v/600/depositphotos_247872612-stock-illustration-no-image-available-icon-vector.jpg"
|
|
||||||
}
|
|
||||||
style={{ width: "10vw" }}
|
|
||||||
/>
|
|
||||||
</Text>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
</Row>
|
||||||
)}
|
)} */}
|
||||||
</Row>
|
</Row>
|
||||||
</Col>
|
</Col>
|
||||||
<Col span={store.ui.mediaQuery.isMobile ? 24 : 5}>
|
<Col span={store.ui.mediaQuery.isMobile ? 24 : 5}>
|
||||||
|
|
|
@ -86,6 +86,7 @@ export class Membership {
|
||||||
async update(id, data) {
|
async update(id, data) {
|
||||||
try {
|
try {
|
||||||
const response = await http.put('/users/' + id).send(data);
|
const response = await http.put('/users/' + id).send(data);
|
||||||
|
console.log(data,"data dari store")
|
||||||
return response;
|
return response;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user