Commit e6b46f31 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'master' into 'didam'

# Conflicts:
#   src/container/HomePage.js
parents 57901879 fda03a4d
...@@ -372,7 +372,7 @@ export default class BudgetTahunan extends Component { ...@@ -372,7 +372,7 @@ export default class BudgetTahunan extends Component {
} }
api.create().getSubmission(payload).then(response => { api.create().getSubmission(payload).then(response => {
console.log(response) console.log(response)
if (response) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
submissionID: response.data.data.submission_id, submissionID: response.data.data.submission_id,
......
...@@ -27,11 +27,13 @@ class HomePage extends Component { ...@@ -27,11 +27,13 @@ class HomePage extends Component {
listSubcoMB: [], listSubcoMB: [],
valueSubmit: 0, valueSubmit: 0,
listdmb: [], listdmb: [],
dataTableMB: [] dataTableMB: [],
loading: false
} }
} }
componentDidMount() { componentDidMount() {
this.setState({ loading: true })
let userId = localStorage.getItem(Constant.USER) let userId = localStorage.getItem(Constant.USER)
api.create().getDetailUser(userId).then((response) => { api.create().getDetailUser(userId).then((response) => {
if (response.data) { if (response.data) {
...@@ -77,7 +79,8 @@ class HomePage extends Component { ...@@ -77,7 +79,8 @@ class HomePage extends Component {
}) })
this.setState({ this.setState({
listSubcoMB: response.data.data, listSubcoMB: response.data.data,
valueSubmit valueSubmit,
loading: false
}) })
} }
} }
...@@ -112,16 +115,18 @@ class HomePage extends Component { ...@@ -112,16 +115,18 @@ class HomePage extends Component {
let indexId = actAM.findIndex((val) => val.user_id == userId) let indexId = actAM.findIndex((val) => val.user_id == userId)
if (indexId === -1) { if (indexId === -1) {
this.setState({ isApprover: false }) this.setState({ isApprover: false })
this.getListUserSubco()
} }
this.getDashboardMB()
console.log(actAM) console.log(actAM)
this.setState({loading: false}) this.setState({loading: false})
}) })
} }
getDashboardMB() { getDashboardMB() {
api.create().getDashboardMB().then((response) =>{ api.create().getDashboardMB().then((response) => {
console.log(response) console.log(response)
if(String(response.data.status).toLocaleLowerCase() == 'success'){ if (String(response.data.status).toLocaleLowerCase() == 'success') {
let data = response.data.data let data = response.data.data
let listdmb = data.sort((a, b) => a.company_id - b.company_id).map((item, index) => { let listdmb = data.sort((a, b) => a.company_id - b.company_id).map((item, index) => {
return [ return [
...@@ -130,12 +135,23 @@ class HomePage extends Component { ...@@ -130,12 +135,23 @@ class HomePage extends Component {
item.operating_indicator item.operating_indicator
] ]
}) })
this.setState({ dataTableMB: listdmb }) this.setState({ dataTableMB: listdmb, loading: false })
} }
}) })
} }
render() { render() {
const loadingComponent = (
<div style={{ position: 'absolute', zIndex: 110, top: 0, left: 0, width: '100%', height: '100%', display: 'flex', justifyContent: 'center', alignItems: 'center', background: 'rgba(255,255,255,0.8)' }}>
<PropagateLoader
// css={override}
size={20}
color={"#274B80"}
loading={this.state.loading}
/>
</div>
);
const columns = ["#", "ID", "Company", "Report Type", "Revision", "Status", { const columns = ["#", "ID", "Company", "Report Type", "Revision", "Status", {
name: "Action", name: "Action",
options: { options: {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment