Skip to content
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

Merged
merged 14 commits into from
May 1, 2024

Conversation

GB27247
Copy link
Member

@GB27247 GB27247 commented Apr 11, 2024

No description provided.

@@ -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)
Copy link
Member

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
Copy link
Member

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.

@GB27247 GB27247 merged commit 22bb031 into main May 1, 2024
14 checks passed
a3957273 pushed a commit that referenced this pull request May 21, 2024
…-error

Disable create and edit buttons on failure

Former-commit-id: 97b5ed10bb47ce20543db4757820f9ad818c2eda [formerly 22bb031]
Former-commit-id: bb575c0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants