Commit ba03fa49 authored by Rifka Kurnia Irfiana's avatar Rifka Kurnia Irfiana

Merge branch 'master' of http://103.44.149.204/d.arizona/tia-dev into rifka

parents 0fc9a6a3 eec2be01
......@@ -56,7 +56,8 @@ export default class BalanceSheet extends Component {
visibleOI: true,
disabledSave: true,
editable: true,
emptyData: false
emptyData: false,
templateNull: true
}
this.handleValue = this.handleValue.bind(this)
this.fileHandler = this.fileHandler.bind(this);
......@@ -370,7 +371,11 @@ export default class BalanceSheet extends Component {
if (response.data) {
if (response.data.status === 'success') {
this.setState({ visibleUpload: false, visibleOI: false, loading: true })
let total = 0
let dataTable = response.data.data.map((item, index) => {
if (item.type_report_id != null) {
total += 1
}
return [
item.type_report_id,
item.item_report_id,
......@@ -397,7 +402,7 @@ export default class BalanceSheet extends Component {
item.error
]
})
this.setState({ dataTable, dataLoaded: true, loading: false })
this.setState({ dataTable, dataLoaded: true, loading: false, templateNull : total > 0 ? true : false })
}
}
})
......@@ -2057,7 +2062,7 @@ export default class BalanceSheet extends Component {
</div>
</button>
</div>
{!this.state.emptyData && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
{!this.state.emptyData && this.state.templateNull && <div className="col-2" style={{ display: 'flex', justifyContent: 'flex-end', maxWidth: '100%' }}>
<button
type="button"
onClick={() =>
......
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