feat: De-globalize JSAPI in IrisGrid package#1262
Conversation
mofojed
left a comment
There was a problem hiding this comment.
Looks good overall, just a little suggested cleanup.
| >; | ||
| export interface IrisGridProps { | ||
| children: React.ReactNode; | ||
| dh: DhType; |
There was a problem hiding this comment.
Side note - it would be ideal if everything was abstracted through the model and we didn't have to depend on dh being passed in to IrisGrid. I think that change is much more work than we're looking for right now though with this change.
Also, we could still use the context in the class component to get the API from the context: https://legacy.reactjs.org/docs/context.html#classcontexttype
I don't think that's much better though.
aff5958 to
72fbc81
Compare
Codecov Report
@@ Coverage Diff @@
## main #1262 +/- ##
==========================================
+ Coverage 45.39% 45.43% +0.03%
==========================================
Files 502 502
Lines 34706 34764 +58
Branches 8677 8679 +2
==========================================
+ Hits 15754 15794 +40
- Misses 18901 18919 +18
Partials 51 51
Flags with carried forward coverage won't be shown. Click here to find out more.
|
72fbc81 to
f1f7f75
Compare
mofojed
left a comment
There was a problem hiding this comment.
Looks good, need to update the Breaking Change bit
Slightly confused how text in the Go To Row has gotten shifted down by a pixel
|
Updated breaking changes in the first comment. |
DateUtilsandTableUtilsin thejsapi-utilspackage.dashboard-core-plugins,code-studio, embed-grid` to match the IrisGrid package changes.BREAKING CHANGE:
DateUtilsstatic methodsmakeDateWrapper,getNextDate,parseDateRangenow require the JSAPI object as the first argument.IrisGridUtilsstatic methodsdehydrateIrisGridState,hydrateIrisGridState,hydrateQuickFilters,dehydrateAdvancedFilters,hydrateAdvancedFilters,dehydrateAdvancedFilterOptions,hydrateAdvancedFilterOptions,dehydratePendingDataMap,hydratePendingDataMap,dehydrateValue,hydrateValue,dehydrateDateTime,hydrateDateTime,hydrateLong,hydrateSort,applyTableSettings,getFiltersFromInputFilters,rangeSetFromRangesconverted to instance methods. Consumers now need to create anIrisGridUtilsinstance and pass the JSAPI object to the constructor.TableUtilsstatic methodsmakeQuickFilter,makeQuickFilterFromComponent,makeQuickNumberFilter,makeQuickTextFilter,makeQuickBooleanFilter,makeQuickDateFilter,makeQuickDateFilterWithOperation,makeQuickCharFilter,makeAdvancedFilter,makeAdvancedValueFilter,makeFilterValue,makeFilterRawValue,makeValue,makeSelectValueFilterconverted to instance methods. Consumers now need to create aTableUtilsinstance and pass the JSAPI object to the constructor.IrisGridTableModel,IrisGridTableModelTemplate,IrisGridProxyModelconstructors require the JSAPI object in the first argument.IrisGridTestUtils.makeModel,IrisGridModelFactory.makeModelnow require the JSAPI object in the first argument.IrisGridContextMenuHandlerconstructor requires the JSAPI object in the second argument.IrisGridPanelrequires a newmakeApiprop, a function that resolves with the JSAPI instance.CrossColumnSearch.createSearchFilterrequires the JSAPI object argument.AdvancedFilterCreatorSelectValue,AdvancedFilterCreatorSelectValueList,ChartBuilder,GotoRow,IrisGrid,IrisGridModelUpdater,IrisGridPartitionSelector,PartitionSelectorSearch,TableCSVExporter,TableSaver,TreeTableViewportUpdater,RowFormatEditor,ColumnFormatEditor,ConditionEditornow require the JSAPI object passed in the new propdh.AdvancedFilterCreator,AdvancedFilterCreatorFilterItemrequire theTableUtilsinstance pass in the new proptableUtils.ConditionalFormattingUtilsstatic methodsgetFormatColumns,isDateConditionValidrequire the JSAPI object in the first argument.ConditionalFormattingAPIUtilsstatic methodmakeRowFormatColumnrequires the JSAPI object in the first argument.