From 7f735dcadaf7077fad58cf6d39b808a3da2df679 Mon Sep 17 00:00:00 2001 From: Gaurav Kumar Date: Thu, 30 Oct 2025 12:29:22 +0530 Subject: [PATCH] Update editnewdash.component.ts --- .../editnewdash/editnewdash.component.ts | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.ts b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.ts index bf233a9..8235097 100644 --- a/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.ts +++ b/frontend/angular-clarity-master/src/app/modules/main/builder/dashboardnew/editnewdash/editnewdash.component.ts @@ -26,6 +26,8 @@ import { SureconnectService } from '../sureconnect/sureconnect.service'; import { CommonFilterComponent } from '../common-filter/common-filter.component'; // Add the CompactFilterComponent import import { CompactFilterComponent } from '../common-filter'; +// Add the FilterService import +import { FilterService } from '../common-filter/filter.service'; function isNullArray(arr) { return !Array.isArray(arr) || arr.length === 0; @@ -203,12 +205,15 @@ export class EditnewdashComponent implements OnInit { private _fb: FormBuilder, private datastoreService: DatastoreService, private alertService: AlertsService, - private sureconnectService: SureconnectService) { } // Add SureconnectService to constructor + private sureconnectService: SureconnectService, + private filterService: FilterService) { } // Add SureconnectService and FilterService to constructor // Add property to track if coming from dashboard runner fromRunner: boolean = false; ngOnInit(): void { + // Reset the filter service when the component is initialized + this.filterService.resetFilters(); // Grid options this.options = { @@ -327,6 +332,9 @@ export class EditnewdashComponent implements OnInit { dashboardLine: any; dashboardName: any; getData() { + // Reset the filter service when switching between dashboard records + this.filterService.resetFilters(); + // We get the id in get current router dashboard/:id this.route.params.subscribe(params => { // + is used to cast string to int @@ -1143,6 +1151,9 @@ export class EditnewdashComponent implements OnInit { // Note: We don't close the modal here, allowing the user to make additional changes // The user can click "Save" when they're done with all changes + + // Reset the filter service to ensure clean state + this.filterService.resetFilters(); } goBack() {