Skip to content

Commit c0bfd30

Browse files
upcoming: [M3-9539] - Quotas Tab Beta Chip (#11872)
* save progress * Add proper colors for secondary styles * fix test * Delete old instance of BetaChip * Changesets
1 parent 6dbce74 commit c0bfd30

File tree

11 files changed

+41
-128
lines changed

11 files changed

+41
-128
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Removed
3+
---
4+
5+
Legacy BetaChip component ([#11872](https://github.com/linode/manager/pull/11872))
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/manager": Upcoming Features
3+
---
4+
5+
Quotas Tab Beta Chip ([#11872](https://github.com/linode/manager/pull/11872))

packages/manager/cypress/component/components/beta-chip.spec.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1+
import { BetaChip } from '@linode/ui';
12
import * as React from 'react';
23
import { checkComponentA11y } from 'support/util/accessibility';
34
import { componentTests, visualTests } from 'support/util/components';
45

5-
import { BetaChip } from 'src/components/BetaChip/BetaChip';
6-
76
componentTests('BetaChip', () => {
87
visualTests((mount) => {
98
it('renders "BETA" text indicator with primary color', () => {
@@ -12,7 +11,7 @@ componentTests('BetaChip', () => {
1211
});
1312

1413
it('renders "BETA" text indicator with default color', () => {
15-
mount(<BetaChip color="default" />);
14+
mount(<BetaChip color="secondary" />);
1615
cy.findByText('beta').should('be.visible');
1716
});
1817

@@ -22,7 +21,7 @@ componentTests('BetaChip', () => {
2221
});
2322

2423
it('passes aXe check with default color', () => {
25-
mount(<BetaChip color="default" />);
24+
mount(<BetaChip color="secondary" />);
2625
checkComponentA11y();
2726
});
2827
});

packages/manager/src/components/BetaChip/BetaChip.stories.tsx

Lines changed: 0 additions & 17 deletions
This file was deleted.

packages/manager/src/components/BetaChip/BetaChip.test.tsx

Lines changed: 0 additions & 32 deletions
This file was deleted.

packages/manager/src/components/BetaChip/BetaChip.tsx

Lines changed: 0 additions & 63 deletions
This file was deleted.

packages/manager/src/features/Account/AccountLanding.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { useAccount, useProfile } from '@linode/queries';
2+
import { BetaChip } from '@linode/ui';
23
import { createLazyRoute } from '@tanstack/react-router';
34
import * as React from 'react';
45
import { matchPath, useHistory, useLocation } from 'react-router-dom';
@@ -89,6 +90,7 @@ const AccountLanding = () => {
8990
...(showQuotasTab
9091
? [
9192
{
93+
chip: <BetaChip color="secondary" />,
9294
routeName: '/account/quotas',
9395
title: 'Quotas',
9496
},

packages/manager/src/features/Databases/DatabaseDetail/index.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
import { CircleProgress, ErrorState, Notice } from '@linode/ui';
1+
import { BetaChip, CircleProgress, ErrorState, Notice } from '@linode/ui';
22
import { useEditableLabelState } from '@linode/utilities';
33
import { createLazyRoute } from '@tanstack/react-router';
44
import * as React from 'react';
55
import { matchPath, useHistory, useParams } from 'react-router-dom';
66

7-
import { BetaChip } from 'src/components/BetaChip/BetaChip';
87
import { DocumentTitleSegment } from 'src/components/DocumentTitle';
98
import { LandingHeader } from 'src/components/LandingHeader';
109
import { SafeTabPanel } from 'src/components/Tabs/SafeTabPanel';
@@ -115,7 +114,9 @@ export const DatabaseDetail = () => {
115114

116115
if (isMonitorEnabled) {
117116
tabs.splice(1, 0, {
118-
chip: flags.dbaasV2MonitorMetrics?.beta ? <BetaChip /> : null,
117+
chip: flags.dbaasV2MonitorMetrics?.beta ? (
118+
<BetaChip color="secondary" />
119+
) : null,
119120
routeName: `/databases/${engine}/${id}/monitor`,
120121
title: 'Monitor',
121122
});
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@linode/ui": Fixed
3+
---
4+
5+
BetaChip `color` prop ([#11872](https://github.com/linode/manager/pull/11872))

packages/ui/src/components/BetaChip/BetaChip.test.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,24 +7,24 @@ import { renderWithTheme } from '../../utilities/testHelpers';
77
import { BetaChip } from './BetaChip';
88

99
describe('BetaChip', () => {
10-
it('renders with default color', () => {
10+
it('renders with default color (primary)', () => {
1111
const { getByTestId } = renderWithTheme(<BetaChip />);
1212
const betaChip = getByTestId('betaChip');
1313
expect(betaChip).toBeInTheDocument();
1414
expect(betaChip).toHaveStyle('background-color: rgba(0, 0, 0, 0.08)');
1515
});
1616

1717
it('renders with primary color', () => {
18-
const { getByTestId } = renderWithTheme(<BetaChip color="primary" />);
18+
const { getByTestId } = renderWithTheme(<BetaChip color="secondary" />);
1919
const betaChip = getByTestId('betaChip');
2020
expect(betaChip).toBeInTheDocument();
21-
expect(betaChip).toHaveStyle('background-color: rgb(16, 138, 214)');
21+
expect(betaChip).toHaveStyle('background-color: rgb(131, 131, 140)');
2222
});
2323

2424
it('triggers an onClick callback', () => {
2525
const onClickMock = vi.fn();
2626
const { getByTestId } = renderWithTheme(
27-
<BetaChip color="default" onClick={onClickMock} />
27+
<BetaChip color="primary" onClick={onClickMock} />
2828
);
2929
const betaChip = getByTestId('betaChip');
3030
fireEvent.click(betaChip);

0 commit comments

Comments
 (0)