Skip to content

Commit

Permalink
fix: registered external resouces should keep singleton ref (#1118)
Browse files Browse the repository at this point in the history
* fix: registered external resouces should keep singleton ref
  • Loading branch information
ghiscoding authored Dec 8, 2023
1 parent a38876a commit fc3bdd6
Show file tree
Hide file tree
Showing 18 changed files with 215 additions and 179 deletions.
26 changes: 13 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@
"new-release": "npm run release, note that yarn is not supported with release-it and will throw an error"
},
"dependencies": {
"@slickgrid-universal/common": "~3.6.0",
"@slickgrid-universal/custom-footer-component": "~3.6.0",
"@slickgrid-universal/empty-warning-component": "~3.6.0",
"@slickgrid-universal/event-pub-sub": "~3.6.0",
"@slickgrid-universal/pagination-component": "~3.6.0",
"@slickgrid-universal/row-detail-view-plugin": "~3.6.0",
"@slickgrid-universal/common": "~3.7.0",
"@slickgrid-universal/custom-footer-component": "~3.7.0",
"@slickgrid-universal/empty-warning-component": "~3.7.0",
"@slickgrid-universal/event-pub-sub": "~3.7.0",
"@slickgrid-universal/pagination-component": "~3.7.0",
"@slickgrid-universal/row-detail-view-plugin": "~3.7.0",
"aurelia-event-aggregator": "^1.0.3",
"aurelia-framework": "^1.4.1",
"aurelia-i18n": "^4.0.4",
Expand All @@ -97,13 +97,13 @@
"@fnando/sparkline": "^0.3.10",
"@popperjs/core": "^2.11.8",
"@release-it/conventional-changelog": "^8.0.1",
"@slickgrid-universal/composite-editor-component": "~3.6.0",
"@slickgrid-universal/custom-tooltip-plugin": "~3.6.0",
"@slickgrid-universal/excel-export": "~3.6.0",
"@slickgrid-universal/graphql": "~3.6.0",
"@slickgrid-universal/odata": "~3.6.0",
"@slickgrid-universal/rxjs-observable": "~3.6.0",
"@slickgrid-universal/text-export": "~3.6.0",
"@slickgrid-universal/composite-editor-component": "~3.7.0",
"@slickgrid-universal/custom-tooltip-plugin": "~3.7.0",
"@slickgrid-universal/excel-export": "~3.7.0",
"@slickgrid-universal/graphql": "~3.7.0",
"@slickgrid-universal/odata": "~3.7.0",
"@slickgrid-universal/rxjs-observable": "~3.7.0",
"@slickgrid-universal/text-export": "~3.7.0",
"@types/bluebird": "^3.5.42",
"@types/dompurify": "^3.0.5",
"@types/fnando__sparkline": "^0.3.7",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,8 @@ describe('Aurelia-Slickgrid Component instantiated via Constructor', () => {
const mockColDefs = [{ id: 'gender', field: 'gender', editor: { model: Editors.text, collectionAsync: of(mockCollection) } }] as Column[];

const rxjsMock = new RxJsResourceStub();
customElement.gridOptions = { registerExternalResources: [rxjsMock] } as unknown as GridOption;
customElement.gridOptions = { externalResources: [rxjsMock] } as unknown as GridOption;
customElement.registerExternalResources([rxjsMock], true);
customElement.columnDefinitions = mockColDefs;
customElement.columnDefinitionsChanged();
customElement.initialization(slickEventHandler);
Expand Down Expand Up @@ -1022,7 +1023,8 @@ describe('Aurelia-Slickgrid Component instantiated via Constructor', () => {
const sortServiceSpy = jest.spyOn(sortServiceStub, 'addRxJsResource');
const paginationServiceSpy = jest.spyOn(paginationServiceStub, 'addRxJsResource');

customElement.gridOptions = { registerExternalResources: [rxjsMock] } as unknown as GridOption;
customElement.gridOptions = { externalResources: [rxjsMock] } as unknown as GridOption;
customElement.registerExternalResources([rxjsMock], true);
customElement.initialization(slickEventHandler);

expect(backendUtilitySpy).toHaveBeenCalled();
Expand Down Expand Up @@ -1304,7 +1306,8 @@ describe('Aurelia-Slickgrid Component instantiated via Constructor', () => {
jest.spyOn((customElement.gridOptions as any).backendServiceApi.service, 'buildQuery').mockReturnValue(query);
const backendExecuteSpy = jest.spyOn(backendUtilityServiceStub, 'executeBackendProcessesCallback');

customElement.gridOptions.registerExternalResources = [rxjsMock];
customElement.gridOptions.externalResources = [rxjsMock];
customElement.registerExternalResources([rxjsMock], true);
customElement.gridOptions.backendServiceApi!.service.options = { executeProcessCommandOnInit: true };
customElement.initialization(slickEventHandler);

Expand Down Expand Up @@ -1394,7 +1397,9 @@ describe('Aurelia-Slickgrid Component instantiated via Constructor', () => {
jest.spyOn(customElement.gridOptions.backendServiceApi!.service, 'buildQuery').mockReturnValue(query);
const backendErrorSpy = jest.spyOn(backendUtilityServiceStub, 'onBackendError');

customElement.gridOptions.registerExternalResources = [rxjsMock];
customElement.gridOptions.externalResources = [rxjsMock];
customElement.resetExternalResources();
customElement.registerExternalResources([rxjsMock], true);
customElement.gridOptions.backendServiceApi!.service.options = { executeProcessCommandOnInit: true };
customElement.initialization(slickEventHandler);

Expand Down
Loading

0 comments on commit fc3bdd6

Please sign in to comment.