-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Disable create and edit buttons on failure #1209
Conversation
@@ -31,6 +31,7 @@ export default function ModelAccess({ model }: ModelAccessProps) { | |||
const [userListQuery, setUserListQuery] = useState('') | |||
const [loading, setLoading] = useState(false) | |||
const [errorMessage, setErrorMessage] = useState('') | |||
const [roleError, onRoleError] = useState(false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is a boolean I would rename this to isRoleError
and setIsRoleError
.
@@ -143,7 +145,13 @@ export default function ModelAccess({ model }: ModelAccessProps) { | |||
</TableHead> | |||
<TableBody>{accessListEntities}</TableBody> | |||
</Table> | |||
<LoadingButton variant='contained' aria-label='Save access list' onClick={updateAccessList} loading={loading}> | |||
<LoadingButton |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is disabled due to the roleError
value being set to true
I would add some error text below the button explaining the error.
It might be more work, but you could replace the boolean and have it as a string, and when you set roleError
inside UserDisplay
set it to error message created by isUserInformationError
.
No description provided.