UI/Card: Remove deprecated props (#49885) (#49900)

(cherry picked from commit d590012a18)

Co-authored-by: kay delaney <45561153+kaydelaney@users.noreply.github.com>
This commit is contained in:
Grot (@grafanabot)
2022-05-31 13:38:22 +01:00
committed by GitHub
co-authored by kay delaney
parent a87062e4e6
commit a8dbc1eaa0
2 changed files with 6 additions and 22 deletions
@@ -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 */
@@ -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>