Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit f339163

Browse files
authored
Merge pull request #1320 from ghiscoding/bugfix/registered-resources-deep-copied
fix: registered external resouces should keep singleton ref
2 parents a038b80 + e82c9f4 commit f339163

18 files changed

+219
-184
lines changed

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
blank_issues_enabled: false
22
contact_links:
3-
- name: Questions & Discussions
3+
- name: Questions
4+
url: https://stackoverflow.com/search?q=slickgrid
5+
about: Use Stack Overflow to find or ask for any related SlickGrid questions
6+
- name: Discussions
47
url: https://github.com/ghiscoding/Angular-Slickgrid/discussions
58
about: Use GitHub discussions for message-board style questions and discussions.

package.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -50,13 +50,13 @@
5050
},
5151
"dependencies": {
5252
"@ngx-translate/core": "^15.0.0",
53-
"@slickgrid-universal/common": "~3.6.0",
54-
"@slickgrid-universal/custom-footer-component": "~3.6.0",
55-
"@slickgrid-universal/empty-warning-component": "~3.6.0",
56-
"@slickgrid-universal/event-pub-sub": "~3.6.0",
57-
"@slickgrid-universal/pagination-component": "~3.6.0",
58-
"@slickgrid-universal/row-detail-view-plugin": "~3.6.0",
59-
"@slickgrid-universal/rxjs-observable": "~3.6.0",
53+
"@slickgrid-universal/common": "~3.7.0",
54+
"@slickgrid-universal/custom-footer-component": "~3.7.0",
55+
"@slickgrid-universal/empty-warning-component": "~3.7.0",
56+
"@slickgrid-universal/event-pub-sub": "~3.7.0",
57+
"@slickgrid-universal/pagination-component": "~3.7.0",
58+
"@slickgrid-universal/row-detail-view-plugin": "~3.7.0",
59+
"@slickgrid-universal/rxjs-observable": "~3.7.0",
6060
"dequal": "^2.0.3",
6161
"dompurify": "^3.0.6",
6262
"rxjs": "^7.8.1",
@@ -87,12 +87,12 @@
8787
"@ngx-translate/http-loader": "^8.0.0",
8888
"@popperjs/core": "^2.11.8",
8989
"@release-it/conventional-changelog": "^8.0.1",
90-
"@slickgrid-universal/composite-editor-component": "~3.6.0",
91-
"@slickgrid-universal/custom-tooltip-plugin": "~3.6.0",
92-
"@slickgrid-universal/excel-export": "~3.6.0",
93-
"@slickgrid-universal/graphql": "~3.6.0",
94-
"@slickgrid-universal/odata": "~3.6.0",
95-
"@slickgrid-universal/text-export": "~3.6.0",
90+
"@slickgrid-universal/composite-editor-component": "~3.7.0",
91+
"@slickgrid-universal/custom-tooltip-plugin": "~3.7.0",
92+
"@slickgrid-universal/excel-export": "~3.7.0",
93+
"@slickgrid-universal/graphql": "~3.7.0",
94+
"@slickgrid-universal/odata": "~3.7.0",
95+
"@slickgrid-universal/text-export": "~3.7.0",
9696
"@types/dompurify": "^3.0.5",
9797
"@types/flatpickr": "^3.1.2",
9898
"@types/fnando__sparkline": "^0.3.7",

src/app/examples/grid-clientside.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ export class GridClientSideComponent implements OnInit {
196196
{ columnId: 'complete', direction: 'ASC' }
197197
],
198198
},
199-
registerExternalResources: [new ExcelExportService()],
199+
externalResources: [new ExcelExportService()],
200200
};
201201

202202
// mock a dataset

src/app/examples/grid-colspan.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export class GridColspanComponent implements OnInit {
6868
excelExportOptions: {
6969
exportWithFormatter: false
7070
},
71-
registerExternalResources: [new ExcelExportService()],
71+
externalResources: [new ExcelExportService()],
7272
};
7373

7474
this.dataset1 = this.getData(500);
@@ -100,7 +100,7 @@ export class GridColspanComponent implements OnInit {
100100
excelExportOptions: {
101101
exportWithFormatter: false
102102
},
103-
registerExternalResources: [new ExcelExportService()],
103+
externalResources: [new ExcelExportService()],
104104
};
105105

106106
this.dataset2 = this.getData(500);

src/app/examples/grid-composite-editor.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ export class GridCompositeEditorComponent implements OnInit {
394394
excelExportOptions: {
395395
exportWithFormatter: false
396396
},
397-
registerExternalResources: [new ExcelExportService(), this.compositeEditorInstance],
397+
externalResources: [new ExcelExportService(), this.compositeEditorInstance],
398398
enableFiltering: true,
399399
rowSelectionOptions: {
400400
// True (Single Selection), False (Multiple Selections)

src/app/examples/grid-contextmenu.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ export class GridContextMenuComponent implements OnInit, OnDestroy {
297297
columnHeaderStyle: { font: { bold: true, italic: true } }
298298
},
299299
i18n: this.translate,
300-
registerExternalResources: [new ExcelExportService()],
300+
externalResources: [new ExcelExportService()],
301301

302302
enableContextMenu: true,
303303
enableCellMenu: true,

src/app/examples/grid-custom-tooltip.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ export class GridCustomTooltipComponent implements OnInit {
323323
exportWithFormatter: true
324324
},
325325
// Custom Tooltip options can be defined in a Column or Grid Options or a mixed of both (first options found wins)
326-
registerExternalResources: [new SlickCustomTooltip(), new ExcelExportService()],
326+
externalResources: [new SlickCustomTooltip(), new ExcelExportService()],
327327
customTooltip: {
328328
formatter: this.tooltipFormatter.bind(this) as Formatter,
329329
headerFormatter: this.headerFormatter,

src/app/examples/grid-draggrouping.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ export class GridDraggableGroupingComponent implements OnInit {
244244
enableTextExport: true,
245245
enableExcelExport: true,
246246
excelExportOptions: { sanitizeDataExport: true },
247-
registerExternalResources: [this.excelExportService, this.textExportService],
247+
externalResources: [this.excelExportService, this.textExportService],
248248
};
249249

250250
this.loadData(500);

src/app/examples/grid-graphql.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ export class GridGraphqlComponent implements OnInit, OnDestroy {
276276
setTimeout(() => {
277277
this.graphqlQuery = this.angularGrid.backendService!.buildQuery();
278278
if (this.isWithCursor) {
279-
// When using cursor pagination, the pagination service needs to updated with the PageInfo data from the latest request
279+
// When using cursor pagination, the pagination service needs to be updated with the PageInfo data from the latest request
280280
// This might be done automatically if using a framework specific slickgrid library
281281
// Note because of this timeout, this may cause race conditions with rapid clicks!
282282
this.angularGrid?.paginationService?.setCursorPageInfo((mockedResult.data[GRAPHQL_QUERY_DATASET_NAME].pageInfo));

src/app/examples/grid-grouping.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ export class GridGroupingComponent implements OnInit {
165165
},
166166
excelExportOptions: { sanitizeDataExport: true },
167167
textExportOptions: { sanitizeDataExport: true },
168-
registerExternalResources: [this.excelExportService, this.textExportService],
168+
externalResources: [this.excelExportService, this.textExportService],
169169
};
170170

171171
this.loadData(500);

src/app/examples/grid-localization.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export class GridLocalizationComponent implements OnInit, OnDestroy {
202202
exportWithFormatter: true,
203203
sanitizeDataExport: true
204204
},
205-
registerExternalResources: [this.excelExportService, this.textExportService],
205+
externalResources: [this.excelExportService, this.textExportService],
206206
};
207207

208208
this.loadData(NB_ITEMS);

src/app/examples/grid-range.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ export class GridRangeComponent implements OnInit, OnDestroy {
185185
{ columnId: 'duration', direction: 'ASC' },
186186
],
187187
},
188-
registerExternalResources: [new SlickCustomTooltip(), new ExcelExportService()],
188+
externalResources: [new SlickCustomTooltip(), new ExcelExportService()],
189189
};
190190

191191
// mock a dataset

src/app/examples/grid-resize-by-content.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ export class GridResizeByContentComponent implements OnInit {
327327
excelExportOptions: {
328328
exportWithFormatter: false
329329
},
330-
registerExternalResources: [new ExcelExportService()],
330+
externalResources: [new ExcelExportService()],
331331
enableFiltering: true,
332332
enableRowSelection: true,
333333
enableCheckboxSelector: true,

src/app/examples/grid-tree-data-hierarchical.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ export class GridTreeDataHierarchicalComponent implements OnInit {
128128
exportWithFormatter: true,
129129
sanitizeDataExport: true
130130
},
131-
registerExternalResources: [new ExcelExportService()],
131+
externalResources: [new ExcelExportService()],
132132
enableFiltering: true,
133133
enableTreeData: true, // you must enable this flag for the filtering & sorting to work as expected
134134
multiColumnSort: false, // multi-column sorting is not supported with Tree Data, so you need to disable it

src/app/examples/grid-tree-data-parent-child.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export class GridTreeDataParentChildComponent implements OnInit {
108108
enableAutoResize: true,
109109
enableExcelExport: true,
110110
excelExportOptions: { exportWithFormatter: true, sanitizeDataExport: true },
111-
registerExternalResources: [new ExcelExportService()],
111+
externalResources: [new ExcelExportService()],
112112
enableFiltering: true,
113113
showCustomFooter: true, // display some metrics in the bottom custom footer
114114
enableTreeData: true, // you must enable this flag for the filtering & sorting to work as expected

src/app/modules/angular-slickgrid/components/__tests__/angular-slickgrid.component.spec.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,8 @@ describe('Angular-Slickgrid Custom Component instantiated via Constructor', () =
973973
const sortServiceSpy = jest.spyOn(sortServiceStub, 'addRxJsResource');
974974
const paginationServiceSpy = jest.spyOn(paginationServiceStub, 'addRxJsResource');
975975

976-
component.gridOptions = { registerExternalResources: [rxjsMock] } as unknown as GridOption;
976+
component.gridOptions = { externalResources: [rxjsMock] } as unknown as GridOption;
977+
component.registerExternalResources([rxjsMock], true);
977978
component.initialization(slickEventHandler);
978979

979980
expect(backendUtilitySpy).toHaveBeenCalled();
@@ -1253,7 +1254,8 @@ describe('Angular-Slickgrid Custom Component instantiated via Constructor', () =
12531254
jest.spyOn((component.gridOptions as any).backendServiceApi.service, 'buildQuery').mockReturnValue(query);
12541255
const backendExecuteSpy = jest.spyOn(backendUtilityServiceStub, 'executeBackendProcessesCallback');
12551256

1256-
component.gridOptions.registerExternalResources = [rxjsMock];
1257+
component.gridOptions.externalResources = [rxjsMock];
1258+
component.registerExternalResources([rxjsMock], true);
12571259
component.gridOptions.backendServiceApi!.service.options = { executeProcessCommandOnInit: true };
12581260
component.initialization(slickEventHandler);
12591261

@@ -1328,7 +1330,9 @@ describe('Angular-Slickgrid Custom Component instantiated via Constructor', () =
13281330
jest.spyOn(component.gridOptions.backendServiceApi!.service, 'buildQuery').mockReturnValue(query);
13291331
const backendErrorSpy = jest.spyOn(backendUtilityServiceStub, 'onBackendError');
13301332

1331-
component.gridOptions.registerExternalResources = [rxjsMock];
1333+
component.gridOptions.externalResources = [rxjsMock];
1334+
component.resetExternalResources();
1335+
component.registerExternalResources([rxjsMock], true);
13321336
component.gridOptions.backendServiceApi!.service.options = { executeProcessCommandOnInit: true };
13331337
component.initialization(slickEventHandler);
13341338

0 commit comments

Comments
 (0)