Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: externalResouces should also work globally #1330

Merged
merged 3 commits into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
push:
branches:
- master
- version6
- next
pull_request:
branches:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,17 +345,18 @@ export class AngularSlickgridComponent implements AfterViewInit, OnDestroy {

// save resource refs to register before the grid options are merged and possibly deep copied
// since a deep copy of grid options would lose original resource refs but we want to keep them as singleton
this._registeredResources = this.gridOptions?.externalResources || this.gridOptions?.registerExternalResources || [];
const extendedGridOptions = { ...GlobalGridOptions, ...this.forRootConfig, ...this.gridOptions } as GridOption;
this._registeredResources = extendedGridOptions?.externalResources || extendedGridOptions?.registerExternalResources || [];
/* istanbul ignore if */
if (this.gridOptions?.registerExternalResources) {
if (extendedGridOptions?.registerExternalResources) {
console.warn('[Angular-Slickgrid] Please note that the grid option `registerExternalResources` was deprecated and will be removed in next major, please use `externalResources` instead.');
}

this.initialization(this._eventHandler);
this._isGridInitialized = true;

// recheck the empty warning message after grid is shown so that it works in every use case
if (this.gridOptions && this.gridOptions.enableEmptyDataWarningMessage && Array.isArray(this.dataset)) {
if (this.gridOptions?.enableEmptyDataWarningMessage && Array.isArray(this.dataset)) {
const finalTotalCount = this.dataset.length;
this.displayEmptyDataWarning(finalTotalCount < 1);
}
Expand Down