Merge branch 'develop' into 'devops-staging'
Develop See merge request empatnusabangsa/ppob/ppob-frontend!71
This commit is contained in:
commit
8fb20f7c00
|
@ -56,6 +56,7 @@ export const DetailUser = observer(() => {
|
||||||
await Promise.allSettled([
|
await Promise.allSettled([
|
||||||
store.transaction.getDataHistoryTopUp(id),
|
store.transaction.getDataHistoryTopUp(id),
|
||||||
store.authentication.getProfit(id),
|
store.authentication.getProfit(id),
|
||||||
|
store.authentication.getProfile(),
|
||||||
store.transaction.getDetailHistoryTransaction(id),
|
store.transaction.getDetailHistoryTransaction(id),
|
||||||
store.membership.getDetail(id),
|
store.membership.getDetail(id),
|
||||||
store.role.getData(isAdmin),
|
store.role.getData(isAdmin),
|
||||||
|
@ -254,7 +255,7 @@ export const DetailUser = observer(() => {
|
||||||
const dataRoute = [
|
const dataRoute = [
|
||||||
{
|
{
|
||||||
route: LINKS.MEMBERSHIP,
|
route: LINKS.MEMBERSHIP,
|
||||||
name: "Keanggotaan"
|
name: "Keanggotaan",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
route: LINKS.USER_DETAIL.replace(":id", id),
|
route: LINKS.USER_DETAIL.replace(":id", id),
|
||||||
|
@ -645,8 +646,9 @@ export const DetailUser = observer(() => {
|
||||||
<Text strong>Foto Toko</Text>
|
<Text strong>Foto Toko</Text>
|
||||||
<Text>
|
<Text>
|
||||||
<Row>
|
<Row>
|
||||||
{store.authentication.listImage.map((item) => (
|
{store.authentication.listImage.map((item, index) => (
|
||||||
<Image
|
<Image
|
||||||
|
key={index}
|
||||||
src={
|
src={
|
||||||
item
|
item
|
||||||
? `${appConfig.apiUrl}/config/image/${item}`
|
? `${appConfig.apiUrl}/config/image/${item}`
|
||||||
|
@ -683,8 +685,9 @@ export const DetailUser = observer(() => {
|
||||||
<Text strong>Foto Toko</Text>
|
<Text strong>Foto Toko</Text>
|
||||||
<Text>
|
<Text>
|
||||||
<Row>
|
<Row>
|
||||||
{store.authentication.listImage.map((item) => (
|
{store.authentication.listImage.map((item, index) => (
|
||||||
<Image
|
<Image
|
||||||
|
key={index}
|
||||||
src={
|
src={
|
||||||
item
|
item
|
||||||
? `${appConfig.apiUrl}/config/image/${item}`
|
? `${appConfig.apiUrl}/config/image/${item}`
|
||||||
|
|
|
@ -269,7 +269,7 @@ export const Membership = observer(() => {
|
||||||
|
|
||||||
if (initialData.id) {
|
if (initialData.id) {
|
||||||
data.image_identity = image;
|
data.image_identity = image;
|
||||||
data.image_store = imageStore;
|
data.image_store = JSON.stringify(imageStore);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (initialData.id) {
|
if (initialData.id) {
|
||||||
|
@ -280,7 +280,7 @@ export const Membership = observer(() => {
|
||||||
const request = {
|
const request = {
|
||||||
...data,
|
...data,
|
||||||
image_identity: image,
|
image_identity: image,
|
||||||
image_store: imageStore,
|
image_store: JSON.stringify(imageStore),
|
||||||
};
|
};
|
||||||
await store.membership.update(initialData.id, request);
|
await store.membership.update(initialData.id, request);
|
||||||
console.log(data, "edit data");
|
console.log(data, "edit data");
|
||||||
|
|
|
@ -141,7 +141,7 @@ export const MembershipModal = ({
|
||||||
name: res.body.filename,
|
name: res.body.filename,
|
||||||
status: "done",
|
status: "done",
|
||||||
url: `${appConfig.apiUrl}/config/image/${res.body.filename}`,
|
url: `${appConfig.apiUrl}/config/image/${res.body.filename}`,
|
||||||
},
|
}
|
||||||
]);
|
]);
|
||||||
|
|
||||||
setLoadingStore(false);
|
setLoadingStore(false);
|
||||||
|
@ -207,7 +207,8 @@ export const MembershipModal = ({
|
||||||
.then((values) => {
|
.then((values) => {
|
||||||
console.log(values, "apa valuesanya");
|
console.log(values, "apa valuesanya");
|
||||||
values.image_identity = responseFilename;
|
values.image_identity = responseFilename;
|
||||||
values.image_store = responseFilenameStore;
|
const data = values.image_store = JSON.stringify(responseFilenameStore);
|
||||||
|
console.log(data,'dari modal')
|
||||||
onCreate(values, responseFilename, responseFilenameStore);
|
onCreate(values, responseFilename, responseFilenameStore);
|
||||||
form.resetFields();
|
form.resetFields();
|
||||||
setFileStore([]);
|
setFileStore([]);
|
||||||
|
|
|
@ -185,7 +185,7 @@ export const Payback = observer(() => {
|
||||||
const dataRoute = [
|
const dataRoute = [
|
||||||
{
|
{
|
||||||
route: LINKS.PAYBACK,
|
route: LINKS.PAYBACK,
|
||||||
name: "Konfirmasi Pembayaran"
|
name: "Konfirmasi Pembayaran",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -201,15 +201,6 @@ export const Payback = observer(() => {
|
||||||
: message.success(
|
: message.success(
|
||||||
response?.body?.message || `Success ${capitalize(type)} Payback`
|
response?.body?.message || `Success ${capitalize(type)} Payback`
|
||||||
);
|
);
|
||||||
// if (response.body.status !== 201 ) {
|
|
||||||
// message.error(
|
|
||||||
// response?.body?.message || `Failed ${capitalize(type)} Payback`
|
|
||||||
// );
|
|
||||||
// } else {
|
|
||||||
// message.success(
|
|
||||||
// response?.body?.message || `Success ${capitalize(type)} Payback`
|
|
||||||
// );
|
|
||||||
// }
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e, "apa errornya");
|
console.error(e, "apa errornya");
|
||||||
message.error(
|
message.error(
|
||||||
|
@ -521,7 +512,7 @@ export const Payback = observer(() => {
|
||||||
label="Dari"
|
label="Dari"
|
||||||
rules={[{ required: true, message: "Please input Date!" }]}
|
rules={[{ required: true, message: "Please input Date!" }]}
|
||||||
>
|
>
|
||||||
<DatePicker style={{ width: "100%" }} />
|
<DatePicker style={{ width: "100%" }}/>
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<Form.Item
|
<Form.Item
|
||||||
name="end_date"
|
name="end_date"
|
||||||
|
@ -532,46 +523,6 @@ export const Payback = observer(() => {
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
</Form>
|
</Form>
|
||||||
</Col>
|
</Col>
|
||||||
{/* <Col span={24}> */}
|
|
||||||
|
|
||||||
{/* <Title level={5} type={"secondary"} strong>
|
|
||||||
Date
|
|
||||||
</Title>
|
|
||||||
<RangePicker style={{ marginBottom: "20px", width: "100%" }} /> */}
|
|
||||||
{/* <Select
|
|
||||||
mode={"multiple"}
|
|
||||||
placeholder="Choose Category"
|
|
||||||
onChange={async (val) => handleFilterCategory(val)}
|
|
||||||
style={{ marginBottom: "20px", width: "100%" }}
|
|
||||||
value={store.product.filterCategory || []}
|
|
||||||
>
|
|
||||||
{store.category.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
|
|
||||||
</Title>
|
|
||||||
<Select
|
|
||||||
mode={"multiple"}
|
|
||||||
placeholder="Choose Sub-Category"
|
|
||||||
onChange={(val) => {
|
|
||||||
setFilterSubCategories(val);
|
|
||||||
}}
|
|
||||||
style={{ marginBottom: "20px", width: "100%" }}
|
|
||||||
value={filterSubCategories}
|
|
||||||
>
|
|
||||||
{store.product.dataSubCategories.map((item) => (
|
|
||||||
<Option value={item.id} key={item.id}>
|
|
||||||
{item.name}
|
|
||||||
</Option>
|
|
||||||
))}
|
|
||||||
</Select>
|
|
||||||
</Col> */}
|
|
||||||
</Row>
|
</Row>
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -90,12 +90,6 @@ export const PaybackCreated = observer(() => {
|
||||||
key: "status",
|
key: "status",
|
||||||
width: "10%",
|
width: "10%",
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
// <Tag
|
|
||||||
// color={PAYBACK_STATUS[text] === PAYBACK_STATUS[3] ? "cyan" : "red"}
|
|
||||||
// style={{ color: "#4F566B" }}
|
|
||||||
// >
|
|
||||||
// {PAYBACK_STATUS[text]}
|
|
||||||
// </Tag>
|
|
||||||
<Tag
|
<Tag
|
||||||
color={
|
color={
|
||||||
record.status === 0
|
record.status === 0
|
||||||
|
@ -159,10 +153,6 @@ export const PaybackCreated = observer(() => {
|
||||||
const handleSubmitFilter = async () => {
|
const handleSubmitFilter = async () => {
|
||||||
const data = form.getFieldsValue();
|
const data = form.getFieldsValue();
|
||||||
console.log(data);
|
console.log(data);
|
||||||
//store.payback.filterMembership = filterMembership;
|
|
||||||
// const awal = format(parseISO(data.start_date), "dd-MM-yyyy")
|
|
||||||
// const akhir = format(parseISO(data.start_date), "dd-MM-yyyy")
|
|
||||||
//const awal= format(startOfDay(date.start_date()), 'yyyy-MM-dd 00:00')
|
|
||||||
const awal = (store.payback.filterStart = moment(data.start_date).format(
|
const awal = (store.payback.filterStart = moment(data.start_date).format(
|
||||||
"YYYY-MM-DD 00:00:00"
|
"YYYY-MM-DD 00:00:00"
|
||||||
));
|
));
|
||||||
|
@ -174,8 +164,6 @@ export const PaybackCreated = observer(() => {
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
await store.payback.getDataCreated();
|
await store.payback.getDataCreated();
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
// form.resetFields();
|
|
||||||
// setFilterMembership([]);
|
|
||||||
store.payback.visibleModalFilterCreate = false;
|
store.payback.visibleModalFilterCreate = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -134,16 +134,6 @@ export const ProductDetail = observer(() => {
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
</Col>
|
</Col>
|
||||||
{/* <Col lg={12} xs={24}>
|
|
||||||
<Row justify={"center"}>
|
|
||||||
<Col lg={24} xs={12}>
|
|
||||||
<Title strong level={3} style={styleSaldoTitle}>Saldo</Title>
|
|
||||||
</Col>
|
|
||||||
<Col lg={24} xs={12}>
|
|
||||||
<Text style={styleSaldoContent}>{store.authentication.profileData?.wallet}</Text>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
</Col> */}
|
|
||||||
</Row>
|
</Row>
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={24}>
|
<Col span={24}>
|
||||||
|
@ -151,13 +141,6 @@ export const ProductDetail = observer(() => {
|
||||||
<Title strong level={3}>
|
<Title strong level={3}>
|
||||||
Product Price History
|
Product Price History
|
||||||
</Title>
|
</Title>
|
||||||
|
|
||||||
{/* <Button style={{marginBottom: '1rem'}} onClick={() => {
|
|
||||||
console.log('clicked filter')
|
|
||||||
}}>
|
|
||||||
<FilterOutlined/>
|
|
||||||
Filter
|
|
||||||
</Button> */}
|
|
||||||
<Table
|
<Table
|
||||||
columns={columns}
|
columns={columns}
|
||||||
dataSource={store.product.dataPriceHistory}
|
dataSource={store.product.dataPriceHistory}
|
||||||
|
|
|
@ -95,8 +95,6 @@ export const Profile = observer(() => {
|
||||||
));
|
));
|
||||||
console.log(awal);
|
console.log(awal);
|
||||||
console.log(akhir);
|
console.log(akhir);
|
||||||
// store.transaction.filterStart = data.start_date;
|
|
||||||
// store.transaction.filterEnd = data.end_date;
|
|
||||||
modalLoader.setLoading(true);
|
modalLoader.setLoading(true);
|
||||||
await store.transaction.getDataHistoryTransaction();
|
await store.transaction.getDataHistoryTransaction();
|
||||||
modalLoader.setLoading(false);
|
modalLoader.setLoading(false);
|
||||||
|
@ -270,83 +268,7 @@ export const Profile = observer(() => {
|
||||||
{store.authentication.profileData.superior?.username}
|
{store.authentication.profileData.superior?.username}
|
||||||
</Text>
|
</Text>
|
||||||
</Col>
|
</Col>
|
||||||
{/* {store.authentication.userData.role === "Retail" && (
|
|
||||||
<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.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>
|
|
||||||
<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>
|
|
||||||
)} */}
|
|
||||||
{store.authentication.userData.role === "Retail" && (
|
{store.authentication.userData.role === "Retail" && (
|
||||||
// <Row>
|
|
||||||
// <Col span={12}>
|
|
||||||
// <Text strong>Foto Identitas</Text>
|
|
||||||
// </Col>
|
|
||||||
// <Col span={12}></Col>
|
|
||||||
// <Col span={12}>
|
|
||||||
// <Text>
|
|
||||||
// <Image
|
|
||||||
// src={
|
|
||||||
// store.authentication.profileData.userDetail
|
|
||||||
// ?.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>
|
|
||||||
// <Col span={24}>
|
|
||||||
// <Text strong>Foto Toko</Text>
|
|
||||||
// <Text>
|
|
||||||
// <Row>
|
|
||||||
// {JSON.parse(
|
|
||||||
// store.authentication.profileData.userDetail
|
|
||||||
// ?.image_store
|
|
||||||
// ).map((item) => (
|
|
||||||
// <Image
|
|
||||||
// src={
|
|
||||||
// store.authentication.profileData.userDetail
|
|
||||||
// ?.image_store
|
|
||||||
// ? `${appConfig.apiUrl}/config/image/${item}`
|
|
||||||
// : "https://st4.depositphotos.com/14953852/24787/v/600/depositphotos_247872612-stock-illustration-no-image-available-icon-vector.jpg"
|
|
||||||
// }
|
|
||||||
// style={{ width: "10vw", marginRight: 15 }}
|
|
||||||
// />
|
|
||||||
// ))}
|
|
||||||
// </Row>
|
|
||||||
// </Text>
|
|
||||||
// </Col>
|
|
||||||
// </Row>
|
|
||||||
<Row>
|
<Row>
|
||||||
<Col span={12}>
|
<Col span={12}>
|
||||||
<Text strong>Foto Identitas</Text>
|
<Text strong>Foto Identitas</Text>
|
||||||
|
|
|
@ -57,10 +57,9 @@ export class Authentication {
|
||||||
async getProfit(id) {
|
async getProfit(id) {
|
||||||
try {
|
try {
|
||||||
const response = await http.get(`/auth/profile/${id}`);
|
const response = await http.get(`/auth/profile/${id}`);
|
||||||
console.log(response)
|
console.log(response,"Data Gambar Store")
|
||||||
this.dataProfit = response.body ?? [];
|
this.dataProfit = response.body ?? [];
|
||||||
this.listImage = this.dataProfit.userDetail?.image_store ? JSON.parse(this.dataProfit.userDetail?.image_store) : [];
|
this.listImage = this.dataProfit.userDetail?.image_store ? JSON.parse(this.dataProfit.userDetail?.image_store) : [];
|
||||||
|
|
||||||
this.total_data = response?.body?.count ?? 0;
|
this.total_data = response?.body?.count ?? 0;
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
|
@ -70,7 +69,7 @@ export class Authentication {
|
||||||
async getProfile() {
|
async getProfile() {
|
||||||
try {
|
try {
|
||||||
const response = await http.get('/auth/profile');
|
const response = await http.get('/auth/profile');
|
||||||
console.log(response)
|
console.log(response,"Data Profile")
|
||||||
this.profileData = response.body;
|
this.profileData = response.body;
|
||||||
this.imageProfil = this.profileData.userDetail?.image_store ? JSON.parse(this.profileData.userDetail?.image_store) : [];
|
this.imageProfil = this.profileData.userDetail?.image_store ? JSON.parse(this.profileData.userDetail?.image_store) : [];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user