diff --git a/package.json b/package.json index f603fc0..b70106e 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "eslint-plugin-markdown": "^1.0.2", "eslint-config-standard-with-typescript": "^23.0.0", "eslint-plugin-n": "^15.0.0", - "eslint-plugin-patternfly-react":"^4.80.5-alpha.0", + "eslint-plugin-patternfly-react": "^4.80.5-alpha.0", "eslint-plugin-import": "^2.25.2", "eslint-plugin-promise": "^6.0.0", "eslint-config-prettier": "8.5.0", @@ -40,19 +40,20 @@ "@typescript-eslint/eslint-plugin": "^5.42.0", "@typescript-eslint/parser": "^5.42.0", "prettier": "2.7.1", - "jest":"^29.2.2", - "babel-jest":"^29.2.2", + "jest": "^29.2.2", + "babel-jest": "^29.2.2", "@babel/core": "^7.19.6", "@babel/preset-env": "^7.19.4", - "@babel/preset-react":"^7.18.6", + "@babel/preset-react": "^7.18.6", "@babel/preset-flow": "^7.18.6", "@babel/preset-typescript": "^7.18.6", - "@testing-library/react":"^13.4.0", + "@testing-library/react": "^13.4.0", "@testing-library/user-event": "14.4.3", - "@testing-library/jest-dom":"5.16.5", + "@testing-library/jest-dom": "5.16.5", "@testing-library/dom": "9.0.0", "jest-environment-jsdom": "^29.2.2", "jest-transform-stub": "^2.0.0", "serve": "^14.1.2" - } + }, + "packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e" } diff --git a/packages/module/src/components/CatalogTile/CatalogTile.tsx b/packages/module/src/components/CatalogTile/CatalogTile.tsx index ef2017e..71fd1ad 100644 --- a/packages/module/src/components/CatalogTile/CatalogTile.tsx +++ b/packages/module/src/components/CatalogTile/CatalogTile.tsx @@ -65,6 +65,8 @@ export class CatalogTile extends React.Component { if (!href) { e.preventDefault(); + } else { + window.open(href, '_blank'); } if (onClick) { onClick(e); @@ -109,19 +111,16 @@ export class CatalogTile extends React.Component { return ( - {(badges.length > 0 || iconImg || iconClass || icon || onClick) && ( + {(badges.length > 0 || iconImg || iconClass || icon || onClick || href) && ( 0 && this.renderBadges(badges), hasNoOffset: true }} - selectableActions={ - onClick && { + selectableActions={ (onClick || href) && { selectableActionId: id + '-input', onClickAction: (e) => this.handleClick(e), selectableActionAriaLabelledby: id diff --git a/packages/module/src/components/CatalogTile/__snapshots__/CatalogTile.test.tsx.snap b/packages/module/src/components/CatalogTile/__snapshots__/CatalogTile.test.tsx.snap index ea32543..5519f51 100644 --- a/packages/module/src/components/CatalogTile/__snapshots__/CatalogTile.test.tsx.snap +++ b/packages/module/src/components/CatalogTile/__snapshots__/CatalogTile.test.tsx.snap @@ -2,14 +2,46 @@ exports[`CatalogTile href renders properly 1`] = ` - +
+
+
+
+ +
+
+
+
+
@@ -42,7 +74,7 @@ exports[`CatalogTile href renders properly 1`] = `
-
+
`; @@ -54,7 +86,6 @@ exports[`CatalogTile renders properly 1`] = ` data-ouia-component-id="OUIA-Generated-Card-1" data-ouia-component-type="PF6/Card" data-ouia-safe="true" - href="#" id="single-badge-test" >
-
- + - + `;