Update editnewdash.component.ts
This commit is contained in:
		
							parent
							
								
									bd315f42a3
								
							
						
					
					
						commit
						7f735dcada
					
				| @ -26,6 +26,8 @@ import { SureconnectService } from '../sureconnect/sureconnect.service'; | |||||||
| import { CommonFilterComponent } from '../common-filter/common-filter.component'; | import { CommonFilterComponent } from '../common-filter/common-filter.component'; | ||||||
| // Add the CompactFilterComponent import
 | // Add the CompactFilterComponent import
 | ||||||
| import { CompactFilterComponent } from '../common-filter'; | import { CompactFilterComponent } from '../common-filter'; | ||||||
|  | // Add the FilterService import
 | ||||||
|  | import { FilterService } from '../common-filter/filter.service'; | ||||||
| 
 | 
 | ||||||
| function isNullArray(arr) { | function isNullArray(arr) { | ||||||
|   return !Array.isArray(arr) || arr.length === 0; |   return !Array.isArray(arr) || arr.length === 0; | ||||||
| @ -203,12 +205,15 @@ export class EditnewdashComponent implements OnInit { | |||||||
|     private _fb: FormBuilder, |     private _fb: FormBuilder, | ||||||
|     private datastoreService: DatastoreService, |     private datastoreService: DatastoreService, | ||||||
|     private alertService: AlertsService, |     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
 |   // Add property to track if coming from dashboard runner
 | ||||||
|   fromRunner: boolean = false; |   fromRunner: boolean = false; | ||||||
|    |    | ||||||
|   ngOnInit(): void { |   ngOnInit(): void { | ||||||
|  |     // Reset the filter service when the component is initialized
 | ||||||
|  |     this.filterService.resetFilters(); | ||||||
| 
 | 
 | ||||||
|     // Grid options
 |     // Grid options
 | ||||||
|     this.options = { |     this.options = { | ||||||
| @ -327,6 +332,9 @@ export class EditnewdashComponent implements OnInit { | |||||||
|   dashboardLine: any; |   dashboardLine: any; | ||||||
|   dashboardName: any; |   dashboardName: any; | ||||||
|   getData() { |   getData() { | ||||||
|  |     // Reset the filter service when switching between dashboard records
 | ||||||
|  |     this.filterService.resetFilters(); | ||||||
|  |      | ||||||
|     // We get the id in get current router dashboard/:id
 |     // We get the id in get current router dashboard/:id
 | ||||||
|     this.route.params.subscribe(params => { |     this.route.params.subscribe(params => { | ||||||
|       // + is used to cast string to int
 |       // + 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
 |     // 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
 |     // The user can click "Save" when they're done with all changes
 | ||||||
|  |      | ||||||
|  |     // Reset the filter service to ensure clean state
 | ||||||
|  |     this.filterService.resetFilters(); | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   goBack() { |   goBack() { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user