UI/Card: Remove deprecated props (#49885)

This commit is contained in:
kay delaney
2022-05-31 12:02:20 +01:00
committed by GitHub
parent f4f25d911b
commit d590012a18
2 changed files with 6 additions and 22 deletions

View File

@@ -47,17 +47,7 @@ const CardContext = React.createContext<{
* *
* @public * @public
*/ */
export const Card: CardInterface = ({ export const Card: CardInterface = ({ disabled, href, onClick, children, isSelected, className, ...htmlProps }) => {
disabled,
href,
onClick,
children,
heading: deprecatedHeading,
description: deprecatedDescription,
isSelected,
className,
...htmlProps
}) => {
const hasHeadingComponent = useMemo( const hasHeadingComponent = useMemo(
() => () =>
React.Children.toArray(children).some( React.Children.toArray(children).some(
@@ -81,8 +71,6 @@ export const Card: CardInterface = ({
> >
<CardContext.Provider value={{ href, onClick: onCardClick, disabled, isSelected }}> <CardContext.Provider value={{ href, onClick: onCardClick, disabled, isSelected }}>
{!hasHeadingComponent && <Heading />} {!hasHeadingComponent && <Heading />}
{deprecatedHeading && <Heading>{deprecatedHeading}</Heading>}
{deprecatedDescription && <Description>{deprecatedDescription}</Description>}
{children} {children}
</CardContext.Provider> </CardContext.Provider>
</CardContainer> </CardContainer>
@@ -93,9 +81,6 @@ interface ChildProps {
className?: string; className?: string;
disabled?: boolean; disabled?: boolean;
children?: React.ReactNode; children?: React.ReactNode;
/** @deprecated Use `className` to add new styles */
styles?: ReturnType<typeof getCardStyles>;
} }
/** Main heading for the card */ /** Main heading for the card */

View File

@@ -313,12 +313,11 @@ const DatasourceNotFound = ({ index, onUpdateDatasource, onRemoveQuery, model }:
return ( return (
<EmptyQueryWrapper> <EmptyQueryWrapper>
<QueryOperationRow title={refId} draggable index={index} id={refId} isOpen> <QueryOperationRow title={refId} draggable index={index} id={refId} isOpen>
<Card <Card>
heading="This datasource has been removed" <Card.Heading>This datasource has been removed</Card.Heading>
description={ <Card.Description>
'The datasource for this query was not found, it was either removed or is not installed correctly.' The datasource for this query was not found, it was either removed or is not installed correctly.
} </Card.Description>
>
<Card.Figure> <Card.Figure>
<Icon name="question-circle" /> <Icon name="question-circle" />
</Card.Figure> </Card.Figure>