Skip to content

Commit

Permalink
Fixes #35873 - add ouiaId to ACS and other components (#10397)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremylenz committed Dec 22, 2022
1 parent 53b2a56 commit cafb142
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 13 deletions.
6 changes: 3 additions & 3 deletions webpack/components/Table/EmptyStateMessage.js
Expand Up @@ -67,7 +67,7 @@ const EmptyStateMessage = ({
};

const actionButton = primaryActionButton ?? (
<Button>
<Button ouiaId="empty-state-primary-action-button">
<a href={primaryActionLink} style={{ color: 'white', textDecoration: 'none' }}>{primaryActionTitle}</a>
</Button>
);
Expand All @@ -91,15 +91,15 @@ const EmptyStateMessage = ({
{showPrimaryAction && actionButton}
{showSecondaryActionAnchor &&
<EmptyStateSecondaryActions>
<Button variant="link">
<Button variant="link" ouiaId="empty-state-secondary-action-link">
<a href={secondaryActionLink} style={{ textDecoration: 'none' }}>{secondaryActionTitle}</a>
</Button>
</EmptyStateSecondaryActions>
}

{(showSecondaryActionButton || searchIsActive || !!filtersAreActive) &&
<EmptyStateSecondaryActions>
<Button variant="link" onClick={handleClick}>
<Button variant="link" onClick={handleClick} ouiaId="empty-state-secondary-action-router-link">
{secondaryActionText}
</Button>
</EmptyStateSecondaryActions>
Expand Down
7 changes: 4 additions & 3 deletions webpack/scenes/AlternateContentSources/MainTable/ACSTable.js
Expand Up @@ -162,7 +162,7 @@ const ACSTable = () => {
<DrawerHead>
{results && isExpanded &&
<div ref={drawerRef}>
<Text component={TextVariants.h1} style={{ marginTop: '0px', fontWeight: 'bold' }}>
<Text ouiaId="acs-name-text" component={TextVariants.h1} style={{ marginTop: '0px', fontWeight: 'bold' }}>
{acs?.name}
</Text>
<TextContent>
Expand Down Expand Up @@ -384,7 +384,7 @@ const ACSTable = () => {
hideSearch={!canView}
>
<Thead>
<Tr>
<Tr ouiaId="acs-table-column-headers-row">
<Th
key="acs-checkbox"
style={{ width: 0 }}
Expand Down Expand Up @@ -415,6 +415,7 @@ const ACSTable = () => {
return (
<Tr
key={index}
ouiaId={`acs-row-${id}`}
style={isSingleSelected(id) && isExpanded ? customStyle : {}}
isStriped={isSingleSelected(id) && isExpanded}
>
Expand All @@ -428,7 +429,7 @@ const ACSTable = () => {
/>
</Td>
<Td>
<Text onClick={() => onClick(id)} component="a">{name}</Text>
<Text onClick={() => onClick(id)} component="a" ouiaId={`acs-link-text-${index}`}>{name}</Text>
</Td>
<Td>{acsType === 'rhui' ? upperCase(acsType) : capitalize(acsType)}</Td>
<Td><LastSync
Expand Down
6 changes: 3 additions & 3 deletions webpack/scenes/Content/Details/ContentRepositories.js
Expand Up @@ -51,14 +51,14 @@ const ContentRepositories = ({ contentType, id, tabKey }) => {
)}
>
<Thead>
<Tr>
<Tr ouiaId="content-repositories-column-headers-row">
{columnHeaders.map(col =>
<Th key={col.title}>{col.title}</Th>)}
</Tr>
</Thead>
<Tbody>
{results?.map(details => (
<Tr key={`${details.id}`}>
{results?.map((details, idx) => (
<Tr key={`${details.id}`} ouiaId={`content-repositories-row-${idx}`}>
{columnHeaders.map((col, index) =>
<Td key={index}>{col.getProperty(details, typeSingularLabel)}</Td>)
}
Expand Down
Expand Up @@ -129,6 +129,7 @@ const ContentViewFilterDetailsHeader = ({
</FlexItem>
<FlexItem>
<Dropdown
ouiaId="cv-filter-actions-kebab"
position={DropdownPosition.right}
style={{ marginLeft: 'auto' }}
toggle={<KebabToggle onToggle={setDropdownOpen} id="toggle-dropdown" />}
Expand Down
2 changes: 1 addition & 1 deletion webpack/scenes/ContentViews/components/WizardHeader.js
Expand Up @@ -9,7 +9,7 @@ const WizardHeader = ({
<Grid style={{ gridGap: '24px' }}>
{title &&
<TextContent>
<Text component={TextVariants.h2}>{title}</Text>
<Text ouiaId="wizard-header-text" component={TextVariants.h2}>{title}</Text>
</TextContent>}
{description &&
<TextContent>
Expand Down
13 changes: 12 additions & 1 deletion webpack/scenes/SmartProxy/SmartProxyContentTable.js
Expand Up @@ -138,7 +138,18 @@ const SmartProxyContentTable = ({ smartProxyId }) => {


return (
<MainTable onCollapse={onCollapse(rows, setRows)} status={status} cells={columnHeaders} rows={rows} error={error} emptyContentTitle="No content synced" emptyContentBody="No content synced to smart proxy" emptySearchTitle="Empty" emptySearchBody="Empty" />
<MainTable
onCollapse={onCollapse(rows, setRows)}
ouiaId="smart-proxy-content-table"
status={status}
cells={columnHeaders}
rows={rows}
error={error}
emptyContentTitle="No content synced"
emptyContentBody="No content synced to smart proxy"
emptySearchTitle="Empty"
emptySearchBody="Empty"
/>
);
};

Expand Down
Expand Up @@ -34,7 +34,7 @@ const CdnTypeForm = ({ typeChangeInProgress, onUpdate }) => {
return (
<Form isHorizontal>
<div id="update-hint-cdn" className="margin-top-16">
<Text>
<Text ouiaId="update-hint-cdn-text">
<FormattedMessage
id="cdn-configuration-type"
defaultMessage={__('Red Hat content will be consumed from the {type}.')}
Expand Down
Expand Up @@ -62,7 +62,7 @@ const CustomCdnTypeForm = ({
return (
<Form isHorizontal>
<div id="update-hint-cdn" className="margin-top-16">
<Text>
<Text ouiaId="cdn-configuration-type-text">
<FormattedMessage
id="cdn-configuration-type"
defaultMessage={__('Red Hat content will be consumed from {type}.')}
Expand Down

0 comments on commit cafb142

Please sign in to comment.