Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function FormDialogBase({
formSaveCallback,
dialogOpenCallback,
triggerIconProps,
saveButtonDisabled,
}) {
const [open, setOpen] = React.useState(false);
const [saving, setSaving] = useState(false);
Expand Down Expand Up @@ -104,7 +105,7 @@ function FormDialogBase({
onClick={saveTriggerd}
color='primary'
variant='contained'
disabled={saving}
disabled={saving || saveButtonDisabled}
data-testid='form-dialog-base-save-btn'
>
{saving ? (<CircularProgress size={16} />) : (<>{saveButtonText}</>)}
Expand All @@ -124,6 +125,7 @@ FormDialogBase.defaultProps = {
color: 'primary',
component: 'span',
},
saveButtonDisabled: false,
};

FormDialogBase.propTypes = {
Expand All @@ -142,6 +144,7 @@ FormDialogBase.propTypes = {
triggerIconProps: PropTypes.shape({}),
formSaveCallback: PropTypes.func.isRequired,
dialogOpenCallback: PropTypes.func,
saveButtonDisabled: PropTypes.bool,
};

export default FormDialogBase;
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ function AddEditGWEnvironment(props) {
triggerButtonText={triggerButtonText}
formSaveCallback={formSaveCallback}
dialogOpenCallback={dialogOpenCallback}
saveButtonDisabled={!roleValidity}
>
<FormControl
variant='standard'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2275,7 +2275,7 @@ function AddEditKeyManager(props) {
variant='contained'
color='primary'
onClick={formSaveCallback}
disabled={isGlobal && !isSuperAdmin}
disabled={(isGlobal && !isSuperAdmin) || !roleValidity}
>
{saving ? (<CircularProgress size={16} />) : (
<>
Expand Down
Loading