Commit 8c2faff3 authored by a.bairuha's avatar a.bairuha

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into syadziy

parents 59627225 2255ee6e
...@@ -45,6 +45,7 @@ export default class ApprovalMatrix extends Component { ...@@ -45,6 +45,7 @@ export default class ApprovalMatrix extends Component {
messageAlert: '', messageAlert: '',
btncreate: false, btncreate: false,
btnedit: false, btnedit: false,
btndelete: false,
load: false, load: false,
judul: '', judul: '',
popupDel: false, popupDel: false,
...@@ -334,6 +335,7 @@ export default class ApprovalMatrix extends Component { ...@@ -334,6 +335,7 @@ export default class ApprovalMatrix extends Component {
this.setState({ this.setState({
btncreate: response.data.data.create, btncreate: response.data.data.create,
btnedit: response.data.data.edit, btnedit: response.data.data.edit,
btndelete: response.data.data.delete,
load: true load: true
}) })
} else { } else {
...@@ -610,8 +612,8 @@ export default class ApprovalMatrix extends Component { ...@@ -610,8 +612,8 @@ export default class ApprovalMatrix extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
console.log(tableMeta) console.log(tableMeta)
return ( return (
this.state.btnedit && (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{this.state.btnedit && <span>
<a data-tip={'Edit'} data-for="edit"> <a data-tip={'Edit'} data-for="edit">
<button <button
style={{ style={{
...@@ -627,6 +629,8 @@ export default class ApprovalMatrix extends Component { ...@@ -627,6 +629,8 @@ export default class ApprovalMatrix extends Component {
</button> </button>
</a> </a>
<ReactTooltip border={true} id="edit" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="edit" place="bottom" type="light" effect="solid" />
</span>}
{this.state.btndelete && <span>
<a data-tip={'Delete'} data-for="delete"> <a data-tip={'Delete'} data-for="delete">
<button <button
style={{ style={{
...@@ -641,8 +645,8 @@ export default class ApprovalMatrix extends Component { ...@@ -641,8 +645,8 @@ export default class ApprovalMatrix extends Component {
</button> </button>
</a> </a>
<ReactTooltip border={true} id="delete" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="delete" place="bottom" type="light" effect="solid" />
</span>}
</div > </div >
)
); );
} }
} }
......
...@@ -36,6 +36,7 @@ export default class Parameter extends Component { ...@@ -36,6 +36,7 @@ export default class Parameter extends Component {
messageAlert: '', messageAlert: '',
create: false, create: false,
edit: false, edit: false,
delete: false,
load: false, load: false,
judul: '' judul: ''
} }
...@@ -58,6 +59,7 @@ export default class Parameter extends Component { ...@@ -58,6 +59,7 @@ export default class Parameter extends Component {
this.setState({ this.setState({
create: response.data.data.create, create: response.data.data.create,
edit: response.data.data.edit, edit: response.data.data.edit,
delete: response.data.data.delete,
load: true load: true
}) })
} else { } else {
...@@ -682,8 +684,9 @@ export default class Parameter extends Component { ...@@ -682,8 +684,9 @@ export default class Parameter extends Component {
filter: false, filter: false,
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
this.state.edit && (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{this.state.edit &&
<span>
<a data-tip={'Edit'} data-for="edit"> <a data-tip={'Edit'} data-for="edit">
<button <button
style={{ style={{
...@@ -699,6 +702,10 @@ export default class Parameter extends Component { ...@@ -699,6 +702,10 @@ export default class Parameter extends Component {
</button> </button>
</a> </a>
<ReactTooltip border={true} id="edit" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="edit" place="bottom" type="light" effect="solid" />
</span>
}
{this.state.delete &&
<span>
<a data-tip={'Delete'} data-for="delete"> <a data-tip={'Delete'} data-for="delete">
<button <button
style={{ style={{
...@@ -713,8 +720,10 @@ export default class Parameter extends Component { ...@@ -713,8 +720,10 @@ export default class Parameter extends Component {
</button> </button>
</a> </a>
<ReactTooltip border={true} id="delete" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="delete" place="bottom" type="light" effect="solid" />
</span>
}
</div > </div >
)
); );
} }
} }
......
...@@ -49,6 +49,7 @@ export default class Perusahaan extends Component { ...@@ -49,6 +49,7 @@ export default class Perusahaan extends Component {
messageAlert: '', messageAlert: '',
create: false, create: false,
edit: false, edit: false,
delete: false,
load: false, load: false,
judul: '', judul: '',
rowData: [], rowData: [],
...@@ -281,6 +282,7 @@ export default class Perusahaan extends Component { ...@@ -281,6 +282,7 @@ export default class Perusahaan extends Component {
this.setState({ this.setState({
create: response.data.data.create, create: response.data.data.create,
edit: response.data.data.edit, edit: response.data.data.edit,
delete: response.data.data.delete,
load: true load: true
}) })
} else { } else {
...@@ -525,8 +527,9 @@ export default class Perusahaan extends Component { ...@@ -525,8 +527,9 @@ export default class Perusahaan extends Component {
sort: false, sort: false,
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
this.state.edit && (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{this.state.edit &&
<span>
<a data-tip={'Edit'} data-for="edit"> <a data-tip={'Edit'} data-for="edit">
<button <button
style={{ style={{
...@@ -546,6 +549,10 @@ export default class Perusahaan extends Component { ...@@ -546,6 +549,10 @@ export default class Perusahaan extends Component {
</button> </button>
</a> </a>
<ReactTooltip border={true} id="edit" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="edit" place="bottom" type="light" effect="solid" />
</span>
}
{this.state.delete &&
<span>
<a data-tip={'Delete'} data-for="delete"> <a data-tip={'Delete'} data-for="delete">
<button <button
style={{ style={{
...@@ -566,8 +573,9 @@ export default class Perusahaan extends Component { ...@@ -566,8 +573,9 @@ export default class Perusahaan extends Component {
</button> </button>
</a> </a>
<ReactTooltip border={true} id="delete" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="delete" place="bottom" type="light" effect="solid" />
</span>
}
</div> </div>
)
); );
} }
} }
......
...@@ -44,6 +44,7 @@ export default class ReportItems extends Component { ...@@ -44,6 +44,7 @@ export default class ReportItems extends Component {
messageAlert: '', messageAlert: '',
buttonCreate: false, buttonCreate: false,
buttonEdit: false, buttonEdit: false,
buttonDelete: false,
load: false, load: false,
judul: '', judul: '',
reportNameDelete: '', reportNameDelete: '',
...@@ -585,6 +586,7 @@ export default class ReportItems extends Component { ...@@ -585,6 +586,7 @@ export default class ReportItems extends Component {
this.setState({ this.setState({
buttonCreate: response.data.data.create, buttonCreate: response.data.data.create,
buttonEdit: response.data.data.edit, buttonEdit: response.data.data.edit,
buttonDelete: response.data.data.delete,
load: true load: true
}) })
} else { } else {
...@@ -829,8 +831,9 @@ export default class ReportItems extends Component { ...@@ -829,8 +831,9 @@ export default class ReportItems extends Component {
sort: false, sort: false,
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
this.state.buttonEdit && (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{this.state.buttonEdit &&
<span>
<a data-tip={'Edit'} data-for="edit"> <a data-tip={'Edit'} data-for="edit">
<button <button
style={{ style={{
...@@ -845,6 +848,10 @@ export default class ReportItems extends Component { ...@@ -845,6 +848,10 @@ export default class ReportItems extends Component {
</button> </button>
</a> </a>
<ReactTooltip border={true} id="edit" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="edit" place="bottom" type="light" effect="solid" />
</span>
}
{this.state.buttonDelete &&
<span>
<a data-tip={'Delete'} data-for="delete"> <a data-tip={'Delete'} data-for="delete">
<button <button
style={{ style={{
...@@ -860,8 +867,9 @@ export default class ReportItems extends Component { ...@@ -860,8 +867,9 @@ export default class ReportItems extends Component {
</button> </button>
</a> </a>
<ReactTooltip border={true} id="delete" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="delete" place="bottom" type="light" effect="solid" />
</span>
}
</div > </div >
)
); );
} }
} }
......
...@@ -45,6 +45,7 @@ export default class UnitBisnis extends Component { ...@@ -45,6 +45,7 @@ export default class UnitBisnis extends Component {
messageAlert: '', messageAlert: '',
create: false, create: false,
edit: false, edit: false,
delete: false,
load: false, load: false,
judul: '', judul: '',
rowData: [], rowData: [],
...@@ -228,6 +229,7 @@ export default class UnitBisnis extends Component { ...@@ -228,6 +229,7 @@ export default class UnitBisnis extends Component {
this.setState({ this.setState({
create: response.data.data.create, create: response.data.data.create,
edit: response.data.data.edit, edit: response.data.data.edit,
delete: response.data.data.delete,
load: true load: true
}) })
} else { } else {
...@@ -477,8 +479,9 @@ export default class UnitBisnis extends Component { ...@@ -477,8 +479,9 @@ export default class UnitBisnis extends Component {
sort: false, sort: false,
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
this.state.edit && (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{this.state.edit &&
<span>
<a data-tip={'Edit'} data-for="edit"> <a data-tip={'Edit'} data-for="edit">
<button <button
style={{ style={{
...@@ -494,6 +497,10 @@ export default class UnitBisnis extends Component { ...@@ -494,6 +497,10 @@ export default class UnitBisnis extends Component {
</button> </button>
</a> </a>
<ReactTooltip border={true} id="edit" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="edit" place="bottom" type="light" effect="solid" />
</span>
}
{this.state.delete &&
<span>
<a data-tip={'Delete'} data-for="delete"> <a data-tip={'Delete'} data-for="delete">
<button <button
style={{ style={{
...@@ -508,8 +515,9 @@ export default class UnitBisnis extends Component { ...@@ -508,8 +515,9 @@ export default class UnitBisnis extends Component {
</button> </button>
</a> </a>
<ReactTooltip border={true} id="delete" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="delete" place="bottom" type="light" effect="solid" />
</span>
}
</div > </div >
)
); );
} }
} }
......
...@@ -184,6 +184,26 @@ export default class UserRole extends Component { ...@@ -184,6 +184,26 @@ export default class UserRole extends Component {
let data = this.state.rowData let data = this.state.rowData
api.create().deleteUser(data[1]).then((response) => { api.create().deleteUser(data[1]).then((response) => {
this.setState({popupDel: false}) this.setState({popupDel: false})
if (response.data) {
if (response.ok) {
if (response.data.status == 'success') {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'success' })
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }, () => {
if (response.data.message.includes("Someone Logged In")) {
setTimeout(() => {
localStorage.removeItem(Constant.TOKEN)
window.location.reload();
}, 1000);
}
})
}
} else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'error' })
}
} else {
this.setState({ alert: true, messageAlert: response.problem, tipeAlert: 'error' })
}
this.getUser() this.getUser()
}) })
} }
...@@ -516,6 +536,8 @@ export default class UserRole extends Component { ...@@ -516,6 +536,8 @@ export default class UserRole extends Component {
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{/* {tableMeta.rowData[6] === "Active" ? */} {/* {tableMeta.rowData[6] === "Active" ? */}
{this.state.buttonEdit && ( {this.state.buttonEdit && (
<span>
<a data-tip={'Edit'} data-for="edit">
<button <button
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
...@@ -527,8 +549,13 @@ export default class UserRole extends Component { ...@@ -527,8 +549,13 @@ export default class UserRole extends Component {
> >
<img src={Images.editCopy} /> <img src={Images.editCopy} />
</button> </button>
</a>
<ReactTooltip border={true} id="edit" place="bottom" type="light" effect="solid" />
</span>
)} )}
{this.state.buttonDelete && ( {this.state.buttonDelete && (
<span>
<a data-tip={'Delete'} data-for="delete">
<button <button
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
...@@ -540,6 +567,9 @@ export default class UserRole extends Component { ...@@ -540,6 +567,9 @@ export default class UserRole extends Component {
> >
<img src={Images.delete} /> <img src={Images.delete} />
</button> </button>
</a>
<ReactTooltip border={true} id="delete" place="bottom" type="light" effect="solid" />
</span>
)} )}
{/* : {/* :
null null
...@@ -809,35 +839,69 @@ export default class UserRole extends Component { ...@@ -809,35 +839,69 @@ export default class UserRole extends Component {
)} )}
{this.state.popupDel && ( {this.state.popupDel && (
<div className="test app-popup-show"> <div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8, padding: 50 }}> <div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
<div style={{ display: 'flex', justifyContent: 'center' }}> <div style={{ display: 'flex', justifyContent: 'center', paddingTop: 20 }}>
<img src={Images.failed} /> <img src={Images.failed} />
</div> </div>
<div style={{ display: 'grid', justifyContent: 'center', marginTop: 20 }}> <div style={{ display: 'grid', justifyContent: 'center', marginTop: 20, paddingBottom: 20 }}>
<span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}> <span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold', fontFamily: 'Nunito Sans, sans-serif' }}>
Delete {titleCase(this.state.rowData[2])} ? Delete {titleCase(this.state.rowData[2])} ?
</span> </span>
{/* <span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
{`Please try again later.`}
</span> */}
</div> </div>
<div style={{ display: 'flex', justifyContent: 'center', marginTop: 24 }}> <div className="border-top grid grid-2x" style={{ height: 56, backgroundColor: '#f5f5f5', paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1" style={{ alignSelf: 'center' }}>
<button <button
className={"btn-save"} type="button"
onClick={()=> this.setState({popupDel: false})} onClick={()=> this.setState({popupDel: false})}
> >
<span style={{ color: 'white' }}>Cancel</span> <div style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#354960', fontSize: 11 }}>Cancel</span>
</div>
</button> </button>
</div>
<div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}>
<button <button
className={"btn-save"} type="button"
style={{ marginLeft: 50}}
onClick={()=> this.deleteUser()} onClick={()=> this.deleteUser()}
> >
<span style={{ color: 'white' }}>Delete</span> <div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Delete</span>
</div>
</button> </button>
</div> </div>
</div> </div>
</div> </div>
</div>
// <div className="test app-popup-show">
// <div className="popup-content background-white border-radius" style={{ borderRadius: 8, padding: 50 }}>
// <div style={{ display: 'flex', justifyContent: 'center' }}>
// <img src={Images.failed} />
// </div>
// <div style={{ display: 'grid', justifyContent: 'center', marginTop: 20 }}>
// <span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
// Delete {titleCase(this.state.rowData[2])} ?
// </span>
// {/* <span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
// {`Please try again later.`}
// </span> */}
// </div>
// <div style={{ display: 'flex', justifyContent: 'center', marginTop: 24 }}>
// <button
// className={"btn-save"}
// onClick={()=> this.setState({popupDel: false})}
// >
// <span style={{ color: 'white' }}>Cancel</span>
// </button>
// <button
// className={"btn-save"}
// style={{ marginLeft: 50}}
// onClick={()=> this.deleteUser()}
// >
// <span style={{ color: 'white' }}>Delete</span>
// </button>
// </div>
// </div>
// </div>
)} )}
{this.state.popupError && ( {this.state.popupError && (
<PopUpFailedSave onClickClose={() => this.setState({ popupError: false })} /> <PopUpFailedSave onClickClose={() => this.setState({ popupError: false })} />
......
...@@ -363,35 +363,69 @@ class UserRole extends Component { ...@@ -363,35 +363,69 @@ class UserRole extends Component {
)} )}
{this.state.popupDel && ( {this.state.popupDel && (
<div className="test app-popup-show"> <div className="test app-popup-show">
<div className="popup-content background-white border-radius" style={{ borderRadius: 8, padding: 50 }}> <div className="popup-content background-white border-radius" style={{ borderRadius: 8 }}>
<div style={{ display: 'flex', justifyContent: 'center' }}> <div style={{ display: 'flex', justifyContent: 'center', paddingTop: 20 }}>
<img src={Images.failed} /> <img src={Images.failed} />
</div> </div>
<div style={{ display: 'grid', justifyContent: 'center', marginTop: 20 }}> <div style={{ display: 'grid', justifyContent: 'center', marginTop: 20, paddingBottom: 20 }}>
<span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}> <span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold', fontFamily: 'Nunito Sans, sans-serif' }}>
Delete {titleCase(this.state.rowData[2])} ? Delete {titleCase(this.state.rowData[2])} ?
</span> </span>
{/* <span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
{`Please try again later.`}
</span> */}
</div> </div>
<div style={{ display: 'flex', justifyContent: 'center', marginTop: 24 }}> <div className="border-top grid grid-2x" style={{ height: 56, backgroundColor: '#f5f5f5', paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1" style={{ alignSelf: 'center' }}>
<button <button
className={"btn-save"} type="button"
onClick={()=> this.setState({popupDel: false})} onClick={()=> this.setState({popupDel: false})}
> >
<span style={{ color: 'white' }}>Cancel</span> <div style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#354960', fontSize: 11 }}>Cancel</span>
</div>
</button> </button>
</div>
<div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}>
<button <button
className={"btn-save"} type="button"
style={{ marginLeft: 50}}
onClick={()=> this.deleteRole()} onClick={()=> this.deleteRole()}
> >
<span style={{ color: 'white' }}>Delete</span> <div style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Delete</span>
</div>
</button> </button>
</div> </div>
</div> </div>
</div> </div>
</div>
// <div className="test app-popup-show">
// <div className="popup-content background-white border-radius" style={{ borderRadius: 8, padding: 50 }}>
// <div style={{ display: 'flex', justifyContent: 'center' }}>
// <img src={Images.failed} />
// </div>
// <div style={{ display: 'grid', justifyContent: 'center', marginTop: 20 }}>
// <span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
// Delete {titleCase(this.state.rowData[2])} ?
// </span>
// {/* <span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
// {`Please try again later.`}
// </span> */}
// </div>
// <div style={{ display: 'flex', justifyContent: 'center', marginTop: 24 }}>
// <button
// className={"btn-save"}
// onClick={()=> this.setState({popupDel: false})}
// >
// <span style={{ color: 'white' }}>Cancel</span>
// </button>
// <button
// className={"btn-save"}
// style={{ marginLeft: 50}}
// onClick={()=> this.deleteRole()}
// >
// <span style={{ color: 'white' }}>Delete</span>
// </button>
// </div>
// </div>
// </div>
)} )}
</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