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>
|
||||
<Col span={24}>
|
||||
<Title level={5} type={"secondary"} strong>
|
||||
Filter Supplier
|
||||
</Title>
|
||||
<Select
|
||||
mode={"multiple"}
|
||||
placeholder="Choose Supplier"
|
||||
onChange={(val) => {
|
||||
setFilterSupplier(val);
|
||||
}}
|
||||
style={{ marginBottom: "20px", width: "100%" }}
|
||||
value={filterSupplier}
|
||||
>
|
||||
{store.supplier.data.map((item) => (
|
||||
<Option value={item.id} key={item.id}>
|
||||
{item.name}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
</Col>
|
||||
{store.authentication.userData.role === "Admin" && (
|
||||
<Col span={24}>
|
||||
<Title level={5} type={"secondary"} strong>
|
||||
Filter Supplier
|
||||
</Title>
|
||||
<Select
|
||||
mode={"multiple"}
|
||||
placeholder="Choose Supplier"
|
||||
onChange={(val) => {
|
||||
setFilterSupplier(val);
|
||||
}}
|
||||
style={{ marginBottom: "20px", width: "100%" }}
|
||||
value={filterSupplier}
|
||||
>
|
||||
{store.supplier.data.map((item) => (
|
||||
<Option value={item.id} key={item.id}>
|
||||
{item.name}
|
||||
</Option>
|
||||
))}
|
||||
</Select>
|
||||
</Col>
|
||||
)}
|
||||
<Col span={24}>
|
||||
<Title level={5} type={"secondary"} strong>
|
||||
Filter Sub-Categories
|
||||
|
|
|
@ -126,15 +126,22 @@ export const DesktopLayout = observer(() => {
|
|||
}}
|
||||
>
|
||||
<Menu>
|
||||
{store.authentication.userData.role === "Admin" ||
|
||||
(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" && (
|
||||
<Menu.Item key="home">
|
||||
<Link to={LINKS.HOME}>
|
||||
<HomeOutlined />
|
||||
<span>Beranda</span>
|
||||
</Link>
|
||||
</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" && (
|
||||
<Menu.Item key="membership">
|
||||
<Link to={LINKS.MEMBERSHIP}>
|
||||
|
|
|
@ -304,11 +304,19 @@ export const DetailUser = observer(() => {
|
|||
id: store.membership.dataDetail.id,
|
||||
name: store.membership.dataDetail.userDetail.name,
|
||||
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:
|
||||
store.membership.dataDetail.userDetail.phone_number,
|
||||
roleId: store.membership.dataDetail.roles.id,
|
||||
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);
|
||||
}}
|
||||
>
|
||||
|
@ -392,36 +400,96 @@ export const DetailUser = observer(() => {
|
|||
: "Inaktif"}
|
||||
</Text>
|
||||
</Col>
|
||||
<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.userDetail?.image_identity
|
||||
? `${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"
|
||||
}
|
||||
style={{ width: "10vw" }}
|
||||
/>
|
||||
</Text>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Text>
|
||||
<Image
|
||||
src={
|
||||
store.authentication.dataProfit.userDetail?.image_store
|
||||
? `${appConfig.apiUrl}/config/image/${store.authentication.dataProfit.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>
|
||||
{store.authentication.userData.role === "Sales" && (
|
||||
<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
|
||||
? `${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"
|
||||
}
|
||||
style={{ width: "10vw" }}
|
||||
/>
|
||||
</Text>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Text>
|
||||
<Image
|
||||
src={
|
||||
store.authentication.dataProfit.profileData
|
||||
?.image_store
|
||||
? `${appConfig.apiUrl}/config/image/${store.authentication.dataProfit.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>
|
||||
)}
|
||||
{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>
|
||||
</Col>
|
||||
<Col lg={12} xs={24}>
|
||||
|
|
|
@ -259,7 +259,13 @@ export const Membership = observer(() => {
|
|||
setConfirmLoading(true);
|
||||
modalLoader.setLoading(true);
|
||||
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(
|
||||
initialData.isChangePassword
|
||||
? "Success Change Member Password"
|
||||
|
@ -520,8 +526,8 @@ export const Membership = observer(() => {
|
|||
visible={visibleModal}
|
||||
confirmLoading={confirmLoading}
|
||||
initialData={initialData}
|
||||
onCreate={async (data,image,imageStore) => {
|
||||
onSubmit(data,image,imageStore);
|
||||
onCreate={async (data, image, imageStore) => {
|
||||
onSubmit(data, image, imageStore);
|
||||
}}
|
||||
onCancel={async () => {
|
||||
setInitialData({});
|
||||
|
|
|
@ -256,7 +256,7 @@ export const Profile = observer(() => {
|
|||
{store.authentication.profileData.superior?.username}
|
||||
</Text>
|
||||
</Col>
|
||||
{store.authentication.userData.role === "Sales" && (
|
||||
{store.authentication.userData.role === "Retail" && (
|
||||
<Row>
|
||||
<Col span={12}>
|
||||
<Text strong>Foto Identitas</Text>
|
||||
|
@ -292,14 +292,12 @@ export const Profile = observer(() => {
|
|||
</Col>
|
||||
</Row>
|
||||
)}
|
||||
{store.authentication.userData.role === "Supervisor" && (
|
||||
{/* {store.authentication.userData.role === "Supervisor" && (
|
||||
<Row>
|
||||
<Col span={12}>
|
||||
<Text strong>Foto Identitas</Text>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Text strong>Foto Toko</Text>
|
||||
</Col>
|
||||
<Col span={12}></Col>
|
||||
<Col span={12}>
|
||||
<Text>
|
||||
<Image
|
||||
|
@ -313,21 +311,8 @@ export const Profile = observer(() => {
|
|||
/>
|
||||
</Text>
|
||||
</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>
|
||||
</Col>
|
||||
<Col span={store.ui.mediaQuery.isMobile ? 24 : 5}>
|
||||
|
|
|
@ -86,6 +86,7 @@ export class Membership {
|
|||
async update(id, data) {
|
||||
try {
|
||||
const response = await http.put('/users/' + id).send(data);
|
||||
console.log(data,"data dari store")
|
||||
return response;
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
|
Loading…
Reference in New Issue
Block a user