Skip to content
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
3 changes: 2 additions & 1 deletion frontend/src/__generated/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions frontend/src/pages/Alerts/Alerts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { SearchEmptyState } from '@components/SearchEmptyState/SearchEmptyState'
import { GetAlertsPagePayloadQuery } from '@graph/operations'
import {
Box,
Callout,
Container,
Heading,
IconSolidChartBar,
Expand All @@ -14,6 +15,7 @@ import {
IconSolidLightningBolt,
IconSolidLogs,
IconSolidMicrosoftTeams,
IconSolidPlay,
IconSolidPlayCircle,
IconSolidPlus,
IconSolidRefresh,
Expand All @@ -34,13 +36,15 @@ import SvgTargetIcon from '@icons/TargetIcon'
import SvgUserPlusIcon from '@icons/UserPlusIcon'
import { AlertEnableSwitch } from '@pages/Alerts/AlertEnableSwitch/AlertEnableSwitch'
import { useAlertsContext } from '@pages/Alerts/AlertsContext/AlertsContext'
import useLocalStorage from '@rehooks/local-storage'
import { useParams } from '@util/react-router/useParams'
import React from 'react'
import { RiMailFill, RiSlackFill } from 'react-icons/ri'
import { useNavigate } from 'react-router-dom'

import { Button } from '@/components/Button'
import { Link } from '@/components/Link'
import { LinkButton } from '@/components/LinkButton'
import {
AlertDestination,
AlertDestinationType,
Expand Down Expand Up @@ -174,6 +178,9 @@ export const ALERT_CONFIGURATIONS: { [key: string]: AlertConfiguration } = {
supportsExcludeRules: true,
},
} as const
const WALKTHROUGH_LINK = 'TODO'

Check notice

Code scanning / devskim

A "TODO" or similar was left in source code, possibly indicating incomplete functionality

Suspicious comment
const ALERTS_DOCS_LINK =
'https://www.highlight.io/docs/general/product-features/general-features/alerts'

export default function AlertsPage() {
const { alertsPayload, loading } = useAlertsContext()
Expand Down Expand Up @@ -265,6 +272,10 @@ function AlertsPageLoaded({
}: {
alertsPayload: GetAlertsPagePayloadQuery | undefined
}) {
const [visible, setVisible] = useLocalStorage<boolean>(
'display-alerts-docs-callout',
true,
)
const { project_id } = useParams<{ project_id: string }>()
const navigate = useNavigate()
const metricAlertsEnabled = useFeatureFlag(Feature.MetricAlerts)
Expand Down Expand Up @@ -392,6 +403,41 @@ function AlertsPageLoaded({
<NewAlertMenu />
)}
</Box>
{visible && (
<Callout
title="Want to learn more about
Alerts?"
icon={false}
handleCloseClick={() => setVisible(false)}
>
<Stack gap="16">
<Text>
Be sure to take a look at the docs, and
the walkthrough coming soon!
</Text>
<Stack flexDirection="row" gap="8">
<LinkButton
kind="secondary"
emphasis="high"
trackingId="alerts-watch-walkthrough"
to={WALKTHROUGH_LINK}
iconLeft={<IconSolidPlay />}
disabled
>
Watch walkthrough
</LinkButton>
<LinkButton
trackingId="alerts-read-docs"
kind="secondary"
emphasis="low"
to={ALERTS_DOCS_LINK}
>
Read docs
</LinkButton>
</Stack>
</Stack>
</Callout>
)}
{alertsPayload && (
<Stack gap="6">
{alertsAsTableRows.length > 0 ? (
Expand Down
56 changes: 55 additions & 1 deletion frontend/src/pages/Graphing/DashboardOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,26 @@ import {
Badge,
Box,
Button,
Callout,
Container,
Heading,
IconSolidChartBar,
IconSolidDotsHorizontal,
IconSolidPlay,
IconSolidTrash,
Menu,
Stack,
Table,
Text,
} from '@highlight-run/ui/components'
import useLocalStorage from '@rehooks/local-storage'
import moment from 'moment'
import React, { useState } from 'react'
import { Helmet } from 'react-helmet'
import { useNavigate } from 'react-router-dom'
import { useDebounce } from 'react-use'

import { LinkButton } from '@/components/LinkButton'
import LoadingBox from '@/components/LoadingBox'
import { SearchEmptyState } from '@/components/SearchEmptyState/SearchEmptyState'
import {
Expand All @@ -37,8 +41,16 @@ import * as style from './DashboardOverview.css'

const ITEMS_PER_PAGE = 10

export default function DashboardOverview() {
const METRICS_DOCS_LINK =
'https://www.highlight.io/docs/general/product-features/metrics/overview'
const WALKTHROUGH_LINK = 'https://www.youtube.com/watch?v=MzJMCcgf6iU'

export const DashboardOverview: React.FC = () => {
const { projectId } = useProjectId()
const [visible, setVisible] = useLocalStorage<boolean>(
'display-dashboard-docs-callout',
true,
)

const [query, setQuery] = useState('')
const [debouncedQuery, setDebouncedQuery] = useState('')
Expand Down Expand Up @@ -113,6 +125,48 @@ export default function DashboardOverview() {
Metrics allow you to visualize what's
happening in your app.
</Text>
{visible && (
<Callout
title="Want to learn more about
Metrics?"
icon={false}
handleCloseClick={() =>
setVisible(false)
}
>
<Stack gap="16">
<Text>
Be sure to take a look at
the docs, or watch the
walkthrough video!
</Text>
<Stack
flexDirection="row"
gap="8"
>
<LinkButton
kind="secondary"
emphasis="high"
trackingId="dashboard-watch-walkthrough"
to={WALKTHROUGH_LINK}
iconLeft={
<IconSolidPlay />
}
>
Watch walkthrough
</LinkButton>
<LinkButton
trackingId="dashboard-read-docs"
kind="secondary"
emphasis="low"
to={METRICS_DOCS_LINK}
>
Read docs
</LinkButton>
</Stack>
</Stack>
</Callout>
)}
</Stack>
<Stack gap="8" width="full">
<Box
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Graphing/DashboardRouter.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Route, Routes } from 'react-router-dom'

import { Dashboard } from '@/pages/Graphing/Dashboard'
import DashboardOverview from '@/pages/Graphing/DashboardOverview'
import { DashboardOverview } from '@/pages/Graphing/DashboardOverview'
import { ExpandedGraph } from '@/pages/Graphing/ExpandedGraph'
import { GraphingEditor } from '@/pages/Graphing/GraphingEditor'

Expand Down
11 changes: 5 additions & 6 deletions packages/ui/src/components/Callout/Callout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,19 +80,18 @@ export const Callout: React.FC<Props> = ({

<Box gap="16" display="flex" flexDirection="column" width="full">
{title && (
<Box
alignItems="flex-start"
display="flex"
justifyContent="space-between"
>
<Box display="flex" position="relative">
<Box mt="6">
<Text color="strong" weight="bold" size="small">
{title}
</Text>
</Box>

{handleCloseClick && (
<Box flexShrink={0}>
<Box
flexShrink={0}
style={{ position: 'absolute', right: '0' }}
>
<ButtonIcon
kind="secondary"
emphasis="low"
Expand Down
9 changes: 5 additions & 4 deletions packages/ui/src/components/Table/Row/styles.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ export const row = style({
},

// Borders
[`${tableStyles.table}:not(${tableStyles.noBorder}) &`]: {
borderLeft: BORDER,
borderRight: BORDER,
},
[`${tableStyles.table}:not(${tableStyles.noBorder}) ${bodyStyles.body} &, ${tableStyles.table}:not(${tableStyles.noBorder}) ${headStyles.head} &`]:
{
borderLeft: BORDER,
borderRight: BORDER,
},
[`${tableStyles.noBorder} ${bodyStyles.body} &:last-of-type`]: {
borderBottom: 0,
},
Expand Down