ciyidogan commited on
Commit
cc39ae7
·
verified ·
1 Parent(s): 3b6a1f2

Update flare-ui/src/app/components/test/test.component.ts

Browse files
flare-ui/src/app/components/test/test.component.ts CHANGED
@@ -92,9 +92,7 @@ export class TestComponent implements OnInit {
92
  }
93
  ];
94
 
95
- get allSelected(): boolean {
96
- return this.categories.every(c => c.selected);
97
- }
98
 
99
  get selectedTests(): TestCase[] {
100
  return this.categories
@@ -121,6 +119,16 @@ export class TestComponent implements OnInit {
121
 
122
  ngOnInit() {
123
  this.initializeTests();
 
 
 
 
 
 
 
 
 
 
124
  }
125
 
126
  initializeTests() {
@@ -355,8 +363,8 @@ export class TestComponent implements OnInit {
355
  }
356
 
357
  toggleAll() {
358
- const newState = !this.allSelected;
359
- this.categories.forEach(c => c.selected = newState);
360
  }
361
 
362
  async runAllTests() {
 
92
  }
93
  ];
94
 
95
+ allSelected = false;
 
 
96
 
97
  get selectedTests(): TestCase[] {
98
  return this.categories
 
119
 
120
  ngOnInit() {
121
  this.initializeTests();
122
+ // Başlangıçta tüm kategoriler seçili mi kontrol et
123
+ this.updateAllSelected();
124
+ }
125
+
126
+ updateAllSelected() {
127
+ this.allSelected = this.categories.length > 0 && this.categories.every(c => c.selected);
128
+ }
129
+
130
+ onCategorySelectionChange() {
131
+ this.updateAllSelected();
132
  }
133
 
134
  initializeTests() {
 
363
  }
364
 
365
  toggleAll() {
366
+ this.allSelected = !this.allSelected;
367
+ this.categories.forEach(c => c.selected = this.allSelected);
368
  }
369
 
370
  async runAllTests() {