From 756a8ad735937bf68ec6a9d4125774d396b1b060 Mon Sep 17 00:00:00 2001 From: Nathan-SR <144961007+Nathan-SR@users.noreply.github.com> Date: Wed, 9 Apr 2025 22:05:31 -0400 Subject: added option to collapse field panels --- .../DataVizBox/DocCreatorMenu/DocCreatorMenu.scss | 8 ++- .../DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx | 82 +++++++++++++--------- .../TemplateFieldTypes/TemplateField.ts | 1 - 3 files changed, 55 insertions(+), 36 deletions(-) (limited to 'src') diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.scss b/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.scss index 48e09d12f..2881fbb66 100644 --- a/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.scss +++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.scss @@ -816,6 +816,7 @@ scrollbar-width: none; .panels-container { + display: flex; height: 100%; width: 100%; flex-direction: column; @@ -936,7 +937,7 @@ flex-direction: column; align-items: center; justify-content: flex-start; - height: 285px; + height: fit-content; width: calc(100% - 10px); border: 1px solid rgb(180, 180, 180); margin: 5px; @@ -964,6 +965,11 @@ .field-title { color: whitesmoke; } + + &:hover { + background-color: rgb(72, 72, 72); + cursor: pointer; + } } .opts-bar { diff --git a/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx b/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx index 6d8d810aa..daba990e4 100644 --- a/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx +++ b/src/client/views/nodes/DataVizBox/DocCreatorMenu/DocCreatorMenu.tsx @@ -89,6 +89,7 @@ export class DocCreatorMenu extends ObservableReactComponent @observable _userCreatedFields: Col[] = []; @observable _selectedCols: { title: string; type: string; desc: string }[] | undefined = []; + @observable _collapsedCols: String[] = []; //any columns whose options panels are hidden @observable _layout: { type: LayoutType; yMargin: number; xMargin: number; columns?: number; repeat: number } = { type: LayoutType.FREEFORM, yMargin: 10, xMargin: 10, columns: 3, repeat: 0 }; @observable _savedLayouts: DataVizTemplateLayout[] = []; @@ -1327,52 +1328,65 @@ export class DocCreatorMenu extends ObservableReactComponent get dashboardContents() { const fieldPanel = (field: Col, id: number) => (
-
+
this.setUpButtonClick(e, runInAction(() => () => { + if (this._collapsedCols.includes(field.title)) { + this._collapsedCols = this._collapsedCols.filter(col => col !== field.title); + } else { + this._collapsedCols.push(field.title); + } + }))}> {`${field.title} Field`}
-
-
-
Title
-