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

feat: [M3-7169, M3-7193, M3-7211, M3-7255, M3-7258] - VPC UX feedback #9832

Merged
merged 13 commits into from
Oct 27, 2023
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

VPC UX feedback ([#9832](https://github.com/linode/manager/pull/9832))
7 changes: 3 additions & 4 deletions packages/manager/src/assets/icons/entityIcons/vpc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ const SelectedOptionsHeader = styled('h4', {
color: theme.color.headline,
fontFamily: theme.font.bold,
fontSize: '14px',
fontWeight: 300,
textTransform: 'initial',
}));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ export const VPCPanel = (props: VPCPanelProps) => {
</Typography>
<TooltipIcon
text={
'A range of non-internet facing IP addresses used in an internal network.'
'A VPC IPv4 is the private IP address for this Linode in the VPC.'
}
status="help"
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,19 @@ import { useFormik } from 'formik';
import * as React from 'react';

import { Autocomplete } from 'src/components/Autocomplete/Autocomplete';
import { Box } from 'src/components/Box';
import { Button } from 'src/components/Button/Button';
import { Checkbox } from 'src/components/Checkbox';
import { DownloadCSV } from 'src/components/DownloadCSV/DownloadCSV';
import { Drawer } from 'src/components/Drawer';
import { FormControlLabel } from 'src/components/FormControlLabel';
import { FormHelperText } from 'src/components/FormHelperText';
import { Link } from 'src/components/Link';
import { Notice } from 'src/components/Notice/Notice';
import { RemovableSelectionsList } from 'src/components/RemovableSelectionsList/RemovableSelectionsList';
import { TextField } from 'src/components/TextField';
import { TooltipIcon } from 'src/components/TooltipIcon';
import { Typography } from 'src/components/Typography';
import { useFormattedDate } from 'src/hooks/useFormattedDate';
import { useUnassignLinode } from 'src/hooks/useUnassignLinode';
import { useAllLinodesQuery } from 'src/queries/linodes/linodes';
Expand Down Expand Up @@ -367,16 +371,29 @@ export const SubnetAssignLinodesDrawer = (
sx={{ marginBottom: '8px' }}
value={values.selectedLinode || null}
/>
<Checkbox
toolTipText={
'A range of non-internet facing IP used in an internal network'
}
checked={autoAssignIPv4}
disabled={userCannotAssignLinodes}
onChange={handleAutoAssignIPv4Change}
sx={{ marginLeft: `2px`, marginTop: `8px` }}
text={'Auto-assign a VPC IPv4 address for this Linode'}
/>
<Box alignItems="center" display="flex" flexDirection="row">
<FormControlLabel
hana-akamai marked this conversation as resolved.
Show resolved Hide resolved
control={
<Checkbox
checked={autoAssignIPv4}
onChange={handleAutoAssignIPv4Change}
/>
}
label={
<Typography>
Auto-assign a VPC IPv4 address for this Linode
</Typography>
}
data-testid="vpc-ipv4-checkbox"
sx={{ marginRight: 0 }}
/>
<TooltipIcon
text={
'A VPC IPv4 is the private IP address for this Linode in the VPC.'
hana-akamai marked this conversation as resolved.
Show resolved Hide resolved
}
status="help"
/>
</Box>
{!autoAssignIPv4 && (
<TextField
onChange={(e) => {
Expand Down Expand Up @@ -446,22 +463,24 @@ export const SubnetAssignLinodesDrawer = (
preferredDataLabel="linodeConfigLabel"
selectionData={assignedLinodesAndConfigData}
/>
<DownloadCSV
sx={{
alignItems: 'flex-start',
display: 'flex',
gap: 1,
marginTop: 2,
textAlign: 'left',
}}
buttonType="styledLink"
csvRef={csvRef}
data={assignedLinodesAndConfigData}
filename={`linodes-assigned-${formattedDate}.csv`}
headers={SUBNET_LINODE_CSV_HEADERS}
onClick={downloadCSV}
text={'Download List of Assigned Linodes (.csv)'}
/>
{assignedLinodesAndConfigData.length > 0 && (
<DownloadCSV
sx={{
alignItems: 'flex-start',
display: 'flex',
gap: 1,
marginTop: 2,
textAlign: 'left',
}}
buttonType="styledLink"
csvRef={csvRef}
data={assignedLinodesAndConfigData}
filename={`linodes-assigned-${formattedDate}.csv`}
headers={SUBNET_LINODE_CSV_HEADERS}
onClick={downloadCSV}
text={'Download List of Assigned Linodes (.csv)'}
/>
)}
<StyledButtonBox>
<Button buttonType="outlined" onClick={handleOnClose}>
Done
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,22 +320,24 @@ export const SubnetUnassignLinodesDrawer = React.memo(
onRemove={handleRemoveLinode}
selectionData={selectedLinodes}
/>
<DownloadCSV
sx={{
alignItems: 'flex-start',
display: 'flex',
gap: 1,
marginTop: 2,
textAlign: 'left',
}}
buttonType="styledLink"
csvRef={csvRef}
data={selectedLinodes}
filename={`linodes-unassigned-${formattedDate}.csv`}
headers={SUBNET_LINODE_CSV_HEADERS}
onClick={downloadCSV}
text={'Download List of Unassigned Linodes (.csv)'}
/>
{selectedLinodes.length > 0 && (
<DownloadCSV
sx={{
alignItems: 'flex-start',
display: 'flex',
gap: 1,
marginTop: 2,
textAlign: 'left',
}}
buttonType="styledLink"
csvRef={csvRef}
data={selectedLinodes}
filename={`linodes-unassigned-${formattedDate}.csv`}
headers={SUBNET_LINODE_CSV_HEADERS}
onClick={downloadCSV}
text={'Download List of Unassigned Linodes (.csv)'}
/>
)}
<ActionsPanel
primaryButtonProps={{
'data-testid': 'unassign-submit-button',
Expand Down
20 changes: 15 additions & 5 deletions packages/manager/src/features/VPCs/VPCDetail/VPCDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,21 @@ const VPCDetail = () => {
</Box>
</EntityHeader>
<StyledPaper>
<StyledSummaryBox display="flex" flex={1} data-qa-vpc-summary>
<StyledSummaryBox data-qa-vpc-summary display="flex" flex={1}>
{summaryData.map((col) => {
return (
<Box key={col[0].label} paddingRight={6}>
<StyledSummaryTextTypography>
<strong>{col[0].label}</strong> {col[0].value}
<span style={{ fontFamily: theme.font.bold }}>
{col[0].label}
</span>{' '}
{col[0].value}
</StyledSummaryTextTypography>
<StyledSummaryTextTypography>
<strong>{col[1].label}</strong> {col[1].value}
<span style={{ fontFamily: theme.font.bold }}>
{col[1].label}
</span>{' '}
{col[1].value}
</StyledSummaryTextTypography>
</Box>
);
Expand All @@ -149,7 +155,9 @@ const VPCDetail = () => {
{vpc.description.length > 0 && (
<StyledDescriptionBox display="flex" flex={1}>
<Typography>
<strong style={{ paddingRight: 8 }}>Description</strong>{' '}
<span style={{ fontFamily: theme.font.bold, paddingRight: 8 }}>
Description
</span>{' '}
</Typography>
<Typography>
{description}{' '}
Expand Down Expand Up @@ -184,7 +192,9 @@ const VPCDetail = () => {
})}
padding={`${theme.spacing(2)} ${theme.spacing()}`}
>
<Typography variant="h2">Subnets ({vpc.subnets.length})</Typography>
<Typography sx={{ fontSize: '1rem' }} variant="h2">
Subnets ({vpc.subnets.length})
</Typography>
</Box>
{numLinodes > 0 && (
<DismissibleBanner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ import {
gettingStartedGuides,
youtubeLinkData,
} from 'src/features/Linodes/LinodesLanding/LinodesLandingEmptyStateData';
import { headers, linkAnalyticsEvent } from './VPCEmptyStateData';
import { sendEvent } from 'src/utilities/analytics';

import { headers, linkAnalyticsEvent } from './VPCEmptyStateData';

export const VPCEmptyState = () => {
const { push } = useHistory();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import type {
} from 'src/components/EmptyLandingPageResources/ResourcesLinksTypes';

export const headers: ResourcesHeaders = {
description: '',
subtitle: 'Create a private and isolated network.',
title: 'VPCs',
description:
'Enable cloud resources to privately and securely communicate with each other, the internet, and other private networks.',
subtitle: 'Create a private and isolated network',
title: 'Virtual Private Cloud (VPC)',
};

export const linkAnalyticsEvent: ResourcesLinks['linkAnalyticsEvent'] = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ describe('VPC Landing Table', () => {
await waitForElementToBeRemoved(getByTestId(loadingTestId));

expect(
getByText('Create a private and isolated network.')
getByText('Create a private and isolated network')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was bugging me the other day -- glad it was already on UX's radar! πŸ˜„ 🧹

).toBeInTheDocument();
});
});