From d3966530fab48ee72fab138b8caf97c4eb73ec91 Mon Sep 17 00:00:00 2001 From: Ghislain B Date: Tue, 17 Nov 2020 11:06:56 -0500 Subject: [PATCH] feat(services): add 2x new methods hideColumnById or ..byIds (#160) * feat(services): add 2x new methods hideColumnById or ..byIds - deprecate previous methods (hideColumn, hideColumnByIndex) since the new methods offer more values with extra options to resize and/or hide from pickers --- .../src/examples/example07.ts | 14 +- .../src/interfaces/gridOption.interface.ts | 2 +- .../interfaces/hideColumnOption.interface.ts | 13 ++ packages/common/src/interfaces/index.ts | 1 + .../services/__tests__/grid.service.spec.ts | 163 +++++++++++++++++- packages/common/src/services/grid.service.ts | 74 +++++++- .../components/slick-vanilla-grid-bundle.ts | 6 +- test/cypress.json | 3 +- 8 files changed, 258 insertions(+), 18 deletions(-) create mode 100644 packages/common/src/interfaces/hideColumnOption.interface.ts diff --git a/examples/webpack-demo-vanilla-bundle/src/examples/example07.ts b/examples/webpack-demo-vanilla-bundle/src/examples/example07.ts index 921604ac1..20295d03b 100644 --- a/examples/webpack-demo-vanilla-bundle/src/examples/example07.ts +++ b/examples/webpack-demo-vanilla-bundle/src/examples/example07.ts @@ -249,14 +249,14 @@ export class Example7 { } hideDurationColumnDynamically() { - const columnIndex = this.sgb.slickGrid.getColumns().findIndex(col => col.id === 'duration'); - if (columnIndex >= 0) { - this.sgb.gridService.hideColumnByIndex(columnIndex); - } + // -- you can hide by one Id or multiple Ids: + // hideColumnById(id, options), hideColumnByIds([ids], options) + // you can also provide options, defaults are: { autoResizeColumns: true, triggerEvent: true, hideFromColumnPicker: false, hideFromGridMenu: false } + + this.sgb.gridService.hideColumnById('duration'); - // you can also remove the column from both pickers (ColumnPicker/GridMenu) - // this.sgb.columnDefinitions[columnIndex].excludeFromColumnPicker = true; - // this.sgb.columnDefinitions[columnIndex].excludeFromGridMenu = true; + // or with multiple Ids and extra options + // this.sgb.gridService.hideColumnByIds(['duration', 'finish'], { autoResizeColumns: false, hideFromColumnPicker: true, hideFromGridMenu: false }); } // Disable/Enable Filtering/Sorting functionalities diff --git a/packages/common/src/interfaces/gridOption.interface.ts b/packages/common/src/interfaces/gridOption.interface.ts index fda580784..0c7425ea9 100644 --- a/packages/common/src/interfaces/gridOption.interface.ts +++ b/packages/common/src/interfaces/gridOption.interface.ts @@ -230,7 +230,7 @@ export interface GridOption { /** Defaults to true, which leads to use an Excel like copy buffer that gets copied in clipboard and can be pasted back in Excel or any other app */ enableExcelCopyBuffer?: boolean; - + /** * Defaults to true, will display a warning message positioned inside the grid when there's no data returned. * When using local (in-memory) dataset, it will show the message when there's no filtered data returned. diff --git a/packages/common/src/interfaces/hideColumnOption.interface.ts b/packages/common/src/interfaces/hideColumnOption.interface.ts new file mode 100644 index 000000000..cced9eaac --- /dev/null +++ b/packages/common/src/interfaces/hideColumnOption.interface.ts @@ -0,0 +1,13 @@ +export interface HideColumnOption { + /** Defaults to true, do we want to auto-reize the columns in the grid after hidding the column(s)? */ + autoResizeColumns?: boolean; + + /** Defaults to false, do we want to hide the column name from the column picker after hidding the column from the grid? */ + hideFromColumnPicker?: boolean; + + /** Defaults to false, do we want to hide the column name from the grid menu after hidding the column from the grid? */ + hideFromGridMenu?: boolean; + + /** Defaults to true, do we want to trigger an even "onHeaderMenuColumnsChanged" after hidding the column(s)? */ + triggerEvent?: boolean; +} diff --git a/packages/common/src/interfaces/index.ts b/packages/common/src/interfaces/index.ts index 3adcf9d19..9d8a60f84 100644 --- a/packages/common/src/interfaces/index.ts +++ b/packages/common/src/interfaces/index.ts @@ -85,6 +85,7 @@ export * from './headerButtonItem.interface'; export * from './headerButtonOnCommandArgs.interface'; export * from './headerMenu.interface'; export * from './headerMenuOption.interface'; +export * from './hideColumnOption.interface'; export * from './htmlElementPosition.interface'; export * from './jQueryUiSliderOption.interface'; export * from './jQueryUiSliderResponse.interface'; diff --git a/packages/common/src/services/__tests__/grid.service.spec.ts b/packages/common/src/services/__tests__/grid.service.spec.ts index 55585eb4c..f3c052069 100644 --- a/packages/common/src/services/__tests__/grid.service.spec.ts +++ b/packages/common/src/services/__tests__/grid.service.spec.ts @@ -1285,13 +1285,13 @@ describe('Grid Service', () => { const mockColumns = [{ id: 'field1', width: 100 }, { id: 'field2', width: 150 }, { id: 'field3', field: 'field3' }] as Column[]; const mockWithoutColumns = [{ id: 'field1', width: 100 }, { id: 'field3', field: 'field3' }] as Column[]; jest.spyOn(gridStub, 'getColumns').mockReturnValue(mockColumns); - const getVisibleSpy = jest.spyOn(SharedService.prototype, 'visibleColumns', 'set'); + const setVisibleSpy = jest.spyOn(SharedService.prototype, 'visibleColumns', 'set'); const setColsSpy = jest.spyOn(gridStub, 'setColumns'); const pubSubSpy = jest.spyOn(pubSubServiceStub, 'publish'); service.hideColumnByIndex(1); - expect(getVisibleSpy).toHaveBeenCalledWith(mockWithoutColumns); + expect(setVisibleSpy).toHaveBeenCalledWith(mockWithoutColumns); expect(setColsSpy).toHaveBeenCalledWith(mockWithoutColumns); expect(pubSubSpy).toHaveBeenCalledWith('onHeaderMenuColumnsChanged', { columns: mockWithoutColumns }); }); @@ -1300,18 +1300,173 @@ describe('Grid Service', () => { const mockColumns = [{ id: 'field1', width: 100 }, { id: 'field2', width: 150 }, { id: 'field3', field: 'field3' }] as Column[]; const mockWithoutColumns = [{ id: 'field1', width: 100 }, { id: 'field3', field: 'field3' }] as Column[]; jest.spyOn(gridStub, 'getColumns').mockReturnValue(mockColumns); - const getVisibleSpy = jest.spyOn(SharedService.prototype, 'visibleColumns', 'set'); + const setVisibleSpy = jest.spyOn(SharedService.prototype, 'visibleColumns', 'set'); const setColsSpy = jest.spyOn(gridStub, 'setColumns'); const pubSubSpy = jest.spyOn(pubSubServiceStub, 'publish'); service.hideColumnByIndex(1, false); - expect(getVisibleSpy).toHaveBeenCalledWith(mockWithoutColumns); + expect(setVisibleSpy).toHaveBeenCalledWith(mockWithoutColumns); expect(setColsSpy).toHaveBeenCalledWith(mockWithoutColumns); expect(pubSubSpy).not.toHaveBeenCalled(); }); }); + describe('hideColumnById method', () => { + it('should return -1 when the column id is not found in the list of loaded column definitions', () => { + const mockColumns = [{ id: 'field1', width: 100 }, { id: 'field2', width: 150 }, { id: 'field3', field: 'field3' }] as Column[]; + jest.spyOn(gridStub, 'getColumns').mockReturnValue(mockColumns); + + const output = service.hideColumnById('xyz'); + + expect(output).toBe(-1); + }); + + it('should set new columns minus the column to hide and it should keep new set as the new "visibleColumns"', () => { + const mockColumns = [{ id: 'field1', width: 100 }, { id: 'field2', width: 150 }, { id: 'field3', field: 'field3' }] as Column[]; + const mockWithoutColumns = [{ id: 'field1', width: 100 }, { id: 'field3', field: 'field3' }] as Column[]; + jest.spyOn(gridStub, 'getColumns').mockReturnValue(mockColumns); + const setVisibleSpy = jest.spyOn(SharedService.prototype, 'visibleColumns', 'set'); + const autoSizeSpy = jest.spyOn(gridStub, 'autosizeColumns'); + const setColsSpy = jest.spyOn(gridStub, 'setColumns'); + const pubSubSpy = jest.spyOn(pubSubServiceStub, 'publish'); + + const output = service.hideColumnById('field2'); + + expect(output).toBe(1); + expect(autoSizeSpy).toHaveBeenCalled(); + expect(setVisibleSpy).toHaveBeenCalledWith(mockWithoutColumns); + expect(setColsSpy).toHaveBeenCalledWith(mockWithoutColumns); + expect(pubSubSpy).toHaveBeenCalledWith('onHeaderMenuColumnsChanged', { columns: mockWithoutColumns }); + }); + + it('should set new columns minus the column to hide but without triggering an event when set to False', () => { + const mockColumns = [{ id: 'field1', width: 100 }, { id: 'field2', width: 150 }, { id: 'field3', field: 'field3' }] as Column[]; + const mockWithoutColumns = [{ id: 'field1', width: 100 }, { id: 'field3', field: 'field3' }] as Column[]; + jest.spyOn(gridStub, 'getColumns').mockReturnValue(mockColumns); + const setVisibleSpy = jest.spyOn(SharedService.prototype, 'visibleColumns', 'set'); + const autoSizeSpy = jest.spyOn(gridStub, 'autosizeColumns'); + const setColsSpy = jest.spyOn(gridStub, 'setColumns'); + const pubSubSpy = jest.spyOn(pubSubServiceStub, 'publish'); + + service.hideColumnById('field2', { triggerEvent: false }); + + expect(autoSizeSpy).toHaveBeenCalled(); + expect(setVisibleSpy).toHaveBeenCalledWith(mockWithoutColumns); + expect(setColsSpy).toHaveBeenCalledWith(mockWithoutColumns); + expect(pubSubSpy).not.toHaveBeenCalled(); + }); + + it('should set new columns minus the column to hide but without resize the columns when "autoResizeColumns" is set to False', () => { + const mockColumns = [{ id: 'field1', width: 100 }, { id: 'field2', width: 150 }, { id: 'field3', field: 'field3' }] as Column[]; + const mockWithoutColumns = [{ id: 'field1', width: 100 }, { id: 'field3', field: 'field3' }] as Column[]; + jest.spyOn(gridStub, 'getColumns').mockReturnValue(mockColumns); + const setVisibleSpy = jest.spyOn(SharedService.prototype, 'visibleColumns', 'set'); + const autoSizeSpy = jest.spyOn(gridStub, 'autosizeColumns'); + const setColsSpy = jest.spyOn(gridStub, 'setColumns'); + const pubSubSpy = jest.spyOn(pubSubServiceStub, 'publish'); + + service.hideColumnById('field2', { autoResizeColumns: false }); + + expect(autoSizeSpy).not.toHaveBeenCalled(); + expect(setVisibleSpy).toHaveBeenCalledWith(mockWithoutColumns); + expect(setColsSpy).toHaveBeenCalledWith(mockWithoutColumns); + expect(pubSubSpy).toHaveBeenCalled(); + }); + + it('should set new columns minus the column to hide AND also hide the column from the column picker when "hideFromColumnPicker" is set to False', () => { + const mockColumns = [{ id: 'field1', width: 100 }, { id: 'field2', width: 150 }, { id: 'field3', field: 'field3' }] as Column[]; + const mockWithoutColumns = [{ id: 'field1', width: 100 }, { id: 'field3', field: 'field3' }] as Column[]; + jest.spyOn(gridStub, 'getColumns').mockReturnValue(mockColumns); + const setVisibleSpy = jest.spyOn(SharedService.prototype, 'visibleColumns', 'set'); + jest.spyOn(SharedService.prototype, 'allColumns', 'get').mockReturnValue(mockColumns); + const autoSizeSpy = jest.spyOn(gridStub, 'autosizeColumns'); + const setColsSpy = jest.spyOn(gridStub, 'setColumns'); + + service.hideColumnById('field2', { hideFromColumnPicker: true }); + + expect(autoSizeSpy).toHaveBeenCalled(); + expect(setVisibleSpy).toHaveBeenCalledWith(mockWithoutColumns); + expect(mockColumns).toEqual([{ id: 'field1', width: 100 }, { id: 'field2', width: 150, excludeFromColumnPicker: true }, { id: 'field3', field: 'field3' }]); + expect(setColsSpy).toHaveBeenCalledWith(mockWithoutColumns); + }); + + it('should set new columns minus the column to hide AND also hide the column from the column picker when "hideFromColumnPicker" is set to False', () => { + const mockColumns = [{ id: 'field1', width: 100 }, { id: 'field2', width: 150 }, { id: 'field3', field: 'field3' }] as Column[]; + const mockWithoutColumns = [{ id: 'field1', width: 100 }, { id: 'field3', field: 'field3' }] as Column[]; + jest.spyOn(gridStub, 'getColumns').mockReturnValue(mockColumns); + const setVisibleSpy = jest.spyOn(SharedService.prototype, 'visibleColumns', 'set'); + jest.spyOn(SharedService.prototype, 'allColumns', 'get').mockReturnValue(mockColumns); + const autoSizeSpy = jest.spyOn(gridStub, 'autosizeColumns'); + const setColsSpy = jest.spyOn(gridStub, 'setColumns'); + + service.hideColumnById('field2', { autoResizeColumns: false, hideFromGridMenu: true }); + + expect(autoSizeSpy).not.toHaveBeenCalled(); + expect(setVisibleSpy).toHaveBeenCalledWith(mockWithoutColumns); + expect(mockColumns).toEqual([{ id: 'field1', width: 100 }, { id: 'field2', width: 150, excludeFromGridMenu: true }, { id: 'field3', field: 'field3' }]); + expect(setColsSpy).toHaveBeenCalledWith(mockWithoutColumns); + }); + }); + + describe('hideColumnByIds method', () => { + it('should loop through the Ids provided and call hideColumnById on each of them with same options', () => { + const mockColumns = [{ id: 'field1', width: 100 }, { id: 'field2', width: 150 }, { id: 'field3', field: 'field3' }] as Column[]; + jest.spyOn(gridStub, 'getColumns').mockReturnValue(mockColumns); + const autoSizeSpy = jest.spyOn(gridStub, 'autosizeColumns'); + const pubSubSpy = jest.spyOn(pubSubServiceStub, 'publish'); + const hideByIdSpy = jest.spyOn(service, 'hideColumnById'); + + service.hideColumnByIds(['field2', 'field3']); + + expect(hideByIdSpy).toHaveBeenCalledTimes(2); + expect(hideByIdSpy).toHaveBeenNthCalledWith(1, 'field2', { autoResizeColumns: false, hideFromColumnPicker: false, hideFromGridMenu: false, triggerEvent: false }); + expect(hideByIdSpy).toHaveBeenNthCalledWith(2, 'field3', { autoResizeColumns: false, hideFromColumnPicker: false, hideFromGridMenu: false, triggerEvent: false }); + expect(autoSizeSpy).toHaveBeenCalled(); + expect(pubSubSpy).toHaveBeenCalledWith('onHeaderMenuColumnsChanged', { columns: expect.toBeArray() }); + }); + + it('should loop through the Ids provided and call hideColumnById on each of them with same options BUT not auto size columns neither trigger when both are disabled', () => { + const mockColumns = [{ id: 'field1', width: 100 }, { id: 'field2', width: 150 }, { id: 'field3', field: 'field3' }] as Column[]; + jest.spyOn(gridStub, 'getColumns').mockReturnValue(mockColumns); + const autoSizeSpy = jest.spyOn(gridStub, 'autosizeColumns'); + const pubSubSpy = jest.spyOn(pubSubServiceStub, 'publish'); + const hideByIdSpy = jest.spyOn(service, 'hideColumnById'); + + service.hideColumnByIds(['field2', 'field3'], { autoResizeColumns: false, triggerEvent: false }); + + expect(hideByIdSpy).toHaveBeenCalledTimes(2); + expect(hideByIdSpy).toHaveBeenNthCalledWith(1, 'field2', { autoResizeColumns: false, hideFromColumnPicker: false, hideFromGridMenu: false, triggerEvent: false }); + expect(hideByIdSpy).toHaveBeenNthCalledWith(2, 'field3', { autoResizeColumns: false, hideFromColumnPicker: false, hideFromGridMenu: false, triggerEvent: false }); + expect(autoSizeSpy).not.toHaveBeenCalled(); + expect(pubSubSpy).not.toHaveBeenCalled(); + }); + + it('should loop through the Ids provided and call hideColumnById on each of them with same options and hide from column picker when "hideFromColumnPicker" is enabled', () => { + const mockColumns = [{ id: 'field1', width: 100 }, { id: 'field2', width: 150 }, { id: 'field3', field: 'field3' }] as Column[]; + jest.spyOn(gridStub, 'getColumns').mockReturnValue(mockColumns); + const hideByIdSpy = jest.spyOn(service, 'hideColumnById'); + + service.hideColumnByIds(['field2', 'field3'], { hideFromColumnPicker: true }); + + expect(hideByIdSpy).toHaveBeenCalledTimes(2); + expect(hideByIdSpy).toHaveBeenNthCalledWith(1, 'field2', { autoResizeColumns: false, hideFromColumnPicker: true, hideFromGridMenu: false, triggerEvent: false }); + expect(hideByIdSpy).toHaveBeenNthCalledWith(2, 'field3', { autoResizeColumns: false, hideFromColumnPicker: true, hideFromGridMenu: false, triggerEvent: false }); + }); + + it('should loop through the Ids provided and call hideColumnById on each of them with same options and hide from column picker when "hideFromColumnPicker" is enabled', () => { + const mockColumns = [{ id: 'field1', width: 100 }, { id: 'field2', width: 150 }, { id: 'field3', field: 'field3' }] as Column[]; + jest.spyOn(gridStub, 'getColumns').mockReturnValue(mockColumns); + const hideByIdSpy = jest.spyOn(service, 'hideColumnById'); + + service.hideColumnByIds(['field2', 'field3'], { hideFromGridMenu: true }); + + expect(hideByIdSpy).toHaveBeenCalledTimes(2); + expect(hideByIdSpy).toHaveBeenNthCalledWith(1, 'field2', { autoResizeColumns: false, hideFromColumnPicker: false, hideFromGridMenu: true, triggerEvent: false }); + expect(hideByIdSpy).toHaveBeenNthCalledWith(2, 'field3', { autoResizeColumns: false, hideFromColumnPicker: false, hideFromGridMenu: true, triggerEvent: false }); + }); + }); + describe('setSelectedRow method', () => { it('should select the row with index provided', () => { const spy = jest.spyOn(gridStub, 'setSelectedRows'); diff --git a/packages/common/src/services/grid.service.ts b/packages/common/src/services/grid.service.ts index 9b4cc92ea..67047b7f0 100644 --- a/packages/common/src/services/grid.service.ts +++ b/packages/common/src/services/grid.service.ts @@ -6,6 +6,7 @@ import { GridServiceDeleteOption, GridServiceInsertOption, GridServiceUpdateOption, + HideColumnOption, OnEventArgs, SlickGrid, SlickNamespace, @@ -22,9 +23,11 @@ import { arrayRemoveItemByIndex } from './utilities'; // using external non-typed js libraries declare const Slick: SlickNamespace; let highlightTimerEnd: any; + const GridServiceDeleteOptionDefaults: GridServiceDeleteOption = { triggerEvent: true }; const GridServiceInsertOptionDefaults: GridServiceInsertOption = { highlightRow: true, position: 'top', resortGrid: false, selectRow: false, triggerEvent: true }; const GridServiceUpdateOptionDefaults: GridServiceUpdateOption = { highlightRow: false, selectRow: false, scrollRowIntoView: false, triggerEvent: true }; +const HideColumnOptionDefaults: HideColumnOption = { autoResizeColumns: true, triggerEvent: true, hideFromColumnPicker: false, hideFromGridMenu: false }; export class GridService { private _grid: SlickGrid; @@ -185,7 +188,8 @@ export class GridService { } /** - * Hide a Column from the Grid (the column will just become hidden and will still show up in columnPicker/gridMenu) + * @deprecated Hide a Column from the Grid (the column will just become hidden and will still show up in columnPicker/gridMenu) + * @see hideColumnById * @param column */ hideColumn(column: Column) { @@ -198,7 +202,8 @@ export class GridService { } /** - * Hide a Column from the Grid by its column definition index (the column will just become hidden and will still show up in columnPicker/gridMenu) + * @deprecated Hide a Column from the Grid by its column definition index (the column will just become hidden and will still show up in columnPicker/gridMenu) + * @see hideColumnById Please use "hideColumnById(id)" or "hideColumnByIds([ids])" instead since it has a lot more options * @param columnIndex - column definition index * @param triggerEvent - do we want to trigger an event (onHeaderMenuColumnsChanged) when column becomes hidden? Defaults to true. */ @@ -214,6 +219,71 @@ export class GridService { } } + /** + * Hide a Column from the Grid by its column definition id, the column will just become hidden and will still show up in columnPicker/gridMenu + * @param {string | number} columnId - column definition id + * @param {boolean} triggerEvent - do we want to trigger an event (onHeaderMenuColumnsChanged) when column becomes hidden? Defaults to true. + * @return {number} columnIndex - column index position when found or -1 + */ + hideColumnById(columnId: string | number, options?: HideColumnOption): number { + options = { ...HideColumnOptionDefaults, ...options }; + if (this._grid && this._grid.getColumns && this._grid.setColumns) { + const currentColumns = this._grid.getColumns(); + const colIndexFound = currentColumns.findIndex(col => col.id === columnId); + + if (colIndexFound >= 0) { + const visibleColumns = arrayRemoveItemByIndex(currentColumns, colIndexFound); + this.sharedService.visibleColumns = visibleColumns; + this._grid.setColumns(visibleColumns); + + const columnIndexFromAllColumns = this.sharedService.allColumns.findIndex(col => col.id === columnId); + if (columnIndexFromAllColumns) { + if (options?.hideFromColumnPicker) { + this.sharedService.allColumns[columnIndexFromAllColumns].excludeFromColumnPicker = true; + } + if (options?.hideFromGridMenu) { + this.sharedService.allColumns[columnIndexFromAllColumns].excludeFromGridMenu = true; + } + } + + // do we want to auto-resize the columns in the grid after hidding some? most often yes + if (options?.autoResizeColumns) { + this._grid.autosizeColumns(); + } + + // do we want to trigger an event after hidding + if (options?.triggerEvent) { + this.pubSubService.publish('onHeaderMenuColumnsChanged', { columns: visibleColumns }); + } + return colIndexFound; + } + } + return -1; + } + + /** + * Hide a Column from the Grid by its column definition id(s), the column will just become hidden and will still show up in columnPicker/gridMenu + * @param {Array} columnIds - column definition ids, can be a single string and an array of strings + * @param {boolean} triggerEvent - do we want to trigger an event (onHeaderMenuColumnsChanged) when column becomes hidden? Defaults to true. + */ + hideColumnByIds(columnIds: Array, options?: HideColumnOption) { + options = { ...HideColumnOptionDefaults, ...options }; + if (Array.isArray(columnIds)) { + for (const columnId of columnIds) { + // hide each column by its id but wait after the for loop to auto resize columns in the grid + this.hideColumnById(columnId, { ...options, triggerEvent: false, autoResizeColumns: false }); + } + // do we want to auto-resize the columns in the grid after hidding some? most often yes + if (options?.autoResizeColumns) { + this._grid.autosizeColumns(); + } + // do we want to trigger an event after hidding + if (options?.triggerEvent) { + this.pubSubService.publish('onHeaderMenuColumnsChanged', { columns: this.sharedService.visibleColumns }); + } + } + } + /** * Highlight then fade a row for x seconds. * The implementation follows this SO answer: https://stackoverflow.com/a/19985148/1212166 diff --git a/packages/vanilla-bundle/src/components/slick-vanilla-grid-bundle.ts b/packages/vanilla-bundle/src/components/slick-vanilla-grid-bundle.ts index 44069a931..97c3637ab 100644 --- a/packages/vanilla-bundle/src/components/slick-vanilla-grid-bundle.ts +++ b/packages/vanilla-bundle/src/components/slick-vanilla-grid-bundle.ts @@ -310,8 +310,6 @@ export class SlickVanillaGridBundle { this.sortService = services?.sortService ?? new SortService(this.sharedService, this._eventPubSubService); this.treeDataService = services?.treeDataService ?? new TreeDataService(this.sharedService); this.paginationService = services?.paginationService ?? new PaginationService(this._eventPubSubService, this.sharedService); - this.gridService = services?.gridService ?? new GridService(this.extensionService, this.filterService, this._eventPubSubService, this.paginationService, this.sharedService, this.sortService); - this.gridStateService = services?.gridStateService ?? new GridStateService(this.extensionService, this.filterService, this._eventPubSubService, this.sharedService, this.sortService); // extensions const autoTooltipExtension = new AutoTooltipExtension(this.extensionUtility, this.sharedService); @@ -345,6 +343,10 @@ export class SlickVanillaGridBundle { this.sharedService, this.translaterService, ); + + this.gridService = services?.gridService ?? new GridService(this.extensionService, this.filterService, this._eventPubSubService, this.paginationService, this.sharedService, this.sortService); + this.gridStateService = services?.gridStateService ?? new GridStateService(this.extensionService, this.filterService, this._eventPubSubService, this.sharedService, this.sortService); + this.groupingService = services?.groupingAndColspanService ?? new GroupingAndColspanService(this.extensionUtility, this.extensionService); if (hierarchicalDataset) { diff --git a/test/cypress.json b/test/cypress.json index 2a803d89f..110f252a5 100644 --- a/test/cypress.json +++ b/test/cypress.json @@ -1,7 +1,6 @@ { "baseUrl": "http://localhost:8888", "baseExampleUrl": "http://localhost:8888/#", - "projectId": "p5zxx6", "video": false, "viewportWidth": 1000, "viewportHeight": 950, @@ -13,5 +12,5 @@ "supportFile": "test/cypress/support/index.js", "videosFolder": "test/cypress/videos", "defaultCommandTimeout": 5000, - "pageLoadTimeout": 60000 + "pageLoadTimeout": 90000 }