Skip to content

Commit

Permalink
Merge branch 'develop' into M3-8945-update-yup-to-v1
Browse files Browse the repository at this point in the history
  • Loading branch information
bnussman committed Nov 26, 2024
2 parents 3b5eaff + 6abe673 commit b1ee6fb
Show file tree
Hide file tree
Showing 59 changed files with 529 additions and 569 deletions.
33 changes: 19 additions & 14 deletions docs/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,20 +48,23 @@ Please specify a release date (and environment, if applicable) to guarantee time
- [ ] ...
- [ ] ...

## As an Author, I have considered 🤔

- 👀 Doing a self review
- ❔ Our [contribution guidelines](https://github.com/linode/manager/blob/develop/docs/CONTRIBUTING.md)
- 🤏 Splitting feature into small PRs
- ➕ Adding a [changeset](https://github.com/linode/manager/blob/develop/docs/CONTRIBUTING.md#writing-a-changeset)
- 🧪 Providing/improving test coverage
- 🔐 Removing all sensitive information from the code and PR description
- 🚩 Using a feature flag to protect the release
- 👣 Providing comprehensive reproduction steps
- 📑 Providing or updating our documentation
- 🕛 Scheduling a pair reviewing session
- 📱 Providing mobile support
- ♿ Providing accessibility support
<details>
<summary> Author Checklists </summary>

## As an Author, to speed up the review process, I considered 🤔

👀 Doing a self review
❔ Our [contribution guidelines](https://github.com/linode/manager/blob/develop/docs/CONTRIBUTING.md)
🤏 Splitting feature into small PRs
➕ Adding a [changeset](https://github.com/linode/manager/blob/develop/docs/CONTRIBUTING.md#writing-a-changeset)
🧪 Providing/improving test coverage
🔐 Removing all sensitive information from the code and PR description
🚩 Using a feature flag to protect the release
👣 Providing comprehensive reproduction steps
📑 Providing or updating our documentation
🕛 Scheduling a pair reviewing session
📱 Providing mobile support
♿ Providing accessibility support

<br/>

Expand All @@ -73,6 +76,8 @@ Please specify a release date (and environment, if applicable) to guarantee time
- [ ] TypeScript compilation succeeded without errors
- [ ] Code passes all linting rules

</details>

---

## Commit message and pull request title format standards
Expand Down
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-11294-fixed-1732119319735.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

Table and Chart Legend Spacing ([#11294](https://github.com/linode/manager/pull/11294))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-11301-fixed-1732202951516.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Fixed
---

Content shifting on Linode Details summary graphs ([#11301](https://github.com/linode/manager/pull/11301))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-11316-removed-1732523914805.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Removed
---

Move `Accordion` from `manager` to `ui` package ([#11316](https://github.com/linode/manager/pull/11316))
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

As part of creating the PAT token, Enabled a new scope - 'Monitor' within Cloud Manager UI ([#11318](https://github.com/linode/manager/pull/11318))
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tech Stories
---

Further improvements to PR template author checklist sections ([#11325](https://github.com/linode/manager/pull/11325))
5 changes: 5 additions & 0 deletions packages/manager/.changeset/pr-11332-tests-1732639325137.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Tests
---

Fix DBaaS unit test flake ([#11332](https://github.com/linode/manager/pull/11332))
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ describe('Integration Tests for DBaaS Dashboard ', () => {
});

//validate the widget areachart is present
cy.findByTestId('areachart-wrapper').within(() => {
cy.get('.recharts-responsive-container').within(() => {
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
metricsAPIResponsePayload,
testData.title,
Expand Down Expand Up @@ -326,7 +326,7 @@ describe('Integration Tests for DBaaS Dashboard ', () => {
});

//validate the widget areachart is present
cy.findByTestId('areachart-wrapper').within(() => {
cy.get('.recharts-responsive-container').within(() => {
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
metricsAPIResponsePayload,
testData.title,
Expand Down Expand Up @@ -397,7 +397,7 @@ describe('Integration Tests for DBaaS Dashboard ', () => {
.click();
cy.get('@widget').should('be.visible');

cy.findByTestId('areachart-wrapper').within(() => {
cy.get('.recharts-responsive-container').within(() => {
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
metricsAPIResponsePayload,
testData.title,
Expand Down Expand Up @@ -429,7 +429,7 @@ describe('Integration Tests for DBaaS Dashboard ', () => {
.scrollIntoView()
.click({ force: true });
cy.get('@widget').should('be.visible');
cy.findByTestId('areachart-wrapper').within(() => {
cy.get('.recharts-responsive-container').within(() => {
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
metricsAPIResponsePayload,
testData.title,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ describe('Integration Tests for Linode Dashboard ', () => {
});

//validate the widget areachart is present
cy.findByTestId('areachart-wrapper').within(() => {
cy.get('.recharts-responsive-container').within(() => {
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
metricsAPIResponsePayload,
testData.title,
Expand Down Expand Up @@ -295,7 +295,7 @@ describe('Integration Tests for Linode Dashboard ', () => {
});

//validate the widget areachart is present
cy.findByTestId('areachart-wrapper').within(() => {
cy.get('.recharts-responsive-container').within(() => {
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
metricsAPIResponsePayload,
testData.title,
Expand Down Expand Up @@ -368,7 +368,7 @@ describe('Integration Tests for Linode Dashboard ', () => {
.should('be.enabled')
.click();
cy.get('@widget').should('be.visible');
cy.findByTestId('areachart-wrapper').within(() => {
cy.get('.recharts-responsive-container').within(() => {
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
metricsAPIResponsePayload,
testData.title,
Expand Down Expand Up @@ -401,7 +401,7 @@ describe('Integration Tests for Linode Dashboard ', () => {
.click({ force: true });
cy.get('@widget').should('be.visible');

cy.findByTestId('areachart-wrapper').within(() => {
cy.get('.recharts-responsive-container').within(() => {
const expectedWidgetValues = getWidgetLegendRowValuesFromResponse(
metricsAPIResponsePayload,
testData.title,
Expand Down
28 changes: 23 additions & 5 deletions packages/manager/src/components/AreaChart/AreaChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,26 @@ interface XAxisProps {
tickFormat: string;

/**
* represents the pixer gap between two x-axis ticks
* represents the pixel gap between two x-axis ticks
*/
tickGap: number;
}

interface YAxisProps {
/**
* The formatter function for the y-axis tick.
*/
tickFormat: () => string;
}

export interface AreaChartProps {
/**
* list of areas to be displayed
*/
areas: AreaProps[];

/**
* arialabel for the graph
* aria-label for the graph
*/
ariaLabel: string;

Expand Down Expand Up @@ -154,6 +161,11 @@ export interface AreaChartProps {
* non-zero value : this many ticks will be generated based on the starting & ending timestamp in the data
*/
xAxisTickCount?: number;

/**
* y-axis properties
*/
yAxisProps?: YAxisProps;
}

export const AreaChart = (props: AreaChartProps) => {
Expand All @@ -176,6 +188,7 @@ export const AreaChart = (props: AreaChartProps) => {
width = '100%',
xAxis,
xAxisTickCount,
yAxisProps,
} = props;

const theme = useTheme();
Expand Down Expand Up @@ -254,7 +267,7 @@ export const AreaChart = (props: AreaChartProps) => {
};

return (
<Box data-testid="areachart-wrapper">
<>
<ResponsiveContainer height={height} width={width}>
<_AreaChart aria-label={ariaLabel} data={data} margin={margin}>
<CartesianGrid
Expand All @@ -277,7 +290,12 @@ export const AreaChart = (props: AreaChartProps) => {
tickFormatter={xAxisTickFormatter}
type="number"
/>
<YAxis stroke={theme.color.label} tickFormatter={humanizeLargeData} />
<YAxis
tickFormatter={
yAxisProps?.tickFormat ? yAxisProps.tickFormat : humanizeLargeData
}
stroke={theme.color.label}
/>
<Tooltip
contentStyle={{
color: theme.tokens.color.Neutrals[70],
Expand Down Expand Up @@ -333,7 +351,7 @@ export const AreaChart = (props: AreaChartProps) => {
timezone={timezone}
unit={unit}
/>
</Box>
</>
);
};

Expand Down
6 changes: 3 additions & 3 deletions packages/manager/src/components/AreaChart/utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ describe('tooltipLabelFormatter', () => {

describe('tooltipValueFormatter', () => {
it('should return the rounded value up to a max of 2 decimals', () => {
expect(tooltipValueFormatter(5.434939999999999, ' Kb/s')).toBe('5.43 Kb/s');
expect(tooltipValueFormatter(5, ' Kb/s')).toBe('5 Kb/s');
expect(tooltipValueFormatter(0.000234, '%')).toBe('0%');
expect(tooltipValueFormatter(5.434939999999999, 'Kb/s')).toBe('5.43 Kb/s');
expect(tooltipValueFormatter(5, 'Kb/s')).toBe('5 Kb/s');
expect(tooltipValueFormatter(0.000234, '%')).toBe('0 %');
});
});

Expand Down
2 changes: 1 addition & 1 deletion packages/manager/src/components/AreaChart/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const tooltipLabelFormatter = (timestamp: number, timezone: string) =>
);

export const tooltipValueFormatter = (value: number, unit: string) =>
`${roundTo(value)}${unit}`;
`${roundTo(value)} ${unit}`;

export const humanizeLargeData = (value: number) => {
if (value >= 1000000000000) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const StyledButton = styled(Button, {
label: 'StyledButton',
shouldForwardProp: omittedProps(['legendColor', 'hidden']),
})<{ legendColor?: string }>(({ hidden, legendColor, theme }) => ({
padding: 0,
...(legendColor && {
'&:before': {
backgroundColor: hidden
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ describe('CPUMetrics', () => {
/>
);

for (const value of ['10.00%', '5.50%', '7.75%']) {
for (const value of ['10.00 %', '5.50 %', '7.75 %']) {
expect(getByText(value)).toBeVisible();
}
});
Expand Down
8 changes: 3 additions & 5 deletions packages/manager/src/components/LineGraph/MetricsDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,13 @@ export const MetricsDisplay = ({
rows,
}: Props) => (
<StyledTable
sx={(theme) => ({
sx={{
'.MuiTable-root': {
border: 0,
},
height: legendHeight,
overflowY: 'auto',
[theme.breakpoints.up(1100)]: {
height: legendHeight,
},
})}
}}
aria-label="Stats and metrics"
stickyHeader
>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { Box, Divider, omittedProps } from '@linode/ui';
import { Accordion, Box, Divider, omittedProps } from '@linode/ui';
import { styled } from '@mui/material/styles';
import Grid from '@mui/material/Unstable_Grid2';
import { Link } from 'react-router-dom';

import AkamaiLogo from 'src/assets/logo/akamai-logo.svg';
import { Accordion } from 'src/components/Accordion';
import { SIDEBAR_WIDTH } from 'src/components/PrimaryNav/SideMenu';

export const StyledGrid = styled(Grid, {
Expand Down
1 change: 0 additions & 1 deletion packages/manager/src/components/Table/Table.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ export const StyledTableWrapper = styled('div', {
borderRight: `1px solid ${theme.borderColors.borderTable}`,
borderTop: `1px solid ${theme.borderColors.borderTable}`,
fontFamily: theme.font.bold,
padding: '10px 15px',
},
},
marginBottom: props.spacingBottom !== undefined ? props.spacingBottom : 0,
Expand Down
3 changes: 1 addition & 2 deletions packages/manager/src/features/Account/AutoBackups.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { Notice, Typography } from '@linode/ui';
import { Accordion, Notice, Typography } from '@linode/ui';
import Grid from '@mui/material/Unstable_Grid2';
import * as React from 'react';
import { makeStyles } from 'tss-react/mui';

import { Accordion } from 'src/components/Accordion';
import { FormControlLabel } from 'src/components/FormControlLabel';
import { Link } from 'src/components/Link';
import { Toggle } from 'src/components/Toggle/Toggle';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Button } from '@linode/ui';
import { Accordion, Button } from '@linode/ui';
import Grid from '@mui/material/Unstable_Grid2';
import * as React from 'react';

import { Accordion } from 'src/components/Accordion';
import { useProfile } from 'src/queries/profile/profile';

import CloseAccountDialog from './CloseAccountDialog';
Expand Down
3 changes: 1 addition & 2 deletions packages/manager/src/features/Account/EnableManaged.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { enableManaged } from '@linode/api-v4/lib/managed';
import { Button, Typography } from '@linode/ui';
import { Accordion, Button, Typography } from '@linode/ui';
import Grid from '@mui/material/Unstable_Grid2';
import { useQueryClient } from '@tanstack/react-query';
import * as React from 'react';

import { Accordion } from 'src/components/Accordion';
import { ActionsPanel } from 'src/components/ActionsPanel/ActionsPanel';
import { ConfirmationDialog } from 'src/components/ConfirmationDialog/ConfirmationDialog';
import { Link } from 'src/components/Link';
Expand Down
3 changes: 1 addition & 2 deletions packages/manager/src/features/Account/NetworkHelper.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { Typography } from '@linode/ui';
import { Accordion, Typography } from '@linode/ui';
import Grid from '@mui/material/Unstable_Grid2';
import * as React from 'react';

import { Accordion } from 'src/components/Accordion';
import { FormControlLabel } from 'src/components/FormControlLabel';
import { Toggle } from 'src/components/Toggle/Toggle';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
Accordion,
Box,
Button,
CircleProgress,
Expand All @@ -9,7 +10,6 @@ import {
import { enqueueSnackbar } from 'notistack';
import * as React from 'react';

import { Accordion } from 'src/components/Accordion';
import { Link } from 'src/components/Link';
import { TypeToConfirmDialog } from 'src/components/TypeToConfirmDialog/TypeToConfirmDialog';
import { useAccountSettings } from 'src/queries/account/settings';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export const CloudPulseLineGraph = React.memo((props: CloudPulseLineGraph) => {
<AreaChart
{...rest}
fillOpacity={0.5}
legendHeight={theme.spacing(16)}
legendHeight="150px"
xAxisTickCount={isSmallScreen ? undefined : 7}
/>
)}
Expand Down
Loading

0 comments on commit b1ee6fb

Please sign in to comment.