Commit 5a61e7cc authored by Riri Novita's avatar Riri Novita

Merge branch 'ENV-DEV' into 'ENV-DEPLOYMENT'

alert error

See merge request !2261
parents a0d7c716 2d0edb47
......@@ -22,9 +22,12 @@ import { fixNumber, roundMath } from "../../library/Utils";
import LOCF from './LOCFMR';
import LOV from './LOVMR';
function Alert(props) {
return <MuiAlert elevation={6} variant="filled" {...props} />;
}
const Alert = withStyles({
})((props) => <MuiAlert elevation={6} variant="filled" {...props} />);
// function Alert(props) {
// return <MuiAlert elevation={6} variant="filled" {...props} />;
// }
const useStyles = makeStyles((theme) => ({
root: {
......@@ -136,6 +139,9 @@ export default class ListOfCreditFacilities extends Component {
saveTambahan: true,
defaultCurrencyUpload: this.props.defaultCurrency,
visibleAlertSave: false,
alert: false,
tipeAlert: '',
messageAlert: '',
}
}
......@@ -456,17 +462,13 @@ export default class ListOfCreditFacilities extends Component {
let error = false
// this.deleteReport()
if (this.state.dataTablelov !== undefined && this.state.tambahLOV == undefined) {
console.log('1');
dataTable2 = this.state.dataTablelov
} else {
console.log('2');
dataTable2 = this.state.dataTableLOV
this.setState({ updateTambah: true, updateData: false })
if (this.state.tambahLOV = 'tambah' && this.state.updateData == false) {
console.log('3');
dataTable2 = this.state.dataTablelov
} else {
console.log('4')
dataTable2 = this.state.dataTableLOV
}
......@@ -552,7 +554,7 @@ export default class ListOfCreditFacilities extends Component {
if (response.data?.message == "Please Set Up Rate Currency First") {
this.setState({ visibleAlertSave: true })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loadingChild: false }, () => {
if (response.data.message.includes("Someone Logged In") || response.data.message.includes("Token Expired")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
......@@ -564,10 +566,11 @@ export default class ListOfCreditFacilities extends Component {
// alert(response.data.status)
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loading: false, handleDoubleClick: 0 })
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error', loadingChild: false, handleDoubleClick: 0 })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loading: false, handleDoubleClick: 0 })
console.log(response.problem);
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error', loadingChild: false, handleDoubleClick: 0 })
}
this.setState({ handleDoubleClick: 0 })
})
......@@ -1403,6 +1406,10 @@ export default class ListOfCreditFacilities extends Component {
}
}
closeAlert() {
this.setState({ alert: false })
}
render() {
let dataTable2 = this.state.dataTable
let loading = this.state.loading
......@@ -1437,9 +1444,9 @@ export default class ListOfCreditFacilities extends Component {
<div style={{ flex: 1, padding: 20, width: '100%' }}>
{this.state.visibleParent ?
< Paper style={{ paddingTop: 10, paddingBottom: 20 }}>
<Snackbar open={this.state.snekbar} autoHideDuration={3000} onClose={handleClose}>
<Alert onClose={handleClose} severity="error">
{this.state.snekbarMsg}
<Snackbar open={this.state.alert} autoHideDuration={6000} onClose={() => this.closeAlert()}>
<Alert onClose={() => this.closeAlert()} severity={this.state.tipeAlert}>
{this.state.messageAlert}
</Alert>
</Snackbar>
<div style={{ borderBottom: 'solid 1px #c4c4c4' }} >
......
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