Skip to content

fix: update ErrorDialog logic and tests #10111

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

Merged
merged 7 commits into from
Oct 6, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: more color sync fixes
  • Loading branch information
Parkreiner committed Oct 6, 2023
commit f6cee9aeadba0382de0fb2389bcdc0f6e1fe8134
6 changes: 3 additions & 3 deletions site/src/components/Dialogs/DeleteDialog/DeleteDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const DeleteDialog: FC<PropsWithChildren<DeleteDialogProps>> = ({
const confirmationId = `${hookId}-${DeleteDialog.name}-confirm`;
const hasError = !deletionConfirmed && confirmationText.length > 0;
const displayErrorMessage = hasError && !isFocused;
const color = hasError ? "error" : "primary";
const inputColor = hasError ? "error" : "primary";

return (
<ConfirmDialog
Expand Down Expand Up @@ -86,13 +86,13 @@ export const DeleteDialog: FC<PropsWithChildren<DeleteDialogProps>> = ({
onFocus={() => setIsFocused(true)}
onBlur={() => setIsFocused(false)}
label={`Name of the ${entity} to delete`}
color={color}
color={inputColor}
error={displayErrorMessage}
helperText={
displayErrorMessage &&
`${confirmationText} does not match the name of this ${entity}`
}
InputProps={{ color }}
InputProps={{ color: inputColor }}
inputProps={{
["data-testid"]: "delete-dialog-name-confirmation",
}}
Expand Down