Skip to content

feat: De-globalize JSAPI in Console package#1292

Merged
vbabich merged 14 commits intodeephaven:mainfrom
vbabich:jsapi-deglobalize-console
May 15, 2023
Merged

feat: De-globalize JSAPI in Console package#1292
vbabich merged 14 commits intodeephaven:mainfrom
vbabich:jsapi-deglobalize-console

Conversation

@vbabich
Copy link
Copy Markdown
Collaborator

@vbabich vbabich commented May 11, 2023

  • Remove global dh references in the Console package, update consumers.
  • Add SET_API reducer.

BREAKING CHANGE:

  • Components IrisGrid, Chart, ChartBuilder, AdvancedFilterCreator, GotoRow, IrisGridModelUpdater, TableCSVExporter get the JSAPI reference from the model prop. dh prop removed.
  • makeApi props in IrisGridPanel and ChartPanel removed.
  • Components Console, ConsoleMenu, ConsoleStatusBar now require the JSAPI instance in the dh prop.
  • ConsoleUtils: static methods isTableType, isWidgetType, isOpenableType, isFigureType, isPandas require JSAPI instance passed in the first argument.
  • SessionUtils: static methods createSessionWrapper, loadSessionWrapper require JSAPI instance passed in the first argument.
  • Class IrisGridModel requires JSAPI instance passed in the constructor args.
  • Components DashboardLayout, ObjectIcon has to be wrapped in ApiContext.Provider passing the JSAPI instance.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2023

Codecov Report

Merging #1292 (428ecb6) into main (b877053) will increase coverage by 0.01%.
The diff coverage is 70.00%.

@@            Coverage Diff             @@
##             main    #1292      +/-   ##
==========================================
+ Coverage   45.49%   45.50%   +0.01%     
==========================================
  Files         504      504              
  Lines       34826    34828       +2     
  Branches     8688     8687       -1     
==========================================
+ Hits        15844    15850       +6     
+ Misses      18931    18927       -4     
  Partials       51       51              
Flag Coverage Δ
unit 45.50% <70.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...s/app-utils/src/components/ConnectionBootstrap.tsx 77.14% <ø> (ø)
packages/chart/src/Chart.tsx 0.00% <0.00%> (ø)
packages/chart/src/MockChartModel.js 0.00% <0.00%> (ø)
packages/code-studio/src/main/AppInit.tsx 0.00% <ø> (ø)
packages/code-studio/src/main/AppMainContainer.tsx 34.58% <ø> (+0.23%) ⬆️
packages/code-studio/src/styleguide/Charts.tsx 100.00% <ø> (ø)
packages/console/src/common/ConsoleUtils.ts 40.47% <0.00%> (-0.99%) ⬇️
packages/console/src/common/ObjectIcon.tsx 0.00% <0.00%> (ø)
.../dashboard-core-plugins/src/ChartBuilderPlugin.tsx 0.00% <ø> (ø)
...ackages/dashboard-core-plugins/src/ChartPlugin.tsx 50.00% <ø> (+2.00%) ⬆️
... and 24 more

Comment thread packages/console/src/Console.tsx
Comment thread packages/console/package.json Outdated
Comment thread package-lock.json Outdated
Comment thread packages/console/tsconfig.json Outdated
Comment thread packages/dashboard/src/DashboardLayout.tsx Outdated
@vbabich vbabich requested a review from mofojed May 12, 2023 14:47
@vbabich vbabich marked this pull request as ready for review May 12, 2023 14:47
@vbabich vbabich self-assigned this May 12, 2023
Comment thread package-lock.json Outdated
Comment thread package-lock.json Outdated
Comment thread packages/console/tsconfig.json Outdated
Comment thread packages/dashboard/package.json
Comment thread packages/dashboard/src/DashboardLayout.tsx
@vbabich vbabich requested a review from mofojed May 12, 2023 16:27
mofojed
mofojed previously approved these changes May 12, 2023
Copy link
Copy Markdown
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, think @mattrunyon may still want a look.

Comment thread packages/redux/src/reducers/api.ts
Copy link
Copy Markdown
Member

@mofojed mofojed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still reviewing the Enterprise side/functionality, so not approving yet. Only one minor cleanup comment.

Comment thread packages/chart/src/ChartModel.ts
Comment thread packages/iris-grid/src/sidebar/ChartBuilder.tsx Outdated
Copy link
Copy Markdown
Collaborator

@mattrunyon mattrunyon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor thing I saw. Looks fine to me though

Comment thread packages/iris-grid/src/sidebar/ChartBuilder.tsx Outdated
@vbabich vbabich merged commit 3f12dd3 into deephaven:main May 15, 2023
@vbabich vbabich deleted the jsapi-deglobalize-console branch May 15, 2023 19:50
@github-actions github-actions Bot locked and limited conversation to collaborators May 15, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants