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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 22 deletions

View File

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

View File

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