Merge branch 'develop' of gitlab.com:empatnusabangsa/ppob/ppob-frontend into develop

This commit is contained in:
rarsyansyahr 2021-12-16 12:50:32 +07:00
commit a40ccf2518
3 changed files with 39 additions and 33 deletions

View File

@ -1,9 +1,10 @@
import React, {useEffect} from "react"; import React, {useEffect} from "react";
import {Card, Col, Row, Table, Typography} from "antd"; import {Button, Card, Col, Row, Table, Typography} from "antd";
import {BreadcumbComponent} from "../../component/BreadcumbComponent"; import {BreadcumbComponent} from "../../component/BreadcumbComponent";
import {LINKS} from "../../routes/app"; import {LINKS} from "../../routes/app";
import {useStore} from "../../utils/useStore"; import {useStore} from "../../utils/useStore";
import {observer} from "mobx-react-lite"; import {observer} from "mobx-react-lite";
import {FilterOutlined} from "@ant-design/icons";
const {Title, Text} = Typography; const {Title, Text} = Typography;
@ -53,36 +54,34 @@ export const Profile = observer(() => {
<div className={["ppob-container"].join(" ")}> <div className={["ppob-container"].join(" ")}>
<BreadcumbComponent data={routeData}/> <BreadcumbComponent data={routeData}/>
<Card> <Card>
<Row style={{marginBottom: 20}}>
<Col span={24}>
<div>
<Title strong>Profile</Title> <Title strong>Profile</Title>
{/*<Row>*/} <Row style={{marginBottom: 20}}>
{/* <Col span={10}>*/} <Col span={12}>
{/* <Text strong>Name</Text>*/} <Row>
{/* </Col>*/} <Col span={12}>
{/* <Col span={14}>*/} <Text strong>Name</Text>
{/* <Text>{store.authentication.profileData.username}</Text>*/} </Col>
{/* </Col>*/} <Col span={12}>
{/* <Col span={10}>*/} <Text>{store.authentication.profileData?.username}</Text>
{/* <Text strong>Role</Text>*/} </Col>
{/* </Col>*/} <Col span={12}>
{/* <Col span={14}>*/} <Text strong>Role</Text>
{/* <Text>{store.authentication.profileData.roles.name}</Text>*/} </Col>
{/* </Col>*/} <Col span={12}>
{/* <Col span={10}>*/} <Text>{store.authentication.profileData.roles?.name}</Text>
{/* <Text strong>Superior</Text>*/} </Col>
{/* </Col>*/} <Col span={12}>
{/* <Col span={14}>*/} <Text strong>Superior</Text>
{/* <Text>{store.authentication.profileData.superior.username}</Text>*/} </Col>
{/* </Col>*/} <Col span={12}>
{/* <Col span={10}>*/} <Text>{store.authentication.profileData.superior?.username}</Text>
{/* <Text strong>Wallet</Text>*/} </Col>
{/* </Col>*/} </Row>
{/* <Col span={14}>*/} </Col>
{/* <Text>{store.authentication.profileData.wallet}</Text>*/} <Col span={12}>
{/* </Col>*/} <div style={{display: 'flex', flexDirection: 'column', alignItems: 'center'}}>
{/*</Row>*/} <Title strong level={3}>Saldo</Title>
<Text style={{fontSize: '1.25rem'}}>{store.authentication.profileData?.wallet}</Text>
</div> </div>
</Col> </Col>
</Row> </Row>
@ -90,6 +89,13 @@ export const Profile = observer(() => {
<Col span={24}> <Col span={24}>
<div> <div>
<Title strong level={3}>History User Transaction</Title> <Title strong level={3}>History User Transaction</Title>
<Button style={{marginBottom: '1rem'}} onClick={() => {
console.log('clicked filter')
}}>
<FilterOutlined/>
Filter
</Button>
<Table <Table
columns={columns} columns={columns}
dataSource={store.transaction.dataHistoryTransaction} dataSource={store.transaction.dataHistoryTransaction}

View File

@ -53,7 +53,7 @@ export class Authentication {
async getProfile() { async getProfile() {
try { try {
const response = await http.get('/auth/profile'); const response = await http.get('/auth/profile');
this.profileData = response.body.data; this.profileData = response.body;
} catch (e) { } catch (e) {
console.error(e); console.error(e);
throw e; throw e;

View File

@ -20,7 +20,7 @@ export class Transaction {
total_dataSubCategories = 0; total_dataSubCategories = 0;
pageHistoryTransaction = 0; pageHistoryTransaction = 0;
pageSizeHistoryTransaction = 10 // pageSizeHistoryTransaction = 10
dataHistoryTransaction = []; dataHistoryTransaction = [];
total_dataHistoryTransaction = 0; total_dataHistoryTransaction = 0;
@ -53,7 +53,7 @@ export class Transaction {
} }
async getDataHistoryTransaction() { async getDataHistoryTransaction() {
const response = await http.get(`/transaction/history?page=${this.pageHistoryTransaction}&pageSize=${this.pageSizeHistoryTransaction}`); const response = await http.get(`/transaction/history?page=${this.pageHistoryTransaction}`);
this.dataHistoryTransaction = response.body.data ?? [] this.dataHistoryTransaction = response.body.data ?? []
this.total_dataHistoryTransaction = response.body.total_data ?? 0 this.total_dataHistoryTransaction = response.body.total_data ?? 0