feat: notebook flag (#18087)

pull/18063/head^2
Alex Boatwright 2020-05-13 11:08:51 -07:00 committed by GitHub
parent 6ad1640641
commit 246eeef794
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 0 deletions

View File

@ -35,6 +35,7 @@ import CreateVariableOverlay from 'src/variables/components/CreateVariableOverla
import DataExplorerPage from 'src/dataExplorer/components/DataExplorerPage'
import SaveAsOverlay from 'src/dataExplorer/components/SaveAsOverlay'
import {MePage} from 'src/me'
import NotebookPage from 'src/notebooks/components/Notebook'
import NotFound from 'src/shared/components/NotFound'
import GetLinks from 'src/shared/containers/GetLinks'
import GetMe from 'src/shared/containers/GetMe'
@ -95,6 +96,9 @@ import NewEndpointOverlay from 'src/notifications/endpoints/components/NewEndpoi
import EditEndpointOverlay from 'src/notifications/endpoints/components/EditEndpointOverlay'
import NoOrgsPage from 'src/organizations/containers/NoOrgsPage'
// Utilities
import {isFlagEnabled} from 'src/shared/utils/featureFlag'
// Overlays
import OverlayHandler, {
RouteOverlay,
@ -278,6 +282,12 @@ class Root extends PureComponent {
</Route>
</Route>
<Route path="me" component={MePage} />
{isFlagEnabled('notebooks') && (
<Route
path="notebooks"
component={NotebookPage}
/>
)}
<Route path="load-data">
<IndexRoute component={BucketsIndex} />
<Route path="tokens" component={TokensIndex}>

View File

@ -0,0 +1,14 @@
import React, {FC} from 'react'
import {Page} from '@influxdata/clockface'
const NotebookPage: FC = () => {
return (
<Page titleTag="Notebook">
<Page.Header fullWidth={false} />
<Page.Contents fullWidth={false} scrollable={true} />
</Page>
)
}
export default NotebookPage

View File

@ -107,6 +107,19 @@ export const generateNavItems = (orgID: string): NavItem[] => {
},
activeKeywords: ['data-explorer'],
},
{
id: 'notebooks',
testID: 'nav-item-notebooks',
icon: IconFont.Erlenmeyer,
label: 'Notebook',
featureFlag: 'notebooks',
shortLabel: 'Book',
link: {
type: 'link',
location: `${orgPrefix}/notebooks`,
},
activeKeywords: ['notebooks'],
},
{
id: 'dashboards',
testID: 'nav-item-dashboards',

View File

@ -10,6 +10,7 @@ export const OSS_FLAGS = {
matchingNotificationRules: false,
demodata: false,
fluxParser: false,
notebooks: false,
}
export const CLOUD_FLAGS = {
@ -22,6 +23,7 @@ export const CLOUD_FLAGS = {
matchingNotificationRules: false,
demodata: false,
fluxParser: false,
notebooks: false,
}
export const activeFlags = (state: AppState): FlagMap => {