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

malam2

parent 1c3cf56c
......@@ -588,7 +588,7 @@ export default function MiniDrawer() {
))}
</List>
{open &&
<div style={{ marginLeft: 20, marginTop: 5 }}>
<div style={{ marginLeft: 20, marginTop: 5, paddingBottom: 20 }}>
<button
style={{
outline: 'none',
......
......@@ -31,13 +31,37 @@ export default class Parameter extends Component {
dataTable: [],
alert: false,
tipeAlert: '',
messageAlert: ''
messageAlert: '',
create: false,
edit: false,
load: false
}
this.fileHandler = this.fileHandler.bind(this);
}
componentDidMount() {
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() {
......@@ -545,6 +569,7 @@ export default class Parameter extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
{this.state.edit && (
<button
style={{
backgroundColor: 'transparent',
......@@ -556,6 +581,7 @@ export default class Parameter extends Component {
>
<img src={Images.editCopy} />
</button>
)}
</div >
);
}
......@@ -571,7 +597,7 @@ export default class Parameter extends Component {
);
}
}
},{
}, {
name: "Group",
options: {
customBodyRender: (val, tableMeta) => {
......@@ -689,6 +715,7 @@ export default class Parameter extends Component {
</Snackbar>
{this.state.visibleParameter === true ?
<div>
{this.state.load && (
<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>
<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 {
</button>
</a>
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
{this.state.create && (
<a data-tip={'Upload'} data-for="upload">
<button
style={{
......@@ -729,6 +757,7 @@ export default class Parameter extends Component {
<img src={Images.upload} />
</button>
</a>
)}
<ReactTooltip border={true} id="upload" place="bottom" type="light" effect="solid" />
<a data-tip={'Download'} data-for="download">
<button
......@@ -744,22 +773,28 @@ export default class Parameter extends Component {
</button>
</a>
<ReactTooltip border={true} id="download" place="bottom" type="light" effect="solid" />
{this.state.create && (
<a data-tip={'Add New'} data-for="create">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
margin: 5,
marginRight: 20
}}
onClick={() => this.setState({ visibleCreate: true })}
>
<img src={Images.add} />
</button>
</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 style={{ padding: 25 }}>
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
......
......@@ -40,8 +40,9 @@ export default class ReportItems extends Component {
alert: false,
tipeAlert: '',
messageAlert: '',
create: false,
edit: false
buttonCreate: false,
buttonEdit: false,
load: false
}
this.fileHandler = this.fileHandler.bind(this);
......@@ -454,7 +455,7 @@ export default class ReportItems extends Component {
componentDidMount() {
this.getData()
// this.getPermission()
this.getPermission()
}
getPermission() {
......@@ -466,9 +467,12 @@ export default class ReportItems extends Component {
if (response.data) {
if (response.data.status === "success") {
this.setState({
create: response.data.data.create,
edit: response.data.data.edit
buttonCreate: response.data.data.create,
buttonEdit: response.data.data.edit,
load: true
})
} else {
this.setState({ load: true })
}
}
})
......@@ -619,7 +623,7 @@ export default class ReportItems extends Component {
customBodyRender: (val, tableMeta) => {
return (
<div style={{ display: 'flex' }}>
{this.state.edit && (
{this.state.buttonEdit && (
<button
style={{
backgroundColor: 'transparent',
......@@ -777,6 +781,7 @@ export default class ReportItems extends Component {
</Snackbar>
{this.state.itemReport === true ?
<div>
{this.state.load && (
<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>
<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 {
</button>
</a>
<ReactTooltip border={true} id="template" place="bottom" type="light" effect="solid" />
{this.state.create && (
{this.state.buttonCreate && (
<a data-tip={'Upload'} data-for="upload">
<button
style={{
......@@ -848,14 +853,15 @@ export default class ReportItems extends Component {
</button>
</a>
<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">
<button
style={{
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
margin: 5,
marginRight: 20
}}
>
<img src={Images.add} onClick={() => this.setState({ add: true })} />
......@@ -863,9 +869,9 @@ export default class ReportItems extends Component {
</a>
)}
<ReactTooltip border={true} id="tambah" place="bottom" type="light" effect="solid" />
</div>
</div>
)}
<div style={{ padding: 25 }}>
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
......@@ -880,6 +886,8 @@ export default class ReportItems extends Component {
:
this.state.visualisasi == true ?
<VisualReportItems
buttonCreate={this.state.buttonCreate}
buttonEdit={this.state.buttonEdit}
onClickClose={() => this.setState({ visualisasi: false, itemReport: true })}
height={this.props.height}
/>
......
......@@ -41,7 +41,8 @@ export default class UnitBisnis extends Component {
tipeAlert: '',
messageAlert: '',
create: false,
edit: false
edit: false,
load: false
}
this.fileHandler = this.fileHandler.bind(this);
}
......@@ -202,7 +203,12 @@ export default class UnitBisnis extends Component {
if (response.data.status === "success") {
this.setState({
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 {
</Snackbar>
{this.state.visibleUnitBisnis === true ?
<div>
{this.state.load && (
<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>
<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 {
backgroundColor: 'transparent',
cursor: 'pointer',
borderColor: 'transparent',
margin: 5
margin: 5,
marginRight: 20
}}
onClick={() => this.setState({ visibleCreate: true })}
>
......@@ -500,6 +508,7 @@ export default class UnitBisnis extends Component {
<ReactTooltip border={true} id="create" place="bottom" type="light" effect="solid" />
</div>
</div>
)}
<div style={{ padding: 25 }}>
<MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable
......
......@@ -270,7 +270,7 @@ export default class VisualReportItems extends Component {
</div>
<div style={{ padding: 25, width: '100%' }}>
<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 }}>
<Autocomplete
{...this.state.listReport}
......@@ -283,7 +283,7 @@ export default class VisualReportItems extends Component {
label="Report Type"
margin="normal"
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}
/>
......@@ -300,7 +300,7 @@ export default class VisualReportItems extends Component {
label="Company"
margin="normal"
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}
/>
......@@ -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" }}>
<span style={{ color: '#fff', fontSize: 11 }}>Back</span>
</div>
{this.props.buttonEdit && (
<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" }}>
<span style={{ color: '#354960', fontSize: 11 }}>Cancel</span>
......@@ -330,6 +331,7 @@ export default class VisualReportItems extends Component {
</div>
</button>
</div>
)}
</div>
</div>
</div>
......
......@@ -12,10 +12,10 @@ export default class PopUpFailedSave extends Component {
</div>
<div style={{ display: 'grid', justifyContent: 'center', marginTop: 20 }}>
<span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
{`Maaf, penyimpanan data gagal.`}
{`Sorry, form save failed.`}
</span>
<span style={{ textAlign: 'center', fontSize: 14, fontWeight: 'bold' }}>
{`Mohon ulangi beberapa saat lagi.`}
{`Please try again later.`}
</span>
</div>
<div style={{ display: 'grid', justifyContent: 'center', marginTop: 24 }}>
......
......@@ -70,7 +70,7 @@ class Upload extends Component {
uploadProgress: false,
percentage: '0'
})
this.setState({ alertMessage: "Unsupported Media Type", alert: true })
this.setState({ alertMessage: "Unsupported File", alert: true })
// alert("Unsupported Media Type")
}
}
......@@ -95,11 +95,11 @@ class Upload extends Component {
if (this.state.sizeFile < 1000) {
this.props.onUpload()
} 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')
}
} else {
this.setState({ alertMessage: 'File Tidak Mendukung', alert: true })
this.setState({ alertMessage: 'Unsupported File', alert: true })
// 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