Skip to content

Commit

Permalink
[New #18] Added loading wheel for buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
LaChope authored and blcham committed Dec 17, 2023
1 parent 62c74a7 commit 46df9bb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions js/components/record/Record.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,23 @@ class Record extends React.Component {
}

_renderRoleSpecificButtons() {
const {record, recordSaved, formgen} = this.props;

return <>
{EXTENSIONS === EXTENSION_CONSTANTS.SUPPLIER &&
<Button className="mx-1" variant='danger' size='sm'
disabled={formgen.status === ACTION_STATUS.PENDING || recordSaved.status === ACTION_STATUS.PENDING
|| !this.state.isFormValid || !record.state.isComplete()}
onClick={this.props.handlers.onReject}>
{this.i18n('reject')}
{this.i18n('reject')}{recordSaved.status === ACTION_STATUS.PENDING && <LoaderSmall/>}
</Button>
}
{EXTENSIONS === EXTENSION_CONSTANTS.OPERATOR &&
<Button className="mx-1" variant='success' size='sm'
disabled={formgen.status === ACTION_STATUS.PENDING || recordSaved.status === ACTION_STATUS.PENDING
|| !this.state.isFormValid || !record.state.isComplete()}
onClick={this.props.handlers.onComplete}>
{this.i18n('complete')}
{this.i18n('complete')}{recordSaved.status === ACTION_STATUS.PENDING && <LoaderSmall/>}
</Button>}
</>;
}
Expand Down

0 comments on commit 46df9bb

Please sign in to comment.