-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): add request poc panel (#6838)
* feat(ui): add request poc panel * feat(ui): use safeBlankLinkOpen * feat(ui): add collapsed version of widget * chore: add feature flag
- Loading branch information
Showing
4 changed files
with
101 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
@import '@influxdata/clockface/dist/variables.scss'; | ||
|
||
.nav-item-poc--contents { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
padding: $cf-space-s; | ||
text-align: center; | ||
background: rgba(241, 241, 243, 0.05); | ||
|
||
.cf-button { | ||
margin-top: $cf-space-s; | ||
} | ||
} | ||
|
||
.nav-item-poc { | ||
margin-top: auto !important; | ||
|
||
+ .nav-item-support { | ||
margin-top: $cf-space-s !important; | ||
} | ||
} | ||
|
||
.cf-popover { | ||
.nav-item-poc--contents { | ||
background: transparent; | ||
padding: 0; | ||
font-weight: normal; | ||
width: 220px; | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,61 @@ | ||
// Libraries | ||
import React, {FC} from 'react' | ||
|
||
// Components | ||
import { | ||
Button, | ||
ComponentColor, | ||
Icon, | ||
IconFont, | ||
TreeNav, | ||
} from '@influxdata/clockface' | ||
|
||
// Utils | ||
import {event} from 'src/cloud/utils/reporting' | ||
import {safeBlankLinkOpen} from 'src/utils/safeBlankLinkOpen' | ||
|
||
// Styles | ||
import 'src/pageLayout/components/RequestPocWidget.scss' | ||
|
||
interface Props { | ||
expanded: boolean | ||
} | ||
|
||
export const RequestPocWidget: FC<Props> = ({expanded}) => { | ||
const handleRequestPocClick = () => { | ||
event('nav.requestPOC.clicked') | ||
safeBlankLinkOpen('https://www.influxdata.com/proof-of-concept/') | ||
} | ||
|
||
const contents = ( | ||
<div className="nav-item-poc--contents"> | ||
<span> | ||
This is a rate limited environment. Want to test the performance and | ||
scalability of your workload? | ||
</span> | ||
<Button | ||
icon={IconFont.Flask} | ||
text="Request a POC" | ||
color={ComponentColor.Primary} | ||
onClick={handleRequestPocClick} | ||
/> | ||
</div> | ||
) | ||
|
||
if (expanded) { | ||
return <div className="nav-item-poc">{contents}</div> | ||
} else { | ||
return ( | ||
<TreeNav.Item | ||
id="nav-item-poc" | ||
testID="nav-item-poc" | ||
icon={<Icon glyph={IconFont.Flask} />} | ||
label="Request a POC" | ||
shortLabel="POC" | ||
className="nav-item-poc" | ||
> | ||
<TreeNav.SubMenu>{contents}</TreeNav.SubMenu> | ||
</TreeNav.Item> | ||
) | ||
} | ||
} |
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,3 +1,3 @@ | ||
.helpBarStyle { | ||
.nav-item-support { | ||
margin-top: auto !important; | ||
} |
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