Skip to content

Commit a1b4a79

Browse files
authored
feat(ui): update main doc link (#6559)
* fix(ui): update docs link in help bar * fix: https instead of http * feat(ui): remove docs search * fix: appease linter * refactor: use isIOxOrg instead of ixNewIOxOrg
1 parent 48fe8cf commit a1b4a79

File tree

4 files changed

+33
-33
lines changed

4 files changed

+33
-33
lines changed

cypress/e2e/shared/helpBar.test.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ describe('Help bar menu sub nav links', () => {
1010
.get('#documentation')
1111
.within(() => {
1212
cy.get('a').should($a => {
13-
expect($a.attr('href'), 'href').to.equal(
14-
'https://docs.influxdata.com/'
15-
)
13+
expect($a.attr('href'), 'href').to.be.oneOf([
14+
'https://docs.influxdata.com/',
15+
'https://docs.influxdata.com/influxdb/cloud-iox/',
16+
])
1617
})
1718
})
1819
})

src/me/components/DocSearchWidget.tsx

Lines changed: 18 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// Libraries
22
import React, {FC} from 'react'
3-
import {useSelector} from 'react-redux'
43

54
// Components
65
import DocSearch, {DocSearchType} from 'src/shared/search/DocSearch'
@@ -11,7 +10,6 @@ import {DOCS_URL_VERSION} from 'src/shared/constants/fluxFunctions'
1110

1211
// Utils
1312
import {event} from 'src/cloud/utils/reporting'
14-
import {isOrgIOx} from 'src/organizations/selectors'
1513

1614
// Styles
1715
import 'src/me/components/DocSearchWidget.scss'
@@ -75,30 +73,24 @@ const DocSearchWidget: FC = () => {
7573
return (
7674
<div className="WidgetSearch">
7775
<DocSearch type={DocSearchType.Widget} />
78-
{!useSelector(isOrgIOx) && (
79-
<>
80-
<p className="WidgetHelperText">
81-
Press CTRL + M on any page to search
82-
</p>
83-
<div className="useful-links">
84-
<h4 style={{textTransform: 'uppercase'}}>Useful Links</h4>
85-
<ul className="docslinks-list">
86-
{supportLinks.map(({link, title, eventName}) => (
87-
<li key={title}>
88-
<a
89-
href={link}
90-
target="_blank"
91-
rel="noreferrer"
92-
onClick={() => handleEventing(eventName)}
93-
>
94-
{title}
95-
</a>
96-
</li>
97-
))}
98-
</ul>
99-
</div>
100-
</>
101-
)}
76+
<p className="WidgetHelperText">Press CTRL + M on any page to search</p>
77+
<div className="useful-links">
78+
<h4 style={{textTransform: 'uppercase'}}>Useful Links</h4>
79+
<ul className="docslinks-list">
80+
{supportLinks.map(({link, title, eventName}) => (
81+
<li key={title}>
82+
<a
83+
href={link}
84+
target="_blank"
85+
rel="noreferrer"
86+
onClick={() => handleEventing(eventName)}
87+
>
88+
{title}
89+
</a>
90+
</li>
91+
))}
92+
</ul>
93+
</div>
10294
</div>
10395
)
10496
}

src/me/components/Resources.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import {isOrgIOx} from 'src/organizations/selectors'
2424

2525
const ResourceLists: FC = () => {
2626
const {paygCreditEnabled} = useContext(UsageContext)
27+
const isIOxOrg = useSelector(isOrgIOx)
2728

2829
return (
2930
<FlexBox
@@ -33,8 +34,7 @@ const ResourceLists: FC = () => {
3334
stretchToFitHeight={true}
3435
margin={ComponentSize.Large}
3536
>
36-
<DocSearchWidget />
37-
{useSelector(isOrgIOx) && (
37+
{isIOxOrg ? (
3838
<AnnouncementCenter>
3939
<AnnouncementBlock
4040
title="New time-series engine for InfluxDB"
@@ -57,6 +57,8 @@ const ResourceLists: FC = () => {
5757
ctaLink="https://www.influxdata.com/cloud-iox-faq/"
5858
/>
5959
</AnnouncementCenter>
60+
) : (
61+
<DocSearchWidget />
6062
)}
6163
{CLOUD && paygCreditEnabled && <UsagePanel />}
6264
<VersionInfo />

src/pageLayout/containers/MainNavigation.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import {isFlagEnabled} from 'src/shared/utils/featureFlag'
2020
import {isUserOperator} from 'src/operator/utils'
2121

2222
// Selectors
23-
import {getOrg} from 'src/organizations/selectors'
23+
import {getOrg, isOrgIOx} from 'src/organizations/selectors'
2424
import {
2525
selectCurrentAccountType,
2626
selectOperatorRole,
@@ -247,6 +247,7 @@ export const MainNavigation: FC = () => {
247247
const operatorRole = useSelector(selectOperatorRole)
248248
const shouldShowNotebooks = useSelector(selectShouldShowNotebooks)
249249
const isNewIOxOrg = useSelector(selectIsNewIOxOrg)
250+
const isIOxOrg = useSelector(isOrgIOx)
250251

251252
const dispatch = useDispatch()
252253

@@ -274,6 +275,10 @@ export const MainNavigation: FC = () => {
274275
return null
275276
}
276277

278+
const docslink = isIOxOrg
279+
? 'https://docs.influxdata.com/influxdb/cloud-iox/'
280+
: 'https://docs.influxdata.com/'
281+
277282
const handleToggleNavExpansion = (): void => {
278283
if (navbarMode === 'expanded') {
279284
setNavbarMode('collapsed')
@@ -412,7 +417,7 @@ export const MainNavigation: FC = () => {
412417
testID="nav-subitem-documentation"
413418
linkElement={() => (
414419
<SafeBlankLink
415-
href="https://docs.influxdata.com/"
420+
href={docslink}
416421
onClick={() => handleEventing('documentation')}
417422
/>
418423
)}

0 commit comments

Comments
 (0)