Bug: loadDatabases() was called at line 374 while environmentId still held the FIRST environment from initialization (line 259), because environmentId = j.environment_id was not set until line 391 (inside the datasource block). Only after that was environmentId correct. This caused the database dropdown to show databases from a different environment than the job's actual environment. For example, db_id=2 is DEV Greenplum in 'dev' but Prod Clickhouse in 'preprod'. The user would select Greenplum from the dev list, but the job would use preprod where db_id=2 is ClickHouse. Fix: set environmentId from the job's stored environment BEFORE calling loadDatabases(), and outside the datasource conditional so it runs for all existing jobs.
Superset Tools Frontend (SvelteKit)
This is the frontend for the Superset Tools application, built with SvelteKit in SPA mode.
Development
-
Install dependencies:
npm install -
Run development server:
npm run devThe frontend will be available at
http://localhost:5173. It is configured to proxy API requests tohttp://localhost:8000.
Production Build
-
Build the static SPA:
npm run buildThis generates a static SPA in the
build/directory. -
Serve with Backend: The Python backend is configured to serve the files from
frontend/build/. Ensure the backend is running:cd ../backend python src/app.py
Architecture
- Routing: File-based routing in
src/routes/. - Layouts: Shared UI in
src/routes/+layout.svelte. - Data Loading:
loadfunctions in+page.tsfor efficient data fetching. - API Client: Centralized API logic in
src/lib/api.js. - Styling: Tailwind CSS.