Skip to content

Replace h3 tag with PF5 Title - #1246

Merged
nofaralfasi merged 2 commits into
theforeman:developfrom
Lukshio:replaceH3
Sep 6, 2026
Merged

nofaralfasi merged 2 commits into
theforeman:developfrom
Lukshio:replaceH3

Conversation

@Lukshio

@Lukshio Lukshio commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues, and left some high level feedback:

  • In InventorySettings.js, the PF5 Title component shouldn’t wrap an

    element; you can pass the translated string directly as children to avoid invalid nested headings.

  • In InventoryAutoUpload.js, the ouiaId "rh-clout-inventory-title" appears to have a typo and should likely be "rh-cloud-inventory-title" for consistency with the label.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In InventorySettings.js, the PF5 Title component shouldn’t wrap an <h3> element; you can pass the translated string directly as children to avoid invalid nested headings.
- In InventoryAutoUpload.js, the ouiaId "rh-clout-inventory-title" appears to have a typo and should likely be "rh-cloud-inventory-title" for consistency with the label.

## Individual Comments

### Comment 1
<location path="webpack/ForemanInventoryUpload/Components/InventorySettings/InventorySettings.js" line_range="35" />
<code_context>
   return (
     <div className="inventory-settings">
-      <h3>{__('Settings')}</h3>
+      <Title headingLevel="h3" size="lg" ouiaId="inventory-settings-title">
+        <h3>{__('Settings')}</h3>
+      </Title>
       {[...settingKeys].map(key => {
</code_context>
<issue_to_address>
**issue (bug_risk):** Avoid nesting an <h3> inside the PatternFly Title component and pass the text directly instead.

Title already renders the correct heading tag based on `headingLevel`, so wrapping an extra `<h3>` inside creates nested headings and invalid semantics, which can impact accessibility and styling. Instead, let Title render the heading directly:

```jsx
<Title headingLevel="h3" size="lg" ouiaId="inventory-settings-title">
  {__('Settings')}
</Title>
```
</issue_to_address>

### Comment 2
<location path="webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/InventoryAutoUpload.js" line_range="36" />
<code_context>
     <FormGroup>
       <Grid>
-        <h3>{__('Red Hat Cloud Inventory')}</h3>
+        <Title headingLevel="h3" size="lg" ouiaId="rh-clout-inventory-title">
+          {__('Red Hat Cloud Inventory')}
+        </Title>
</code_context>
<issue_to_address>
**suggestion (typo):** The `ouiaId` value appears to have a typo and may be clearer as `rh-cloud-inventory-title`.

Please update the `ouiaId` to `rh-cloud-inventory-title` so it’s spelled correctly and aligns with the component name, which will make OUIA-based tests and tooling more reliable.

```suggestion
        <Title headingLevel="h3" size="lg" ouiaId="rh-cloud-inventory-title">
```
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@Lukshio
Lukshio force-pushed the replaceH3 branch 2 times, most recently from 043dc11 to 3f27b42 Compare August 19, 2026 16:32

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery assessment

Approved.

@nofaralfasi nofaralfasi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.
Image

@nofaralfasi
nofaralfasi merged commit 6c0c0d0 into theforeman:develop Sep 6, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants