Update editnewdash.component.ts
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user