Skip to content

fix: Handling erroneous state in Entity item ADS template #40363

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 2 commits into from
Apr 24, 2025
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 @@ -16,6 +16,7 @@ export const isEllipsisActive = (element: HTMLElement | null) => {
export const EditableEntityName = (props: EditableEntityNameProps) => {
const {
canEdit,
hasError,
icon,
inputTestId,
isEditing,
Expand Down Expand Up @@ -106,6 +107,7 @@ export const EditableEntityName = (props: EditableEntityNameProps) => {
<Styled.Text
aria-invalid={Boolean(validationError)}
className={clsx("t--entity-name", { editing: inEditMode })}
color={hasError ? "var(--ads-v2-color-fg-error)" : undefined}
data-isediting={inEditMode}
data-isfixedwidth={isFixedWidth}
inputProps={inputProps}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ export interface EditableEntityNameProps {
normalizeName?: boolean;
/** Used for showing ellipsis for longer names */
showEllipsis?: boolean;
/** Whether to show the entity is in error state */
hasError?: boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const EntityItem = (props: EntityItemProps) => {
return (
<EditableEntityName
canEdit={canEdit}
hasError={props.hasError}
icon={startIcon}
isEditing={isEditing}
isFixedWidth
Expand All @@ -50,6 +51,7 @@ export const EntityItem = (props: EntityItemProps) => {
normalizeName,
onEditComplete,
onNameSave,
props.hasError,
props.title,
startIcon,
validateName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export interface EntityListTreeItem {
id: string;
name: string;
type: string;
hasError?: boolean;
}

export interface EntityListTreeProps {
Expand Down
Loading