Commit 208c0945 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'riri' into 'master'

update

See merge request !119
parents 34a1f518 bc96792c
...@@ -116,27 +116,14 @@ export default class EditReportItems extends Component { ...@@ -116,27 +116,14 @@ export default class EditReportItems extends Component {
// alert('coba ya') // alert('coba ya')
if (R.isNil(this.state.reportType)) return alert("Jenis Laporan is Required."); if (R.isNil(this.state.reportType)) return alert("Jenis Laporan is Required.");
if (R.isNil(this.state.company)) return alert("Perusahaan is Required."); if (R.isNil(this.state.company)) return alert("Perusahaan is Required.");
else if (R.isNil(this.state.order)) { else if (R.isEmpty(this.state.tempData.order)) {
this.setState({errorOrder: true, msgErrorOrder: 'Order Harus Diisi'}) this.setState({errorOrder: true, msgErrorOrder: 'Order Harus Diisi'})
} } else if (R.isEmpty(this.state.tempData.description)) {
else if (R.isEmpty(this.state.description)) {
this.setState({errorDesc: true, msgErrorDesc: 'Deskripsi Harus Diisi'}) this.setState({errorDesc: true, msgErrorDesc: 'Deskripsi Harus Diisi'})
} } else if (R.isNil(this.state.InputType)) return alert("Tipe Data harus dipilih.")
else if (R.isNil(this.state.parent)) return alert("Parent ID is Required.") else if (this.state.InputType.type_report_name === 'Formula' || this.state.InputType.type_report_name === 'Validation' && R.isEmpty(this.state.tempData.formula)) {
else if (R.isNil(this.state.InputType)) return alert("Tipe Data is Required.");
else if (this.state.disabledFormula === false && R.isEmpty(this.state.formula)) {
this.setState({errorFormula: true, msgErrorFormula: 'Formula Harus Diisi'}) this.setState({errorFormula: true, msgErrorFormula: 'Formula Harus Diisi'})
} }
else if (this.state.disabledValue === false && R.isEmpty(this.state.realVal)) {
this.setState({errorRV: true, msgErrorRV: 'Nilai Seharusnya Harus Diisi'})
}
else if (this.state.disabledCondt === false && R.isEmpty(this.state.condition)) return alert("Kondisi Jika Salah is Required.")
else if (R.isNil(this.state.startDate)) {
this.setState({errorStartDate: true, msgErrorSD: 'Start Date tidak boleh kosong'})
}
else if (R.isNil(this.state.endDate)) {
this.setState({errorEndDate: true, msgErrorED: 'End Date tidak boleh kosong'})
}
else { else {
this.updateReportItems() this.updateReportItems()
} }
...@@ -368,6 +355,8 @@ export default class EditReportItems extends Component { ...@@ -368,6 +355,8 @@ export default class EditReportItems extends Component {
id="description" id="description"
label="Deskripsi" label="Deskripsi"
name="description" name="description"
error={this.state.errorDesc}
helperText={this.state.msgErrorDesc}
onChange={(e) => this.handleChange(e, '')} onChange={(e) => this.handleChange(e, '')}
value={this.state.tempData === null ? '' : this.state.tempData.description} value={this.state.tempData === null ? '' : this.state.tempData.description}
inputProps={{ inputProps={{
...@@ -545,14 +534,15 @@ export default class EditReportItems extends Component { ...@@ -545,14 +534,15 @@ export default class EditReportItems extends Component {
id="order" id="order"
label="Order" label="Order"
name="order" name="order"
onChange={(e) => this.handleChange(e, '')}
value={this.state.tempData === null ? '' : this.state.tempData.order} value={this.state.tempData === null ? '' : this.state.tempData.order}
error={this.state.errorOrder}
helperText={this.state.msgErrorOrder}
onChange={(e) => this.handleChange(e, '')}
inputProps={{ inputProps={{
style: { style: {
fontSize: 11, fontSize: 11,
fontWeight: 600, fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif', fontFamily: 'Nunito Sans, sans-serif'
paddingLeft: 10
} }
}} }}
InputLabelProps={{ InputLabelProps={{
...@@ -560,8 +550,7 @@ export default class EditReportItems extends Component { ...@@ -560,8 +550,7 @@ export default class EditReportItems extends Component {
fontSize: 11, fontSize: 11,
fontWeight: 600, fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif', fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085', color: '#7e8085'
paddingLeft: 10
} }
}} }}
> >
...@@ -623,6 +612,8 @@ export default class EditReportItems extends Component { ...@@ -623,6 +612,8 @@ export default class EditReportItems extends Component {
label="Formula" label="Formula"
disabled={this.state.InputType == null? true : (this.state.InputType.type_report_name === 'Formula' || this.state.InputType.type_report_name === 'Validation'? false : true)} disabled={this.state.InputType == null? true : (this.state.InputType.type_report_name === 'Formula' || this.state.InputType.type_report_name === 'Validation'? false : true)}
name="formula" name="formula"
error={this.state.errorFormula}
helperText={this.state.msgErrorFormula}
onChange={(e) => this.handleChange(e, '')} onChange={(e) => this.handleChange(e, '')}
value={this.state.tempData === null ? '' : this.state.tempData.formula} value={this.state.tempData === null ? '' : this.state.tempData.formula}
inputProps={{ inputProps={{
...@@ -701,7 +692,7 @@ export default class EditReportItems extends Component { ...@@ -701,7 +692,7 @@ export default class EditReportItems extends Component {
</button> </button>
</div> </div>
<div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}> <div className="column-2" style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }}>
<button onClick={() => this.updateReportItems()}> <button onClick={() => this.validasi()}>
<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' }}>
<span style={{ color: '#fff', fontSize: 11 }}>Simpan</span> <span style={{ color: '#fff', fontSize: 11 }}>Simpan</span>
</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