Commit 51a93f4c authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

ngakalin loading malah diakalin balik auah

parent 8db482f5
......@@ -327,7 +327,7 @@ export default class CreateManagementDoc extends Component {
);
return (
<div>
<div className="test app-popup-show">
<div className="test app-popup-show" style={{ zIndex: 120 }}>
<div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
<div className="popup-panel grid grid-2x main-color" style={{ height: 64, borderTopRightRadius: 8, borderTopLeftRadius: 8 }}>
<div className="col-1" style={{ maxWidth: "inherit", display: 'flex', alignItems: 'center' }}>
......@@ -528,11 +528,11 @@ export default class CreateManagementDoc extends Component {
<button
type="button"
onClick={() =>
// {this.props.handleLoading(1)
{this.props.handleLoading(1)
setTimeout(() => {
this.validasi()
}, 100)
// }
}
}
>
<div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
......
......@@ -93,19 +93,17 @@ export default class DocumentManagement extends Component {
}
createDocument(payload, settingID, menuName) {
this.setState({ visibleCreate: false, loading: true })
// this.setState({ visibleCreate: false, loading: true })
api.create().uploadDocument(payload).then(response => {
console.log(response)
if (response.data) {
if (response.ok) {
if (response.data.message === "The Document Already Exists in The System, Do You Want to Overwrite It?") {
this.setState({ formData: payload, docId: response.data.data.document_id, settingID, menuName, loading: false }, () => {
this.setState({ konfirmasi: true })
})
this.setState({ konfirmasi: true, formData: payload, docId: response.data.data.document_id, settingID, menuName, loading: false })
}
else if (response.data.message === "Data was Saved Successfully") {
this.getDataDocument(settingID, menuName)
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success', settingID, menuName, visibleCreate: false, loading: false})
this.setState({ visibleCreate: false, loading: false, alert: true, messageAlert: response.data.message, tipeAlert: 'success', settingID, menuName})
}
else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
......@@ -127,7 +125,7 @@ export default class DocumentManagement extends Component {
}
createUploadDocument() {
this.setState({ visibleCreate: false, loading: true })
this.setState({ visibleCreate: false, konfirmasi: false })
const formData = this.state.formData
formData.append("documentId", this.state.docId)
formData.append("updated", 1)
......@@ -138,7 +136,7 @@ export default class DocumentManagement extends Component {
if (response.ok) {
if (response.data.status === "success") {
this.getDataDocument(this.state.settingID, this.state.menuName)
this.setState({ konfirmasi: false, alert: true, messageAlert: response.data.message, tipeAlert: 'success', visibleCreate: false })
this.setState({ konfirmasi: false, alert: true, messageAlert: response.data.message, tipeAlert: 'success', visibleCreate: false, loading: false })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
if (response.data.message.includes("Someone Logged In")) {
......
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