Commit 4f77b039 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'didam' into 'master'

updatee

See merge request !275
parents 900901a4 2a13b78a
......@@ -15,7 +15,8 @@ import PopUpDeleteAM from "./PopUpDeleteAM";
import PopUpFailedSave from "../../library/PopUpFailedSave";
import api from "../../api";
import Constant from '../../library/Constant';
import { css } from "@emotion/core";
import PropagateLoader from "react-spinners/PropagateLoader"
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
const options = ct.customOptions();
......@@ -49,6 +50,7 @@ export default class ApprovalMatrix extends Component {
load: false,
judul: '',
popupDel: false,
loading: false
}
this.fileHandler = this.fileHandler.bind(this);
}
......@@ -350,6 +352,7 @@ export default class ApprovalMatrix extends Component {
}
getData() {
this.setState({loading: true})
api.create().getAM().then((response) => {
// console.log(response)
if (response.data) {
......@@ -359,9 +362,13 @@ export default class ApprovalMatrix extends Component {
let listData = data.sort((a, b) => a.approval_matrix_id - b.approval_matrix_id).map((item, index) => {
return [index, item.approval_matrix_id, item.approval_type_name, item.orders, item.fullname, item.operator_type_name, item.status]
})
this.setState({ dataTable: listData, listData: response.data.data })
this.setState({ dataTable: listData, listData: response.data.data }, () => {
setTimeout(() => {
this.setState({loading: false})
}, 2000);
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
......@@ -371,10 +378,10 @@ export default class ApprovalMatrix extends Component {
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
}
})
}
......@@ -723,7 +730,16 @@ export default class ApprovalMatrix extends Component {
}
}
}]
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>
);
return (
<div>
{this.state.visibleAM === true ?
......@@ -827,6 +843,7 @@ export default class ApprovalMatrix extends Component {
</div >
</div>
<div style={{ padding: 25, width: '100%' }}>
{this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
theme={getMuiTheme()}
......
......@@ -392,6 +392,7 @@ export default function MiniDrawer() {
}
const selectSub = (e) => {
setOpen(true)
setSelectSub(e)
setSelectedIndex("")
}
......@@ -399,6 +400,9 @@ export default function MiniDrawer() {
const selectIndex = (e) => {
setSelectSub("")
setSelectedIndex(e)
// if (open == false) {
// setOpen(true)
// }
}
let { path, url } = useRouteMatch();
......@@ -406,6 +410,7 @@ export default function MiniDrawer() {
const { height, width } = UseWindowDimensions();
function handleCollapse(item) {
setOpen(true);
let arr = application
let index = arr.findIndex((val) => val.label === item.label)
arr[index].collapse = !arr[index].collapse
......@@ -413,6 +418,7 @@ export default function MiniDrawer() {
}
function handleCollapseSetting(item) {
setOpen(true);
let arr = setting
let index = arr.findIndex((val) => val.label === item.label)
arr[index].collapse = !arr[index].collapse
......
......@@ -12,6 +12,8 @@ import UploadFile from "../../../library/Upload";
import { ExcelRenderer } from 'react-excel-renderer';
import Constant from '../../../library/Constant';
import PopUpDelete from '../../../library/PopUpDelete';
import { css } from "@emotion/core";
import PropagateLoader from "react-spinners/PropagateLoader"
var ct = require("../../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
......@@ -38,7 +40,8 @@ export default class Parameter extends Component {
edit: false,
delete: false,
load: false,
judul: ''
judul: '',
loading: false
}
this.fileHandler = this.fileHandler.bind(this);
}
......@@ -70,6 +73,7 @@ export default class Parameter extends Component {
}
getAllParameter() {
this.setState({loading: true})
api.create().getAllParameter().then(response => {
if (response.data) {
if (response.ok) {
......@@ -91,9 +95,13 @@ export default class Parameter extends Component {
item.status
]
})
this.setState({ dataTable: listData, data: response.data.data })
this.setState({ dataTable: listData, data: response.data.data }, () => {
setTimeout(() => {
this.setState({loading: false})
}, 2000);
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
......@@ -103,10 +111,10 @@ export default class Parameter extends Component {
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
}
})
}
......@@ -845,6 +853,16 @@ export default class Parameter extends Component {
["", "LAPORAN_BULANAN", "BALANCE_SHEET", "Daya Group", "Range Periode Lap", "4", "-", "1", "20", "Non Aktif"],
["", "-", "-", "-", "-", "-"]
]
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>
);
return (
<div style={{ height: this.props.height }}>
{/* <Row> */}
......@@ -937,6 +955,7 @@ export default class Parameter extends Component {
)}
<div style={{ padding: 25 }}>
{this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
theme={getMuiTheme()}
......
......@@ -18,6 +18,8 @@ import { TextField, InputBase, Snackbar, withStyles } from "@material-ui/core";
import PopUpFailedSave from '../../../library/PopUpFailedSave';
import PopUpDelete from "../../../library/PopUpDelete";
import Constant from '../../../library/Constant';
import { css } from "@emotion/core";
import PropagateLoader from "react-spinners/PropagateLoader"
var ct = require("../../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
......@@ -53,7 +55,8 @@ export default class Perusahaan extends Component {
load: false,
judul: '',
rowData: [],
companyName: ''
companyName: '',
loading: false
}
this.fileHandler = this.fileHandler.bind(this);
......@@ -295,6 +298,7 @@ export default class Perusahaan extends Component {
}
getData() {
this.setState({loading: true})
api.create().getPerusahaan().then((response) => {
// console.log(response)
if (response.data) {
......@@ -304,9 +308,13 @@ export default class Perusahaan extends Component {
let listData = data.sort((a, b) => a.company_id - b.company_id).map((item, index) => {
return [index, item.company_id, item.company_name, item.parent_name, item.business_unit_name, item.status]
})
this.setState({ dataTable: listData, listData: response.data.data })
this.setState({ dataTable: listData, listData: response.data.data }, () => {
setTimeout(() => {
this.setState({loading: false})
}, 2000);
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
......@@ -316,10 +324,10 @@ export default class Perusahaan extends Component {
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
}
})
}
......@@ -642,6 +650,16 @@ export default class Perusahaan extends Component {
["", "4", "Puninar Infinite Raya", "Puninar Group", "Service", "5", "Non Aktif"],
["", "-", "-", "-", "-", "-"],
]
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>
);
return (
<div style={{ height: this.props.height }}>
{/* <Row> */}
......@@ -745,6 +763,7 @@ export default class Perusahaan extends Component {
</div>
</div>
<div style={{ padding: 25 }}>
{this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
theme={getMuiTheme()}
......
......@@ -14,6 +14,8 @@ import ReactTooltip from "react-tooltip";
import PopUpFailedSave from "../../library/PopUpFailedSave";
import Constant from "../../library/Constant";
import PopUpDelete from "../../library/PopUpDelete";
import { css } from "@emotion/core";
import PropagateLoader from "react-spinners/PropagateLoader"
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
......@@ -49,7 +51,8 @@ export default class ReportItems extends Component {
judul: '',
reportNameDelete: '',
visibleDelete: false,
invalidTemplate: false
invalidTemplate: false,
loading: false
}
this.fileHandler = this.fileHandler.bind(this);
......@@ -597,6 +600,7 @@ export default class ReportItems extends Component {
}
getData() {
this.setState({loading: true})
api.create().getReportItems().then((response) => {
console.log(response)
if (response.data) {
......@@ -607,10 +611,12 @@ export default class ReportItems extends Component {
return [index, item.item_report_id, item.report_name, item.company_name, item.order, item.description, item.parent, item.uom, item.weight, item.type_item_report_name, item.kpi_type, item.max_ach, item.formula_ytd, item.status]
})
this.setState({ dataTable: listData, listData: response.data.data }, () => {
console.log(this.state.dataTable);
setTimeout(() => {
this.setState({loading: false})
}, 2000);
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
......@@ -620,10 +626,10 @@ export default class ReportItems extends Component {
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
}
})
}
......@@ -1038,7 +1044,16 @@ export default class ReportItems extends Component {
["", "4", "KPI", "TIA", "4", "EBITDA", "1", "Rp Bio", "0%", "Formula", "Non Aktif"],
["", "-", "-", "-", "-", "-", "-", "-", "-", "-", "-"],
]
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>
);
return (
<div style={{ height: this.props.height }}>
{/* <Row> */}
......@@ -1141,6 +1156,7 @@ export default class ReportItems extends Component {
</div>
</div>
<div style={{ padding: 25 }}>
{this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
theme={getMuiTheme()}
......
......@@ -15,6 +15,8 @@ import { isThisSecond } from "date-fns";
import PopUpFailedSave from "../../library/PopUpFailedSave";
import PopUpDelete from "../../library/PopUpDelete";
import Constant from "../../library/Constant";
import { css } from "@emotion/core";
import PropagateLoader from "react-spinners/PropagateLoader"
var ct = require("../../library/CustomTable");
const getMuiTheme = () => createMuiTheme(ct.customTable());
......@@ -49,8 +51,9 @@ export default class UnitBisnis extends Component {
load: false,
judul: '',
rowData: [],
unitBisnisName: ''
// visibleLoad: true
unitBisnisName: '',
// visibleLoad: true,
loading: false
}
this.fileHandler = this.fileHandler.bind(this);
}
......@@ -244,6 +247,7 @@ export default class UnitBisnis extends Component {
}
getData() {
this.setState({loading: true})
api.create().getUnitBisnis().then((response) => {
// console.log(response)
if (response.data) {
......@@ -253,9 +257,13 @@ export default class UnitBisnis extends Component {
let listData = data.sort((a, b) => a.business_unit_id - b.business_unit_id).map((item, index) => {
return [index, item.business_unit_id, item.business_unit_name, item.status]
})
this.setState({ dataTable: listData, listData: response.data.data })
this.setState({ dataTable: listData, listData: response.data.data }, () => {
setTimeout(() => {
this.setState({loading: false})
}, 2000);
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
......@@ -265,10 +273,10 @@ export default class UnitBisnis extends Component {
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false })
}
})
}
......@@ -562,6 +570,16 @@ export default class UnitBisnis extends Component {
["", "4", "Service", "Non Aktif"],
["", "-", "-", "-"],
]
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>
);
return (
<div style={{ height: this.props.height }}>
{/* <Row> */}
......@@ -651,6 +669,7 @@ export default class UnitBisnis extends Component {
</div>
</div>
<div style={{ padding: 25 }}>
{this.state.loading && loadingComponent}
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
theme={getMuiTheme()}
......
......@@ -16,9 +16,6 @@ import ReactTooltip from "react-tooltip";
import PopUpFailedSave from "../../library/PopUpFailedSave";
import Constant from "../../library/Constant";
import { css } from "@emotion/core";
import HashLoader from "react-spinners/HashLoader";
import ClimbingBoxLoader from "react-spinners/ClimbingBoxLoader"
import SkewLoader from "react-spinners/SkewLoader"
import PropagateLoader from "react-spinners/PropagateLoader"
const override = css`
......@@ -95,7 +92,7 @@ export default class UserRole extends Component {
}, 2000);
})
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
......
......@@ -14,7 +14,7 @@ export default function NoMatch() {
<img src={Images.tia}/>
</div>
<h3 style={{marginTop: 20}}>
'<code>{location.pathname}</code>' Not Found
'<code>{location.pathname}</code>' Coming Soon !
</h3>
</div>
</div>
......
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