Commit 7ff858c5 authored by Riri Novita's avatar Riri Novita

Merge branch 'riri' into 'master'

tooltip button

See merge request !840
parents fc31b29f 18f19d7f
...@@ -71,7 +71,6 @@ export default class OperatingIndicatorMR extends Component { ...@@ -71,7 +71,6 @@ export default class OperatingIndicatorMR extends Component {
// this.getItemHierarki() // this.getItemHierarki()
this.getSettingControl() this.getSettingControl()
this.getLatestUpdate() this.getLatestUpdate()
// console.log(this.props.permission.create);
} }
getLatestUpdate() { getLatestUpdate() {
...@@ -121,7 +120,7 @@ export default class OperatingIndicatorMR extends Component { ...@@ -121,7 +120,7 @@ export default class OperatingIndicatorMR extends Component {
minValue: response.data.data[0] ? Number(response.data.data[0].min_value) : -5, minValue: response.data.data[0] ? Number(response.data.data[0].min_value) : -5,
maxValue: response.data.data[0] ? Number(response.data.data[0].max_value) : 5, maxValue: response.data.data[0] ? Number(response.data.data[0].max_value) : 5,
}, () => { }, () => {
this.getItemHierarki() this.getOperatingIDMonthly()
}) })
} else { } else {
this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => { this.setState({ alert: true, messageAlert: response.data.message, tipeAlert: 'warning', loading: false }, () => {
...@@ -139,10 +138,31 @@ export default class OperatingIndicatorMR extends Component { ...@@ -139,10 +138,31 @@ export default class OperatingIndicatorMR extends Component {
}) })
} }
getOperatingIDMonthly() {
let payload = {
"company_id": this.props.data.company.company_id,
"periode": this.props.data.periode.periode,
"months": this.props.data.report_id === 22 ? 1 : 23 ? 2 : 24 ? 3 : 25 ? 4 : 27 ? 5 : 28 ? 6 : 29 ? 7 : 31 ? 8 : 32 ? 9 : 33 ? 10 : 35 ? 11 : 36 ? 12 : null
}
api.create().getOpetratingIndID(payload).then(response => {
if (response) {
if (response.data.data) {
this.setState({ operatingIndIDMonthly: response.data.data.operating_indicator_id } , () => {
this.getItemHierarki()
})
} else {
this.setState({ operatingIndIDMonthly: null }, () => {
this.getItemHierarki()
})
}
}
})
}
getItemHierarki() { getItemHierarki() {
this.setState({ loading: true }) this.setState({ loading: true })
let payload = { let payload = {
"operating_indicator_id": this.props.data.operatingIndID, "operating_indicator_id": this.state.operatingIndIDMonthly,
"report_id": this.props.data.report_id, "report_id": this.props.data.report_id,
"company_id": this.props.data.company.company_id, "company_id": this.props.data.company.company_id,
"periode": this.props.data.periode, "periode": this.props.data.periode,
...@@ -1487,7 +1507,13 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1487,7 +1507,13 @@ export default class OperatingIndicatorMR extends Component {
})} })}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography> {this.state.editable === true?
<LightTooltip title={"Data Incomplete"} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</LightTooltip>
:
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
}
</div> </div>
</button> </button>
<button <button
...@@ -1507,7 +1533,13 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1507,7 +1533,13 @@ export default class OperatingIndicatorMR extends Component {
}} }}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography> {this.state.editable === true ?
<LightTooltip title={"Data Incomplete"} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</LightTooltip>
:
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
}
</div> </div>
</button> </button>
</div>} </div>}
...@@ -1607,7 +1639,13 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1607,7 +1639,13 @@ export default class OperatingIndicatorMR extends Component {
})} })}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography> {this.state.editable === true?
<LightTooltip title={"Data Incomplete"} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</LightTooltip>
:
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
}
</div> </div>
</button> </button>
<button <button
...@@ -1630,7 +1668,13 @@ export default class OperatingIndicatorMR extends Component { ...@@ -1630,7 +1668,13 @@ export default class OperatingIndicatorMR extends Component {
}} }}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography> {this.state.editable === true ?
<LightTooltip title={"Data Incomplete"} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</LightTooltip>
:
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
}
</div> </div>
</button> </button>
</div>} </div>}
......
...@@ -1994,7 +1994,13 @@ export default class ProfitLossMR extends Component { ...@@ -1994,7 +1994,13 @@ export default class ProfitLossMR extends Component {
} }
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
{this.state.saveDraft === true ?
<LightTooltip title={"Data Incomplete"} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</LightTooltip>
:
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography> <Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
}
</div> </div>
</button> </button>
<button <button
...@@ -2016,7 +2022,13 @@ export default class ProfitLossMR extends Component { ...@@ -2016,7 +2022,13 @@ export default class ProfitLossMR extends Component {
}} }}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography> {this.state.buttonError ?
<LightTooltip title={"Data Incomplete"} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</LightTooltip>
:
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
}
</div> </div>
</button> </button>
</div> </div>
...@@ -2112,7 +2124,13 @@ export default class ProfitLossMR extends Component { ...@@ -2112,7 +2124,13 @@ export default class ProfitLossMR extends Component {
} }
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography> {this.state.saveDraft === true ?
<LightTooltip title={"Data Incomplete"} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
</LightTooltip>
:
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save as Draft</Typography>
}
</div> </div>
</button> </button>
<button <button
...@@ -2134,7 +2152,13 @@ export default class ProfitLossMR extends Component { ...@@ -2134,7 +2152,13 @@ export default class ProfitLossMR extends Component {
}} }}
> >
<div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}> <div style={{ backgroundColor: '#354960', width: 105, height: 25, borderRadius: 3, justifyContent: 'center', display: 'flex', alignItems: 'center' }}>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography> {this.state.buttonError ?
<LightTooltip title={"Data Incomplete"} arrow>
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
</LightTooltip>
:
<Typography style={{ fontSize: '11px', color: '#fff', textAlign: 'center' }}>Save & Complete</Typography>
}
</div> </div>
</button> </button>
</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