Skip to content

Commit

Permalink
Fixes #36557 - ouiaId does not apply to PF3
Browse files Browse the repository at this point in the history
  • Loading branch information
lfu committed Dec 12, 2023
1 parent 6b4f4ad commit d068f0d
Show file tree
Hide file tree
Showing 22 changed files with 19 additions and 59 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"@testing-library/user-event": "^13.5.0",
"@theforeman/builder": ">= 6.0.0",
"@theforeman/find-foreman": "^4.8.0",
"@theforeman/eslint-plugin-rules": "^12.0.1",
"@theforeman/eslint-plugin-rules": "^12.2.0",
"axios-mock-adapter": "^1.10.0",
"eslint": "^6.2.2",
"eslint-config-airbnb": "^16.0.0",
Expand Down
6 changes: 3 additions & 3 deletions webpack/components/Content/Details/ContentDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const ContentDetails = (props) => {

const tabHeaders = () => {
const tabs = schema.map(node => (
<NavItem key={node.key} eventKey={node.key} ouiaId={`${node.key}-nav-item`}>
<NavItem key={node.key} eventKey={node.key}>
<div>{node.tabHeader}</div>
</NavItem>
));
Expand Down Expand Up @@ -40,12 +40,12 @@ const ContentDetails = (props) => {
<Grid>
<Row>
<Col sm={12}>
<Nav id="content-nav-container" bsClass="nav nav-tabs" ouiaId="content-details-nav">
<Nav id="content-nav-container" bsClass="nav nav-tabs">
{schema && tabHeaders()}
</Nav>
</Col>
</Row>
<TabContent animation={false} ouiaId="content-details-tab-content">
<TabContent animation={false}>
{schema && tabPanes()}
</TabContent>
</Grid>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ exports[`Content Details Info should render and contain appropriate components 1
bsClass="nav nav-tabs"
id="content-nav-container"
justified={false}
ouiaId="content-details-nav"
pullLeft={false}
pullRight={false}
stacked={false}
Expand All @@ -45,7 +44,6 @@ exports[`Content Details Info should render and contain appropriate components 1
disabled={false}
eventKey={1}
key="1"
ouiaId="1-nav-item"
>
<div>
Details
Expand All @@ -56,7 +54,6 @@ exports[`Content Details Info should render and contain appropriate components 1
disabled={false}
eventKey={2}
key="2"
ouiaId="2-nav-item"
>
<div>
Repositories
Expand All @@ -70,7 +67,6 @@ exports[`Content Details Info should render and contain appropriate components 1
bsClass="tab"
componentClass="div"
mountOnEnter={false}
ouiaId="content-details-tab-content"
unmountOnExit={false}
>
<TabPane
Expand Down
1 change: 0 additions & 1 deletion webpack/components/SelectOrg/SetOrganization.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ class SetOrganization extends Component {
<div className="col-sm-3">
<a href={`/organizations/${id}/select`}>
<Button
ouiaId="select-org-button"
disabled={this.state.disabled}
className="btn btn-primary"
onClick={this.onSend}
Expand Down
4 changes: 2 additions & 2 deletions webpack/components/TooltipButton/TooltipButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ import './TooltipButton.scss';
const TooltipButton = ({
disabled, title, tooltipText, tooltipId, tooltipPlacement, renderedButton, ...props
}) => {
if (!disabled) return renderedButton || (<Button {...props} ouiaId="tooltip-button">{title}</Button>);
if (!disabled) return renderedButton || (<Button {...props}>{title}</Button>);
return (
<OverlayTrigger
placement={tooltipPlacement}
delayHide={150}
overlay={<Tooltip id={tooltipId}>{tooltipText}</Tooltip>}
>
<div className="tooltip-button-helper">
{renderedButton || (<Button {...props} disabled ouiaId="tooltip-disabled-button">{title}</Button>)}
{renderedButton || (<Button {...props} disabled>{title}</Button>)}
</div>
</OverlayTrigger>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ exports[`TooltipButton renders disabled TooltipButton 1`] = `
bsClass="btn"
bsStyle="default"
disabled={true}
ouiaId="tooltip-disabled-button"
>
some-title
</Button>
Expand Down Expand Up @@ -74,7 +73,6 @@ exports[`TooltipButton renders enabled TooltipButton 1`] = `
bsClass="btn"
bsStyle="default"
disabled={false}
ouiaId="tooltip-button"
>
some-title
</Button>
Expand All @@ -89,6 +87,5 @@ exports[`TooltipButton renders minimal TooltipButton 1`] = `
bsClass="btn"
bsStyle="default"
disabled={false}
ouiaId="tooltip-button"
/>
`;
1 change: 0 additions & 1 deletion webpack/components/pf3Table/components/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ const Table = ({
{body}
</PfTable.PfProvider>
{shouldRenderPagination && (
// eslint-disable-next-line @theforeman/rules/require-ouiaid
<Pagination
itemCount={itemCount}
onChange={onPaginationChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ exports[`RedHatRepositories page should render 1`] = `
onChange={[Function]}
onPerPageSelect={null}
onSetPage={null}
ouiaId="enabled-repos-pagination"
page={1}
perPage={null}
updateParamsByUrl={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const RecommendedRepositorySetsToggler = ({
return (
<div className={classes} {...props}>
<Switch
ouiaId="enabled-repo-set-switch"
bsSize="mini"
value={enabled}
onChange={() => onChange(!enabled)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export class RepositorySetRepositories extends Component {

if (data.error) {
return (
<Alert type="danger" ouiaId="repo-set-alert">
<Alert type="danger">
<span>{data.error.displayMessage}</span>
</Alert>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ exports[`RecommendedRepositorySetsToggler rendering renders recommended-reposito
onChange={[Function]}
onColor="primary"
onText="ON"
ouiaId="enabled-repo-set-switch"
readonly={false}
tristate={false}
value={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ exports[`RepositorySetRepositories Component should render with error 1`] = `
<Alert
className=""
onDismiss={null}
ouiaId="repo-set-alert"
type="danger"
>
<span>
Expand Down
2 changes: 0 additions & 2 deletions webpack/scenes/RedHatRepositories/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ export const getSetsComponent = (repoSetsState, onPaginationChange) => {
<ListView>
<div className="sticky-pagination">
<Pagination
ouiaId="repos-pagination"
itemCount={itemCount}
onChange={onPaginationChange}
isCompact
Expand Down Expand Up @@ -65,7 +64,6 @@ export const getEnabledComponent = (enabledReposState, onPaginationChange) => {
<ListView>
<div className="sticky-pagination sticky-pagination-grey">
<Pagination
ouiaId="enabled-repos-pagination"
isCompact
itemCount={itemCount}
onChange={onPaginationChange}
Expand Down
8 changes: 4 additions & 4 deletions webpack/scenes/Subscriptions/Details/SubscriptionDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ class SubscriptionDetails extends Component {
<TabContainer id="subscription-tabs-container" defaultActiveKey={1}>
<div>
<LoadingState loading={subscriptionDetails.loading} loadingText={__('Loading')}>
<Nav bsClass="nav nav-tabs" ouiaId="subscription-details-nav">
<NavItem eventKey={1} ouiaId="details-nav-item">
<Nav bsClass="nav nav-tabs">
<NavItem eventKey={1}>
<div>{__('Details')}</div>
</NavItem>
<NavItem eventKey={2} ouiaId="product-content-nav-item">
<NavItem eventKey={2}>
<div>{__('Product Content')}</div>
</NavItem>
</Nav>
<Grid bsClass="container-fluid">
<TabContent ouiaId="subscription-details-tab-content" animation={false}>
<TabContent animation={false}>
<TabPane eventKey={1}>
<div>
<Row>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ exports[`subscriptions details page should render and contain appropiate compone
<Nav
bsClass="nav nav-tabs"
justified={false}
ouiaId="subscription-details-nav"
pullLeft={false}
pullRight={false}
stacked={false}
Expand All @@ -49,7 +48,6 @@ exports[`subscriptions details page should render and contain appropiate compone
active={false}
disabled={false}
eventKey={1}
ouiaId="details-nav-item"
>
<div>
Details
Expand All @@ -59,7 +57,6 @@ exports[`subscriptions details page should render and contain appropiate compone
active={false}
disabled={false}
eventKey={2}
ouiaId="product-content-nav-item"
>
<div>
Product Content
Expand All @@ -76,7 +73,6 @@ exports[`subscriptions details page should render and contain appropiate compone
bsClass="tab"
componentClass="div"
mountOnEnter={false}
ouiaId="subscription-details-tab-content"
unmountOnExit={false}
>
<TabPane
Expand Down
12 changes: 4 additions & 8 deletions webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,9 @@ class ManageManifestModal extends Component {

return (
<ForemanModal id={MANAGE_MANIFEST_MODAL_ID} title={__('Manage Manifest')}>
<Tabs id="manifest-history-tabs" ouiaId="manifest-history-tabs">
<Tabs id="manifest-history-tabs">
{showManifestTab &&
<Tab
ouiaId="subscription-manifest-tab"
eventKey={1}
title={__('Manifest')}
>
Expand Down Expand Up @@ -199,10 +198,10 @@ class ManageManifestModal extends Component {
<ForemanModal title={__('Confirm delete manifest')} id={DELETE_MANIFEST_MODAL_ID}>
<DeleteManifestModalText simpleContentAccess={simpleContentAccess} />
<ForemanModal.Footer>
<Button ouiaId="cancel-button" bsStyle="default" onClick={this.hideDeleteManifestModal}>
<Button bsStyle="default" onClick={this.hideDeleteManifestModal}>
{__('Cancel')}
</Button>
<Button ouiaId="delete-button" bsStyle="danger" onClick={this.deleteManifest}>
<Button bsStyle="danger" onClick={this.deleteManifest}>
{__('Delete')}
</Button>
</ForemanModal.Footer>
Expand All @@ -216,13 +215,11 @@ class ManageManifestModal extends Component {
</Tab>
}
<Tab
ouiaId="manifest-history-tab"
eventKey={2}
title={__('Manifest History')}
>
<LoadingState loading={manifestHistory.loading} loadingText={__('Loading')}>
<Table
ouiaId="manifest-history-table"
rows={manifestHistory.results}
columns={columns}
emptyState={emptyStateData()}
Expand All @@ -231,7 +228,6 @@ class ManageManifestModal extends Component {
</Tab>
{showCdnConfigurationTab &&
<Tab
ouiaId="cdn-configuration-tab"
eventKey={3}
title={__('CDN Configuration')}
>
Expand All @@ -248,7 +244,7 @@ class ManageManifestModal extends Component {
}
</Tabs>
<ForemanModal.Footer>
<Button ouiaId="close-button" bsStyle="primary" onClick={this.hideModal}>
<Button bsStyle="primary" onClick={this.hideModal}>
{__('Close')}
</Button>
</ForemanModal.Footer>
Expand Down
2 changes: 1 addition & 1 deletion webpack/scenes/Subscriptions/SubscriptionsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ class SubscriptionsPage extends Component {
};

const SCAAlert = (
<Alert ouiaId="sca-alert" type="warning">
<Alert type="warning">
<FormattedMessage
id="sca-alert"
values={{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ class UpstreamSubscriptionsPage extends Component {
<Row>
<Col sm={12}>
<Button
ouiaId="submit-button"
style={{ marginTop: '10px', marginRight: '5px' }}
bsStyle="primary"
type="submit"
Expand All @@ -144,7 +143,7 @@ class UpstreamSubscriptionsPage extends Component {
</Button>

<LinkContainer to="/subscriptions" style={{ marginTop: '10px' }}>
<Button ouiaId="cancel-button">
<Button>
{__('Cancel')}
</Button>
</LinkContainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,6 @@ exports[`upstream subscriptions page should render 1`] = `
bsStyle="primary"
disabled={true}
onClick={[Function]}
ouiaId="submit-button"
style={
Object {
"marginRight": "5px",
Expand All @@ -216,7 +215,6 @@ exports[`upstream subscriptions page should render 1`] = `
bsClass="btn"
bsStyle="default"
disabled={false}
ouiaId="cancel-button"
>
Cancel
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ exports[`subscriptions page should render 1`] = `
<Alert
className=""
onDismiss={null}
ouiaId="sca-alert"
type="warning"
>
<FormattedMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,11 @@ const SubscriptionsToolbar = ({
</a>
}

<Button ouiaId="manage-manifest-button" onClick={onManageManifestButtonClick}>
<Button onClick={onManageManifestButtonClick}>
{__('Manage Manifest')}
</Button>

<Button
ouiaId="export-csv-button"
onClick={onExportCsvButtonClick}
>
<Button onClick={onExportCsvButtonClick}>
{__('Export CSV')}
</Button>
{canManageSubscriptionAllocations &&
Expand Down
Loading

0 comments on commit d068f0d

Please sign in to comment.