Commit a603a761 authored by Riri Novita's avatar Riri Novita

oi apdet

parent 4510c225
...@@ -79,32 +79,11 @@ export default class OperatingIndicatorMR extends Component { ...@@ -79,32 +79,11 @@ export default class OperatingIndicatorMR extends Component {
} }
handleViewOnly() { handleViewOnly() {
let checkApprover = false let checkCreate = this.props.permission.create
let checkLastStatus = false let checkEdit = this.props.permission.edit
let checkStatus = false let checkIsSubmit = this.props.isSubmit
if (this.props.isApprover) { this.setState({viewOnly: checkCreate && checkEdit && checkIsSubmit})
checkApprover = true
} else {
checkApprover = false
}
if (this.props.lastStatus == 'SUBMIT' || this.props.lastStatus == 'REVISION') {
checkLastStatus = true
} else {
checkLastStatus = false
}
// else if (this.props.prevRevision) {
// viewOnly = false
// }
if (this.props.status === 'revision' || this.props.status === 'not-yet' || this.props.status === 'draft' || this.props.status === 'submitted') {
checkStatus = true
} else {
checkStatus = false
}
this.setState({viewOnly: !checkApprover && checkLastStatus && checkStatus})
} }
handleGetFor(type) { handleGetFor(type) {
...@@ -1503,7 +1482,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1503,7 +1482,7 @@ export default class OperatingIndicatorMR extends Component {
} }
}} }}
onBlur={(event) => { onBlur={(event) => {
handleText(event.target.value, tableMeta, 0) handleText(event.target.value, tableMeta, 1)
}} }}
/> />
: :
...@@ -1532,7 +1511,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1532,7 +1511,7 @@ export default class OperatingIndicatorMR extends Component {
} }
}} }}
onBlur={(event) => { onBlur={(event) => {
handleText(event.target.value, tableMeta, 0) handleText(event.target.value, tableMeta, 1)
}} }}
/> />
</LightTooltipError> </LightTooltipError>
...@@ -1552,7 +1531,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1552,7 +1531,7 @@ export default class OperatingIndicatorMR extends Component {
} }
}} }}
onBlur={(event) => { onBlur={(event) => {
handleText(event.target.value, tableMeta, 0) handleText(event.target.value, tableMeta, 1)
}} }}
/> />
} }
...@@ -1675,13 +1654,16 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1675,13 +1654,16 @@ export default class OperatingIndicatorMR extends Component {
<div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}> <div style={{ marginTop: 20, width: this.props.width - (this.props.open === true ? 400 : 150) }}>
{this.state.loading && loadingComponent} {this.state.loading && loadingComponent}
{!this.state.loading &&
<MuiThemeProvider theme={getMuiTheme()}> <MuiThemeProvider theme={getMuiTheme()}>
<MUIDataTable <MUIDataTable
data={dataTable2} data={dataTable2}
columns={columns} columns={columns}
options={options} options={options}
/> />
</MuiThemeProvider> </MuiThemeProvider>
}
</div> </div>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : {this.state.updateBy}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 20 }}>Last Updated by : {this.state.updateBy}</Typography>
<Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10 }}>Notes : {this.state.notesUpdate}</Typography> <Typography style={{ fontSize: '11px', color: '#4b4b4b', marginTop: 10 }}>Notes : {this.state.notesUpdate}</Typography>
......
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