diff --git a/frontend/app/components/Assist/AssistSearchActions/AssistSearchActions.tsx b/frontend/app/components/Assist/AssistSearchActions/AssistSearchActions.tsx index 8069a96f3..deeb6cac6 100644 --- a/frontend/app/components/Assist/AssistSearchActions/AssistSearchActions.tsx +++ b/frontend/app/components/Assist/AssistSearchActions/AssistSearchActions.tsx @@ -6,8 +6,8 @@ import { MODULES } from 'Components/Client/Modules'; import { useStore } from 'App/mstore'; import { observer } from 'mobx-react-lite'; import AssistStats from '../../AssistStats'; -import Recordings from '../RecordingsList/Recordings'; import { useTranslation } from 'react-i18next'; +import TrainingVideosBtn from './TrainingVideosBtn'; function AssistSearchActions() { const { t } = useTranslation(); @@ -23,12 +23,6 @@ function AssistSearchActions() { const showStats = () => { showModal(, { right: true, width: 960 }); }; - const showRecords = () => { - showModal(, { right: true, width: 960 }); - }; - - const originStr = window.env.ORIGIN || window.location.origin; - const isSaas = /app\.openreplay\.com/.test(originStr); return (

@@ -44,9 +38,7 @@ function AssistSearchActions() { {t('Clear')} - {!isSaas && isEnterprise && !modules.includes(MODULES.OFFLINE_RECORDINGS) - ? : null - } + {isEnterprise && userStore.account?.admin && ( : null + ) +} + +export default observer(TrainingVideosBtn); diff --git a/frontend/app/components/Dashboard/components/AddCardSection/AddCardSection.tsx b/frontend/app/components/Dashboard/components/AddCardSection/AddCardSection.tsx index 4cccdb14b..95ade1977 100644 --- a/frontend/app/components/Dashboard/components/AddCardSection/AddCardSection.tsx +++ b/frontend/app/components/Dashboard/components/AddCardSection/AddCardSection.tsx @@ -11,7 +11,6 @@ import { AppWindow, Combine, Users, - Sparkles, Globe, MonitorSmartphone, } from 'lucide-react'; @@ -250,8 +249,6 @@ const AddCardSection = observer( { label: t('Web Analytics'), value: 'web_analytics' }, ]; - const originStr = window.env.ORIGIN || window.location.origin; - const isSaas = /api\.openreplay\.com/.test(originStr); const onExistingClick = () => { const dashboardId = dashboardStore.selectedDashboard?.dashboardId; const siteId = projectsStore.activeSiteId; @@ -273,12 +270,6 @@ const AddCardSection = observer(
{t('What do you want to visualize?')}
- {isSaas ? ( -
- -
{t('Ask AI')}
-
- ) : null}

{options.length > 1 ? ( diff --git a/frontend/app/components/Dashboard/components/AddCardSelectionModal.tsx b/frontend/app/components/Dashboard/components/AddCardSelectionModal.tsx index b7829ee37..5c9a1c699 100644 --- a/frontend/app/components/Dashboard/components/AddCardSelectionModal.tsx +++ b/frontend/app/components/Dashboard/components/AddCardSelectionModal.tsx @@ -1,12 +1,12 @@ -import { Card, Col, Modal, Row, Typography } from 'antd'; +import { Col, Modal, Row, Typography } from 'antd'; import { GalleryVertical, Plus } from 'lucide-react'; import React from 'react'; import { useStore } from 'App/mstore'; import NewDashboardModal from 'Components/Dashboard/components/DashboardList/NewDashModal'; -import AiQuery from './DashboardView/AiQuery'; import { useTranslation } from 'react-i18next'; +import AiQuerySection, { panelSize } from './AiQuerySection'; interface Props { open: boolean; @@ -32,8 +32,6 @@ function AddCardSelectionModal(props: Props) { setOpen(true); }; - const originStr = window.env.ORIGIN || window.location.origin; - const isSaas = /app\.openreplay\.com/.test(originStr); return ( <> +
+ + + +
+ {t('or')} +
+ + ) +} + +export const panelSize = 900 + */ + +function AiQuerySection() { + return null +} + +export const panelSize = undefined + +export default AiQuerySection diff --git a/frontend/app/components/Dashboard/components/DashboardView/DashboardView.tsx b/frontend/app/components/Dashboard/components/DashboardView/DashboardView.tsx index 64b67be76..f9da96601 100644 --- a/frontend/app/components/Dashboard/components/DashboardView/DashboardView.tsx +++ b/frontend/app/components/Dashboard/components/DashboardView/DashboardView.tsx @@ -4,7 +4,7 @@ import { useStore } from 'App/mstore'; import { Loader } from 'UI'; import { withSiteId } from 'App/routes'; import withModal from 'App/components/Modal/withModal'; -import { withRouter, RouteComponentProps } from 'react-router-dom'; +import { RouteComponentProps } from 'react-router-dom'; import { useModal } from 'App/components/Modal'; import AlertFormModal from 'App/components/Alerts/AlertFormModal'; import withPageTitle from 'HOCs/withPageTitle'; @@ -89,9 +89,6 @@ function DashboardView(props: Props) { }, [dashboard]); if (!dashboard) return null; - - const originStr = window.env.ORIGIN || window.location.origin; - const isSaas = /app\.openreplay\.com/.test(originStr); return (
- {isSaas ? : null} 0; - // @ts-ignore - const originStr = window.env.ORIGIN || window.location.origin; - const isSaas = /app\.openreplay\.com/.test(originStr); const showSummary = () => { player.pause(); @@ -197,13 +194,11 @@ const DevtoolsButtons = observer( }; return ( <> - {isSaas ? ( - - ) : null} + diff --git a/frontend/app/components/Session_/OverviewPanel/OverviewPanel.tsx b/frontend/app/components/Session_/OverviewPanel/OverviewPanel.tsx index af0a2951e..3f1021260 100644 --- a/frontend/app/components/Session_/OverviewPanel/OverviewPanel.tsx +++ b/frontend/app/components/Session_/OverviewPanel/OverviewPanel.tsx @@ -10,7 +10,7 @@ import { } from 'App/components/Session/playerContext'; import { useStore } from 'App/mstore'; import SummaryBlock from 'Components/Session/Player/ReplayPlayer/SummaryBlock'; -import { SummaryButton } from 'Components/Session_/Player/Controls/Controls'; +import SummaryButton from 'Components/Session_/Player/Controls/SummaryButton'; import TimelineZoomButton from 'Components/Session_/Player/Controls/components/TimelineZoomButton'; import { Icon, NoContent } from 'UI'; import TabSelector from '../../shared/DevTools/TabSelector'; @@ -99,8 +99,6 @@ function MobileOverviewPanelCont() { player.scale(); }, [selectedFeatures]); - const originStr = window.env.ORIGIN || window.location.origin; - const isSaas = /app\.openreplay\.com/.test(originStr); return ( aiSummaryStore.setToggleSummary(!aiSummaryStore.toggleSummary) } @@ -229,8 +227,6 @@ function WebOverviewPanelCont() { ], ); - const originStr = window.env.ORIGIN || window.location.origin; - const isSaas = /app\.openreplay\.com/.test(originStr); return ( aiSummaryStore.setToggleSummary(!aiSummaryStore.toggleSummary) } diff --git a/frontend/app/components/Session_/Player/Controls/Controls.tsx b/frontend/app/components/Session_/Player/Controls/Controls.tsx index 691ae6eb1..8aa152b61 100644 --- a/frontend/app/components/Session_/Player/Controls/Controls.tsx +++ b/frontend/app/components/Session_/Player/Controls/Controls.tsx @@ -41,6 +41,7 @@ import Timeline from './Timeline'; import PlayerControls from './components/PlayerControls'; import styles from './controls.module.css'; import { useTranslation } from 'react-i18next'; +import SummaryButton from './SummaryButton'; export const SKIP_INTERVALS = { 2: 2e3, @@ -231,11 +232,6 @@ const DevtoolsButtons = observer( const { t } = useTranslation(); const { aiSummaryStore, integrationsStore } = useStore(); const { store, player } = React.useContext(PlayerContext); - - // @ts-ignore - const originStr = window.env.ORIGIN || window.location.origin; - const isSaas = /app\.openreplay\.com/.test(originStr); - const { inspectorMode, currentTab, tabStates } = store.get(); const disableButtons = disabled; @@ -304,7 +300,7 @@ const DevtoolsButtons = observer( const getLabel = (block: string) => labels[block][showIcons ? 'icon' : 'label'] return ( <> - {isSaas ? : null} + @@ -435,37 +431,6 @@ const DevtoolsButtons = observer( }, ); -export function SummaryButton({ - onClick, - withToggle, - onToggle, - toggleValue, -}: { - onClick?: () => void; - withToggle?: boolean; - onToggle?: () => void; - toggleValue?: boolean; -}) { - const { t } = useTranslation(); - const [isHovered, setHovered] = React.useState(false); - - return ( -
-
setHovered(true)} - onMouseLeave={() => setHovered(false)} - > - {withToggle ? ( - - ) : null} - -
{t('Summary AI')}
-
-
- ); -} - export const gradientButton = { border: 'double 1px transparent', borderRadius: '60px', @@ -479,7 +444,7 @@ export const gradientButton = { alignItems: 'center', justifyContent: 'center', }; -const onHoverFillStyle = { +export const onHoverFillStyle = { width: '100%', height: '100%', display: 'flex', @@ -489,7 +454,7 @@ const onHoverFillStyle = { padding: '1px 8px', background: 'linear-gradient(156deg, #E3E6FF 0%, #E4F3F4 69.48%)', }; -const fillStyle = { +export const fillStyle = { width: '100%', height: '100%', display: 'flex', diff --git a/frontend/app/components/Session_/Player/Controls/SummaryButton.tsx b/frontend/app/components/Session_/Player/Controls/SummaryButton.tsx new file mode 100644 index 000000000..d1c4c1fa1 --- /dev/null +++ b/frontend/app/components/Session_/Player/Controls/SummaryButton.tsx @@ -0,0 +1,44 @@ +/** Saas +import React from 'react' +import { Switch, } from 'antd' +import { Icon } from 'UI'; +import { useTranslation } from 'react-i18next'; +import { gradientButton, onHoverFillStyle, fillStyle } from './Controls'; + +function SummaryButton({ + onClick, + withToggle, + onToggle, + toggleValue, +}: { + onClick?: () => void; + withToggle?: boolean; + onToggle?: () => void; + toggleValue?: boolean; +}) { + const { t } = useTranslation(); + const [isHovered, setHovered] = React.useState(false); + + return ( +
+
setHovered(true)} + onMouseLeave={() => setHovered(false)} + > + {withToggle ? ( + + ) : null} + +
{t('Summary AI')}
+
+
+ ); +} +*/ + +function SummaryButton(props: any) { + return null; +} + +export default SummaryButton; diff --git a/frontend/app/components/shared/SearchActions/AiSearchSection.tsx b/frontend/app/components/shared/SearchActions/AiSearchSection.tsx new file mode 100644 index 000000000..4f8d21a13 --- /dev/null +++ b/frontend/app/components/shared/SearchActions/AiSearchSection.tsx @@ -0,0 +1,14 @@ +/** Saas +import React from 'react' +import AiSessionSearchField from 'Shared/SessionFilters/AiSessionSearchField'; + +function AiSearchSection() { + return +} +*/ + +function AiSearchSection() { + return null +} + +export default AiSearchSection diff --git a/frontend/app/components/shared/SearchActions/SearchActions.tsx b/frontend/app/components/shared/SearchActions/SearchActions.tsx index 5f88ac4fd..199446a34 100644 --- a/frontend/app/components/shared/SearchActions/SearchActions.tsx +++ b/frontend/app/components/shared/SearchActions/SearchActions.tsx @@ -3,7 +3,7 @@ import AnimatedSVG, { ICONS } from 'Shared/AnimatedSVG/AnimatedSVG'; import { observer } from 'mobx-react-lite'; import { useStore } from 'App/mstore'; import { Button, Tooltip } from 'antd'; -import AiSessionSearchField from 'Shared/SessionFilters/AiSessionSearchField'; +import AiSearchSection from './AiSearchSection'; import { useTranslation } from 'react-i18next'; import SavedSearch from '../SavedSearch/SavedSearch'; @@ -30,13 +30,11 @@ function SearchActions() { return t('Sessions'); }, [activeTab?.type, isEnterprise, i18n.language]); - // @ts-ignore - const originStr = window.env.ORIGIN || window.location.origin; - const isSaas = /app\.openreplay\.com/.test(originStr); - const showAiField = isSaas && activeTab?.type === 'sessions'; + const showAiField = activeTab?.type === 'sessions'; const showPanel = hasEvents || hasFilters || aiFiltersStore.isLoading; return !metaLoading ? (
+ {/* mobile */}

{title}

@@ -54,12 +52,13 @@ function SearchActions() {
- {isSaas ? : null} +
+ {/* desktop */}

{title}

- {isSaas && showAiField ? : null} + {showAiField ? : null}