Commit 46be3014 authored by Dida Adams Arizona's avatar Dida Adams Arizona

Merge branch 'rifka' into 'master'

loading create auah

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