From 4b7902e74af68da8a3b1c02555d0a6125011f57c Mon Sep 17 00:00:00 2001 From: Vadim Ogievetsky Date: Wed, 30 Oct 2024 11:50:52 -0700 Subject: [PATCH] Web console: Improve workbench view with resizable side panels (#17387) --- licenses.yaml | 10 - web-console/package-lock.json | 34 - web-console/package.json | 2 - web-console/src/components/index.ts | 1 + .../splitter-layout.spec.tsx.snap | 41 ++ .../splitter-layout/layout-pane.tsx | 48 ++ .../splitter-layout/splitter-layout.scss | 68 ++ .../splitter-layout/splitter-layout.spec.tsx | 52 ++ .../splitter-layout/splitter-layout.tsx | 249 +++++++ .../src/druid-models/execution/execution.ts | 5 + web-console/src/entry.scss | 1 - web-console/src/utils/local-storage-keys.tsx | 2 + web-console/src/variables.scss | 8 + .../datasources-view.spec.tsx.snap | 657 +++++++++--------- .../datasources-view/datasources-view.scss | 29 +- .../datasources-view/datasources-view.tsx | 21 +- .../src/views/lookups-view/lookups-view.scss | 2 +- .../src/views/lookups-view/lookups-view.tsx | 4 +- .../__snapshots__/segments-view.spec.tsx.snap | 175 ++--- .../views/segments-view/segments-view.scss | 29 +- .../src/views/segments-view/segments-view.tsx | 117 ++-- .../number-menu-items/number-menu-items.tsx | 9 +- .../column-tree/column-tree.tsx | 4 +- .../execution-summary-panel.tsx | 2 +- .../workbench-view/query-tab/query-tab.scss | 29 +- .../workbench-view/query-tab/query-tab.tsx | 73 +- .../recent-query-task-panel.scss | 3 + .../views/workbench-view/workbench-view.scss | 18 +- .../views/workbench-view/workbench-view.tsx | 94 ++- 29 files changed, 1158 insertions(+), 629 deletions(-) create mode 100644 web-console/src/components/splitter-layout/__snapshots__/splitter-layout.spec.tsx.snap create mode 100644 web-console/src/components/splitter-layout/layout-pane.tsx create mode 100644 web-console/src/components/splitter-layout/splitter-layout.scss create mode 100644 web-console/src/components/splitter-layout/splitter-layout.spec.tsx create mode 100644 web-console/src/components/splitter-layout/splitter-layout.tsx diff --git a/licenses.yaml b/licenses.yaml index c7053f17ff27..40305fc55c66 100644 --- a/licenses.yaml +++ b/licenses.yaml @@ -6329,16 +6329,6 @@ license_file_path: licenses/bin/react-router.MIT --- -name: "react-splitter-layout" -license_category: binary -module: web-console -license_name: MIT License -copyright: Yang Liu -version: 4.0.0 -license_file_path: licenses/bin/react-splitter-layout.MIT - ---- - name: "react-table" license_category: binary module: web-console diff --git a/web-console/package-lock.json b/web-console/package-lock.json index 3431d44e4a51..95768117648c 100644 --- a/web-console/package-lock.json +++ b/web-console/package-lock.json @@ -42,7 +42,6 @@ "react-dom": "^18.3.1", "react-router": "^5.3.4", "react-router-dom": "^5.3.4", - "react-splitter-layout": "^4.0.0", "react-table": "~6.11.5", "regenerator-runtime": "^0.13.7", "tslib": "^2.8.0", @@ -75,7 +74,6 @@ "@types/react": "^18.3.11", "@types/react-dom": "^18.3.1", "@types/react-router-dom": "^5.3.3", - "@types/react-splitter-layout": "^3.0.5", "@types/react-table": "6.8.5", "@types/uuid": "^7.0.2", "autoprefixer": "^10.4.20", @@ -4064,15 +4062,6 @@ "@types/react-router": "*" } }, - "node_modules/@types/react-splitter-layout": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@types/react-splitter-layout/-/react-splitter-layout-3.0.5.tgz", - "integrity": "sha512-J3NKVdPguGcSSN41/EDV3BYdYfndxUil2SX4wDBJiVfcnyopCegdhIrC2kcaa4CxjpaPChe1bja2k8LLDxP0ZQ==", - "dev": true, - "dependencies": { - "@types/react": "*" - } - }, "node_modules/@types/react-table": { "version": "6.8.5", "resolved": "https://registry.npmjs.org/@types/react-table/-/react-table-6.8.5.tgz", @@ -14964,15 +14953,6 @@ "integrity": "sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==", "dev": true }, - "node_modules/react-splitter-layout": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/react-splitter-layout/-/react-splitter-layout-4.0.0.tgz", - "integrity": "sha512-SLqOjBOxRuizWUa83w6q5/u9cDWa9/yj9Iko9V9JFN8x+cqIXiDlUFWSx+icz3IIgvsN/oRIw3za5/32RjIwrA==", - "peerDependencies": { - "prop-types": "^15.5.0", - "react": "^15.5.0 || ^16.0.0" - } - }, "node_modules/react-table": { "version": "6.11.5", "resolved": "https://registry.npmjs.org/react-table/-/react-table-6.11.5.tgz", @@ -21157,15 +21137,6 @@ "@types/react-router": "*" } }, - "@types/react-splitter-layout": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/@types/react-splitter-layout/-/react-splitter-layout-3.0.5.tgz", - "integrity": "sha512-J3NKVdPguGcSSN41/EDV3BYdYfndxUil2SX4wDBJiVfcnyopCegdhIrC2kcaa4CxjpaPChe1bja2k8LLDxP0ZQ==", - "dev": true, - "requires": { - "@types/react": "^18.3.11" - } - }, "@types/react-table": { "version": "6.8.5", "resolved": "https://registry.npmjs.org/@types/react-table/-/react-table-6.8.5.tgz", @@ -28826,11 +28797,6 @@ } } }, - "react-splitter-layout": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/react-splitter-layout/-/react-splitter-layout-4.0.0.tgz", - "integrity": "sha512-SLqOjBOxRuizWUa83w6q5/u9cDWa9/yj9Iko9V9JFN8x+cqIXiDlUFWSx+icz3IIgvsN/oRIw3za5/32RjIwrA==" - }, "react-table": { "version": "6.11.5", "resolved": "https://registry.npmjs.org/react-table/-/react-table-6.11.5.tgz", diff --git a/web-console/package.json b/web-console/package.json index 96de0349e2fc..1e76234841ab 100644 --- a/web-console/package.json +++ b/web-console/package.json @@ -83,7 +83,6 @@ "react-dom": "^18.3.1", "react-router": "^5.3.4", "react-router-dom": "^5.3.4", - "react-splitter-layout": "^4.0.0", "react-table": "~6.11.5", "regenerator-runtime": "^0.13.7", "tslib": "^2.8.0", @@ -116,7 +115,6 @@ "@types/react": "^18.3.11", "@types/react-dom": "^18.3.1", "@types/react-router-dom": "^5.3.3", - "@types/react-splitter-layout": "^3.0.5", "@types/react-table": "6.8.5", "@types/uuid": "^7.0.2", "autoprefixer": "^10.4.20", diff --git a/web-console/src/components/index.ts b/web-console/src/components/index.ts index 437017a8c767..d885bf07434a 100644 --- a/web-console/src/components/index.ts +++ b/web-console/src/components/index.ts @@ -51,6 +51,7 @@ export * from './segment-timeline/segment-timeline'; export * from './show-json/show-json'; export * from './show-log/show-log'; export * from './show-value/show-value'; +export * from './splitter-layout/splitter-layout'; export * from './suggestion-menu/suggestion-menu'; export * from './supervisor-history-panel/supervisor-history-panel'; export * from './table-cell/table-cell'; diff --git a/web-console/src/components/splitter-layout/__snapshots__/splitter-layout.spec.tsx.snap b/web-console/src/components/splitter-layout/__snapshots__/splitter-layout.spec.tsx.snap new file mode 100644 index 000000000000..7cb7b2ceca26 --- /dev/null +++ b/web-console/src/components/splitter-layout/__snapshots__/splitter-layout.spec.tsx.snap @@ -0,0 +1,41 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`SplitterLayout matches snapshot one child 1`] = ` +
+
+
+
+
+`; + +exports[`SplitterLayout matches snapshot two children 1`] = ` +
+
+
+
+