@@ -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"
>
@@ -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
+
+
+ )
+}
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`] = `
None
|
@@ -35,13 +35,13 @@ exports[`SchemaFrame renders empty 1`] = `
@@ -49,10 +49,10 @@ exports[`SchemaFrame renders empty 1`] = `
None
|
@@ -92,43 +92,43 @@ exports[`SchemaFrame renders empty for Neo4j >= 4.0 1`] = `
class="sc-ibxdXY lnvWNA"
>
@@ -136,42 +136,42 @@ exports[`SchemaFrame renders empty for Neo4j >= 4.0 1`] = `
None
|
|
|
|
|
|
|
@@ -179,10 +179,10 @@ exports[`SchemaFrame renders empty for Neo4j >= 4.0 1`] = `
None
|
@@ -222,13 +222,13 @@ exports[`SchemaFrame renders results for Neo4j < 4.0 1`] = `
class="sc-ibxdXY lnvWNA"
>
@@ -236,10 +236,10 @@ exports[`SchemaFrame renders results for Neo4j < 4.0 1`] = `
ON :Movie(released) ONLINE
|
@@ -247,13 +247,13 @@ exports[`SchemaFrame renders results for Neo4j < 4.0 1`] = `
@@ -261,10 +261,10 @@ exports[`SchemaFrame renders results for Neo4j < 4.0 1`] = `
ON ( book:Book ) ASSERT book.isbn IS UNIQUE
|
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;
+`