Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecations, October 2021 Edition #5323

Merged
merged 27 commits into from
Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
1ed22be
remove betaBadgeLabel, betaBadgeTooltipContent, betaBadgeTitle props …
thompsongl Oct 25, 2021
bebb30d
remove panelPaddingSize from EuiPageContent
thompsongl Oct 25, 2021
805cd26
remove secondary color prop options
thompsongl Oct 25, 2021
4ab8a68
remove makeId
thompsongl Oct 25, 2021
036b25b
remove old mobile only props from EuiTableRowCell
thompsongl Oct 25, 2021
e0a137d
remove EuiLoadingKibana
thompsongl Oct 25, 2021
ce99781
remove EuiCodeEditor
thompsongl Oct 25, 2021
0a9af3b
remove loading_kibana and code_editor scss imports
thompsongl Oct 26, 2021
29689c9
remove subdued color prop option from EuiButtonIcon
thompsongl Oct 26, 2021
cf6397f
Merge branch 'master' into 1469-october-2021
thompsongl Oct 26, 2021
d3b3f7e
CL
thompsongl Oct 26, 2021
84fea9e
secondary -> success
thompsongl Oct 27, 2021
b9c8acd
EuiCard beta badge:
Oct 27, 2021
0ca8103
Removing `secondary`: More finds
Oct 27, 2021
6a4ce22
EuiTableRowCell mobile props:
Oct 27, 2021
097b0e6
EuiLoadingKibana
Oct 27, 2021
b41f1f8
Merge branch '1469-october-2021' of https://github.com/thompsongl/eui…
thompsongl Oct 28, 2021
321a903
clean up
thompsongl Oct 28, 2021
eae3495
[EuiButtonDisplay] Setting better fallbacks for color vs `null`
Oct 28, 2021
9a8ac1e
Merge branch 'master' into 1469-october-2021
thompsongl Oct 28, 2021
a25f002
Merge branch '1469-october-2021' of https://github.com/thompsongl/eui…
thompsongl Oct 28, 2021
c9f9525
restore i18ntokens.json
thompsongl Oct 28, 2021
66ef400
Merge branch 'master' into 1469-october-2021
thompsongl Oct 28, 2021
ae1bca6
Found more `mobileOptions.fullWidth`
Oct 28, 2021
0dde0a3
🤦‍♀️ Undo `secondary` button
Oct 28, 2021
2d70163
A couple last fixes found from console errors
Oct 28, 2021
6e285a8
cl
Oct 28, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src-docs/src/views/card/card_beta.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ const cardNodes = icons.map(function (item, index) {
icon={<EuiIcon size="xxl" type={`${item}App`} />}
title={`Kibana ${item}`}
description="Example of a card's description. Stick to one or two sentences."
betaBadgeLabel={badges[index]}
betaBadgeTooltipContent={
badges[index]
betaBadgeProps={{
label: badges[index],
tooltipContent: badges[index]
? 'This module is not GA. Please help us by reporting any bugs.'
: undefined
}
: undefined,
}}
onClick={() => {}}
/>
</EuiFlexItem>
Expand All @@ -41,9 +41,9 @@ export default () => (
betaBadgeProps={{
href: 'http://www.elastic.co/subscriptions',
target: '_blank',
label: 'Basic',
tooltipContent: 'This feature requires a Basic License',
}}
betaBadgeLabel="Basic"
betaBadgeTooltipContent="This feature requires a Basic License"
onClick={() => {}}
/>
</EuiFlexItem>
Expand Down
7 changes: 5 additions & 2 deletions src-docs/src/views/card/card_display.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ export default () => (
title="Transparent"
display="transparent"
description="This one doesn't have a background color anymore."
betaBadgeLabel="Beta"
betaBadgeTooltipContent="This module is not GA. Please help us by reporting any bugs."
betaBadgeProps={{
label: 'Beta',
tooltipContent:
'This module is not GA. Please help us by reporting any bugs.',
}}
onClick={() => {}}
/>
</EuiFlexItem>
Expand Down
16 changes: 9 additions & 7 deletions src-docs/src/views/card/card_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@ export const CardExample = {
text: (
<p>
If the card links to or references a module that is not GA (beta, lab,
etc), you can add a <EuiCode>betaBadgeLabel</EuiCode> and{' '}
<EuiCode>betaBadgeTooltipContent</EuiCode> to the card and it will
properly create and position an <strong>EuiBetaBadge</strong>. If you
want to change the title of the tooltip, supply a{' '}
<EuiCode>betaBadgeTitle</EuiCode> prop.
etc), you can add a <EuiCode>betaBadgeProps.label</EuiCode> and{' '}
<EuiCode>betaBadgeProps.tooltipContent</EuiCode> to the card and it
will properly create and position an <strong>EuiBetaBadge</strong>. If
you want to change the title of the tooltip, supply a{' '}
<EuiCode>betaBadgeProps.title</EuiCode> prop.
</p>
),
props: { EuiCard },
Expand All @@ -259,8 +259,10 @@ export const CardExample = {
title="title"
description="description"
onClick={handleClick}
betaBadgeLabel="betaBadgeLabel"
betaBadgeTooltipContent={betaBadgeTooltipContent}
betaBadgeProps={{
label: 'betaBadgeLabel',
toolTipContent: 'betaBadgeTooltipContent',
}}
/>`,
},
{
Expand Down
5 changes: 0 additions & 5 deletions src-docs/src/views/card/playground.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ export const cardConfig = () => {
type: PropTypes.String,
};

propsToUse.betaBadgeTooltipContent = {
...propsToUse.betaBadgeTooltipContent,
type: PropTypes.String,
};

propsToUse.onClick = simulateFunction(propsToUse.onClick);
propsToUse.display = createOptionalEnum(propsToUse.display);

Expand Down
2 changes: 1 addition & 1 deletion src/components/card/card.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -292,8 +292,8 @@ describe('EuiCard', () => {
description="Card description"
betaBadgeProps={{
href: 'http://www.elastic.co/',
label: 'Link',
}}
betaBadgeLabel="Link"
/>
);

Expand Down
29 changes: 4 additions & 25 deletions src/components/card/card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,24 +121,9 @@ export type EuiCardProps = Omit<CommonProps, 'aria-label'> &
href?: string;
target?: string;
rel?: string;

/**
* Add a badge to the card to label it as "Beta" or other non-GA state
* **DEPRECATED: Use `betaBadgeProps.label` instead.**
*/
betaBadgeLabel?: string;

/**
* Add a description to the beta badge (will appear in a tooltip)
* **DEPRECATED: Use `betaBadgeProps.tooltipContent` instead.**
*/
betaBadgeTooltipContent?: ReactNode;

/**
* Optional title will be supplied as tooltip title or title attribute otherwise the label will be used.
* **DEPRECATED: Use `betaBadgeProps.title` instead.**
* Props to be passed through to the EuiBetaBadge
*/
betaBadgeTitle?: string;
betaBadgeProps?: Partial<EuiBetaBadgeProps>;
cchaos marked this conversation as resolved.
Show resolved Hide resolved
/**
* Matches to the color property of EuiPanel. If defined, removes any border & shadow.
Expand Down Expand Up @@ -186,9 +171,6 @@ export const EuiCard: FunctionComponent<EuiCardProps> = ({
rel,
target,
textAlign = 'center',
betaBadgeLabel,
betaBadgeTooltipContent,
betaBadgeTitle,
betaBadgeProps,
layout = 'vertical',
selectable,
Expand Down Expand Up @@ -234,10 +216,10 @@ export const EuiCard: FunctionComponent<EuiCardProps> = ({
layoutToClassNameMap[layout],
{
'euiCard--isClickable': isClickable,
'euiCard--hasBetaBadge': betaBadgeLabel,
'euiCard--hasBetaBadge': betaBadgeProps?.label,
'euiCard--hasIcon': icon,
'euiCard--isSelectable': selectable,
'euiCard-isSelected': selectable && selectable.isSelected,
'euiCard-isSelected': selectable?.isSelected,
'euiCard-isDisabled': isDisabled,
},
selectableColorClass,
Expand Down Expand Up @@ -287,16 +269,13 @@ export const EuiCard: FunctionComponent<EuiCardProps> = ({

let optionalBetaBadge;
let optionalBetaBadgeID = '';
if (betaBadgeLabel) {
if (betaBadgeProps?.label) {
optionalBetaBadgeID = `${ariaId}BetaBadge`;
optionalBetaBadge = (
<span className="euiCard__betaBadgeWrapper">
<EuiBetaBadge
id={optionalBetaBadgeID}
{...(betaBadgeProps as EuiBetaBadgeProps)}
label={betaBadgeLabel}
title={betaBadgeTitle}
tooltipContent={betaBadgeTooltipContent}
className={classNames(
'euiCard__betaBadge',
betaBadgeProps?.className
Expand Down