-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat(Support status redirect): add status to support panel #42223
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
b6d625c
aa4544a
677b91e
3cf66ce
2b6c4d9
efcda45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| import { useActions, useValues } from 'kea' | ||
| import React from 'react' | ||
|
|
||
| import { IconFeatures, IconHelmet, IconMap } from '@posthog/icons' | ||
| import { IconFeatures, IconHelmet, IconMap, IconWarning } from '@posthog/icons' | ||
| import { LemonButton, Link } from '@posthog/lemon-ui' | ||
|
|
||
| import { SupportForm } from 'lib/components/Support/SupportForm' | ||
|
|
@@ -20,6 +20,8 @@ import { AvailableFeature, BillingFeatureType, BillingPlan, BillingType, SidePan | |
|
|
||
| import { SidePanelPaneHeader } from '../components/SidePanelPaneHeader' | ||
| import { sidePanelLogic } from '../sidePanelLogic' | ||
| import { sidePanelStatusIncidentIoLogic } from './sidePanelStatusIncidentIoLogic' | ||
| import { sidePanelStatusLogic } from './sidePanelStatusLogic' | ||
|
|
||
| const Section = ({ title, children }: { title: string; children: React.ReactNode }): React.ReactElement => { | ||
| return ( | ||
|
|
@@ -32,6 +34,54 @@ const Section = ({ title, children }: { title: string; children: React.ReactNode | |
| ) | ||
| } | ||
|
|
||
| const StatusPageAlert = (): JSX.Element | null => { | ||
| const { featureFlags } = useValues(featureFlagLogic) | ||
| const useIncidentIo = !!featureFlags[FEATURE_FLAGS.INCIDENT_IO_STATUS_PAGE] | ||
| const { openSidePanel } = useActions(sidePanelLogic) | ||
|
|
||
| const { status: atlassianStatus, statusPage } = useValues(sidePanelStatusLogic) | ||
| const { status: incidentIoStatus, statusDescription: incidentIoDescription } = | ||
| useValues(sidePanelStatusIncidentIoLogic) | ||
|
|
||
| const status = useIncidentIo ? incidentIoStatus : atlassianStatus | ||
|
|
||
| if (status === 'operational') { | ||
| return null | ||
| } | ||
|
|
||
| const description = useIncidentIo | ||
| ? incidentIoDescription | ||
| : statusPage?.status.description || 'We are experiencing issues' | ||
|
|
||
| const severityClass = status.includes('outage') | ||
| ? 'bg-danger-highlight border-danger' | ||
| : 'bg-warning-highlight border-warning' | ||
|
|
||
| return ( | ||
| <div className={`border rounded p-3 mb-3 ${severityClass}`}> | ||
| <div className="flex items-start gap-2"> | ||
| <IconWarning className="text-warning w-5 h-5 shrink-0 mt-0.5" /> | ||
clr182 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <div className="flex-1"> | ||
| <p className="font-semibold mb-1">{description}</p> | ||
|
||
| <p className="text-sm mb-2"> | ||
| We're aware of issues that may affect your experience. Check our status page for updates before | ||
| contacting support. | ||
clr182 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| </p> | ||
| <LemonButton | ||
| type="secondary" | ||
| size="small" | ||
| fullWidth | ||
| center | ||
| onClick={() => openSidePanel(SidePanelTab.Status)} | ||
| > | ||
| View status page | ||
| </LemonButton> | ||
|
||
| </div> | ||
| </div> | ||
| </div> | ||
| ) | ||
| } | ||
|
|
||
| // In order to set these turn on the `support-message-override` feature flag. | ||
|
|
||
| //Support offsite messaging | ||
|
|
@@ -323,6 +373,7 @@ export function SidePanelSupport(): JSX.Element { | |
|
|
||
| {showEmailSupport && isBillingLoaded && ( | ||
| <Section title="Contact us"> | ||
| <StatusPageAlert /> | ||
| <p>Can't find what you need and PostHog AI unable to help?</p> | ||
| <LemonButton | ||
| type="secondary" | ||
|
|
||

Uh oh!
There was an error while loading. Please reload this page.