Skip to content

Commit

Permalink
Added loading icon to export button of SearchBar
Browse files Browse the repository at this point in the history
This patch adds an status of loading to the export button of the Search
Bar component. This gives the user feedback that the download initiated
and avoid multiple unecessary download requests.

Fixes: https://gitlab.com/stoqtech/private/bdil/issues/256
Change-Id: Ifaf29b2aa07a3ccd7fdd0afa07241d7d6b4a7b89
  • Loading branch information
mariano-filipe committed Apr 5, 2019
1 parent 87c52fb commit 6c5dcfd
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions search-bar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,12 +213,16 @@ module.exports = SearchBar = React.createClass({
return null;
}

return <div className="input-group-btn">
<button name="export-file" className="btn btn-default"
title="Exportar relatório" onClick={this._export}>
<i className="fa fa-file-excel-o"/>
</button>
</div>;
const iconClasses = this.props.exportLoading ? 'fa fa-refresh fa-spin' : 'fa fa-file-excel-o';
const btnClicked = this.props.exportLoading ? null : this._export;
return (
<div className="input-group-btn">
<button name="export-file" className="btn btn-default"
title="Exportar relatório" onClick={btnClicked}>
<i className={iconClasses}/>
</button>
</div>
);
},

_getColumnsButton: function() {
Expand Down

0 comments on commit 6c5dcfd

Please sign in to comment.