From 507f1acb41dad0979634f1c4be902c64cac11138 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Mon, 22 Aug 2022 14:54:21 +0200 Subject: [PATCH 1/2] feat(ui) - support link --- frontend/app/Router.js | 9 +++++++-- .../shared/SupportCallout/SupportCallout.tsx | 17 +++++++++++++++++ .../components/shared/SupportCallout/index.ts | 1 + 3 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 frontend/app/components/shared/SupportCallout/SupportCallout.tsx create mode 100644 frontend/app/components/shared/SupportCallout/index.ts diff --git a/frontend/app/Router.js b/frontend/app/Router.js index e8fa64eab..d150ba28a 100644 --- a/frontend/app/Router.js +++ b/frontend/app/Router.js @@ -16,12 +16,13 @@ import { withStore } from 'App/mstore'; import APIClient from './api_client'; import * as routes from './routes'; -import { OB_DEFAULT_TAB } from 'App/routes'; +import { OB_DEFAULT_TAB, isRoute } from 'App/routes'; import Signup from './components/Signup/Signup'; import { fetchTenants } from 'Duck/user'; import { setSessionPath } from 'Duck/sessions'; import { ModalProvider } from './components/Modal'; import { GLOBAL_DESTINATION_PATH } from 'App/constants/storageKeys'; +import SupportCallout from 'Shared/SupportCallout'; const Login = lazy(() => import('Components/Login/Login')); const ForgotPassword = lazy(() => import('Components/ForgotPassword/ForgotPassword')); @@ -103,6 +104,7 @@ const ONBOARDING_REDIRECT_PATH = routes.onboarding(OB_DEFAULT_TAB); tenants: state.getIn(['user', 'tenants']), existingTenant: state.getIn(['user', 'authDetails', 'tenants']), onboarding: state.getIn(['user', 'onboarding']), + isEnterprise: state.getIn(['user', 'account', 'edition']) === 'ee' || state.getIn(['user', 'authDetails', 'edition']) === 'ee', }; }, { @@ -171,9 +173,10 @@ class Router extends React.Component { } render() { - const { isLoggedIn, jwt, siteId, sites, loading, changePassword, location, existingTenant, onboarding } = this.props; + const { isLoggedIn, jwt, siteId, sites, loading, changePassword, location, existingTenant, onboarding, isEnterprise } = this.props; const siteIdList = sites.map(({ id }) => id).toJS(); const hideHeader = (location.pathname && location.pathname.includes('/session/')) || location.pathname.includes('/assist/'); + const isPlayer = isRoute(SESSION_PATH, location.pathname); return isLoggedIn ? ( @@ -230,6 +233,7 @@ class Router extends React.Component { + {!isEnterprise && !isPlayer && } ) : ( }> @@ -239,6 +243,7 @@ class Router extends React.Component { {!existingTenant && } + {!isEnterprise && } ); } diff --git a/frontend/app/components/shared/SupportCallout/SupportCallout.tsx b/frontend/app/components/shared/SupportCallout/SupportCallout.tsx new file mode 100644 index 000000000..951c98274 --- /dev/null +++ b/frontend/app/components/shared/SupportCallout/SupportCallout.tsx @@ -0,0 +1,17 @@ +import React from 'react'; +import SlackIcon from '../../../svg/integrations/slack.svg'; +import { Popup } from 'UI'; + +function SupportCallout() { + return ( + + +
+ +
+
+
+ ); +} + +export default SupportCallout; diff --git a/frontend/app/components/shared/SupportCallout/index.ts b/frontend/app/components/shared/SupportCallout/index.ts new file mode 100644 index 000000000..76db66d7a --- /dev/null +++ b/frontend/app/components/shared/SupportCallout/index.ts @@ -0,0 +1 @@ +export { default } from './SupportCallout'; \ No newline at end of file From 15535278612b6a4061adea624e09a4beac417403 Mon Sep 17 00:00:00 2001 From: Shekar Siri Date: Mon, 22 Aug 2022 16:11:55 +0200 Subject: [PATCH 2/2] feat(ui) - support link --- .../shared/SupportCallout/SupportCallout.tsx | 14 ++++----- frontend/app/svg/slack-help.svg | 31 +++++++++++++++++++ 2 files changed, 38 insertions(+), 7 deletions(-) create mode 100644 frontend/app/svg/slack-help.svg diff --git a/frontend/app/components/shared/SupportCallout/SupportCallout.tsx b/frontend/app/components/shared/SupportCallout/SupportCallout.tsx index 951c98274..b37b64616 100644 --- a/frontend/app/components/shared/SupportCallout/SupportCallout.tsx +++ b/frontend/app/components/shared/SupportCallout/SupportCallout.tsx @@ -1,16 +1,16 @@ import React from 'react'; -import SlackIcon from '../../../svg/integrations/slack.svg'; +import SlackIcon from '../../../svg/slack-help.svg'; import { Popup } from 'UI'; function SupportCallout() { return ( - - -
+ +
+ -
-
- + +
+ ); } diff --git a/frontend/app/svg/slack-help.svg b/frontend/app/svg/slack-help.svg new file mode 100644 index 000000000..d2e3c0382 --- /dev/null +++ b/frontend/app/svg/slack-help.svg @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +