Commit ae8e3a9f 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 2217adfb 7a8f4f68
...@@ -131,7 +131,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') => ...@@ -131,7 +131,7 @@ const create = (baseURL = 'https://tia.eksad.com/tia-reporting-dev/public/') =>
//Report Items //Report Items
const getReportItems = () => api.get('item_report/get_all_item_report') const getReportItems = () => api.get('item_report/get_all_item_report')
const getInputType = () => api.get('type_report/get_all_type_report') const getInputType = () => api.get('type_item_report/get_all_type_item_report')
const getReportType = () => api.get('report/get_all_report') const getReportType = () => api.get('report/get_all_report')
const getReportTypeBody = (body) => api.post('report/get_all_report', body) const getReportTypeBody = (body) => api.post('report/get_all_report', body)
const getDetailReportItems = (userId) => api.get(`item_report/get_item_report_by_id/${userId}`) const getDetailReportItems = (userId) => api.get(`item_report/get_item_report_by_id/${userId}`)
......
...@@ -35,7 +35,7 @@ export default class BudgetTahunan extends Component { ...@@ -35,7 +35,7 @@ export default class BudgetTahunan extends Component {
let payload = { let payload = {
"company_id": this.state.company.company_id, "company_id": this.state.company.company_id,
"periode": this.state.periode, "periode": this.state.periode,
"revisi": this.state.periode "report_type": "Master Budget",
} }
api.create().getReportTypeBody(payload).then(response => { api.create().getReportTypeBody(payload).then(response => {
if (response.data) { if (response.data) {
......
...@@ -58,6 +58,9 @@ export default class BalanceSheet extends Component { ...@@ -58,6 +58,9 @@ export default class BalanceSheet extends Component {
response.data.data.map((item, index) => { response.data.data.map((item, index) => {
if (item.children.length > 0) { if (item.children.length > 0) {
dataTable.push([ dataTable.push([
item.type_report_id,
item.id,
item.parent,
item.level, item.level,
item.description item.description
]) ])
...@@ -65,23 +68,35 @@ export default class BalanceSheet extends Component { ...@@ -65,23 +68,35 @@ export default class BalanceSheet extends Component {
if (i.children) { if (i.children) {
if (i.children.length > 0) { if (i.children.length > 0) {
dataTable.push([ dataTable.push([
i.type_report_id,
i.id,
i.parent,
i.level, i.level,
i.description i.description
]) ])
i.children.map(val => { i.children.map(val => {
dataTable.push([ dataTable.push([
val.type_report_id,
val.id,
val.parent,
val.level, val.level,
val.description val.description
]) ])
}) })
} else { } else {
dataTable.push([ dataTable.push([
i.type_report_id,
i.id,
i.parent,
i.level, i.level,
i.description i.description
]) ])
} }
} else { } else {
dataTable.push([ dataTable.push([
i.type_report_id,
i.id,
i.parent,
i.level, i.level,
i.description i.description
]) ])
...@@ -89,6 +104,9 @@ export default class BalanceSheet extends Component { ...@@ -89,6 +104,9 @@ export default class BalanceSheet extends Component {
}) })
} else { } else {
dataTable.push([ dataTable.push([
item.type_report_id,
item.id,
item.parent,
item.level, item.level,
item.description item.description
]) ])
...@@ -101,9 +119,24 @@ export default class BalanceSheet extends Component { ...@@ -101,9 +119,24 @@ export default class BalanceSheet extends Component {
}) })
} }
handleValue(data) {
let total = 0
this.state.dataTable.map((item,index) => {
if (data[1] == item[2]) {
total = item[6] == undefined? (total + 0) : (total + item[6])
}
// console.log(data[2])
})
return total
}
handleChange(value, tableMeta) { handleChange(value, tableMeta) {
let data = this.state.dataTable let data = this.state.dataTable
let a = data[tableMeta.rowIndex][tableMeta.columnIndex] = value let indexParent = data.findIndex((val) => val[1] == data[tableMeta.rowIndex][2])
let a = data[tableMeta.rowIndex][tableMeta.columnIndex] = Number(value)
let jagain = data[indexParent][tableMeta.columnIndex]
a = data[indexParent][tableMeta.columnIndex] = jagain == undefined? (0 + Number(value)) : (jagain + Number(value))
this.setState({ this.setState({
data: a data: a
}, () => console.log(this.state.dataTable)) }, () => console.log(this.state.dataTable))
...@@ -117,7 +150,22 @@ export default class BalanceSheet extends Component { ...@@ -117,7 +150,22 @@ export default class BalanceSheet extends Component {
options: { options: {
display: false display: false
} }
}, { },{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},{
name: "",
options: {
display: false
}
},{
name: "Account", name: "Account",
options: { options: {
customHeadRender: (columnMeta) => ( customHeadRender: (columnMeta) => (
...@@ -129,10 +177,10 @@ export default class BalanceSheet extends Component { ...@@ -129,10 +177,10 @@ export default class BalanceSheet extends Component {
customBodyRender: (val, tableMeta) => { customBodyRender: (val, tableMeta) => {
return ( return (
<div style={{ width: 388 }}> <div style={{ width: 388 }}>
{tableMeta.rowData[0] == 0 ? {tableMeta.rowData[3] == 0 ?
<span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(val).toUpperCase()}</span> <span style={{ fontSize: 12, fontWeight: 'bold' }}>{String(val).toUpperCase()}</span>
: :
tableMeta.rowData[0] === 1? tableMeta.rowData[3] === 1?
<span style={{ fontSize: 12, marginLeft: 20 }}>{val}</span> : <span style={{ fontSize: 12, marginLeft: 20 }}>{val}</span> :
<span style={{ fontSize: 12, marginLeft: 40 }}>{val}</span> <span style={{ fontSize: 12, marginLeft: 40 }}>{val}</span>
} }
...@@ -168,7 +216,7 @@ export default class BalanceSheet extends Component { ...@@ -168,7 +216,7 @@ export default class BalanceSheet extends Component {
customBodyRender: (value, tableMeta, updateValue) => { customBodyRender: (value, tableMeta, updateValue) => {
return ( return (
<div style={{ textAlign: 'right' }}> <div style={{ textAlign: 'right' }}>
{tableMeta.rowIndex === 3 || tableMeta.rowIndex === 4 || tableMeta.rowIndex === 9 ? {tableMeta.rowData[0] !== 2 ?
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<FormControlLabel <FormControlLabel
style={{ margin: 0 }} style={{ margin: 0 }}
...@@ -194,6 +242,7 @@ export default class BalanceSheet extends Component { ...@@ -194,6 +242,7 @@ export default class BalanceSheet extends Component {
placeholder="" placeholder=""
value={value} value={value}
onChange={event => { onChange={event => {
// console.log(event.target)
updateValue(event.target.value) updateValue(event.target.value)
this.handleChange(event.target.value, tableMeta) this.handleChange(event.target.value, tableMeta)
}} }}
...@@ -201,7 +250,7 @@ export default class BalanceSheet extends Component { ...@@ -201,7 +250,7 @@ export default class BalanceSheet extends Component {
} }
/> />
</div> : </div> :
<span style={{ fontSize: 12, textAlign: 'right' }}>{value === "" ? "-" : value}</span> <span style={{ fontSize: 12, textAlign: 'right' }}>{this.handleValue(tableMeta.rowData)}</span>
} }
</div> </div>
) )
......
...@@ -485,7 +485,7 @@ export default class ReportItems extends Component { ...@@ -485,7 +485,7 @@ export default class ReportItems extends Component {
if (response.data.status == 'success') { if (response.data.status == 'success') {
let data = response.data.data let data = response.data.data
let listData = data.sort((a, b) => a.item_report_id - b.item_report_id).map((item, index) => { let listData = data.sort((a, b) => a.item_report_id - b.item_report_id).map((item, index) => {
return [index, item.item_report_id, item.report_name, item.company_name, item.order, item.description, item.parent, item.uom, item.weight, item.type_report_name, item.status] return [index, item.item_report_id, item.report_name, item.company_name, item.order, item.description, item.parent, item.uom, item.weight, item.type_item_report_name, item.status]
}) })
this.setState({ dataTable: listData, listData: response.data.data }) this.setState({ dataTable: listData, listData: response.data.data })
} else { } else {
...@@ -521,7 +521,7 @@ export default class ReportItems extends Component { ...@@ -521,7 +521,7 @@ export default class ReportItems extends Component {
if (response.data.status == 'success') { if (response.data.status == 'success') {
let data = response.data.data let data = response.data.data
let listData = data.map((item, index) => { let listData = data.map((item, index) => {
return [index, item.item_report_id, item.report_name, item.company_name, item.order, item.description, item.parent, item.uom, item.weight, item.type_report_name, item.status] return [index, item.item_report_id, item.report_name, item.company_name, item.order, item.description, item.parent, item.uom, item.weight, item.type_item_report_name, item.status]
}) })
this.setState({ dataTable: listData, listData: response.data.data }) this.setState({ dataTable: listData, listData: response.data.data })
} else { } else {
......
...@@ -187,7 +187,7 @@ export default class CreateReportItems extends Component { ...@@ -187,7 +187,7 @@ export default class CreateReportItems extends Component {
"description": this.state.description, "description": this.state.description,
"orders": this.state.order, "orders": this.state.order,
"parent": this.state.parent === null ? null : this.state.parent.item_report_id, "parent": this.state.parent === null ? null : this.state.parent.item_report_id,
"type_report_id": this.state.InputType.type_report_id, "type_report_id": this.state.InputType.type_item_report_id,
"formula": this.state.formula, "formula": this.state.formula,
"uom": this.state.uom, "uom": this.state.uom,
"weight": this.state.weight, "weight": this.state.weight,
...@@ -209,13 +209,13 @@ export default class CreateReportItems extends Component { ...@@ -209,13 +209,13 @@ export default class CreateReportItems extends Component {
let data = response.data.data let data = response.data.data
let inputData = data.map((item) => { let inputData = data.map((item) => {
return { return {
type_report_id: item.type_report_id, type_item_report_id: item.type_item_report_id,
type_report_name: item.type_report_name type_item_report_name: item.type_item_report_name
} }
}) })
let defaultProps = { let defaultProps = {
options: inputData, options: inputData,
getOptionLabel: (option) => titleCase(option.type_report_name), getOptionLabel: (option) => titleCase(option.type_item_report_name),
}; };
this.setState({ listInputType: defaultProps, inputData: response.data.data }) this.setState({ listInputType: defaultProps, inputData: response.data.data })
} else { } else {
...@@ -598,7 +598,7 @@ export default class CreateReportItems extends Component { ...@@ -598,7 +598,7 @@ export default class CreateReportItems extends Component {
id="inputType" id="inputType"
onChange={(event, newInputValue) => this.setState({ InputType: newInputValue }, onChange={(event, newInputValue) => this.setState({ InputType: newInputValue },
() => newInputValue === null ? this.setState({ disabledFormula: true, disabledCondt: true, disabledValue: true, formula: '', condition: '', realVal: '' }) () => newInputValue === null ? this.setState({ disabledFormula: true, disabledCondt: true, disabledValue: true, formula: '', condition: '', realVal: '' })
: newInputValue.type_report_name === 'Formula' ? : newInputValue.type_item_report_name === 'Formula' ?
this.setState({ this.setState({
disabledFormula: false, disabledFormula: false,
disabledCondt: true, disabledCondt: true,
...@@ -607,7 +607,7 @@ export default class CreateReportItems extends Component { ...@@ -607,7 +607,7 @@ export default class CreateReportItems extends Component {
condition: '', condition: '',
realVal: '' realVal: ''
}, () => this.clearMessage()) }, () => this.clearMessage())
: newInputValue.type_report_name === 'Validation' ? : newInputValue.type_item_report_name === 'Validation' ?
this.setState({ this.setState({
disabledFormula: false, disabledFormula: false,
disabledCondt: false, disabledCondt: false,
......
...@@ -137,11 +137,11 @@ export default class EditReportItems extends Component { ...@@ -137,11 +137,11 @@ export default class EditReportItems extends Component {
this.setState({ errorDesc: true, msgErrorDesc: 'Description is required..' }) this.setState({ errorDesc: true, msgErrorDesc: 'Description is required..' })
} else if (R.isNil(this.state.InputType)) { } else if (R.isNil(this.state.InputType)) {
this.setState({ errorTipeData: true, msgErrorTipeData: 'Data type is required.' }) this.setState({ errorTipeData: true, msgErrorTipeData: 'Data type is required.' })
} else if ((this.state.InputType.type_report_name === 'Formula' && R.isEmpty(this.state.tempData.formula)) || (this.state.InputType.type_report_name === 'Validation' && R.isEmpty(this.state.tempData.formula))) { } else if ((this.state.InputType.type_item_report_name === 'Formula' && R.isEmpty(this.state.tempData.formula)) || (this.state.InputType.type_item_report_name === 'Validation' && R.isEmpty(this.state.tempData.formula))) {
this.setState({ errorFormula: true, msgErrorFormula: 'Formula is required.' }) this.setState({ errorFormula: true, msgErrorFormula: 'Formula is required.' })
} else if (this.state.InputType.type_report_name === 'Validation' && R.isEmpty(this.state.tempData.condition_it_should_be)) { } else if (this.state.InputType.type_item_report_name === 'Validation' && R.isEmpty(this.state.tempData.condition_it_should_be)) {
this.setState({ errorRV: true, msgErrorRV: 'True value is required.' }) this.setState({ errorRV: true, msgErrorRV: 'True value is required.' })
} else if (this.state.InputType.type_report_name === 'Validation' && R.isNil(this.state.tempData.condition_if_wrong)) { } else if (this.state.InputType.type_item_report_name === 'Validation' && R.isNil(this.state.tempData.condition_if_wrong)) {
this.setState({ errorCondition: true, msgErrorCondition: 'False condition is required.' }) this.setState({ errorCondition: true, msgErrorCondition: 'False condition is required.' })
} 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 is required.' }) this.setState({ errorStartDate: true, msgErrorSD: 'Start date is required.' })
...@@ -162,7 +162,7 @@ export default class EditReportItems extends Component { ...@@ -162,7 +162,7 @@ export default class EditReportItems extends Component {
"description": this.state.tempData.description, "description": this.state.tempData.description,
"orders": this.state.tempData.order, "orders": this.state.tempData.order,
"parent": this.state.parent == null ? this.state.tempData.parent : this.state.parent.item_report_id, "parent": this.state.parent == null ? this.state.tempData.parent : this.state.parent.item_report_id,
"type_report_id": this.state.InputType == null ? this.state.tempData.type_report_id : this.state.InputType.type_report_id, "type_report_id": this.state.InputType == null ? this.state.tempData.type_item_report_id : this.state.InputType.type_item_report_id,
"formula": this.state.tempData.formula, "formula": this.state.tempData.formula,
"uom": this.state.tempData.uom, "uom": this.state.tempData.uom,
"weight": this.state.tempData.weight == null ? "" : this.state.tempData.weight, "weight": this.state.tempData.weight == null ? "" : this.state.tempData.weight,
...@@ -204,16 +204,16 @@ export default class EditReportItems extends Component { ...@@ -204,16 +204,16 @@ export default class EditReportItems extends Component {
let data = response.data.data let data = response.data.data
let inputData = data.map((item) => { let inputData = data.map((item) => {
return { return {
type_report_id: item.type_report_id, type_item_report_id: item.type_item_report_id,
type_report_name: item.type_report_name type_item_report_name: item.type_item_report_name
} }
}) })
let defaultProps = { let defaultProps = {
options: inputData, options: inputData,
getOptionLabel: (option) => titleCase(option.type_report_name), getOptionLabel: (option) => titleCase(option.type_item_report_name),
}; };
let index = inputData.findIndex((val) => val.type_report_id === this.state.tempData.type_report_id) let index = inputData.findIndex((val) => val.type_item_report_id === this.state.tempData.type_item_report_id)
this.setState({ listInputType: defaultProps, InputType: index === -1 ? null : inputData[index] }) this.setState({ listInputType: defaultProps, InputType: index === -1 ? null : inputData[index] })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' }) this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning' })
...@@ -613,7 +613,7 @@ export default class EditReportItems extends Component { ...@@ -613,7 +613,7 @@ export default class EditReportItems extends Component {
style={{ width: '100%' }} style={{ width: '100%' }}
id="formula" id="formula"
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_item_report_name === 'Formula' || this.state.InputType.type_item_report_name === 'Validation' ? false : true)}
name="formula" name="formula"
error={this.state.errorFormula} error={this.state.errorFormula}
helperText={this.state.msgErrorFormula} helperText={this.state.msgErrorFormula}
...@@ -646,7 +646,7 @@ export default class EditReportItems extends Component { ...@@ -646,7 +646,7 @@ export default class EditReportItems extends Component {
label="True Value" label="True Value"
error={this.state.errorRV} error={this.state.errorRV}
helperText={this.state.msgErrorRV} helperText={this.state.msgErrorRV}
disabled={this.state.InputType == null ? true : (this.state.InputType.type_report_name === 'Validation' ? false : true)} disabled={this.state.InputType == null ? true : (this.state.InputType.type_item_report_name === 'Validation' ? false : true)}
name="condition_it_should_be" name="condition_it_should_be"
onChange={(e) => this.handleChange(e, '')} onChange={(e) => this.handleChange(e, '')}
value={this.state.tempData === null ? '' : this.state.tempData.condition_it_should_be} value={this.state.tempData === null ? '' : this.state.tempData.condition_it_should_be}
...@@ -671,7 +671,7 @@ export default class EditReportItems extends Component { ...@@ -671,7 +671,7 @@ export default class EditReportItems extends Component {
<Autocomplete <Autocomplete
value={this.state.tempData === null ? "" : this.state.tempData.condition_if_wrong} value={this.state.tempData === null ? "" : this.state.tempData.condition_if_wrong}
id="isWrongCondition" id="isWrongCondition"
disabled={this.state.InputType == null ? true : (this.state.InputType.type_report_name === 'Validation' ? false : true)} disabled={this.state.InputType == null ? true : (this.state.InputType.type_item_report_name === 'Validation' ? false : true)}
onChange={(event, newValue) => { onChange={(event, newValue) => {
this.setState({ tempData: { ...this.state.tempData, condition_if_wrong: newValue } }, () => this.clearMessage()); this.setState({ tempData: { ...this.state.tempData, condition_if_wrong: newValue } }, () => this.clearMessage());
}} }}
......
...@@ -572,7 +572,7 @@ export default class UserRole extends Component { ...@@ -572,7 +572,7 @@ export default class UserRole extends Component {
style={{ marginRight: 20 }} style={{ marginRight: 20 }}
> >
<div style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}> <div style={{ width: 102, height: 30, border: 'solid 1px #354960', borderRadius: 5, alignItems: 'center', display: 'flex', justifyContent: 'center' }}>
<span style={{ color: '#354960', fontSize: 11 }}>Batal</span> <span style={{ color: '#354960', fontSize: 11 }}>Cancel</span>
</div> </div>
</button> </button>
<button <button
...@@ -581,7 +581,7 @@ export default class UserRole extends Component { ...@@ -581,7 +581,7 @@ export default class UserRole extends Component {
style={{}} style={{}}
> >
<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 }}>Save</span>
</div> </div>
</button> </button>
</div> </div>
......
...@@ -158,17 +158,17 @@ export default class AddUser extends Component { ...@@ -158,17 +158,17 @@ export default class AddUser extends Component {
var isEmail = this.isEmail(this.state.email) var isEmail = this.isEmail(this.state.email)
if (R.isEmpty(this.state.fullname)) { if (R.isEmpty(this.state.fullname)) {
this.setState({ errorFullname: true, msgErrorFN: 'Full Name is Required' }) this.setState({ errorFullname: true, msgErrorFN: 'Fullname is required' })
} else if (R.isEmpty(this.state.email)) { } else if (R.isEmpty(this.state.email)) {
this.setState({ errorEmail: true, msgErrorEM: 'Email is Required' }) this.setState({ errorEmail: true, msgErrorEM: 'Email is required' })
} else if (!isEmail) { } else if (!isEmail) {
this.setState({ errorEmail: true, msgErrorEM: 'Email format not recognized!' }) this.setState({ errorEmail: true, msgErrorEM: 'Email format not recognized!' })
} else if (R.isNil(this.state.role)) { } else if (R.isNil(this.state.role)) {
this.setState({ errorRoleName: true, msgErrorRN: 'Role Name is Required' }) this.setState({ errorRoleName: true, msgErrorRN: 'Role name is required' })
} else if (R.isNil(this.state.startDate)) { } else if (R.isNil(this.state.startDate)) {
this.setState({ errorStartDate: true, msgErrorSD: 'Start Date is Required' }) this.setState({ errorStartDate: true, msgErrorSD: 'Start date is required' })
} else if (R.isNil(this.state.endDate)) { } else if (R.isNil(this.state.endDate)) {
this.setState({ errorEndDate: true, msgErrorED: 'End Date is Required' }) this.setState({ errorEndDate: true, msgErrorED: 'End date is required' })
} }
// else if (this.state.privileges.length < 1) { // else if (this.state.privileges.length < 1) {
// alert('Hak Akses belum di pilih !!') // alert('Hak Akses belum di pilih !!')
......
...@@ -705,8 +705,8 @@ export default class EditUser extends Component { ...@@ -705,8 +705,8 @@ export default class EditUser extends Component {
</div> </div>
</div> </div>
<div style={{ flexDirection: 'column', display: 'flex', paddingLeft: 20, paddingRight: 20 }}> <div style={{ flexDirection: 'column', display: 'flex', paddingLeft: 20, paddingRight: 20 }}>
<Typography style={{ fontSize: 12 }}>{`Created by : ${this.state.tempData === null ? '' : this.state.tempData.created}`}</Typography> <Typography style={{ fontSize: 11 }}>{`Created By : ${this.state.tempData === null ? '' : this.state.tempData.created}`}</Typography>
<Typography style={{ fontSize: 12 }}>{`Updated by: ${this.state.tempData === null ? '' : this.state.tempData.updated}`}</Typography> <Typography style={{ fontSize: 11 }}>{`Updated By : ${this.state.tempData === null ? '' : this.state.tempData.updated}`}</Typography>
</div> </div>
<Divider style={{ margin: 20 }} /> <Divider style={{ margin: 20 }} />
<div style={{ paddingLeft: 20, paddingRight: 20 }}> <div style={{ paddingLeft: 20, paddingRight: 20 }}>
......
...@@ -110,11 +110,11 @@ export default class AddRole extends Component { ...@@ -110,11 +110,11 @@ export default class AddRole extends Component {
validasi() { validasi() {
if (R.isEmpty(this.state.roleName)) { if (R.isEmpty(this.state.roleName)) {
this.setState({ errorRoleName: true, msgErrorRN: 'Role Name is Required' }) this.setState({ errorRoleName: true, msgErrorRN: 'Role name is required' })
} else if (R.isNil(this.state.startDate)) { } else if (R.isNil(this.state.startDate)) {
this.setState({ errorStartDate: true, msgErrorSD: 'Start Date is Required' }) this.setState({ errorStartDate: true, msgErrorSD: 'Start date is required' })
} else if (R.isNil(this.state.endDate)) { } else if (R.isNil(this.state.endDate)) {
this.setState({ errorEndDate: true, msgErrorED: 'End Date is Required' }) this.setState({ errorEndDate: true, msgErrorED: 'End date is required' })
} else if (this.state.privileges.length < 1) { } else if (this.state.privileges.length < 1) {
this.setState({ alert: true, messageAlert: 'You must choose the Access Rights!!', tipeAlert: 'warning' }) this.setState({ alert: true, messageAlert: 'You must choose the Access Rights!!', tipeAlert: 'warning' })
} else { } else {
......
...@@ -116,11 +116,11 @@ export default class EditRole extends Component { ...@@ -116,11 +116,11 @@ export default class EditRole extends Component {
validasi() { validasi() {
if (R.isEmpty(this.state.tempData.role_name)) { if (R.isEmpty(this.state.tempData.role_name)) {
this.setState({ errorRoleName: true, msgErrorRN: 'Role Name is Required' }) this.setState({ errorRoleName: true, msgErrorRN: 'Role name is required' })
} 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 is Required' }) this.setState({ errorStartDate: true, msgErrorSD: 'Start date is required' })
} else if (R.isNil(this.state.tempData.end_date)) { } else if (R.isNil(this.state.tempData.end_date)) {
this.setState({ errorEndDate: true, msgErrorED: 'End Date is Required' }) this.setState({ errorEndDate: true, msgErrorED: 'End date is required' })
} else if (this.state.privileges.length < 1) { } else if (this.state.privileges.length < 1) {
this.setState({ alert: true, messageAlert: 'You must choose the Access Rights', tipeAlert: 'warning' }) this.setState({ alert: true, messageAlert: 'You must choose the Access Rights', tipeAlert: 'warning' })
} else { } else {
...@@ -506,8 +506,8 @@ export default class EditRole extends Component { ...@@ -506,8 +506,8 @@ export default class EditRole extends Component {
</div> </div>
</div> </div>
<div style={{ flexDirection: 'column', display: 'flex', paddingLeft: 20, paddingRight: 20 }}> <div style={{ flexDirection: 'column', display: 'flex', paddingLeft: 20, paddingRight: 20 }}>
<Typography style={{ fontSize: 12 }}>{`Created by : ${this.state.tempData === null ? '' : (this.state.tempData.created === null ? '-' : this.state.tempData.created)}`}</Typography> <Typography style={{ fontSize: 11 }}>{`Created By : ${this.state.tempData === null ? '' : (this.state.tempData.created === null ? '-' : this.state.tempData.created)}`}</Typography>
<Typography style={{ fontSize: 12 }}>{`Updated by: ${this.state.tempData === null ? '' : (this.state.tempData.updated === null ? '-' : this.state.tempData.updated)}`}</Typography> <Typography style={{ fontSize: 11 }}>{`Updated By : ${this.state.tempData === null ? '' : (this.state.tempData.updated === null ? '-' : this.state.tempData.updated)}`}</Typography>
</div> </div>
<Divider style={{ margin: 20 }} /> <Divider style={{ margin: 20 }} />
<div style={{ paddingLeft: 20, paddingRight: 20 }}> <div style={{ paddingLeft: 20, paddingRight: 20 }}>
......
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