Skip to content

Commit

Permalink
all issues fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
jakub-bao committed Feb 14, 2020
1 parent b10c68b commit d827580
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/modules/action/components/action.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,19 @@ export default class Action extends React.Component<
performAction = (action:string)=>{
this.setState({processing: true});
performAction(action, this.state.workflow.id, this.state.period.id, this.state.mechanisms.map(m=>m.meta)).then((response)=>{
this.setState({processing: false});
if (!response.ok || response.redirected) return this.errorMessage(action);
if (!response.ok || response.redirected) {
this.setState({processing: false});
return this.errorMessage(action);
}
this.getMechanismStatuses(this.state.workflow.id, this.state.period.id, this.state.mechanisms).then(()=>{
this.successMessage(action);
this.setState({processing: false});
});
});
};



renderAction(){
if (this.state.processing) return <Loading message='Loading...'/>;
return <ActionButtons mechanismState={this.state.mechanismState} performAction={this.performAction} mechanismsNr={this.state.mechanisms.length}/>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export default class ResultsTabs extends React.Component<

switchTab = (ev, tabNr) => {
const action = mechanismActions[tabNr];
if (this.state.action===action) return;
let filteredMechanisms = this.filterMechanisms(this.props.mechanisms, action);
this.setState({action: action, filteredMechanisms: filteredMechanisms});
this.props.onSwitchTab(action)
Expand Down

0 comments on commit d827580

Please sign in to comment.