Draft
Conversation
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/SqlLabSpaServlet.java
Fixed
Show fixed
Hide fixed
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/SqlLabSpaServlet.java
Fixed
Show fixed
Hide fixed
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/DashboardResources.java
Fixed
Show fixed
Hide fixed
exec/java-exec/src/main/java/org/apache/drill/exec/server/rest/DashboardResources.java
Fixed
Show fixed
Hide fixed
exec/java-exec/src/main/resources/webapp/src/pages/DashboardViewPage.tsx
Fixed
Show fixed
Hide fixed
exec/java-exec/src/main/resources/webapp/src/pages/DashboardViewPage.tsx
Fixed
Show fixed
Hide fixed
exec/java-exec/src/main/resources/webapp/src/pages/DashboardViewPage.tsx
Fixed
Show fixed
Hide fixed
Comment on lines
976
to
981
| return Response.ok(imageFile, contentType) | ||
| .header("Cache-Control", "public, max-age=86400") | ||
| .header("Content-Disposition", "inline; filename=\"" + filename + "\"") | ||
| .header("Content-Security-Policy", "default-src 'none'; style-src 'unsafe-inline'") | ||
| .header("X-Content-Type-Options", "nosniff") | ||
| .build(); |
Check warning
Code scanning / CodeQL
Cross-site scripting Medium
Reorder callback declarations before the useEffect that depends on them to fix TypeScript "used before declaration" errors. The loadConfig and loadProviders callbacks must be declared before the useEffect dependency array references them. Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
Add instructional text explaining what workspaces are to help users without referring to documentation. Display warning when all workspaces are deleted, and prevent saving file system plugins without at least one valid workspace. Always enforce allowAccessOutsideWorkspace: false for security. Validation state is tracked and passed from FileSystemForm to parent component to disable the Save button when invalid.
Remove useCallback wrapper from handleWorkspaceChange that was causing issues. Add special handling for classpath plugin which doesn't support workspaces: - Disable Add Workspace button for classpath - Show warning message explaining classpath limitation - Always mark validation as valid for classpath regardless of workspaces - Track fsType changes and update validation state accordingly
The classpath file system plugin does not support workspaces, so the tab is now completely hidden when classpath is selected. This provides a cleaner UI and prevents confusion about why workspaces cannot be added.
Wrap handleWorkspaceChange in useCallback to ensure it properly captures current values of dependencies and calls emitChange with correct state.
…seMemo Wrap addWorkspace, removeWorkspace, and updateWorkspace in useCallback to ensure they have access to current state. Wrap wsColumns in useMemo to prevent unnecessary table re-renders and state churn. Add debugging console.logs to diagnose button click issues.
The problem was that adding a workspace would call emitChange, which updated the parent's config. The parent would re-render and pass the updated config back to FileSystemForm. The useEffect([config]) would then fire and re-initialize workspaces from config - but config only contains workspaces with valid names, so empty workspaces were filtered out. The fix is to only re-initialize workspaces when the connection string changes (indicating a different storage plugin), not on every config update. This allows local workspace changes to persist while still loading workspaces when the user switches plugins. Also cleaned up debug console.logs.
Prevent users from creating workspaces with duplicate names in the same plugin. When duplicate names are detected: - Display an error alert showing which names are duplicated - Disable the Save button until duplicates are resolved - Update validation in real-time as user types Added getDuplicateWorkspaceNames helper function to detect duplicates, and integrated it into the validation logic.
The workspace list wasn't being loaded on first component mount because lastConfigRef was initialized with config, so on the first useEffect run, lastConnection === currentConnection and initialization was skipped. Added initializedRef flag to ensure workspaces are loaded on first mount, then only re-initialize when the connection string changes. This ensures saved workspaces appear in the UI after page reload while still preserving local edits during the same session.
## Summary Add interactive column menus to the ResultsGrid component with 5 feature categories: 1. **Actions** - Hide/show columns, pin/unpin to left/right 2. **Statistics** - Calculate and display column stats (count, null count, distinct, min/max/avg) 3. **Filters** - Show top 10 values and data quality indicators 4. **Transform** - SQL transformations (UPPER, LOWER, TRIM, CAST, TRUNCATE, SUBSTRING) 5. **Export** - Copy to clipboard or export as CSV ## Architecture - **SQL Transformation Utility** (src/utils/sqlTransformations.ts): Regex-based transformation logic - Handles simple columns, table prefixes, backticks, and aliases - Safe column wrapping with SQL functions - Client-side statistics calculation - **ColumnMenu Component** (src/components/results/ColumnMenu.tsx): Custom menu with 5 tabs - Statistics calculation from displayed data - Column visibility and pinning controls - Top 10 values preview for quick data exploration - Text transformations and type casting options - **CustomHeader Component** (src/components/results/CustomHeader.tsx): AG Grid header integration - Menu button in column headers using Popover - Connects to ColumnMenu for user interactions - **ResultsGrid Updates** (src/components/results/ResultsGrid.tsx): - Column state persistence to localStorage - New toolbar buttons for column and sort management - Modal dialogs for managing column visibility and sort order - Event listeners for saving state on column changes - **SqlLabPage Handler** (src/pages/SqlLabPage.tsx): - handleTransformColumn callback that shows preview modal - Transformation confirmation before modifying SQL - Auto-executes query after transformation ## Features Implemented ✅ Column Actions (hide/show, pin/unpin) ✅ Column Statistics (count, nulls, distinct, min/max/avg, percentages) ✅ Data Quality Indicators (non-null %, uniqueness %) ✅ Quick Data Preview (top 10 values) ✅ SQL Transformations (UPPER, LOWER, TRIM, CAST, TRUNCATE, SUBSTRING) ✅ Export Functions (copy to clipboard, export as CSV) ✅ Column State Persistence (localStorage) ✅ Sort Management (view current sorts, clear all) ✅ Column Management (show/hide all columns) ## Technical Details - Regex-based SQL transformation instead of parser library (avoids 500KB+ dependency) - Statistics computed on displayed/paginated data (not full dataset) - AG Grid API integration for column visibility and pinning - localStorage for persisting column state across sessions - TypeScript interfaces for type safety - Ant Design components for consistent UI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DRILL-XXXX: Refactor User Interface
Description
This PR refactors Drill's UI and refactors the Query view, adds visualizations and dashboards and in general makes Drill much more user friendly.
Documentation
(Please describe user-visible changes similar to what should appear in the Drill documentation.)
Testing
(Please describe how this PR has been tested.)