From 2d28af19dcf10121b38fa259e07ab9fca0297a66 Mon Sep 17 00:00:00 2001 From: Rostislav Dugin Date: Sat, 21 Mar 2026 14:14:22 +0300 Subject: [PATCH] FEATURE (playground): Remove playground warning --- frontend/src/features/playground/index.ts | 1 - .../ui/PlaygroundWarningComponent.tsx | 149 ------------------ frontend/src/pages/AuthPageComponent.tsx | 3 - .../src/widgets/main/MainScreenComponent.tsx | 3 - 4 files changed, 156 deletions(-) delete mode 100644 frontend/src/features/playground/index.ts delete mode 100644 frontend/src/features/playground/ui/PlaygroundWarningComponent.tsx diff --git a/frontend/src/features/playground/index.ts b/frontend/src/features/playground/index.ts deleted file mode 100644 index 428cd8e..0000000 --- a/frontend/src/features/playground/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { PlaygroundWarningComponent } from './ui/PlaygroundWarningComponent'; diff --git a/frontend/src/features/playground/ui/PlaygroundWarningComponent.tsx b/frontend/src/features/playground/ui/PlaygroundWarningComponent.tsx deleted file mode 100644 index 23d6ed4..0000000 --- a/frontend/src/features/playground/ui/PlaygroundWarningComponent.tsx +++ /dev/null @@ -1,149 +0,0 @@ -import { Modal } from 'antd'; -import type { JSX } from 'react'; -import { useEffect, useState } from 'react'; - -import { IS_CLOUD } from '../../../constants'; - -const STORAGE_KEY = 'databasus_playground_info_dismissed'; - -const TIMEOUT_SECONDS = 30; - -export const PlaygroundWarningComponent = (): JSX.Element => { - const [isVisible, setIsVisible] = useState(false); - const [remainingSeconds, setRemainingSeconds] = useState(TIMEOUT_SECONDS); - const [isButtonEnabled, setIsButtonEnabled] = useState(false); - - const handleClose = () => { - try { - localStorage.setItem(STORAGE_KEY, 'true'); - } catch (e) { - console.warn('Failed to save playground modal state to localStorage:', e); - } - setIsVisible(false); - }; - - useEffect(() => { - if (!IS_CLOUD) { - return; - } - - try { - const isDismissed = localStorage.getItem(STORAGE_KEY) === 'true'; - if (!isDismissed) { - setIsVisible(true); - } - } catch (e) { - console.warn('Failed to read playground modal state from localStorage:', e); - setIsVisible(true); - } - }, []); - - useEffect(() => { - if (!isVisible) { - return; - } - - const interval = setInterval(() => { - setRemainingSeconds((prev) => { - if (prev <= 1) { - setIsButtonEnabled(true); - clearInterval(interval); - return 0; - } - return prev - 1; - }); - }, 1000); - - return () => clearInterval(interval); - }, [isVisible]); - - return ( - - {isButtonEnabled ? 'Understood' : `${remainingSeconds}`} - - } - okButtonProps={{ disabled: !isButtonEnabled }} - closable={false} - cancelButtonProps={{ style: { display: 'none' } }} - width={500} - centered - maskClosable={false} - > -
-
-

What is Playground?

-

- Playground is a dev environment of Databasus development team. It is used by Databasus - dev team to test new features and see issues which hard to detect when using self hosted - (without logs or reports).{' '} - Here you can make backups for small and not critical databases for free -

-
- -
-

What is limit?

-
    -
  • Single backup size - 100 MB (~1.5 GB database)
  • -
  • Store period - 7 days
  • -
-
- -
-

Is it secure?

-

- Yes, it's regular Databasus installation, secured and maintained by Databasus team. - More about security{' '} - - you can read here - -

-
- -
-

Can my data be currepted?

-

- No, because playground use only read-only users and cannot affect your DB. Only issue - you can face is instability: playground background workers frequently reloaded so backup - can be slower or be restarted due to app restart. Do not rely production DBs on - playground, please. At once we may clean backups or something like this. At least, check - your backups here once a week -

-
- -
-

What if I see an issue?

-

- Create{' '} - - GitHub issue - {' '} - or write{' '} - - to the community - -

-
-
-
- ); -}; diff --git a/frontend/src/pages/AuthPageComponent.tsx b/frontend/src/pages/AuthPageComponent.tsx index 0f2544d..5eed537 100644 --- a/frontend/src/pages/AuthPageComponent.tsx +++ b/frontend/src/pages/AuthPageComponent.tsx @@ -4,7 +4,6 @@ import { useEffect, useState } from 'react'; import { IS_CLOUD } from '../constants'; import { userApi } from '../entity/users'; -import { PlaygroundWarningComponent } from '../features/playground'; import { AdminPasswordComponent, AuthNavbarComponent, @@ -110,8 +109,6 @@ export function AuthPageComponent() { info@databasus.com | © 2026 Databasus. All rights reserved. )} - - ); } diff --git a/frontend/src/widgets/main/MainScreenComponent.tsx b/frontend/src/widgets/main/MainScreenComponent.tsx index 69c9f79..142ba30 100644 --- a/frontend/src/widgets/main/MainScreenComponent.tsx +++ b/frontend/src/widgets/main/MainScreenComponent.tsx @@ -14,7 +14,6 @@ import { import { type WorkspaceResponse, workspaceApi } from '../../entity/workspaces'; import { DatabasesComponent } from '../../features/databases/ui/DatabasesComponent'; import { NotifiersComponent } from '../../features/notifiers/ui/NotifiersComponent'; -import { PlaygroundWarningComponent } from '../../features/playground'; import { SettingsComponent } from '../../features/settings'; import { StoragesComponent } from '../../features/storages/ui/StoragesComponent'; import { ProfileComponent } from '../../features/users'; @@ -381,8 +380,6 @@ export const MainScreenComponent = () => { workspacesCount={workspaces.length} /> )} - - ); };