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-7358] - Add AGLB Feedback Link #9885

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

Add AGLB Feedback Link ([#9885](https://github.com/linode/manager/pull/9885))
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Grid from '@mui/material/Unstable_Grid2';
import { styled, useTheme } from '@mui/material/styles';
import { Theme, styled, useTheme } from '@mui/material/styles';
import useMediaQuery from '@mui/material/useMediaQuery';
import * as React from 'react';

import BetaFeedbackIcon from 'src/assets/icons/icon-feedback.svg';
Expand Down Expand Up @@ -59,6 +60,8 @@ export const LandingHeader = ({
const renderActions = Boolean(onButtonClick || extraActions);
const labelTitle = title?.toString();

const xsDown = useMediaQuery((theme: Theme) => theme.breakpoints.down('sm'));

const docsAnalyticsLabel = analyticsLabel
? analyticsLabel
: `${title} Landing`;
Expand Down Expand Up @@ -92,13 +95,14 @@ export const LandingHeader = ({
{betaFeedbackLink && (
<span
style={{
marginLeft: xsDown ? `${theme.spacing(2)}` : undefined,
marginRight: `${theme.spacing(2)}`,
}}
>
<DocsLink
href={betaFeedbackLink}
label="BETA Feedback"
icon={<BetaFeedbackIcon />}
label="BETA Feedback"
/>
</span>
)}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { CreateBasicLoadbalancerSchema } from '@linode/validation';
import { useFormik } from 'formik';
import { useSnackbar } from 'notistack';
import * as React from 'react';
Expand All @@ -11,11 +12,11 @@ import { Notice } from 'src/components/Notice/Notice';
import { Paper } from 'src/components/Paper';
import { Stack } from 'src/components/Stack';
import { TextField } from 'src/components/TextField';
import { AGLB_FEEDBACK_FORM_URL } from 'src/features/LoadBalancers/constants';
import { useLoadBalancerBasicCreateMutation } from 'src/queries/aglb/loadbalancers';
import { getFormikErrorsFromAPIErrors } from 'src/utilities/formikErrorUtils';

import { LoadBalancerRegions } from './LoadBalancerRegions';
import { CreateBasicLoadbalancerSchema } from '@linode/validation';

export const LoadBalancerBasicCreate = () => {
const {
Expand Down Expand Up @@ -63,6 +64,7 @@ export const LoadBalancerBasicCreate = () => {
],
pathname: location.pathname,
}}
betaFeedbackLink={AGLB_FEEDBACK_FORM_URL}
title="Create"
/>
<Stack spacing={3}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import * as React from 'react';

import { DocumentTitleSegment } from 'src/components/DocumentTitle/DocumentTitle';
import { LandingHeader } from 'src/components/LandingHeader';
import { AGLB_FEEDBACK_FORM_URL } from 'src/features/LoadBalancers/constants';

import { LoadBalancerActionPanel } from './LoadBalancerActionPanel';
import { LoadBalancerConfiguration } from './LoadBalancerConfiguration';
Expand Down Expand Up @@ -32,6 +33,7 @@ export const LoadBalancerCreate = () => {
],
pathname: location.pathname,
}}
betaFeedbackLink={AGLB_FEEDBACK_FORM_URL}
title="Create"
/>
<Formik<CreateLoadbalancerPayload>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { LandingHeader } from 'src/components/LandingHeader';
import { Tabs } from 'src/components/ReachTabs';
import { SuspenseLoader } from 'src/components/SuspenseLoader';
import { TabLinkList } from 'src/components/TabLinkList/TabLinkList';
import { AGLB_FEEDBACK_FORM_URL } from 'src/features/LoadBalancers/constants';
import { useLoadBalancerQuery } from 'src/queries/aglb/loadbalancers';

const LoadBalancerSummary = React.lazy(() =>
Expand Down Expand Up @@ -103,6 +104,7 @@ export const LoadBalancerDetail = () => {
labelOptions: { noCap: true },
pathname: `/loadbalancers/${loadbalancer?.label}`,
}}
betaFeedbackLink={AGLB_FEEDBACK_FORM_URL}
docsLabel="Docs"
docsLink="" // TODO: AGLB - Add docs link
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { TableCell } from 'src/components/TableCell';
import { TableHead } from 'src/components/TableHead';
import { TableRow } from 'src/components/TableRow';
import { TableSortCell } from 'src/components/TableSortCell';
import { AGLB_FEEDBACK_FORM_URL } from 'src/features/LoadBalancers/constants';
import { useOrder } from 'src/hooks/useOrder';
import { usePagination } from 'src/hooks/usePagination';
import { useLoadBalancersQuery } from 'src/queries/aglb/loadbalancers';
Expand Down Expand Up @@ -95,6 +96,7 @@ export const LoadBalancerLanding = () => {
) : (
<>
<LandingHeader
betaFeedbackLink={AGLB_FEEDBACK_FORM_URL}
breadcrumbProps={{ pathname: '/loadbalancers' }}
createButtonText="Create Load Balancer"
docsLabel="Docs"
Expand Down
2 changes: 2 additions & 0 deletions packages/manager/src/features/LoadBalancers/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const AGLB_FEEDBACK_FORM_URL =
'https://docs.google.com/forms/d/e/1FAIpQLSdfetx9VvwjUAC_gdGQai_FpZN4xZ1GZGW54abezS2aV5rCcQ/viewform';
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ describe('TicketAttachmentList component', () => {
});
it('should render all attachment when show more is clicked', () => {
const { getByText } = renderWithTheme(<TicketAttachmentList {...props} />);
const showMoreButton = getByText("Show More Files").closest('button');
const showMoreButton = getByText('Show More Files').closest('button');
userEvent.click(showMoreButton!);
for (const attachment of props.attachments) {
expect(getByText(attachment)).toBeVisible();
Expand Down