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 Sidebar Popout for Support Links #11745

Merged
merged 7 commits into from
Apr 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions airbyte-webapp/src/config/uiConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const uiConfig = {
updateLink: `${BASE_DOCS_LINK}/upgrading-airbyte`,
productReleaseStages: `${BASE_DOCS_LINK}/project-overview/product-release-stages`,
slackLink: "https://slack.airbyte.com",
supportTicketLink: "https://airbyte.com/contact-support",
docsLink: BASE_DOCS_LINK,
configurationArchiveLink: `${BASE_DOCS_LINK}/tutorials/upgrading-airbyte`,
normalizationLink: `${BASE_DOCS_LINK}/understanding-airbyte/connections#airbyte-basic-normalization`,
Expand Down
2 changes: 2 additions & 0 deletions airbyte-webapp/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
"sidebar.joinSlack": "Join our Slack",
"sidebar.status": "Airbyte status",
"sidebar.chat": "Chat with us",
"sidebar.support": "Support",
"sidebar.supportTicket": "Submit a Ticket",
"sidebar.recipes": "Tutorials - Use cases",

"form.continue": "Continue",
Expand Down
28 changes: 19 additions & 9 deletions airbyte-webapp/src/packages/cloud/views/layout/SideBar/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { FormattedMessage, FormattedNumber } from "react-intl";
import { NavLink } from "react-router-dom";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faStar } from "@fortawesome/free-regular-svg-icons";
import { faQuestionCircle } from "@fortawesome/free-regular-svg-icons";

import { Link } from "components";

Expand All @@ -20,7 +21,7 @@ import SettingsIcon from "views/layout/SideBar/components/SettingsIcon";
import SourceIcon from "views/layout/SideBar/components/SourceIcon";
import { useGetCloudWorkspace } from "packages/cloud/services/workspaces/WorkspacesService";
import { NotificationIndicator } from "views/layout/SideBar/NotificationIndicator";
import ResourcesPopup, { Icon, Item } from "views/layout/SideBar/components/ResourcesPopup";
import SidebarPopout, { Icon, Item } from "views/layout/SideBar/components/SidebarPopout";
import { FeatureItem, WithFeature } from "hooks/services/Feature";

import { RoutePaths } from "../../../../../pages/routePaths";
Expand Down Expand Up @@ -157,11 +158,21 @@ const SideBar: React.FC = () => {
</MenuItem>
</li>
<li>
<ResourcesPopup
<SidebarPopout options={[{ value: "docs" }, { value: "slack" }, { value: "status" }, { value: "recipes" }]}>
{({ onOpen }) => (
<MenuItem onClick={onOpen} as="div">
<DocsIcon />
<Text>
<FormattedMessage id="sidebar.resources" />
</Text>
</MenuItem>
)}
</SidebarPopout>
</li>
<li>
<SidebarPopout
options={[
{ value: "docs" },
{ value: "slack" },
{ value: "status" },
{ value: "ticket" },
{
value: "chat",
label: (
Expand All @@ -173,18 +184,17 @@ const SideBar: React.FC = () => {
</Item>
),
},
{ value: "recipes" },
]}
>
{({ onOpen }) => (
<MenuItem onClick={onOpen} as="div">
<DocsIcon />
<FontAwesomeIcon icon={faQuestionCircle} size="2x" />
<Text>
<FormattedMessage id="sidebar.resources" />
<FormattedMessage id="sidebar.support" />
</Text>
</MenuItem>
)}
</ResourcesPopup>
</SidebarPopout>
</li>
<li>
<MenuItem to={RoutePaths.Settings}>
Expand Down
6 changes: 3 additions & 3 deletions airbyte-webapp/src/views/layout/SideBar/SideBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import DocsIcon from "./components/DocsIcon";
import OnboardingIcon from "./components/OnboardingIcon";
import SettingsIcon from "./components/SettingsIcon";
import SourceIcon from "./components/SourceIcon";
import ResourcesPopup from "./components/ResourcesPopup";
import SidebarPopout from "./components/SidebarPopout";
import { NotificationIndicator } from "./NotificationIndicator";

const Bar = styled.nav`
Expand Down Expand Up @@ -146,7 +146,7 @@ const SideBar: React.FC = () => {
</MenuLinkItem>
</li>
<li>
<ResourcesPopup options={[{ value: "docs" }, { value: "slack" }, { value: "recipes" }]}>
<SidebarPopout options={[{ value: "docs" }, { value: "slack" }, { value: "recipes" }]}>
{({ onOpen }) => (
<MenuItem onClick={onOpen} as="div">
<DocsIcon />
Expand All @@ -155,7 +155,7 @@ const SideBar: React.FC = () => {
</Text>
</MenuItem>
)}
</ResourcesPopup>
</SidebarPopout>
</li>

<li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import styled from "styled-components";
import { FormattedMessage } from "react-intl";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faSlack } from "@fortawesome/free-brands-svg-icons";
import { faEnvelope } from "@fortawesome/free-regular-svg-icons";

import { Popout } from "components";

Expand All @@ -27,7 +28,7 @@ export const Icon = styled.div`
font-size: 22px;
`;

const ResourcesPopup: React.FC<{
const SidebarPopout: React.FC<{
children: (props: { onOpen: () => void }) => React.ReactNode;
options: { value: string; label?: React.ReactNode }[];
}> = ({ children, options }) => {
Expand Down Expand Up @@ -86,6 +87,18 @@ const ResourcesPopup: React.FC<{
</Item>
),
};
case "ticket":
return {
value: "ticket",
label: (
<Item href={config.ui.supportTicketLink} target="_blank">
<Icon>
<FontAwesomeIcon icon={faEnvelope} />
</Icon>
<FormattedMessage id="sidebar.supportTicket" />
</Item>
),
};
default:
return {
value: item.value,
Expand All @@ -103,7 +116,7 @@ const ResourcesPopup: React.FC<{
menuPortal: (base) => ({
...base,
// TODO: temporary dirty hack
transform: "translate3D(100px, -200px, 0px)",
transform: "translate3D(100px, -100px, 0px)",
}),
}}
isSearchable={false}
Expand All @@ -112,4 +125,4 @@ const ResourcesPopup: React.FC<{
);
};

export default ResourcesPopup;
export default SidebarPopout;