Skip to content
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

fix: prevent console errors for read only badges in card actions #76

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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 @@ -2,6 +2,9 @@
color: var(--pf-t--global--text--color--regular);
text-decoration: none;
}
.ws-react-e-catalog-tile .pf-v6-c-card__header-main {
display: flex;
}
.ws-react-e-catalog-tile .catalog-tile-pf-header .catalog-tile-pf-subtitle {
color: var(--pf-t--global--text--color--subtle);
font-size: var(--pf-t--global--font--size--body--sm);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
text-decoration: none;
}

.pf-v6-c-card__header-main {
display: flex;
}

.pf-v6-c-card__actions {
padding-left: 5px;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/module/src/components/CatalogTile/CatalogTile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ export class CatalogTile extends React.Component<CatalogTileProps> {
>
{(badges.length > 0 || iconImg || iconClass || icon || onClick || href) && (
<CardHeader
actions={{ actions: badges.length > 0 && this.renderBadges(badges), hasNoOffset: true }}
selectableActions={ (onClick || href) && {
selectableActionId: id + '-input',
onClickAction: (e) => this.handleClick(e),
Expand All @@ -129,6 +128,7 @@ export class CatalogTile extends React.Component<CatalogTileProps> {
>
{iconImg && <img className="catalog-tile-pf-icon" src={iconImg} alt={iconAlt} />}
{!iconImg && (iconClass || icon) && <span className={`catalog-tile-pf-icon ${iconClass}`}>{icon}</span>}
{badges.length > 0 && this.renderBadges(badges)}
</CardHeader>
)}
<CardTitle className="catalog-tile-pf-header">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ exports[`CatalogTile href renders properly 1`] = `
class="pf-v6-c-card__header"
>
<div
class="pf-v6-c-card__actions pf-m-no-offset"
class="pf-v6-c-card__actions"
>
<div
class="pf-v6-c-card__selectable-actions"
Expand Down Expand Up @@ -80,7 +80,7 @@ exports[`CatalogTile renders properly 1`] = `
class="pf-v6-c-card__header"
>
<div
class="pf-v6-c-card__actions pf-m-no-offset"
class="pf-v6-c-card__header-main"
>
<div
class="catalog-tile-pf-badge-container"
Expand Down Expand Up @@ -134,9 +134,6 @@ exports[`CatalogTile renders properly 1`] = `
</span>
</div>
</div>
<div
class="pf-v6-c-card__header-main"
/>
</div>
<div
class="pf-v6-c-card__title"
Expand Down Expand Up @@ -189,7 +186,7 @@ exports[`CatalogTile renders properly 1`] = `
class="pf-v6-c-card__header"
>
<div
class="pf-v6-c-card__actions pf-m-no-offset"
class="pf-v6-c-card__header-main"
>
<div
class="catalog-tile-pf-badge-container"
Expand Down Expand Up @@ -252,9 +249,6 @@ exports[`CatalogTile renders properly 1`] = `
</span>
</div>
</div>
<div
class="pf-v6-c-card__header-main"
/>
</div>
<div
class="pf-v6-c-card__title"
Expand Down Expand Up @@ -300,8 +294,11 @@ exports[`CatalogTile renders properly 1`] = `
class="pf-v6-c-card__header"
>
<div
class="pf-v6-c-card__actions pf-m-no-offset"
class="pf-v6-c-card__header-main"
>
<span
class="catalog-tile-pf-icon fa fa-codepen"
/>
<div
class="catalog-tile-pf-badge-container"
>
Expand Down Expand Up @@ -335,13 +332,6 @@ exports[`CatalogTile renders properly 1`] = `
</span>
</div>
</div>
<div
class="pf-v6-c-card__header-main"
>
<span
class="catalog-tile-pf-icon fa fa-codepen"
/>
</div>
</div>
<div
class="pf-v6-c-card__title"
Expand Down Expand Up @@ -387,7 +377,21 @@ exports[`CatalogTile renders properly 1`] = `
class="pf-v6-c-card__header"
>
<div
class="pf-v6-c-card__actions pf-m-no-offset"
class="pf-v6-c-card__actions"
>
<div
class="pf-v6-c-card__selectable-actions"
>
<button
aria-labelledby="tile-footer-test"
class="pf-v6-c-card__clickable-action"
id="tile-footer-test-input"
type="button"
/>
</div>
</div>
<div
class="pf-v6-c-card__header-main"
>
<div
class="catalog-tile-pf-badge-container"
Expand Down Expand Up @@ -421,20 +425,7 @@ exports[`CatalogTile renders properly 1`] = `
</div>
</span>
</div>
<div
class="pf-v6-c-card__selectable-actions"
>
<button
aria-labelledby="tile-footer-test"
class="pf-v6-c-card__clickable-action"
id="tile-footer-test-input"
type="button"
/>
</div>
</div>
<div
class="pf-v6-c-card__header-main"
/>
</div>
<div
class="pf-v6-c-card__title"
Expand Down Expand Up @@ -500,7 +491,7 @@ exports[`CatalogTile renders properly 1`] = `
class="pf-v6-c-card__header"
>
<div
class="pf-v6-c-card__actions pf-m-no-offset"
class="pf-v6-c-card__actions"
>
<div
class="pf-v6-c-card__selectable-actions"
Expand Down
Loading