Commit 457e97e2 authored by Deni Rinaldi's avatar Deni Rinaldi

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into deni-dev(pc)

parents 92e9e0de 387cb89d
...@@ -113,14 +113,13 @@ export default class CreateReportItems extends Component { ...@@ -113,14 +113,13 @@ export default class CreateReportItems 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.order)) {
this.setState({errorOrder: true, msgErrorOrder: 'Order Harus Diisi'}) this.setState({errorOrder: true, msgErrorOrder: 'Order Harus Diisi'})
} }
else if (R.isEmpty(this.state.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.parent)) return alert("Parent ID is Required.") else if (R.isNil(this.state.InputType)) return alert("Tipe Data is Required.")
else if (R.isNil(this.state.InputType)) return alert("Tipe Data is Required.");
else if (this.state.disabledFormula === false && R.isEmpty(this.state.formula)) { 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'})
} }
...@@ -290,8 +289,7 @@ export default class CreateReportItems extends Component { ...@@ -290,8 +289,7 @@ export default class CreateReportItems extends Component {
</div> </div>
</div> </div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="border-bottom grid grid-2x grid-mobile-none gap-15px" style={{ padding: 20 }}>
<div className="column-1"> <div className="column-1">
<div className="margin-top-10px" style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}> <div className="margin-top-10px" style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}>
<TextField <TextField
...@@ -317,7 +315,36 @@ export default class CreateReportItems extends Component { ...@@ -317,7 +315,36 @@ export default class CreateReportItems extends Component {
}} }}
/> />
</div> </div>
<div className="margin-top-10px" style={{padding: 10}} > </div>
<div className="column-2">
<div className="margin-top-10px" style={{padding: 10, borderRadius: 5}}>
<Autocomplete
{...this.state.listReportType}
id="reportType"
onChange={(event, newInputValue) => this.setState({reportType: newInputValue})}
debug
renderInput={(params) =>
<TextField {...params}
label="Jenis Laporan"
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontWeight: 600, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
value={this.state.reportType}
/>
</div>
</div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-top-10px" style={{padding: 10, borderRadius: 5}} >
<Autocomplete <Autocomplete
{...this.state.listCompany} {...this.state.listCompany}
id="company" id="company"
...@@ -339,17 +366,19 @@ export default class CreateReportItems extends Component { ...@@ -339,17 +366,19 @@ export default class CreateReportItems extends Component {
value={this.state.company} value={this.state.company}
/> />
</div> </div>
<div style={{ padding: 10, borderRadius: 5 }}> </div>
<div className="column-2">
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<TextField <TextField
style={{ width: '100%' }} style={{ width: '100%' }}
id="description" id="orders"
label="Deskripsi" name="order"
name="description" label="Order"
value={this.state.description} onChange={(e) => this.handleChange(e, '')}
error={this.state.errorDesc} value={this.state.order}
helperText={this.state.msgErrorDesc} error={this.state.errorOrder}
helperText={this.state.msgErrorOrder}
onChange={(e) => this.handleChange(e, '')} onChange={(e) => this.handleChange(e, '')}
// value={this.props.data.business_unit_name}
inputProps={{ inputProps={{
style: { style: {
fontSize: 11, fontSize: 11,
...@@ -368,14 +397,22 @@ export default class CreateReportItems extends Component { ...@@ -368,14 +397,22 @@ export default class CreateReportItems extends Component {
> >
</TextField> </TextField>
</div> </div>
<div style={{ padding: 10, borderRadius: 5 }}> </div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<TextField <TextField
style={{ width: '100%' }} style={{ width: '100%' }}
id="uom" id="description"
name="uom" label="Deskripsi"
label="UOM" name="description"
value={this.state.uom} value={this.state.description}
error={this.state.errorDesc}
helperText={this.state.msgErrorDesc}
onChange={(e) => this.handleChange(e, '')} onChange={(e) => this.handleChange(e, '')}
// value={this.props.data.business_unit_name}
inputProps={{ inputProps={{
style: { style: {
fontSize: 11, fontSize: 11,
...@@ -394,20 +431,18 @@ export default class CreateReportItems extends Component { ...@@ -394,20 +431,18 @@ export default class CreateReportItems extends Component {
> >
</TextField> </TextField>
</div> </div>
<div className="margin-top-10px" style={{padding: 10}}> </div>
<div className="column-2">
<div className="margin-top-10px" style={{padding: 10, borderRadius: 5}} >
<Autocomplete <Autocomplete
{...this.state.listInputType} {...this.state.listParent}
id="inputType" id="parentId"
onChange={(event, newInputValue) => this.setState({InputType: newInputValue}, onChange={(event, newInputValue) => this.setState({parent: newInputValue})}
() => newInputValue === null ? this.setState({disabledFormula: true, disabledCondt: true, disabledValue: true, formula: '', condition: '', realVal: ''})
: newInputValue.type_report_name === 'Formula' ? this.setState({disabledFormula: false, disabledCondt: true, disabledValue: true, formula: '', condition: '', realVal: ''})
: newInputValue.type_report_name === 'Validation' ? this.setState({disabledFormula: false, disabledCondt: false, disabledValue: false, formula: '', condition: '', realVal: ''})
: this.setState({disabledFormula: true, disabledCondt: true, disabledValue: true, formula: '', condition: '', realVal: ''})
)}
debug debug
disabled={this.state.reportType == null || this.state.company == null}
renderInput={(params) => renderInput={(params) =>
<TextField {...params} <TextField {...params}
label="Tipe Data" label="Parent ID"
InputLabelProps={{ InputLabelProps={{
style: { style: {
fontSize: 11, fontSize: 11,
...@@ -418,20 +453,21 @@ export default class CreateReportItems extends Component { ...@@ -418,20 +453,21 @@ export default class CreateReportItems extends Component {
}} }}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontWeight: 600, fontFamily: 'Nunito Sans, sans-serif' } }} InputProps={{ ...params.InputProps, style: { fontSize: 11, fontWeight: 600, fontFamily: 'Nunito Sans, sans-serif' } }}
/>} />}
value={this.state.InputType} value={this.state.parent}
/> />
</div> </div>
</div>
</div>
<div className="margin-top-10px" style={{padding: 10}}> <div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<TextField <TextField
style={{ width: '100%' }} style={{ width: '100%' }}
id="realVal" id="uom"
label="Nilai Seharusnya" name="uom"
name="realVal" label="UOM"
disabled={this.state.disabledValue} value={this.state.uom}
value={this.state.realVal}
error={this.state.errorRV}
helperText={this.state.msgErrorRV}
onChange={(e) => this.handleChange(e, '')} onChange={(e) => this.handleChange(e, '')}
inputProps={{ inputProps={{
style: { style: {
...@@ -448,110 +484,18 @@ export default class CreateReportItems extends Component { ...@@ -448,110 +484,18 @@ export default class CreateReportItems extends Component {
color: '#7e8085', color: '#7e8085',
} }
}} }}
/> >
</div> </TextField>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<DatePicker
margin="normal"
id="startDate"
label="Berlaku Mulai"
format="dd MMMM yyyy"
value={this.state.startDate}
error={this.state.errorStartDate}
helperText={this.state.msgErrorSD}
onChange={(e) => this.handleChange(e, 'start_date')}
KeyboardButtonProps={{
'aria-label': 'change date',
}}
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
style={{padding: 0, margin: 0, width: '100%'}}
/>
</div>
<div className="margin-top-10px" style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}>
<TextField
style={{ width: '100%' }}
value={'Aktif'}
id="status"
label="Status"
disabled
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085',
}
}}
/>
</div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<div style={{display: 'flex'}}>
<Typography style={{ fontSize: 11, width: '20%' }}>Dibuat</Typography>
<Typography style={{ fontSize: 11 }}>: Admin - 21 Jul 2020, 18:45</Typography>
</div>
<div style={{display: 'flex'}}>
<Typography style={{ fontSize: 11, width: '20%' }}>Diubah</Typography>
<Typography style={{ fontSize: 11 }}>: Admin - 21 Jul 2020, 18:45</Typography>
</div>
</div> </div>
</div> </div>
<div className="column-2"> <div className="column-2">
<div className="margin-top-10px" style={{padding: 10}}> <div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<Autocomplete
{...this.state.listReportType}
id="reportType"
onChange={(event, newInputValue) => this.setState({reportType: newInputValue})}
debug
renderInput={(params) =>
<TextField {...params}
label="Jenis Laporan"
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontWeight: 600, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
value={this.state.reportType}
/>
</div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<TextField <TextField
style={{ width: '100%' }} style={{ width: '100%' }}
id="orders" id="weight"
name="order" label="Weight"
label="Order" name="weight"
onChange={(e) => this.handleChange(e, '')} value={this.state.weight}
value={this.state.order}
error={this.state.errorOrder}
helperText={this.state.msgErrorOrder}
onChange={(e) => this.handleChange(e, '')} onChange={(e) => this.handleChange(e, '')}
inputProps={{ inputProps={{
style: { style: {
...@@ -571,16 +515,25 @@ export default class CreateReportItems extends Component { ...@@ -571,16 +515,25 @@ export default class CreateReportItems extends Component {
> >
</TextField> </TextField>
</div> </div>
<div style={{padding: 10}} > </div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-top-10px" style={{padding: 10, borderRadius: 5}}>
<Autocomplete <Autocomplete
{...this.state.listParent} {...this.state.listInputType}
id="parentId" id="inputType"
onChange={(event, newInputValue) => this.setState({parent: newInputValue})} onChange={(event, newInputValue) => this.setState({InputType: newInputValue},
() => newInputValue === null ? this.setState({disabledFormula: true, disabledCondt: true, disabledValue: true, formula: '', condition: '', realVal: ''})
: newInputValue.type_report_name === 'Formula' ? this.setState({disabledFormula: false, disabledCondt: true, disabledValue: true, formula: '', condition: '', realVal: ''})
: newInputValue.type_report_name === 'Validation' ? this.setState({disabledFormula: false, disabledCondt: false, disabledValue: false, formula: '', condition: '', realVal: ''})
: this.setState({disabledFormula: true, disabledCondt: true, disabledValue: true, formula: '', condition: '', realVal: ''})
)}
debug debug
disabled={this.state.reportType == null || this.state.company == null}
renderInput={(params) => renderInput={(params) =>
<TextField {...params} <TextField {...params}
label="Parent ID" label="Tipe Data"
InputLabelProps={{ InputLabelProps={{
style: { style: {
fontSize: 11, fontSize: 11,
...@@ -591,16 +544,21 @@ export default class CreateReportItems extends Component { ...@@ -591,16 +544,21 @@ export default class CreateReportItems extends Component {
}} }}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontWeight: 600, fontFamily: 'Nunito Sans, sans-serif' } }} InputProps={{ ...params.InputProps, style: { fontSize: 11, fontWeight: 600, fontFamily: 'Nunito Sans, sans-serif' } }}
/>} />}
value={this.state.parent} value={this.state.InputType}
/> />
</div> </div>
<div style={{ padding: 10, borderRadius: 5 }}> </div>
<div className="column-2">
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<TextField <TextField
style={{ width: '100%' }} style={{ width: '100%' }}
id="weight" id="formula"
label="Weight" label="Formula"
name="weight" name="formula"
value={this.state.weight} disabled={this.state.disabledFormula}
value={this.state.formula}
error={this.state.errorFormula}
helperText={this.state.msgErrorFormula}
onChange={(e) => this.handleChange(e, '')} onChange={(e) => this.handleChange(e, '')}
inputProps={{ inputProps={{
style: { style: {
...@@ -620,16 +578,21 @@ export default class CreateReportItems extends Component { ...@@ -620,16 +578,21 @@ export default class CreateReportItems extends Component {
> >
</TextField> </TextField>
</div> </div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}> </div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-top-10px" style={{padding: 10, borderRadius: 5}}>
<TextField <TextField
style={{ width: '100%' }} style={{ width: '100%' }}
id="formula" id="realVal"
label="Formula" label="Nilai Seharusnya"
name="formula" name="realVal"
disabled={this.state.disabledFormula} disabled={this.state.disabledValue}
value={this.state.formula} value={this.state.realVal}
error={this.state.errorFormula} error={this.state.errorRV}
helperText={this.state.msgErrorFormula} helperText={this.state.msgErrorRV}
onChange={(e) => this.handleChange(e, '')} onChange={(e) => this.handleChange(e, '')}
inputProps={{ inputProps={{
style: { style: {
...@@ -646,10 +609,11 @@ export default class CreateReportItems extends Component { ...@@ -646,10 +609,11 @@ export default class CreateReportItems extends Component {
color: '#7e8085', color: '#7e8085',
} }
}} }}
> />
</TextField>
</div> </div>
<div className="margin-top-10px" style={{padding: 10}}> </div>
<div className="column-2">
<div className="margin-top-10px" style={{padding: 10, borderRadius: 5}}>
<Autocomplete <Autocomplete
value={this.state.condition} value={this.state.condition}
id="isWrongCondition" id="isWrongCondition"
...@@ -673,7 +637,46 @@ export default class CreateReportItems extends Component { ...@@ -673,7 +637,46 @@ export default class CreateReportItems extends Component {
/>} />}
/> />
</div> </div>
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}> </div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<DatePicker
margin="normal"
id="startDate"
label="Berlaku Mulai"
format="dd MMMM yyyy"
value={this.state.startDate}
error={this.state.errorStartDate}
helperText={this.state.msgErrorSD}
onChange={(e) => this.handleChange(e, 'start_date')}
KeyboardButtonProps={{
'aria-label': 'change date',
}}
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
style={{padding: 0, margin: 0, width: '100%'}}
/>
</div>
</div>
<div className="column-2">
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<DatePicker <DatePicker
margin="normal" margin="normal"
id="endDate" id="endDate"
...@@ -707,7 +710,50 @@ export default class CreateReportItems extends Component { ...@@ -707,7 +710,50 @@ export default class CreateReportItems extends Component {
/> />
</div> </div>
</div> </div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-top-10px" style={{ backgroundColor: '#e8e8e8', padding: 10, borderRadius: 5 }}>
<TextField
style={{ width: '100%' }}
value={'Aktif'}
id="status"
label="Status"
disabled
inputProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontWeight: 600,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085',
}
}}
/>
</div>
</div>
</div>
<div className="grid grid-2x grid-mobile-none gap-15px" style={{ paddingLeft: 20, paddingRight: 20 }}>
<div className="column-1">
<div className="margin-top-10px" style={{ padding: 10, borderRadius: 5 }}>
<div style={{display: 'flex'}}>
<Typography style={{ fontSize: 11, width: '20%' }}>Dibuat</Typography>
<Typography style={{ fontSize: 11 }}>: Admin - 21 Jul 2020, 18:45</Typography>
</div>
<div style={{display: 'flex'}}>
<Typography style={{ fontSize: 11, width: '20%' }}>Diubah</Typography>
<Typography style={{ fontSize: 11 }}>: Admin - 21 Jul 2020, 18:45</Typography>
</div>
</div>
</div>
</div> </div>
<div className="border-top grid grid-2x" style={{ height: 56, backgroundColor: '#f5f5f5', paddingLeft: 20, paddingRight: 20 }}> <div className="border-top grid grid-2x" style={{ height: 56, backgroundColor: '#f5f5f5', paddingLeft: 20, paddingRight: 20 }}>
...@@ -722,9 +768,14 @@ export default class CreateReportItems extends Component { ...@@ -722,9 +768,14 @@ export default class CreateReportItems 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'}}>
<div onClick={() => this.validasi()} style={{ width: 102, height: 30, backgroundColor: '#354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}> <button
type="button"
onClick={() => this.validasi()}
>
<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>
</button>
</div> </div>
</div> </div>
</div> </div>
......
...@@ -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>
......
...@@ -143,8 +143,10 @@ export default class VisualReportItems extends Component { ...@@ -143,8 +143,10 @@ export default class VisualReportItems extends Component {
} }
api.create().getItemReportHierarki(payload).then((response) => { api.create().getItemReportHierarki(payload).then((response) => {
console.log(response.data) console.log(response.data)
if (response.data.status == 'success') { if (response.data) {
this.setState({ items: response.data.data }) if (response.data.status == 'success') {
this.setState({ items: response.data.data })
}
} }
}) })
} }
......
...@@ -102,136 +102,138 @@ export default class UserRole extends Component { ...@@ -102,136 +102,138 @@ export default class UserRole extends Component {
this.setState({ payload: body }) this.setState({ payload: body })
api.create().checkUploadUser(body).then(response => { api.create().checkUploadUser(body).then(response => {
console.log(response); console.log(response);
if (response.data.status === "success") { if (response.data) {
let dataRow = response.data.data.map((item, index) => { if (response.data.status === "success") {
return [ let dataRow = response.data.data.map((item, index) => {
index + 1, return [
item.fullname, index + 1,
item.email, item.fullname,
item.role, item.email,
item.start_date, item.role,
item.end_date, item.start_date,
item.error item.end_date,
] item.error
}) ]
})
let columns = [
"Data Ke-", let columns = [
"Nama Lengkap", "Data Ke-",
{ "Nama Lengkap",
name: "Email", {
options: { name: "Email",
customBodyRender: (val, tableMeta) => { options: {
console.log(tableMeta) customBodyRender: (val, tableMeta) => {
let check = null console.log(tableMeta)
if (tableMeta.rowData[6] != null) { let check = null
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('email')) if (tableMeta.rowData[6] != null) {
if (check > -1) { check = tableMeta.rowData[6].findIndex((val) => val.field.includes('email'))
this.setState({ buttonError: true }) if (check > -1) {
this.setState({ buttonError: true })
}
}
return (
<div style={{ display: 'flex' }}>
{tableMeta.rowData[6] != null && check > -1 ?
<a data-tip={tableMeta.rowData[6][check].message} data-for="email">
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
</a> :
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}
<ReactTooltip border={true} id="email" place="bottom" type="light" effect="solid" />
</div >
);
} }
} }
return ( },
<div style={{ display: 'flex' }}> {
{tableMeta.rowData[6] != null && check > -1 ? name: "Role",
<a data-tip={tableMeta.rowData[6][check].message} data-for="email"> options: {
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> customBodyRender: (val, tableMeta) => {
</a> : let check = null
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('role'))
if (check > -1) {
this.setState({ buttonError: true })
}
} }
<ReactTooltip border={true} id="email" place="bottom" type="light" effect="solid" /> return (
</div > <div style={{ display: 'flex' }}>
); {tableMeta.rowData[6] != null && check > -1 ?
} <a data-tip={tableMeta.rowData[6][check].message} data-for="role">
} <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}, </a> :
{ <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
name: "Role", }
options: { <ReactTooltip border={true} id="role" place="bottom" type="light" effect="solid" />
customBodyRender: (val, tableMeta) => { </div >
let check = null );
if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('role'))
if (check > -1) {
this.setState({ buttonError: true })
} }
} }
return ( },
<div style={{ display: 'flex' }}> {
{tableMeta.rowData[6] != null && check > -1 ? name: "Berlaku Mulai",
<a data-tip={tableMeta.rowData[6][check].message} data-for="role"> options: {
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> customBodyRender: (val, tableMeta) => {
</a> : let check = null
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('start_date'))
if (check > -1) {
this.setState({ buttonError: true })
}
} }
<ReactTooltip border={true} id="role" place="bottom" type="light" effect="solid" /> return (
</div > <div style={{ display: 'flex' }}>
); {tableMeta.rowData[6] != null && check > -1 ?
} <a data-tip={tableMeta.rowData[6][check].message} data-for="startdate">
} <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}, </a> :
{ <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
name: "Berlaku Mulai", }
options: { <ReactTooltip border={true} id="startdate" place="bottom" type="light" effect="solid" />
customBodyRender: (val, tableMeta) => { </div >
let check = null );
if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('start_date'))
if (check > -1) {
this.setState({ buttonError: true })
} }
} }
return ( },
<div style={{ display: 'flex' }}> {
{tableMeta.rowData[6] != null && check > -1 ? name: "Berakhir Hingga",
<a data-tip={tableMeta.rowData[6][check].message} data-for="startdate"> options: {
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> customBodyRender: (val, tableMeta) => {
</a> : let check = null
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('end_date'))
if (check > -1) {
this.setState({ buttonError: true })
}
} }
<ReactTooltip border={true} id="startdate" place="bottom" type="light" effect="solid" /> return (
</div > <div style={{ display: 'flex' }}>
); {tableMeta.rowData[6] != null && check > -1 ?
} <a data-tip={tableMeta.rowData[6][check].message} data-for="enddate">
} <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}, </a> :
{ <span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
name: "Berakhir Hingga", }
options: { <ReactTooltip border={true} id="enddate" place="bottom" type="light" effect="solid" />
customBodyRender: (val, tableMeta) => { </div >
let check = null );
if (tableMeta.rowData[6] != null) {
check = tableMeta.rowData[6].findIndex((val) => val.field.includes('end_date'))
if (check > -1) {
this.setState({ buttonError: true })
} }
} }
return ( },
<div style={{ display: 'flex' }}> {
{tableMeta.rowData[6] != null && check > -1 ? name: "",
<a data-tip={tableMeta.rowData[6][check].message} data-for="enddate"> options: {
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span> display: false
</a> : }
<span style={{ color: check != null && check > -1 ? "red" : 'black' }}>{val}</span>
}
<ReactTooltip border={true} id="enddate" place="bottom" type="light" effect="solid" />
</div >
);
} }
} ]
},
{ this.setState({
name: "", dataLoaded: true,
options: { cols: columns,
display: false rows: dataRow
} });
} }
]
this.setState({
dataLoaded: true,
cols: columns,
rows: dataRow
});
} }
}) })
} }
...@@ -261,7 +263,7 @@ export default class UserRole extends Component { ...@@ -261,7 +263,7 @@ export default class UserRole extends Component {
let url = window.URL.createObjectURL(res); let url = window.URL.createObjectURL(res);
let a = document.createElement('a'); let a = document.createElement('a');
a.href = url; a.href = url;
a.download = 'Data User.xlsx'; a.download = 'User.xlsx';
a.click(); a.click();
} }
} }
......
...@@ -70,37 +70,56 @@ export default class AddUser extends Component { ...@@ -70,37 +70,56 @@ export default class AddUser extends Component {
componentDidMount() { componentDidMount() {
this.getRole() this.getRole()
this.getPerusahaan() this.getPerusahaan()
if (this.props.type === 'edit') {
//
} else {
let date = format(new Date, 'yyyy-MM-dd')
console.log(date);
this.setState({
startDate: date,
endDate: date
})
}
} }
handleChange(e, type) { handleChange(e, type) {
let data = this.state let data = this.state
let isDate = type !== '' ? true : false let isDate = type !== '' ? true : false
if (isDate && type === 'start_date') { if (isDate && type === 'start_date') {
this.setState({ this.setState({ ...data, startDate: format(e, 'yyyy-MM-dd'), endDate: null,
...data, startDate: format(e, 'yyyy-MM-dd'), endDate: null, errorFullname: false,
errorEmail: false,
errorRoleName: false, errorRoleName: false,
errorStartDate: false, errorStartDate: false,
errorEndDate: false, errorEndDate: false,
msgErrorFN: '',
msgErrorEM: '',
msgErrorRN: '', msgErrorRN: '',
msgErrorSD: '', msgErrorSD: '',
msgErrorED: '', msgErrorED: '',
}) })
} else if (isDate && type === 'end_date') { } else if (isDate && type === 'end_date') {
this.setState({ this.setState({ ...data, endDate: format(e, 'yyyy-MM-dd') ,
...data, endDate: format(e, 'yyyy-MM-dd'), errorFullname: false,
errorEmail: false,
errorRoleName: false, errorRoleName: false,
errorStartDate: false, errorStartDate: false,
errorEndDate: false, errorEndDate: false,
msgErrorFN: '',
msgErrorEM: '',
msgErrorRN: '', msgErrorRN: '',
msgErrorSD: '', msgErrorSD: '',
msgErrorED: '', msgErrorED: '',
}) })
} else { } else {
this.setState({ this.setState({ ...data, [e.target.name]: e.target.value,
...data, [e.target.name]: e.target.value, errorFullname: false,
errorEmail: false,
errorRoleName: false, errorRoleName: false,
errorStartDate: false, errorStartDate: false,
errorEndDate: false, errorEndDate: false,
msgErrorFN: '',
msgErrorEM: '',
msgErrorRN: '', msgErrorRN: '',
msgErrorSD: '', msgErrorSD: '',
msgErrorED: '', msgErrorED: '',
...@@ -108,8 +127,33 @@ export default class AddUser extends Component { ...@@ -108,8 +127,33 @@ export default class AddUser extends Component {
} }
} }
isEmail(email) {
const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(String(email).toLowerCase());
}
validasi() { validasi() {
var isEmail = this.isEmail(this.state.email)
if (R.isEmpty(this.state.fullname)) {
this.setState({ errorFullname: true, msgErrorFN: 'Nama Lengkap tidak boleh kosong' })
} else if (R.isEmpty(this.state.email)) {
this.setState({ errorEmail: true, msgErrorEM: 'Email tidak boleh kosong' })
} else if (!isEmail) {
this.setState({ errorEmail: true, msgErrorEM: 'Format email tidak sesuai!' })
} else if (R.isNil(this.state.role)) {
this.setState({ errorRoleName: true, msgErrorRN: 'Role Name tidak boleh kosong' })
} 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 if (this.state.privileges.length < 1) {
// alert('Hak Akses belum di pilih !!')
// }
else {
this.createUser() this.createUser()
}
} }
createUser() { createUser() {
...@@ -316,6 +360,19 @@ export default class AddUser extends Component { ...@@ -316,6 +360,19 @@ export default class AddUser extends Component {
variant="filled" variant="filled"
value={'-'} value={'-'}
onChange={(e) => null} onChange={(e) => null}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085',
}
}}
> >
{/* {periode.map((option) => ( {/* {periode.map((option) => (
<MenuItem key={option.value} value={option.value}> <MenuItem key={option.value} value={option.value}>
...@@ -329,12 +386,27 @@ export default class AddUser extends Component { ...@@ -329,12 +386,27 @@ export default class AddUser extends Component {
<div className="column-2"> <div className="column-2">
<div className=""> <div className="">
<TextField <TextField
style={{ width: '100%', marginTop: 7 }} style={{ width: '100%' , marginTop: 7}}
id="fullname" id="fullname"
name="fullname" name="fullname"
label="Nama Lengkap" label="Nama Lengkap"
value={this.state.fullname} value={this.state.fullname}
onChange={(e) => this.handleChange(e, '')} error={this.state.errorFullname}
helperText={this.state.msgErrorFN}
onChange={(e) => this.handleChange(e, '')}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085',
}
}}
// defaultValue="Default Value" // defaultValue="Default Value"
// helperText="Some important text" // helperText="Some important text"
/> />
...@@ -346,12 +418,27 @@ export default class AddUser extends Component { ...@@ -346,12 +418,27 @@ export default class AddUser extends Component {
<div className="column-1"> <div className="column-1">
<div className="margin-bottom-20px"> <div className="margin-bottom-20px">
<TextField <TextField
style={{ width: '100%', marginTop: 7 }} style={{ width: '100%' , marginTop: 7}}
id="email" id="email"
name="email" name="email"
label="Email" label="Email"
value={this.state.email} value={this.state.email}
onChange={(e) => this.handleChange(e, '')} error={this.state.errorEmail}
helperText={this.state.msgErrorEM}
onChange={(e) => this.handleChange(e, '')}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085',
}
}}
// defaultValue="Default Value" // defaultValue="Default Value"
// helperText="Some important text" // helperText="Some important text"
/> />
...@@ -365,7 +452,24 @@ export default class AddUser extends Component { ...@@ -365,7 +452,24 @@ export default class AddUser extends Component {
id="role" id="role"
onChange={(event, newInputValue) => this.setState({ role: newInputValue })} onChange={(event, newInputValue) => this.setState({ role: newInputValue })}
debug debug
renderInput={(params) => <TextField {...params} label="Role" margin="normal" style={{ marginTop: 7 }} />} renderInput={(params) =>
<TextField
{...params}
label="Role"
margin="normal"
style={{marginTop: 7}}
onChange={(e) => this.handleChange(e, '')}
error={this.state.errorRoleName}
helperText={this.state.msgErrorRN}
InputLabelProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
value={this.state.role} value={this.state.role}
/> />
</div> </div>
...@@ -387,6 +491,19 @@ export default class AddUser extends Component { ...@@ -387,6 +491,19 @@ export default class AddUser extends Component {
KeyboardButtonProps={{ KeyboardButtonProps={{
'aria-label': 'change date', 'aria-label': 'change date',
}} }}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
style={{ padding: 0, margin: 0, width: '100%' }} style={{ padding: 0, margin: 0, width: '100%' }}
/> />
...@@ -408,6 +525,19 @@ export default class AddUser extends Component { ...@@ -408,6 +525,19 @@ export default class AddUser extends Component {
KeyboardButtonProps={{ KeyboardButtonProps={{
'aria-label': 'change date', 'aria-label': 'change date',
}} }}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
style={{ padding: 0, margin: 0, width: '100%' }} style={{ padding: 0, margin: 0, width: '100%' }}
/> />
...@@ -426,6 +556,19 @@ export default class AddUser extends Component { ...@@ -426,6 +556,19 @@ export default class AddUser extends Component {
// id="outlined-read-only-input" // id="outlined-read-only-input"
variant="filled" variant="filled"
value={'Aktif'} value={'Aktif'}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
> >
{/* {periode.map((option) => ( {/* {periode.map((option) => (
<MenuItem key={option.value} value={option.value}> <MenuItem key={option.value} value={option.value}>
...@@ -447,6 +590,19 @@ export default class AddUser extends Component { ...@@ -447,6 +590,19 @@ export default class AddUser extends Component {
// id="outlined-read-only-input" // id="outlined-read-only-input"
variant="filled" variant="filled"
value={'T'} value={'T'}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
> >
{/* {periode.map((option) => ( {/* {periode.map((option) => (
<MenuItem key={option.value} value={option.value}> <MenuItem key={option.value} value={option.value}>
......
...@@ -126,12 +126,22 @@ export default class EditUser extends Component { ...@@ -126,12 +126,22 @@ export default class EditUser extends Component {
}) })
} }
isEmail(email) {
const re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
return re.test(String(email).toLowerCase());
}
validasi() { validasi() {
var isEmail = this.isEmail(this.state.tempData.email)
// console.log(this.state.tempData)
if (R.isEmpty(this.state.tempData.fullname)) { if (R.isEmpty(this.state.tempData.fullname)) {
this.setState({ errorFullname: true, msgErrorFN: 'Nama Lengkap tidak boleh kosong' }) this.setState({ errorFullname: true, msgErrorFN: 'Nama Lengkap tidak boleh kosong' })
} else if (R.isEmpty(this.state.tempData.email)) { } else if (R.isEmpty(this.state.tempData.email)) {
this.setState({ errorEmail: true, msgErrorEM: 'Email tidak boleh kosong' }) this.setState({ errorEmail: true, msgErrorEM: 'Email tidak boleh kosong' })
} else if (R.isEmpty(this.state.tempData.role_name)) { } else if (!isEmail) {
this.setState({ errorEmail: true, msgErrorEM: 'Format email tidak sesuai!' })
} else if (R.isNil(this.state.role)) {
this.setState({ errorRoleName: true, msgErrorRN: 'Role Name tidak boleh kosong' }) this.setState({ errorRoleName: true, msgErrorRN: 'Role Name tidak boleh kosong' })
} else if (R.isNil(this.state.tempData.start_date)) { } else if (R.isNil(this.state.tempData.start_date)) {
this.setState({ errorStartDate: true, msgErrorSD: 'Start Date tidak boleh kosong' }) this.setState({ errorStartDate: true, msgErrorSD: 'Start Date tidak boleh kosong' })
...@@ -349,6 +359,19 @@ export default class EditUser extends Component { ...@@ -349,6 +359,19 @@ export default class EditUser extends Component {
variant="filled" variant="filled"
value={this.state.tempData === null ? '' : this.state.tempData.user_id} value={this.state.tempData === null ? '' : this.state.tempData.user_id}
onChange={(e) => null} onChange={(e) => null}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
> >
{/* {periode.map((option) => ( {/* {periode.map((option) => (
<MenuItem key={option.value} value={option.value}> <MenuItem key={option.value} value={option.value}>
...@@ -371,6 +394,19 @@ export default class EditUser extends Component { ...@@ -371,6 +394,19 @@ export default class EditUser extends Component {
// defaultValue="Default Value" // defaultValue="Default Value"
error={this.state.errorFullname} error={this.state.errorFullname}
helperText={this.state.msgErrorFN} helperText={this.state.msgErrorFN}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
/> />
</div> </div>
</div> </div>
...@@ -388,6 +424,19 @@ export default class EditUser extends Component { ...@@ -388,6 +424,19 @@ export default class EditUser extends Component {
onChange={(e) => this.handleChange(e, '')} onChange={(e) => this.handleChange(e, '')}
error={this.state.errorEmail} error={this.state.errorEmail}
helperText={this.state.msgErrorEM} helperText={this.state.msgErrorEM}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
/> />
</div> </div>
</div> </div>
...@@ -400,7 +449,23 @@ export default class EditUser extends Component { ...@@ -400,7 +449,23 @@ export default class EditUser extends Component {
onChange={(event, newInputValue) => this.setState({ role: newInputValue })} onChange={(event, newInputValue) => this.setState({ role: newInputValue })}
debug debug
renderInput={(params) => <TextField {...params} label="Role" margin="normal" style={{ marginTop: 7 }} />} renderInput={(params) => <TextField
{...params}
label="Role"
margin="normal"
style={{ marginTop: 7 }}
onChange={(e) => this.handleChange(e, '')}
error={this.state.errorRoleName}
helperText={this.state.msgErrorRN}
InputLabelProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085'
}
}}
InputProps={{ ...params.InputProps, style: { fontSize: 11, fontFamily: 'Nunito Sans, sans-serif' } }}
/>}
value={this.state.role} value={this.state.role}
/> />
</div> </div>
...@@ -422,6 +487,19 @@ export default class EditUser extends Component { ...@@ -422,6 +487,19 @@ export default class EditUser extends Component {
KeyboardButtonProps={{ KeyboardButtonProps={{
'aria-label': 'change date', 'aria-label': 'change date',
}} }}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
style={{ padding: 0, margin: 0, width: '100%' }} style={{ padding: 0, margin: 0, width: '100%' }}
/> />
</div> </div>
...@@ -442,7 +520,19 @@ export default class EditUser extends Component { ...@@ -442,7 +520,19 @@ export default class EditUser extends Component {
KeyboardButtonProps={{ KeyboardButtonProps={{
'aria-label': 'change date', 'aria-label': 'change date',
}} }}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
style={{ padding: 0, margin: 0, width: '100%' }} style={{ padding: 0, margin: 0, width: '100%' }}
/> />
</div> </div>
...@@ -460,6 +550,19 @@ export default class EditUser extends Component { ...@@ -460,6 +550,19 @@ export default class EditUser extends Component {
// id="outlined-read-only-input" // id="outlined-read-only-input"
variant="filled" variant="filled"
value={this.state.tempData === null ? '' : this.state.tempData.status} value={this.state.tempData === null ? '' : this.state.tempData.status}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
> >
{/* {periode.map((option) => ( {/* {periode.map((option) => (
<MenuItem key={option.value} value={option.value}> <MenuItem key={option.value} value={option.value}>
...@@ -481,6 +584,19 @@ export default class EditUser extends Component { ...@@ -481,6 +584,19 @@ export default class EditUser extends Component {
// id="outlined-read-only-input" // id="outlined-read-only-input"
variant="filled" variant="filled"
value={this.state.tempData === null ? '' : this.state.tempData.is_expired} value={this.state.tempData === null ? '' : this.state.tempData.is_expired}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
> >
{/* {periode.map((option) => ( {/* {periode.map((option) => (
<MenuItem key={option.value} value={option.value}> <MenuItem key={option.value} value={option.value}>
......
...@@ -52,6 +52,16 @@ export default class AddRole extends Component { ...@@ -52,6 +52,16 @@ export default class AddRole extends Component {
componentDidMount() { componentDidMount() {
this.getMenu() this.getMenu()
if (this.props.type === 'edit') {
//
} else {
let date = format(new Date, 'yyyy-MM-dd')
console.log(date);
this.setState({
startDate: date,
endDate: date
})
}
} }
handleChange(e, type) { handleChange(e, type) {
...@@ -266,6 +276,19 @@ export default class AddRole extends Component { ...@@ -266,6 +276,19 @@ export default class AddRole extends Component {
variant="filled" variant="filled"
value={'-'} value={'-'}
onChange={(e) => null} onChange={(e) => null}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085',
}
}}
> >
{/* {periode.map((option) => ( {/* {periode.map((option) => (
<MenuItem key={option.value} value={option.value}> <MenuItem key={option.value} value={option.value}>
...@@ -287,6 +310,19 @@ export default class AddRole extends Component { ...@@ -287,6 +310,19 @@ export default class AddRole extends Component {
error={this.state.errorRoleName} error={this.state.errorRoleName}
helperText={this.state.msgErrorRN} helperText={this.state.msgErrorRN}
onChange={(e) => this.handleChange(e, '')} onChange={(e) => this.handleChange(e, '')}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
color: '#7e8085',
}
}}
// defaultValue="Default Value" // defaultValue="Default Value"
// helperText="Some important text" // helperText="Some important text"
/> />
...@@ -309,6 +345,19 @@ export default class AddRole extends Component { ...@@ -309,6 +345,19 @@ export default class AddRole extends Component {
KeyboardButtonProps={{ KeyboardButtonProps={{
'aria-label': 'change date', 'aria-label': 'change date',
}} }}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
style={{ padding: 0, margin: 0, width: '100%' }} style={{ padding: 0, margin: 0, width: '100%' }}
/> />
...@@ -330,6 +379,19 @@ export default class AddRole extends Component { ...@@ -330,6 +379,19 @@ export default class AddRole extends Component {
KeyboardButtonProps={{ KeyboardButtonProps={{
'aria-label': 'change date', 'aria-label': 'change date',
}} }}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
style={{ padding: 0, margin: 0, width: '100%' }} style={{ padding: 0, margin: 0, width: '100%' }}
/> />
...@@ -348,6 +410,20 @@ export default class AddRole extends Component { ...@@ -348,6 +410,20 @@ export default class AddRole extends Component {
// id="outlined-read-only-input" // id="outlined-read-only-input"
variant="filled" variant="filled"
value={'Aktif'} value={'Aktif'}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
> >
{/* {periode.map((option) => ( {/* {periode.map((option) => (
<MenuItem key={option.value} value={option.value}> <MenuItem key={option.value} value={option.value}>
......
...@@ -274,6 +274,19 @@ export default class EditRole extends Component { ...@@ -274,6 +274,19 @@ export default class EditRole extends Component {
variant="filled" variant="filled"
value={this.state.tempData === null ? '' : this.state.tempData.role_id} value={this.state.tempData === null ? '' : this.state.tempData.role_id}
onChange={(e) => null} onChange={(e) => null}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
> >
{/* {periode.map((option) => ( {/* {periode.map((option) => (
<MenuItem key={option.value} value={option.value}> <MenuItem key={option.value} value={option.value}>
...@@ -295,6 +308,19 @@ export default class EditRole extends Component { ...@@ -295,6 +308,19 @@ export default class EditRole extends Component {
error={this.state.errorRoleName} error={this.state.errorRoleName}
helperText={this.state.msgErrorRN} helperText={this.state.msgErrorRN}
onChange={(e) => this.handleChange(e, '')} onChange={(e) => this.handleChange(e, '')}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
// defaultValue="Default Value" // defaultValue="Default Value"
// helperText="Some important text" // helperText="Some important text"
/> />
...@@ -317,6 +343,19 @@ export default class EditRole extends Component { ...@@ -317,6 +343,19 @@ export default class EditRole extends Component {
KeyboardButtonProps={{ KeyboardButtonProps={{
'aria-label': 'change date', 'aria-label': 'change date',
}} }}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
style={{ padding: 0, margin: 0, width: '100%' }} style={{ padding: 0, margin: 0, width: '100%' }}
/> />
...@@ -338,6 +377,19 @@ export default class EditRole extends Component { ...@@ -338,6 +377,19 @@ export default class EditRole extends Component {
KeyboardButtonProps={{ KeyboardButtonProps={{
'aria-label': 'change date', 'aria-label': 'change date',
}} }}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
style={{ padding: 0, margin: 0, width: '100%' }} style={{ padding: 0, margin: 0, width: '100%' }}
/> />
...@@ -356,6 +408,19 @@ export default class EditRole extends Component { ...@@ -356,6 +408,19 @@ export default class EditRole extends Component {
// id="outlined-read-only-input" // id="outlined-read-only-input"
variant="filled" variant="filled"
value={this.state.tempData === null ? '' : this.state.tempData.status} value={this.state.tempData === null ? '' : this.state.tempData.status}
inputProps={{
style: {
fontSize: 11,
fontFamily: 'Nunito Sans, sans-serif',
}
}}
InputLabelProps={{
style: {
fontSize: 11,
color: '#7e8085',
fontFamily: 'Nunito Sans, sans-serif',
}
}}
> >
{/* {periode.map((option) => ( {/* {periode.map((option) => (
<MenuItem key={option.value} value={option.value}> <MenuItem key={option.value} value={option.value}>
......
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