Skip to content

Commit

Permalink
feat: [M3-7209] – VPC BETA Feedback button (#9879)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwiley-akamai authored Nov 8, 2023
1 parent 2a863b5 commit dddde6c
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@linode/manager": Upcoming Features
---

Add VPC BETA Feedback link to VPC landing and detail pages ([#9879](https://github.com/linode/manager/pull/9879))
5 changes: 5 additions & 0 deletions packages/manager/src/assets/icons/icon-feedback.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions packages/manager/src/components/DocsLink/DocsLink.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export interface DocsLinkProps {
label?: string;
/** A callback function when the link is clicked */
onClick?: () => void;
/* */
icon?: JSX.Element;
}

/**
Expand All @@ -25,7 +27,7 @@ export interface DocsLinkProps {
* - Consider displaying the title of a key guide or product document as the link instead of the generic “Docs”.
*/
export const DocsLink = (props: DocsLinkProps) => {
const { analyticsLabel, href, label, onClick } = props;
const { analyticsLabel, href, label, onClick, icon } = props;

return (
<StyledDocsLink
Expand All @@ -39,7 +41,7 @@ export const DocsLink = (props: DocsLinkProps) => {
className="docsButton"
to={href}
>
<DocsIcon />
{icon ?? <DocsIcon />}
{label ?? 'Docs'}
</StyledDocsLink>
);
Expand Down
16 changes: 16 additions & 0 deletions packages/manager/src/components/LandingHeader/LandingHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Grid from '@mui/material/Unstable_Grid2';
import { styled, useTheme } from '@mui/material/styles';
import * as React from 'react';

import BetaFeedbackIcon from 'src/assets/icons/icon-feedback.svg';
import {
Breadcrumb,
BreadcrumbProps,
Expand All @@ -11,6 +12,7 @@ import { DocsLink } from 'src/components/DocsLink/DocsLink';

export interface LandingHeaderProps {
analyticsLabel?: string;
betaFeedbackLink?: string;
breadcrumbDataAttrs?: { [key: string]: boolean };
breadcrumbProps?: BreadcrumbProps;
buttonDataAttrs?: { [key: string]: boolean | string };
Expand All @@ -35,6 +37,7 @@ export interface LandingHeaderProps {
*/
export const LandingHeader = ({
analyticsLabel,
betaFeedbackLink,
breadcrumbDataAttrs,
breadcrumbProps,
buttonDataAttrs,
Expand Down Expand Up @@ -86,6 +89,19 @@ export const LandingHeader = ({
{!shouldHideDocsAndCreateButtons && (
<Grid>
<Grid alignItems="center" container justifyContent="flex-end">
{betaFeedbackLink && (
<span
style={{
marginRight: `${theme.spacing(2)}`,
}}
>
<DocsLink
href={betaFeedbackLink}
label="BETA Feedback"
icon={<BetaFeedbackIcon />}
/>
</span>
)}
{docsLink ? (
<DocsLink
analyticsLabel={docsAnalyticsLabel}
Expand Down
3 changes: 3 additions & 0 deletions packages/manager/src/features/VPCs/VPCDetail/VPCDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import { useRegionsQuery } from 'src/queries/regions';
import { useVPCQuery } from 'src/queries/vpcs';
import { truncate } from 'src/utilities/truncate';

import { VPC_FEEDBACK_FORM_URL } from 'src/features/VPCs/constants';

import { VPCDeleteDialog } from '../VPCLanding/VPCDeleteDialog';
import { VPCEditDrawer } from '../VPCLanding/VPCEditDrawer';
import { REBOOT_LINODE_WARNING_VPCDETAILS } from '../constants';
Expand Down Expand Up @@ -97,6 +99,7 @@ const VPCDetail = () => {
<>
<DocumentTitleSegment segment={vpc.label} />
<LandingHeader
betaFeedbackLink={VPC_FEEDBACK_FORM_URL}
breadcrumbProps={{
crumbOverrides: [
{
Expand Down
3 changes: 3 additions & 0 deletions packages/manager/src/features/VPCs/VPCLanding/VPCLanding.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ import { usePagination } from 'src/hooks/usePagination';
import { useVPCsQuery } from 'src/queries/vpcs';
import { getAPIErrorOrDefault } from 'src/utilities/errorUtils';

import { VPC_FEEDBACK_FORM_URL } from 'src/features/VPCs/constants';

import { VPCDeleteDialog } from './VPCDeleteDialog';
import { VPCEditDrawer } from './VPCEditDrawer';
import { VPCEmptyState } from './VPCEmptyState';
Expand Down Expand Up @@ -96,6 +98,7 @@ const VPCLanding = () => {
docsLink="#" // @TODO VPC: Add docs link
onButtonClick={createVPC}
title={VPC_LABEL}
betaFeedbackLink={VPC_FEEDBACK_FORM_URL}
/>
<Table>
<TableHead>
Expand Down
3 changes: 3 additions & 0 deletions packages/manager/src/features/VPCs/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,6 @@ export const VPC_CREATE_FORM_SUBNET_HELPER_TEXT = `A subnet divides a VPC into m

export const VPC_CREATE_FORM_VPC_HELPER_TEXT =
'A virtual private cloud (VPC) is an isolated network which allows for control over how resources are networked and can communicate.';

export const VPC_FEEDBACK_FORM_URL =
'https://docs.google.com/forms/d/e/1FAIpQLScvWbTupCNsBF5cz5YEsv5oErHM4ONBZodDYi8KuOgC8fyfag/viewform';

0 comments on commit dddde6c

Please sign in to comment.