Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate dashboard into own package #203

Merged
merged 49 commits into from
Oct 8, 2021

Conversation

mofojed
Copy link
Member

@mofojed mofojed commented Sep 21, 2021

  • Create new package @deephaven/dashboard that contains the new Dashboard.tsx, which replaces DashboardContainer.jsx
  • Dashboard uses plugins now instead of internally registering it's own list of panels and event handlers
  • Dashboard plugins handle registration of panels, hydration/dehydration of those panels, the same functionality as event handlers
  • All plugins currently written as hooks with Typescript, though they could be any React component
  • Dashboard plugins pulled into a separate package, @deephaven/dashboard-core-plugins. Didn't feel a need to separate them further than that at this time.
  • Updated redux actions to write dashboard data from @deephaven/dashboard, @deephaven/dashboard-core-plugins, pulled out of @deephaven/redux
  • Fixes Separate dashboard into it's own package #23

@mofojed mofojed added enhancement New feature or request web-client-ui labels Sep 21, 2021
@mofojed mofojed added this to the September 2021 milestone Sep 21, 2021
@mofojed mofojed requested a review from vbabich September 21, 2021 18:15
@mofojed mofojed self-assigned this Sep 21, 2021
packages/dashboard/.gitignore Outdated Show resolved Hide resolved
packages/dashboard/src/Dashboard.tsx Outdated Show resolved Hide resolved
packages/dashboard/src/DashboardLayout.tsx Outdated Show resolved Hide resolved
packages/dashboard/src/DashboardLayout.tsx Outdated Show resolved Hide resolved
packages/dashboard/src/PanelManager.ts Show resolved Hide resolved
packages/golden-layout/src/js/LayoutManager.js Outdated Show resolved Hide resolved
packages/dashboard/src/PanelManager.ts Show resolved Hide resolved
@mofojed mofojed requested a review from vbabich September 28, 2021 20:40
vbabich
vbabich previously approved these changes Sep 30, 2021
mofojed added 17 commits October 7, 2021 16:50
- DashboardContainer now takes plugins that register components, can add event handlers, emit events, hydrate/dehydrate panels
- All of our redux has moved to @deephaven/redux. I'd like to use React Contexts only for dashboards, and get rid of redux, but one step at a time
- The CoreDashboardPlugin just has all the functionality in it right now. Need to break that down further
- Need to break DashboardContainer into it's own package

Start implementing a Dashboard/DashboardLayout

Goal is to simplify the lifecycle of the plugins. Usage will be something like

<Dashboard ...>
  <Plugin1 />
  <Plugin2 />
  ...more plugins...
</Dashboard>

WIP Use new initialization model to show it works

- Now plugins just mount/unmount like regular components, Linker should we easy to build now
- Layout initializations with an empty configuration first, then we add the config after all the plugins have been initialized.
--> This allows plugins to get the layout component when initializing, register components and provide a hydration function, and then adding the layout afterward
- Still lots of cleanup to do, like registering event listeners, adding Linker as a plugin, etc.

WIP Clean up a bit after rebasing

- Register FileExplorerPanel
- Fix up the Linker issue, add a TODO

WIP start implementing GridPlugin

Make a GridPlugin component, it works!

ChartPlugin...

WIP add ConsolePlugin

WIP Converting Linker to TypeScript

(cherry picked from commit e5a9cf9)

Clean up some unused imports

(cherry picked from commit 6464ed5)

Clean up the props in Linker

Following steps in docs: https://react-redux.js.org/using-react-redux/usage-with-typescript#typing-the-connect-higher-order-component

Remove the UnknownLinker stuff now that Linker is converted to TS

Fix up tests and conflicts

Fix golden-layout references after rebasing

Clean up more after rebasing
- hydrate/dehydrate default function in a common DashboardUtils file
- Each plugin responsible for registering it's own components
- Still need to register event handlers and what not
- Added a registerComponent function from golden-layout
- Cleaned up so all plugins now deregister if unmounted (hot swap plugins!)
Need to split out ControlEvent.OPEN into different InputFilterEvents and MarkdownEvent or something
- Now MarkdownEvent.OPEN and InputFilterEvent.OPEN_* events
- Handlers are built into the MarkdownPlugin and the FilterPlugin
Big time work in progress, everything is broken right now. In particular, need to figure out how to handle the Panel and WidgetPanel component
Still a lot of cleaning up to do. For some reason golden-layout isn't starting in the build and it's causing errors?
looks like golden-layout isn't building first for some reason...
Now everything builds, but it's not all done yet. Need to work on DownloadServiceWorkerUtils next
Just clean it up and leave it in code-studio for now, don't try and do too much at once for Vlad's sake
Still need to wire up onDataChange and onLayoutConfigChange... need to decide how to do "data" in a plugin universe
mofojed added 16 commits October 7, 2021 16:51
Still a couple failing
Had to replace a few spreads with Array.from(). Should switch to es6 probably before merging this in case there are other similar errors that I've missed
Would be nice if we could combine hydration with creating the object... I'll leave that as a future exercise. Could do it be saying all events are required to be serializable or something, then any non-serializable objects get added in a hydration step when creating the panel. May have other implications though, and this change is already quite large.
Still need to switch over a bunch more redux actions/selectors, like the input table map ones
Lightens up the @deephaven/redux package quite a bit
It's not needed now that Console panel is getting added after layout is initialized
Can't use type imported from outside of jest.mock
Enterprise needs to be able to import those shortcuts, or we're going to have problems registering shortcuts
@mofojed mofojed force-pushed the 23-dashboard-only branch from 68167cf to 6a991e9 Compare October 7, 2021 20:51
@mofojed mofojed merged commit a288d31 into deephaven:main Oct 8, 2021
@mofojed mofojed deleted the 23-dashboard-only branch October 8, 2021 18:18
mofojed added a commit to mofojed/web-client-ui that referenced this pull request Oct 12, 2021
* `chart`, `code-studio`, `components`, `console`, `dashboard-core-plugins`, `dashboard`, `file-explorer`, `golden-layout`, `grid`, `iris-grid`, `jsapi-shim`, `log`, `mocks`, `react-hooks`, `redux`, `storage`, `utils`
  * [deephaven#203](deephaven#203) Separate dashboard into own package ([@mofojed](https://github.com/mofojed))

* `chart`, `code-studio`, `components`, `console`, `dashboard-core-plugins`, `dashboard`, `file-explorer`, `golden-layout`, `grid`, `iris-grid`, `jsapi-shim`, `log`, `mocks`, `react-hooks`, `redux`, `storage`, `utils`
  * [deephaven#203](deephaven#203) Separate dashboard into own package ([@mofojed](https://github.com/mofojed))
* `icons`
  * [deephaven#220](deephaven#220) update to latest @vscode/codicons and add dhFreeze icon ([@dsmmcken](https://github.com/dsmmcken))

* `code-studio`
  * [deephaven#225](deephaven#225) Handle invalid layout files from the server correctly ([@mofojed](https://github.com/mofojed))
* `components`, `console`
  * [deephaven#202](deephaven#202) Don't show custom context menu on right-click in Monaco editor ([@vbabich](https://github.com/vbabich))

* [deephaven#226](deephaven#226) Add fetch-depth flag in alpha publish ([@mofojed](https://github.com/mofojed))
* [deephaven#224](deephaven#224) Update publish action auth ([@mofojed](https://github.com/mofojed))

- Don ([@dsmmcken](https://github.com/dsmmcken))
- Mike Bender ([@mofojed](https://github.com/mofojed))
- [@vbabich](https://github.com/vbabich)
@mofojed mofojed mentioned this pull request Oct 12, 2021
mofojed added a commit that referenced this pull request Oct 12, 2021
* `chart`, `code-studio`, `components`, `console`, `dashboard-core-plugins`, `dashboard`, `file-explorer`, `golden-layout`, `grid`, `iris-grid`, `jsapi-shim`, `log`, `mocks`, `react-hooks`, `redux`, `storage`, `utils`
  * [#203](#203) Separate dashboard into own package ([@mofojed](https://github.com/mofojed))

* `chart`, `code-studio`, `components`, `console`, `dashboard-core-plugins`, `dashboard`, `file-explorer`, `golden-layout`, `grid`, `iris-grid`, `jsapi-shim`, `log`, `mocks`, `react-hooks`, `redux`, `storage`, `utils`
  * [#203](#203) Separate dashboard into own package ([@mofojed](https://github.com/mofojed))
* `icons`
  * [#220](#220) update to latest @vscode/codicons and add dhFreeze icon ([@dsmmcken](https://github.com/dsmmcken))

* `code-studio`
  * [#225](#225) Handle invalid layout files from the server correctly ([@mofojed](https://github.com/mofojed))
* `components`, `console`
  * [#202](#202) Don't show custom context menu on right-click in Monaco editor ([@vbabich](https://github.com/vbabich))

* [#226](#226) Add fetch-depth flag in alpha publish ([@mofojed](https://github.com/mofojed))
* [#224](#224) Update publish action auth ([@mofojed](https://github.com/mofojed))

- Don ([@dsmmcken](https://github.com/dsmmcken))
- Mike Bender ([@mofojed](https://github.com/mofojed))
- [@vbabich](https://github.com/vbabich)
dsmmcken added a commit that referenced this pull request Jul 20, 2022
* Resolves #663 by copying enterprise fix DH-12258. Removes dead code.
* Fix shortcut broken by #203 Seperating dashboard into own package
* Cleanup hjkl shortcuts to not conflict with ctrl+L for linker
* add shift key support
vbabich pushed a commit to vbabich/web-client-ui that referenced this pull request Nov 29, 2022
* Resolves deephaven#663 by copying enterprise fix DH-12258. Removes dead code.
* Fix shortcut broken by deephaven#203 Seperating dashboard into own package
* Cleanup hjkl shortcuts to not conflict with ctrl+L for linker
* add shift key support
vbabich added a commit that referenced this pull request Nov 30, 2022
* Resolves #663 by copying enterprise fix DH-12258. Removes dead code.
* Fix shortcut broken by #203 Seperating dashboard into own package
* Cleanup hjkl shortcuts to not conflict with ctrl+L for linker
* add shift key support

Co-authored-by: Don <donmckenzie@deephaven.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separate dashboard into it's own package
2 participants