Commit 97e361fe authored by Deni Rinaldi's avatar Deni Rinaldi

malam2

parent 1c3cf56c
...@@ -588,7 +588,7 @@ export default function MiniDrawer() { ...@@ -588,7 +588,7 @@ export default function MiniDrawer() {
))} ))}
</List> </List>
{open && {open &&
<div style={{ marginLeft: 20, marginTop: 5 }}> <div style={{ marginLeft: 20, marginTop: 5, paddingBottom: 20 }}>
<button <button
style={{ style={{
outline: 'none', outline: 'none',
......
...@@ -31,13 +31,37 @@ export default class Parameter extends Component { ...@@ -31,13 +31,37 @@ export default class Parameter extends Component {
dataTable: [], dataTable: [],
alert: false, alert: false,
tipeAlert: '', tipeAlert: '',
messageAlert: '' messageAlert: '',
create: false,
edit: false,
load: false
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
} }
componentDidMount() { componentDidMount() {
this.getAllParameter() this.getAllParameter()
this.getPermission()
}
getPermission() {
let payload = {
menu: "parameters"
}
api.create().getPermission(payload).then(response => {
console.log(response)
if (response.data) {
if (response.data.status === "success") {
this.setState({
create: response.data.data.create,
edit: response.data.data.edit,
load: true
})
} else {
this.setState({ load: true })
}
}
})
} }
getAllParameter() { getAllParameter() {
...@@ -545,6 +569,7 @@ export default class Parameter extends Component { ...@@ -545,6 +569,7 @@ export default class Parameter extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{this.state.edit && (
<button <button
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
...@@ -556,6 +581,7 @@ export default class Parameter extends Component { ...@@ -556,6 +581,7 @@ export default class Parameter extends Component {
> >
<img src={Images.editCopy} /> <img src={Images.editCopy} />
</button> </button>
)}
</div > </div >
); );
} }
...@@ -571,7 +597,7 @@ export default class Parameter extends Component { ...@@ -571,7 +597,7 @@ export default class Parameter extends Component {
); );
} }
} }
},{ }, {
name: "Group", name: "Group",
options: { options: {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
...@@ -689,6 +715,7 @@ export default class Parameter extends Component { ...@@ -689,6 +715,7 @@ export default class Parameter extends Component {
</Snackbar> </Snackbar>
{this.state.visibleParameter === true ? {this.state.visibleParameter === true ?
<div> <div>
{this.state.load && (
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -118 }}> <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -118 }}>
<label style={{ color: 'white', fontSize: 16, alignSelf: 'center', width: '20%', }}>Parameter</label> <label style={{ color: 'white', fontSize: 16, alignSelf: 'center', width: '20%', }}>Parameter</label>
<div style={{ color: 'white', width: '50%', height: 37, display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center', borderRadius: 6, paddingLeft: 5, paddingRight: 5, alignSelf: 'center' }}> <div style={{ color: 'white', width: '50%', height: 37, display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center', borderRadius: 6, paddingLeft: 5, paddingRight: 5, alignSelf: 'center' }}>
...@@ -716,6 +743,7 @@ export default class Parameter extends Component { ...@@ -716,6 +743,7 @@ export default class Parameter extends Component {
</button> </button>
</a> </a>
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
{this.state.create && (
<a data-tip={'Upload'} data-for="upload"> <a data-tip={'Upload'} data-for="upload">
<button <button
style={{ style={{
...@@ -729,6 +757,7 @@ export default class Parameter extends Component { ...@@ -729,6 +757,7 @@ export default class Parameter extends Component {
<img src={Images.upload} /> <img src={Images.upload} />
</button> </button>
</a> </a>
)}
<ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
<a data-tip={'Download'} data-for="download"> <a data-tip={'Download'} data-for="download">
<button <button
...@@ -744,22 +773,28 @@ export default class Parameter extends Component { ...@@ -744,22 +773,28 @@ export default class Parameter extends Component {
</button> </button>
</a> </a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
{this.state.create && (
<a data-tip={'Add New'} data-for="create"> <a data-tip={'Add New'} data-for="create">
<button <button
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: 'pointer', cursor: 'pointer',
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5,
marginRight: 20
}} }}
onClick={() => this.setState({ visibleCreate: true })} onClick={() => this.setState({ visibleCreate: true })}
> >
<img src={Images.add} /> <img src={Images.add} />
</button> </button>
</a> </a>
<ReactTooltip border={true} id="create" place="bottom" type="light" effect="solid" /> )}
<ReactTooltip multiline={false} border={true} id="create" place="bottom" type="light" effect="solid" />
</div> </div>
</div> </div>
)}
<div style={{ padding: 25 }}> <div style={{ padding: 25 }}>
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
......
...@@ -40,8 +40,9 @@ export default class ReportItems extends Component { ...@@ -40,8 +40,9 @@ export default class ReportItems extends Component {
alert: false, alert: false,
tipeAlert: '', tipeAlert: '',
messageAlert: '', messageAlert: '',
create: false, buttonCreate: false,
edit: false buttonEdit: false,
load: false
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
...@@ -454,7 +455,7 @@ export default class ReportItems extends Component { ...@@ -454,7 +455,7 @@ export default class ReportItems extends Component {
componentDidMount() { componentDidMount() {
this.getData() this.getData()
// this.getPermission() this.getPermission()
} }
getPermission() { getPermission() {
...@@ -466,9 +467,12 @@ export default class ReportItems extends Component { ...@@ -466,9 +467,12 @@ export default class ReportItems extends Component {
if (response.data) { if (response.data) {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
create: response.data.data.create, buttonCreate: response.data.data.create,
edit: response.data.data.edit buttonEdit: response.data.data.edit,
load: true
}) })
} else {
this.setState({ load: true })
} }
} }
}) })
...@@ -619,7 +623,7 @@ export default class ReportItems extends Component { ...@@ -619,7 +623,7 @@ export default class ReportItems extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ display: 'flex' }}> <div style={{ display: 'flex' }}>
{this.state.edit && ( {this.state.buttonEdit && (
<button <button
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
...@@ -777,6 +781,7 @@ export default class ReportItems extends Component { ...@@ -777,6 +781,7 @@ export default class ReportItems extends Component {
</Snackbar> </Snackbar>
{this.state.itemReport === true ? {this.state.itemReport === true ?
<div> <div>
{this.state.load && (
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -118 }}> <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -118 }}>
<label style={{ color: 'white', fontSize: 16, alignSelf: 'center', width: '20%', }}>Master Data - Report Items</label> <label style={{ color: 'white', fontSize: 16, alignSelf: 'center', width: '20%', }}>Master Data - Report Items</label>
<div style={{ color: 'white', width: '50%', height: 37, display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center', borderRadius: 6, paddingLeft: 5, paddingRight: 5, alignSelf: 'center' }}> <div style={{ color: 'white', width: '50%', height: 37, display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center', borderRadius: 6, paddingLeft: 5, paddingRight: 5, alignSelf: 'center' }}>
...@@ -804,7 +809,7 @@ export default class ReportItems extends Component { ...@@ -804,7 +809,7 @@ export default class ReportItems extends Component {
</button> </button>
</a> </a>
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
{this.state.create && ( {this.state.buttonCreate && (
<a data-tip={'Upload'} data-for="upload"> <a data-tip={'Upload'} data-for="upload">
<button <button
style={{ style={{
...@@ -848,14 +853,15 @@ export default class ReportItems extends Component { ...@@ -848,14 +853,15 @@ export default class ReportItems extends Component {
</button> </button>
</a> </a>
<ReactTooltip border={true} id="visualisasi" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="visualisasi" place="bottom" type="light" effect="solid" />
{this.state.create && ( {this.state.buttonCreate && (
<a data-tip={'Add New'} data-for="tambah"> <a data-tip={'Add New'} data-for="tambah">
<button <button
style={{ style={{
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: 'pointer', cursor: 'pointer',
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5,
marginRight: 20
}} }}
> >
<img src={Images.add} onClick={() => this.setState({ add: true })} /> <img src={Images.add} onClick={() => this.setState({ add: true })} />
...@@ -863,9 +869,9 @@ export default class ReportItems extends Component { ...@@ -863,9 +869,9 @@ export default class ReportItems extends Component {
</a> </a>
)} )}
<ReactTooltip border={true} id="tambah" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="tambah" place="bottom" type="light" effect="solid" />
</div> </div>
</div> </div>
)}
<div style={{ padding: 25 }}> <div style={{ padding: 25 }}>
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
...@@ -880,6 +886,8 @@ export default class ReportItems extends Component { ...@@ -880,6 +886,8 @@ export default class ReportItems extends Component {
: :
this.state.visualisasi == true ? this.state.visualisasi == true ?
<VisualReportItems <VisualReportItems
buttonCreate={this.state.buttonCreate}
buttonEdit={this.state.buttonEdit}
onClickClose={() => this.setState({ visualisasi: false, itemReport: true })} onClickClose={() => this.setState({ visualisasi: false, itemReport: true })}
height={this.props.height} height={this.props.height}
/> />
......
...@@ -41,7 +41,8 @@ export default class UnitBisnis extends Component { ...@@ -41,7 +41,8 @@ export default class UnitBisnis extends Component {
tipeAlert: '', tipeAlert: '',
messageAlert: '', messageAlert: '',
create: false, create: false,
edit: false edit: false,
load: false
} }
this.fileHandler = this.fileHandler.bind(this); this.fileHandler = this.fileHandler.bind(this);
} }
...@@ -202,7 +203,12 @@ export default class UnitBisnis extends Component { ...@@ -202,7 +203,12 @@ export default class UnitBisnis extends Component {
if (response.data.status === "success") { if (response.data.status === "success") {
this.setState({ this.setState({
create: response.data.data.create, create: response.data.data.create,
edit: response.data.data.edit edit: response.data.data.edit,
load: true
})
} else {
this.setState({
load: true
}) })
} }
} }
...@@ -425,6 +431,7 @@ export default class UnitBisnis extends Component { ...@@ -425,6 +431,7 @@ export default class UnitBisnis extends Component {
</Snackbar> </Snackbar>
{this.state.visibleUnitBisnis === true ? {this.state.visibleUnitBisnis === true ?
<div> <div>
{this.state.load && (
<div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -118 }}> <div style={{ display: 'flex', flexDirection: 'row', justifyContent: 'space-between', paddingRight: 25, paddingLeft: 25, marginTop: -118 }}>
<label style={{ color: 'white', fontSize: 16, alignSelf: 'center', width: '20%', }}>Master Data - Business Unit</label> <label style={{ color: 'white', fontSize: 16, alignSelf: 'center', width: '20%', }}>Master Data - Business Unit</label>
<div style={{ color: 'white', width: '50%', height: 37, display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center', borderRadius: 6, paddingLeft: 5, paddingRight: 5, alignSelf: 'center' }}> <div style={{ color: 'white', width: '50%', height: 37, display: 'flex', backgroundColor: 'white', borderWidth: 2, alignItems: 'center', borderRadius: 6, paddingLeft: 5, paddingRight: 5, alignSelf: 'center' }}>
...@@ -489,7 +496,8 @@ export default class UnitBisnis extends Component { ...@@ -489,7 +496,8 @@ export default class UnitBisnis extends Component {
backgroundColor: 'transparent', backgroundColor: 'transparent',
cursor: 'pointer', cursor: 'pointer',
borderColor: 'transparent', borderColor: 'transparent',
margin: 5 margin: 5,
marginRight: 20
}} }}
onClick={() => this.setState({ visibleCreate: true })} onClick={() => this.setState({ visibleCreate: true })}
> >
...@@ -500,6 +508,7 @@ export default class UnitBisnis extends Component { ...@@ -500,6 +508,7 @@ export default class UnitBisnis extends Component {
<ReactTooltip border={true} id="create" place="bottom" type="light" effect="solid" /> <ReactTooltip border={true} id="create" place="bottom" type="light" effect="solid" />
</div> </div>
</div> </div>
)}
<div style={{ padding: 25 }}> <div style={{ padding: 25 }}>
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
......
...@@ -270,7 +270,7 @@ export default class VisualReportItems extends Component { ...@@ -270,7 +270,7 @@ export default class VisualReportItems extends Component {
</div> </div>
<div style={{ padding: 25, width: '100%' }}> <div style={{ padding: 25, width: '100%' }}>
<div style={{ width: '100%', padding: 25, backgroundColor: 'white', borderRadius: 6, border: 'solid 1px #c4c4c4' }}> <div style={{ width: '100%', padding: 25, backgroundColor: 'white', borderRadius: 6, border: 'solid 1px #c4c4c4' }}>
<label style={{ color: '#4b4b4b', fontSize: '16px', fontWeight: 'bold' }}>Report Item Hierarchy</label> <label style={{ color: '#4b4b4b', fontSize: '16px', fontWeight: 'bold' }}>Reports Item Hierarchy</label>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}> <div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete <Autocomplete
{...this.state.listReport} {...this.state.listReport}
...@@ -283,7 +283,7 @@ export default class VisualReportItems extends Component { ...@@ -283,7 +283,7 @@ export default class VisualReportItems extends Component {
label="Report Type" label="Report Type"
margin="normal" margin="normal"
style={{ marginTop: 7 }} style={{ marginTop: 7 }}
InputProps={{ ...params.InputProps, style: { width: "15%" , fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }} InputProps={{ ...params.InputProps, style: { width: "15%", fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>} />}
value={this.state.report} value={this.state.report}
/> />
...@@ -300,7 +300,7 @@ export default class VisualReportItems extends Component { ...@@ -300,7 +300,7 @@ export default class VisualReportItems extends Component {
label="Company" label="Company"
margin="normal" margin="normal"
style={{ marginTop: 7 }} style={{ marginTop: 7 }}
InputProps={{ ...params.InputProps, style: { width: "15%" , fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }} InputProps={{ ...params.InputProps, style: { width: "15%", fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>} />}
value={this.state.company} value={this.state.company}
/> />
...@@ -320,6 +320,7 @@ export default class VisualReportItems extends Component { ...@@ -320,6 +320,7 @@ export default class VisualReportItems extends Component {
<div onClick={() => this.props.onClickClose()} style={{ width: 102, height: 30, marginLeft: 25, backgroundColor: 'dodgerblue', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor: "pointer" }}> <div onClick={() => this.props.onClickClose()} style={{ width: 102, height: 30, marginLeft: 25, backgroundColor: 'dodgerblue', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor: "pointer" }}>
<span style={{ color: '#fff', fontSize: 11 }}>Back</span> <span style={{ color: '#fff', fontSize: 11 }}>Back</span>
</div> </div>
{this.props.buttonEdit && (
<div className="row" style={{ float: 'right', marginRight: 25 }}> <div className="row" style={{ float: 'right', marginRight: 25 }}>
<div onClick={() => this.props.onClickClose()} style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor: "pointer" }}> <div onClick={() => this.props.onClickClose()} style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center', cursor: "pointer" }}>
<span style={{ color: '#354960', fontSize: 11 }}>Cancel</span> <span style={{ color: '#354960', fontSize: 11 }}>Cancel</span>
...@@ -330,6 +331,7 @@ export default class VisualReportItems extends Component { ...@@ -330,6 +331,7 @@ export default class VisualReportItems extends Component {
</div> </div>
</button> </button>
</div> </div>
)}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -12,10 +12,10 @@ export default class PopUpFailedSave extends Component { ...@@ -12,10 +12,10 @@ export default class PopUpFailedSave extends Component {
</div> </div>
<div style={{ display: 'grid', justifyContent: 'center', marginTop: 20 }}> <div style={{ display: 'grid', justifyContent: 'center', marginTop: 20 }}>
<span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}> <span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
{`Maaf, penyimpanan data gagal.`} {`Sorry, form save failed.`}
</span> </span>
<span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}> <span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
{`Mohon ulangi beberapa saat lagi.`} {`Please try again later.`}
</span> </span>
</div> </div>
<div style={{ display: 'grid', justifyContent: 'center', marginTop: 24 }}> <div style={{ display: 'grid', justifyContent: 'center', marginTop: 24 }}>
......
...@@ -70,7 +70,7 @@ class Upload extends Component { ...@@ -70,7 +70,7 @@ class Upload extends Component {
uploadProgress: false, uploadProgress: false,
percentage: '0' percentage: '0'
}) })
this.setState({ alertMessage: "Unsupported Media Type", alert: true }) this.setState({ alertMessage: "Unsupported File", alert: true })
// alert("Unsupported Media Type") // alert("Unsupported Media Type")
} }
} }
...@@ -95,11 +95,11 @@ class Upload extends Component { ...@@ -95,11 +95,11 @@ class Upload extends Component {
if (this.state.sizeFile < 1000) { if (this.state.sizeFile < 1000) {
this.props.onUpload() this.props.onUpload()
} else { } else {
this.setState({ alertMessage: 'File Tidak Boleh Lebih Dari 1MB', alert: true }) this.setState({ alertMessage: 'File cannot be more than 1MB', alert: true })
// alert('File Tidak Boleh Lebih Dari 1MB') // alert('File Tidak Boleh Lebih Dari 1MB')
} }
} else { } else {
this.setState({ alertMessage: 'File Tidak Mendukung', alert: true }) this.setState({ alertMessage: 'Unsupported File', alert: true })
// alert('File Tidak Mendukung') // alert('File Tidak Mendukung')
} }
} }
......
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