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

Add support section with contact and faq pages #5649

Closed
wants to merge 10 commits into from
7 changes: 5 additions & 2 deletions frontend-react/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ import Spinner from "./components/Spinner";
import Submissions from "./pages/submissions/Submissions";
import { GettingStartedPublicHealthDepartments } from "./pages/getting-started/public-health-departments";
import { GettingStartedTestingFacilities } from "./pages/getting-started/testing-facilities";
import { SupportFaq } from "./pages/support/faq";
import { SupportContact } from "./pages/support/contact";
import { AdminMain } from "./pages/admin/AdminMain";
import { AdminOrgEdit } from "./pages/admin/AdminOrgEdit";
import { EditReceiverSettings } from "./components/Admin/EditReceiverSettings";
Expand All @@ -48,6 +46,7 @@ import { DAPHeader } from "./components/header/DAPHeader";
import ValueSetsIndex from "./pages/admin/value-set-editor/ValueSetsIndex";
import SessionProvider from "./contexts/SessionContext";
import BuiltForYouIndex from "./pages/built-for-you/BuiltForYouIndex";
import SupportIndex from "./pages/support/SupportIndex";
import InternalUserGuides from "./pages/admin/InternalUserGuides";

const OKTA_AUTH = new OktaAuth(oktaAuthConfig);
Expand Down Expand Up @@ -158,6 +157,10 @@ const App = () => {
path="/built-for-you"
component={BuiltForYouIndex}
/>
<Route
path="/support"
component={SupportIndex}
/>
<AuthorizedRoute
path="/daily-data"
authorize={PERMISSIONS.RECEIVER}
Expand Down
7 changes: 6 additions & 1 deletion frontend-react/src/components/header/ReportStreamHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import {
FeatureFlagName,
} from "../../pages/misc/FeatureFlags";
import { BuiltForYouDropdown } from "../../pages/built-for-you/BuiltForYouIndex";
import { SupportDropdown } from "../../pages/support/SupportIndex";

import { SignInOrUser } from "./SignInOrUser";
import {
Expand All @@ -34,7 +35,11 @@ export const ReportStreamHeader = () => {
const { authState } = useOktaAuth();
const { memberships } = useSessionContext();
const [expanded, setExpanded] = useState(false);
let itemsMenu = [<GettingStartedDropdown />, <HowItWorksDropdown />];
let itemsMenu = [
<GettingStartedDropdown />,
<HowItWorksDropdown />,
<SupportDropdown />,
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're not shipping with content, let's add this dynamically with CheckFeatureFlag("support") like we do down on line 42 with Built For You

];

const toggleMobileNav = (): void =>
setExpanded((prvExpanded) => !prvExpanded);
Expand Down
3 changes: 3 additions & 0 deletions frontend-react/src/content/support/contact.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Contact us

Foo baz bar
3 changes: 3 additions & 0 deletions frontend-react/src/content/support/faq.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Frequently asked questions

yo
28 changes: 28 additions & 0 deletions frontend-react/src/pages/support/SupportIndex.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import React from "react";

import { MarkdownDirectory } from "../../components/Markdown/MarkdownDirectory";
import StaticPageFromDirectories from "../../components/Markdown/StaticPageFromDirectories";
import faq from "../../content/support/faq.md";
import contact from "../../content/support/contact.md";
import DropdownNav from "../../components/header/DropdownNav";

/* This controls the content for Support
*
* visit: https://reportstream.cdc.gov/admin/guides/create-markdown-pages
* for mor info on how to edit this directory */
export const SUPPORT: MarkdownDirectory[] = [
new MarkdownDirectory("Frequently asked questions", "faq", [faq]),
new MarkdownDirectory("Contact", "contact", [contact]),
];

/* This generates the navigation item for Built For You
* Import and use this in ReportStreamHeader */
export const SupportDropdown = () => {
return (
<DropdownNav label="Support" root="/support" directories={SUPPORT} />
);
};

/* Creates the page and side-nav from your directory array */
const SupportIndex = () => <StaticPageFromDirectories directories={SUPPORT} />;
export default SupportIndex;
Loading