-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(ui): improve first time alerting experience (#14917)
* refactor(ui): move QuestionMarkTooltip into shared folder * refactor(ui): delete unused component * refactor(ui): allow QuestionMarkTooltip to wrap other elements * refactor(ui): Add question mark tooltips to alerting column headers * refactor(ui): color code buttons to indicate importance and grouping * refactor(ui): swap order of endpoints and rules columns * refactor(ui): show "first time" widget when no alerting resources exist * refactor(ui): update alerting empty copy * refactor(ui): ensure onboarding tooltips are using the correct prop names * refactor(ui): remove tests for tooltips in admin step These should be handled by Clockface instead * refactor(ui): fix affected e2e test * chore(ui): update changelog
- Loading branch information
1 parent
ee21140
commit 20f717d
Showing
21 changed files
with
343 additions
and
293 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,65 @@ | ||
// Libraries | ||
import React, {FC} from 'react' | ||
import React, {FC, ReactChild} from 'react' | ||
|
||
// Components | ||
import { | ||
Button, | ||
ComponentColor, | ||
Panel, | ||
InfluxColors, | ||
DapperScrollbars, | ||
Input, | ||
IconFont, | ||
FlexBox, | ||
FlexDirection, | ||
ComponentSize, | ||
} from '@influxdata/clockface' | ||
import QuestionMarkTooltip from 'src/shared/components/question_mark_tooltip/QuestionMarkTooltip' | ||
|
||
interface Props { | ||
title: string | ||
testID?: string | ||
onCreate: () => void | ||
createButton: JSX.Element | ||
questionMarkTooltipContents: ReactChild | ||
} | ||
|
||
const AlertsColumnHeader: FC<Props> = ({ | ||
children, | ||
onCreate, | ||
title, | ||
testID = '', | ||
}) => { | ||
return ( | ||
<Panel | ||
backgroundColor={InfluxColors.Kevlar} | ||
className="alerting-index--column" | ||
> | ||
<Panel.Header> | ||
<Panel.Title>{title}</Panel.Title> | ||
<Button | ||
text="Create" | ||
icon={IconFont.Plus} | ||
onClick={onCreate} | ||
color={ComponentColor.Primary} | ||
testID={`alert-column--header ${testID}`} | ||
createButton, | ||
questionMarkTooltipContents, | ||
}) => ( | ||
<Panel | ||
backgroundColor={InfluxColors.Kevlar} | ||
className="alerting-index--column" | ||
> | ||
<Panel.Header> | ||
<FlexBox direction={FlexDirection.Row} margin={ComponentSize.Small}> | ||
<Panel.Title style={{fontSize: '17px', width: 'auto'}}> | ||
{title} | ||
</Panel.Title> | ||
<QuestionMarkTooltip | ||
testID={`${title}--question-mark`} | ||
tipContent={questionMarkTooltipContents} | ||
/> | ||
</Panel.Header> | ||
<div className="alerting-index--search"> | ||
<Input | ||
icon={IconFont.Search} | ||
placeholder={`Filter ${title}...`} | ||
value="" | ||
onChange={() => {}} | ||
/> | ||
</div> | ||
<div className="alerting-index--column-body"> | ||
<DapperScrollbars | ||
autoSize={false} | ||
autoHide={true} | ||
style={{width: '100%', height: '100%'}} | ||
> | ||
<div className="alerting-index--list">{children}</div> | ||
</DapperScrollbars> | ||
</div> | ||
</Panel> | ||
) | ||
} | ||
</FlexBox> | ||
{createButton} | ||
</Panel.Header> | ||
<div className="alerting-index--search"> | ||
<Input | ||
icon={IconFont.Search} | ||
placeholder={`Filter ${title}...`} | ||
value="" | ||
onChange={() => {}} | ||
/> | ||
</div> | ||
<div className="alerting-index--column-body"> | ||
<DapperScrollbars | ||
autoSize={false} | ||
autoHide={true} | ||
style={{width: '100%', height: '100%'}} | ||
> | ||
<div className="alerting-index--list">{children}</div> | ||
</DapperScrollbars> | ||
</div> | ||
</Panel> | ||
) | ||
|
||
export default AlertsColumnHeader |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.