mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
UI/Card: Remove deprecated props (#49885)
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
Reference in New Issue
Block a user