From a684d1595cadd0ef33b1fab58a8aff6890204c81 Mon Sep 17 00:00:00 2001 From: Martin Rohrmeier Date: Thu, 11 Apr 2024 09:28:33 +0200 Subject: [PATCH] fix(compatibility): re-introduce props --- CHANGELOG.md | 4 ++++ package.json | 6 +++--- src/components/content/Cards/CardHorizontal.tsx | 10 ++++++++++ src/components/content/Cards/index.tsx | 8 +++++++- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe9f7bd3..09692253 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 3.0.3 + +- Re-introduce some props for backward compatibility + ## 3.0.2 - Remove eclipse dash tool jar: add step to dependencies check to download eclipse dash tool instead diff --git a/package.json b/package.json index c7286f73..3faf074a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@catena-x/portal-shared-components", - "version": "3.0.2", + "version": "3.0.3", "description": "Catena-X Portal Shared Components", "author": "Catena-X Contributors", "license": "Apache-2.0", @@ -91,10 +91,10 @@ "pretty": "prettier --write \"**/*.{ts,tsx,js,jsx,json,css,sass,scss,xml,md}\"", "test": "jest", "test:ci": "CI=true jest", + "start": "yarn start:storybook", "start:dev": "vite", "start:storybook": "storybook dev -p 3006", "build:storybook": "storybook build -o ./storybook", - "storybook": "storybook dev -p 6006", - "build-storybook": "storybook build" + "storybook": "storybook dev -p 6006" } } diff --git a/src/components/content/Cards/CardHorizontal.tsx b/src/components/content/Cards/CardHorizontal.tsx index 801e553b..cc89b1d5 100644 --- a/src/components/content/Cards/CardHorizontal.tsx +++ b/src/components/content/Cards/CardHorizontal.tsx @@ -31,10 +31,12 @@ interface CardHorizontalProps extends CardChipProps { subTitle?: string borderRadius: number imagePath: string + imageAlt?: string description?: string backgroundColor?: string buttonText?: string onBtnClick?: React.MouseEventHandler + expandOnHover?: boolean } export const CardHorizontal = ({ @@ -43,10 +45,18 @@ export const CardHorizontal = ({ subTitle, borderRadius = 0, imagePath, + // @ts-expect-error keep for backward compatibility + imageAlt, description, + // @ts-expect-error keep for backward compatibility + status, + // @ts-expect-error keep for backward compatibility + statusText, buttonText, onBtnClick, backgroundColor, + // @ts-expect-error keep for backward compatibility + expandOnHover = false, }: CardHorizontalProps) => { const theme = useTheme() const boxRef = useRef(null) diff --git a/src/components/content/Cards/index.tsx b/src/components/content/Cards/index.tsx index eab99e50..afb25d44 100644 --- a/src/components/content/Cards/index.tsx +++ b/src/components/content/Cards/index.tsx @@ -43,16 +43,18 @@ interface CardsProps { imageShape?: CardProps['imageShape'] imageLoader?: CardProps['imageLoader'] imageElement?: CardProps['imageElement'] + columns?: number readMoreText?: CardProps['readMoreText'] readMoreLink?: CardProps['readMoreLink'] addButtonClicked?: boolean + showAddNewCard?: boolean newButtonText?: string onNewCardButton?: React.MouseEventHandler onCardClick?: (item: CardItems) => void subMenu?: boolean activeSubmenuOptions?: SubItems[] inactiveSubmenuOptions?: SubItems[] - submenuClick?: (sortMenu: string, id: string | undefined) => undefined + submenuClick?: (sortMenu: string, id?: string) => undefined tooltipText?: string showStatus?: boolean status?: string @@ -69,9 +71,13 @@ export const Cards = ({ imageSize, imageShape, imageLoader, + // @ts-expect-error keep for backward compatibility + columns = 6, expandOnHover, filledBackground, addButtonClicked = false, + // @ts-expect-error keep for backward compatibility + showAddNewCard = false, newButtonText, onNewCardButton, onCardClick = () => {