IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
Ver código fonte

Made the process dashboard lazy.

pull/1/head
Stanislaw Adaszewski 4 anos atrás
pai
commit
5078d35f5b
2 arquivos alterados com 16 adições e 5 exclusões
  1. +15
    -4
      frontend/src/js/component/wb-process-dashboard.js
  2. +1
    -1
      frontend/src/js/page/wb-process-view.js

+ 15
- 4
frontend/src/js/component/wb-process-dashboard.js Ver arquivo

@@ -117,21 +117,32 @@ class WBProcessDashboard extends Component {
}
componentDidMount() {
this.fetchData();
if (!this.props.lazy)
this.fetchData();
}
componentWillReceiveProps(nextProps) {
if (nextProps.parentProcessUuid === this.props.parentProcessUuid)
return;
if (this.props.lazy) {
this.setState({ rows: Array(5).fill(Array(6).fill('-')) });
return;
}
this.props = nextProps;
this.fetchData();
}
render({}, { rows }) {
render({ lazy }, { rows }) {
return (
<WBTable columns={ [ 'State', 'Pending', 'Running', 'Complete', 'Failed', 'Cancelled' ] }
rows={ rows } verticalHeader={ true } />
<div>
<WBTable columns={ [ 'State', 'Pending', 'Running', 'Complete', 'Failed', 'Cancelled' ] }
rows={ rows } verticalHeader={ true } />
{ lazy ? (
<a href="#" onclick={ e => { e.preventDefault(); this.fetchData(); } }>Refresh</a>
) : null }
</div>
);
}
}


+ 1
- 1
frontend/src/js/page/wb-process-view.js Ver arquivo

@@ -64,7 +64,7 @@ class WBProcessView extends Component {
</div>
<h2>Children Dashboard</h2>
<WBProcessDashboard app={ app } parentProcessUuid={ uuid } />
<WBProcessDashboard app={ app } parentProcessUuid={ uuid } lazy={ true } />
<h2>Common Fields</h2>
<WBCommonFields app={ app } uuid={ uuid } />


Carregando…
Cancelar
Salvar