From 38d6f664c93c567f8c7e294818ad7c362ee3fda0 Mon Sep 17 00:00:00 2001 From: renczesstefan Date: Mon, 6 Jul 2026 15:33:54 +0200 Subject: [PATCH 1/5] [NAE-2464] Release 1.0.1 Bugfixes Updated `elasticKeywords` logic to include the `Equals` operator alongside `Substring` in the identifier search. This ensures better matching capabilities for both `case-string-id` and `case-visual-id` categories. --- .../src/lib/search/models/category/case/case-string-id.ts | 2 +- .../src/lib/search/models/category/case/case-visual-id.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/netgrif-components-core/src/lib/search/models/category/case/case-string-id.ts b/projects/netgrif-components-core/src/lib/search/models/category/case/case-string-id.ts index 7b1f6ef09b..895ec157e6 100644 --- a/projects/netgrif-components-core/src/lib/search/models/category/case/case-string-id.ts +++ b/projects/netgrif-components-core/src/lib/search/models/category/case/case-string-id.ts @@ -41,7 +41,7 @@ export class CaseStringId extends NoConfigurationCategory { protected get elasticKeywords(): Array { if (!!this._optionalDependencies) { const resolver = this._optionalDependencies.searchIndexResolver; - return [resolver.getCoreIndex(CaseSearch.STRING_ID, this.isSelectedOperator(Substring))]; + return [resolver.getCoreIndex(CaseSearch.STRING_ID, this.isSelectedOperator(Substring) || this.isSelectedOperator(Equals))]; } else { return this._elasticKeywords; } diff --git a/projects/netgrif-components-core/src/lib/search/models/category/case/case-visual-id.ts b/projects/netgrif-components-core/src/lib/search/models/category/case/case-visual-id.ts index d009b9fed9..09efdca346 100644 --- a/projects/netgrif-components-core/src/lib/search/models/category/case/case-visual-id.ts +++ b/projects/netgrif-components-core/src/lib/search/models/category/case/case-visual-id.ts @@ -37,7 +37,7 @@ export class CaseVisualId extends NoConfigurationCategory { protected get elasticKeywords(): Array { if (!!this._optionalDependencies) { const resolver = this._optionalDependencies.searchIndexResolver; - return [resolver.getCoreIndex(CaseSearch.VISUAL_ID, this.isSelectedOperator(Substring))]; + return [resolver.getCoreIndex(CaseSearch.VISUAL_ID, this.isSelectedOperator(Substring) || this.isSelectedOperator(Equals))]; } else { return this._elasticKeywords; } From 09b6ec6f6b0103f67c2acbd4182373ba6e0d0438 Mon Sep 17 00:00:00 2001 From: renczesstefan Date: Tue, 4 Aug 2026 10:42:39 +0200 Subject: [PATCH 2/5] Refactor tab switching to handle concurrent updates safely Introduce a mechanism to prevent race conditions during tab switching by adding a `_switching` flag and `_pendingIndex`. This ensures seamless handling of concurrent user actions and avoids inconsistencies in the selected tab state. --- .../src/lib/tabs/classes/tab-view.ts | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/projects/netgrif-components-core/src/lib/tabs/classes/tab-view.ts b/projects/netgrif-components-core/src/lib/tabs/classes/tab-view.ts index bc2feec17e..96612fc4f3 100644 --- a/projects/netgrif-components-core/src/lib/tabs/classes/tab-view.ts +++ b/projects/netgrif-components-core/src/lib/tabs/classes/tab-view.ts @@ -33,6 +33,11 @@ export class TabView implements TabViewInterface { public selectedIndex: FormControl; private uniqueIdCounter = new IncrementingCounter(); + + private _switching = false; + + private _pendingIndex: number; + /** * @ignore * Holds a reference to an object that hides some public attributes and methods from tabs. @@ -274,17 +279,35 @@ export class TabView implements TabViewInterface { } public tabChange(event: MatTabChangeEvent) { - if (event.index !== this.selectedIndex.value) { + this._pendingIndex = event.index; + if (this._switching) { + return; // an update is already being processed; the pending value will be picked up after + } + this._processSwitch(); + } + + private _processSwitch() { + this._switching = true; + const index = this._pendingIndex!; + + if (index !== this.selectedIndex.value) { let tab = this.openedTabs[this.selectedIndex.value]; if (tab) { tab.tabSelected$.next(false); } - tab = this.openedTabs[event.index]; + tab = this.openedTabs[index]; if (tab) { tab.tabSelected$.next(true); } - this.selectedIndex.setValue(event.index); + this.selectedIndex.setValue(index); } + + setTimeout(() => { + this._switching = false; + if (this._pendingIndex !== index) { + this._processSwitch(); + } + }, 150); } /** From afd848110b85d36484141ea592d59adbf6f1b1d5 Mon Sep 17 00:00:00 2001 From: Machac Date: Tue, 4 Aug 2026 12:55:58 +0200 Subject: [PATCH 3/5] Release 7.0.2 --- package.json | 2 +- projects/netgrif-components-core/package.json | 2 +- projects/netgrif-components/package.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b758cf5060..2469bcb43b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@netgrif/components-project", - "version": "7.0.0", + "version": "7.0.2", "description": "Netgrif Application Engine Frontend project. Project includes angular libraries as base for NAE applications.", "homepage": "https://components.netgrif.com", "license": "SEE LICENSE IN LICENSE", diff --git a/projects/netgrif-components-core/package.json b/projects/netgrif-components-core/package.json index e2e241993c..3524daef04 100644 --- a/projects/netgrif-components-core/package.json +++ b/projects/netgrif-components-core/package.json @@ -1,6 +1,6 @@ { "name": "@netgrif/components-core", - "version": "7.0.0", + "version": "7.0.2", "description": "Netgrif Application engine frontend core Angular library", "homepage": "https://components.netgrif.com", "license": "SEE LICENSE IN LICENSE", diff --git a/projects/netgrif-components/package.json b/projects/netgrif-components/package.json index 9cb7c2985f..3e3c62c3f8 100644 --- a/projects/netgrif-components/package.json +++ b/projects/netgrif-components/package.json @@ -1,6 +1,6 @@ { "name": "@netgrif/components", - "version": "7.0.0", + "version": "7.0.2", "description": "Netgrif Application Engine frontend Angular components", "homepage": "https://components.netgrif.com", "license": "SEE LICENSE IN LICENSE", @@ -29,7 +29,7 @@ "nae frontend" ], "peerDependencies": { - "@netgrif/components-core": "7.0.0", + "@netgrif/components-core": "7.0.2", "@angular-material-components/datetime-picker": "~16.0.0", "@angular-material-components/moment-adapter": "~16.0.0", "@angular/animations": "~17.1.0", From 6db3f17b4053fcfb8441e297b40894f41449b6e9 Mon Sep 17 00:00:00 2001 From: renczesstefan Date: Tue, 4 Aug 2026 14:17:44 +0200 Subject: [PATCH 4/5] Refactor tab switching to use unique IDs instead of indices Replaced index-based tracking with unique ID-based tracking for tab switching logic. This ensures more reliable identification of tabs and avoids potential issues with index mismatches. Adjusted all relevant methods to accommodate the use of unique IDs. --- .../src/lib/tabs/classes/tab-view.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/projects/netgrif-components-core/src/lib/tabs/classes/tab-view.ts b/projects/netgrif-components-core/src/lib/tabs/classes/tab-view.ts index 96612fc4f3..58e255db19 100644 --- a/projects/netgrif-components-core/src/lib/tabs/classes/tab-view.ts +++ b/projects/netgrif-components-core/src/lib/tabs/classes/tab-view.ts @@ -36,7 +36,7 @@ export class TabView implements TabViewInterface { private _switching = false; - private _pendingIndex: number; + private _pendingTabUniqueId: string | undefined; /** * @ignore @@ -279,7 +279,10 @@ export class TabView implements TabViewInterface { } public tabChange(event: MatTabChangeEvent) { - this._pendingIndex = event.index; + this._pendingTabUniqueId = this.openedTabs[event.index]?.uniqueId; + if (this._pendingTabUniqueId === undefined) { + return; + } if (this._switching) { return; // an update is already being processed; the pending value will be picked up after } @@ -288,9 +291,10 @@ export class TabView implements TabViewInterface { private _processSwitch() { this._switching = true; - const index = this._pendingIndex!; + const uniqueId = this._pendingTabUniqueId; + const index = this.openedTabs.findIndex(tab => tab.uniqueId === uniqueId); - if (index !== this.selectedIndex.value) { + if (index !== -1 && index !== this.selectedIndex.value) { let tab = this.openedTabs[this.selectedIndex.value]; if (tab) { tab.tabSelected$.next(false); @@ -304,7 +308,7 @@ export class TabView implements TabViewInterface { setTimeout(() => { this._switching = false; - if (this._pendingIndex !== index) { + if (this._pendingTabUniqueId !== uniqueId) { this._processSwitch(); } }, 150); From 757d792e8bde567094a39257b7469cef2ad9f794 Mon Sep 17 00:00:00 2001 From: renczesstefan Date: Tue, 4 Aug 2026 14:25:12 +0200 Subject: [PATCH 5/5] Refactor tabChange method to improve variable clarity Replaced direct assignment to the class property with a local variable for better readability and maintainability. Ensured functionality remains unchanged while improving code clarity. --- .../netgrif-components-core/src/lib/tabs/classes/tab-view.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/projects/netgrif-components-core/src/lib/tabs/classes/tab-view.ts b/projects/netgrif-components-core/src/lib/tabs/classes/tab-view.ts index 58e255db19..a81e28193d 100644 --- a/projects/netgrif-components-core/src/lib/tabs/classes/tab-view.ts +++ b/projects/netgrif-components-core/src/lib/tabs/classes/tab-view.ts @@ -279,10 +279,11 @@ export class TabView implements TabViewInterface { } public tabChange(event: MatTabChangeEvent) { - this._pendingTabUniqueId = this.openedTabs[event.index]?.uniqueId; - if (this._pendingTabUniqueId === undefined) { + const pendingTabUniqueId = this.openedTabs[event.index]?.uniqueId; + if (pendingTabUniqueId === undefined) { return; } + this._pendingTabUniqueId = pendingTabUniqueId; if (this._switching) { return; // an update is already being processed; the pending value will be picked up after }