diff --git a/src/browser/images/aura-logo-inverted.svg b/src/browser/images/aura-logo-inverted.svg new file mode 100644 index 00000000000..6346e711d33 --- /dev/null +++ b/src/browser/images/aura-logo-inverted.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/browser/images/aura-logo.svg b/src/browser/images/aura-logo.svg new file mode 100644 index 00000000000..4b76d6803eb --- /dev/null +++ b/src/browser/images/aura-logo.svg @@ -0,0 +1,35 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/browser/modules/ClickToCode/__snapshots__/index.test.tsx.snap b/src/browser/modules/ClickToCode/__snapshots__/index.test.tsx.snap index 75a97d01330..88d2e8b5964 100644 --- a/src/browser/modules/ClickToCode/__snapshots__/index.test.tsx.snap +++ b/src/browser/modules/ClickToCode/__snapshots__/index.test.tsx.snap @@ -5,7 +5,7 @@ exports[`ClickToCode does not render if no children 1`] = `
`; exports[`ClickToCode renders all children 1`] = `
@@ -20,7 +20,7 @@ exports[`ClickToCode renders all children 1`] = ` exports[`ClickToCode renders children as code if no code is provided 1`] = `
hellohi! @@ -30,7 +30,7 @@ exports[`ClickToCode renders children as code if no code is provided 1`] = ` exports[`ClickToCode renders code as the code when code is available 1`] = `
hello diff --git a/src/browser/modules/Stream/CypherFrame/__snapshots__/CodeView.test.tsx.snap b/src/browser/modules/Stream/CypherFrame/__snapshots__/CodeView.test.tsx.snap index 21e077cfa97..62c756a31a3 100644 --- a/src/browser/modules/Stream/CypherFrame/__snapshots__/CodeView.test.tsx.snap +++ b/src/browser/modules/Stream/CypherFrame/__snapshots__/CodeView.test.tsx.snap @@ -6,7 +6,7 @@ exports[`CodeViews CodeStatusbar displays no statusBarMessage 1`] = ` class="sc-ckVGcZ fsAzIa" >
@@ -18,7 +18,7 @@ exports[`CodeViews CodeStatusbar displays statusBarMessage 1`] = ` class="sc-ckVGcZ fsAzIa" >
Started streaming 1 records after 5 ms and completed after 10 ms.
diff --git a/src/browser/modules/Stream/CypherFrame/__snapshots__/ErrorsView.test.tsx.snap b/src/browser/modules/Stream/CypherFrame/__snapshots__/ErrorsView.test.tsx.snap index 7bc9d63da6d..9f56e1c40d2 100644 --- a/src/browser/modules/Stream/CypherFrame/__snapshots__/ErrorsView.test.tsx.snap +++ b/src/browser/modules/Stream/CypherFrame/__snapshots__/ErrorsView.test.tsx.snap @@ -10,7 +10,7 @@ exports[`ErrorsViews ErrorsStatusbar displays error 1`] = ` title="Test.Error: Test error description" > Test.Error: Test error description @@ -61,7 +61,7 @@ exports[`ErrorsViews ErrorsView displays procedure link if unknown procedure 1`] class="sc-bMVAic kWTfCD" >  List available procedures diff --git a/src/browser/modules/Stream/CypherFrame/__snapshots__/VisualizationView.test.tsx.snap b/src/browser/modules/Stream/CypherFrame/__snapshots__/VisualizationView.test.tsx.snap index dba6bf4211a..2ef4d565da8 100644 --- a/src/browser/modules/Stream/CypherFrame/__snapshots__/VisualizationView.test.tsx.snap +++ b/src/browser/modules/Stream/CypherFrame/__snapshots__/VisualizationView.test.tsx.snap @@ -5,7 +5,7 @@ exports[`Visualization renders 1`] = `
`; exports[`Visualization renders with result and escapes any HTML 1`] = `
@@ -145,7 +145,7 @@ exports[`Visualization renders with result and escapes any HTML 1`] = ` class="sc-cvbbAY ZoyPP zoom-out" > diff --git a/src/browser/modules/Stream/CypherFrame/__snapshots__/relatable-view.test.tsx.snap b/src/browser/modules/Stream/CypherFrame/__snapshots__/relatable-view.test.tsx.snap index d9b04e44541..815b603c48e 100644 --- a/src/browser/modules/Stream/CypherFrame/__snapshots__/relatable-view.test.tsx.snap +++ b/src/browser/modules/Stream/CypherFrame/__snapshots__/relatable-view.test.tsx.snap @@ -6,7 +6,7 @@ exports[`RelatableViews RelatableView displays bodyMessage if no rows 1`] = ` class="sc-ckVGcZ fsAzIa" >
(no changes, no records)
@@ -17,7 +17,7 @@ exports[`RelatableViews RelatableView displays bodyMessage if no rows 1`] = ` exports[`RelatableViews RelatableView does not display bodyMessage if rows, and escapes HTML 1`] = `
@@ -102,7 +102,7 @@ exports[`RelatableViews TableStatusbar displays statusBarMessage 1`] = ` class="sc-ckVGcZ fsAzIa" >
Started streaming 1 records after 5 ms and completed after 10 ms.
diff --git a/src/browser/modules/Stream/PlayFrame.tsx b/src/browser/modules/Stream/PlayFrame.tsx index 2bb42f2f2cf..49985ae9387 100644 --- a/src/browser/modules/Stream/PlayFrame.tsx +++ b/src/browser/modules/Stream/PlayFrame.tsx @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -import React, { useEffect, useState } from 'react' +import React, { useContext, useEffect, useState } from 'react' import { withBus } from 'react-suber' import { fetchGuideFromAllowlistAction } from 'shared/modules/commands/commandsDuck' @@ -38,6 +38,36 @@ import { } from 'browser-components/icons/Icons' import { splitMdxSlides } from '../Docs/MDX/splitMdx' import { LAST_GUIDE_SLIDE } from 'shared/modules/udc/udcDuck' +import { connect } from 'react-redux' +import { GlobalState } from 'shared/globalState' +import { inCloudEnv } from 'shared/modules/app/appDuck' +import { getEdition, isEnterprise } from 'shared/modules/dbMeta/dbMetaDuck' +import { PromotionContainer, AuraPromoLink } from './styled' +import { ThemeContext } from 'styled-components' +import { DARK_THEME } from 'shared/modules/settings/settingsDuck' + +const AuraPromotion = () => { + const theme = useContext(ThemeContext) + const isDarkTheme = theme.name === DARK_THEME + + return ( + + + Sign up + + for a free Neo4j cloud instance with + Neo4j + + ) +} const { play: { chapters } @@ -50,7 +80,7 @@ const checkHtmlForSlides = (html: any) => { return !!slides.length } -export function PlayFrame({ stack, bus }: any): JSX.Element { +export function PlayFrame({ stack, bus, showPromotion }: any): JSX.Element { const [stackIndex, setStackIndex] = useState(0) const [atSlideStart, setAtSlideStart] = useState(null) const [atSlideEnd, setAtSlideEnd] = useState(null) @@ -75,7 +105,8 @@ export function PlayFrame({ stack, bus }: any): JSX.Element { currentFrame, bus, onSlide, - shouldUseSlidePointer + shouldUseSlidePointer, + showPromotion ) if (stillMounted) { setInitialPlay(false) @@ -88,7 +119,7 @@ export function PlayFrame({ stack, bus }: any): JSX.Element { stillMounted = false } // The full dependency array causes a re-run which switches to slide 1 - }, [bus, currentFrame]) + }, [bus, currentFrame, showPromotion]) const { guide, aside, hasCarousel, isRemote } = guideObj @@ -158,7 +189,8 @@ function generateContent( stackFrame: any, bus: any, onSlide: any, - shouldUseSlidePointer: any + shouldUseSlidePointer: any, + showPromotion = false ): any { // Not found if (stackFrame.response && stackFrame.response.status === 404) { @@ -242,13 +274,25 @@ function generateContent( // Check if content exists locally if (isPlayChapter(guideName)) { const { content, title, subtitle, slides = null } = chapters[guideName] + + const isPlayStart = stackFrame.cmd.trim() === ':play start' + const updatedContent = + isPlayStart && showPromotion ? ( + <> + {content} + + + ) : ( + content + ) + return { guide: ( ({ + showPromotion: + getEdition(state) !== null && !isEnterprise(state) && !inCloudEnv(state) +}) + +export default connect(mapStateToProps)(withBus(PlayFrame)) diff --git a/src/browser/modules/Stream/__snapshots__/SchemaFrame.test.tsx.snap b/src/browser/modules/Stream/__snapshots__/SchemaFrame.test.tsx.snap index f516f57651c..e7c725018de 100644 --- a/src/browser/modules/Stream/__snapshots__/SchemaFrame.test.tsx.snap +++ b/src/browser/modules/Stream/__snapshots__/SchemaFrame.test.tsx.snap @@ -10,13 +10,13 @@ exports[`SchemaFrame renders empty 1`] = ` class="sc-ibxdXY lnvWNA" > @@ -24,10 +24,10 @@ exports[`SchemaFrame renders empty 1`] = ` @@ -35,13 +35,13 @@ exports[`SchemaFrame renders empty 1`] = `
Indexes
None
@@ -49,10 +49,10 @@ exports[`SchemaFrame renders empty 1`] = ` @@ -92,43 +92,43 @@ exports[`SchemaFrame renders empty for Neo4j >= 4.0 1`] = ` class="sc-ibxdXY lnvWNA" >
Constraints
None
@@ -136,42 +136,42 @@ exports[`SchemaFrame renders empty for Neo4j >= 4.0 1`] = `
Index Name Type Uniqueness EntityType LabelsOrTypes Properties State
None
@@ -179,10 +179,10 @@ exports[`SchemaFrame renders empty for Neo4j >= 4.0 1`] = ` @@ -222,13 +222,13 @@ exports[`SchemaFrame renders results for Neo4j < 4.0 1`] = ` class="sc-ibxdXY lnvWNA" >
Constraints
None
@@ -236,10 +236,10 @@ exports[`SchemaFrame renders results for Neo4j < 4.0 1`] = ` @@ -247,13 +247,13 @@ exports[`SchemaFrame renders results for Neo4j < 4.0 1`] = `
Indexes
ON :Movie(released) ONLINE
@@ -261,10 +261,10 @@ exports[`SchemaFrame renders results for Neo4j < 4.0 1`] = ` diff --git a/src/browser/modules/Stream/styled.tsx b/src/browser/modules/Stream/styled.tsx index a33d8c0a4d4..f0380dfd1cd 100644 --- a/src/browser/modules/Stream/styled.tsx +++ b/src/browser/modules/Stream/styled.tsx @@ -395,3 +395,17 @@ const rollDownAnimation = keyframes` export const AnimationContainer = styled.div` animation: ${rollDownAnimation} 0.4s ease-in; ` + +export const PromotionContainer = styled.div` + display: flex; + align-items: center; + font-size: 14px; + margin-top: 20px; + justify-content: center; +` + +export const AuraPromoLink = styled.a` + cursor: pointer; + text-decoration: none; + margin-right: 5px; +`
Constraints
ON ( book:Book ) ASSERT book.isbn IS UNIQUE