Skip to content

Commit 0c013c4

Browse files
Merge pull request #94 from aquality-automation/feature/add_possibility_to_filter_by_inactive_milestone
Feature/add possibility to filter by inactive milestone
2 parents 4edbc07 + a404166 commit 0c013c4

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# CHANGELOG
22

3+
## 0.3.8 (unreleased)
4+
5+
Features:
6+
- Test Run List: Add posibility to filter by Inactive Milestone -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/73)
7+
38
## 0.3.7 (2020-03-02)
49

510
Features:

src/app/elements/table/table.filter.component.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
</div>
7878
<lookup class="ms-lookup-sm" [small]="true" [cutLongText]="true"
7979
[model]="textFilterData(col.property)" *ngIf="col.type === 'link' && col.filter"
80-
placeholder="{{col?.name}} Filter" [allowEmptyValue]="true" [array]="col.lookup.values"
80+
placeholder="{{col?.name}} Filter" [allowEmptyValue]="true" [array]="col.lookup.filterValues ? col.lookup.filterValues : col.lookup.values"
8181
(modelChange)="handleFilterChange(col, $event)"></lookup>
8282

8383
<lookup-colored *ngIf="col.type === 'lookup-colored' && col.filter" [cutLongText]="true"
@@ -95,7 +95,7 @@
9595

9696
<lookup-autocomplete *ngIf="col.type === 'lookup-autocomplete' && col.filter"
9797
[cutLongText]="true" [small]="true" [propertiesToShow]="col.lookup.propToShow"
98-
[array]="col.lookup.values"
98+
[array]="col.lookup.filterValues ? col.lookup.filterValues : col.lookup.values"
9999
[placeholder]="col.lookup.placeholder ? col.lookup.placeholder : 'None'"
100100
[allowEmptyValue]="true" [model]="getLookupFilterValue(col)[0]"
101101
[emptyForFilter]="col.nullFilter"
@@ -118,7 +118,7 @@
118118
</div>
119119
<lookup-autocomplete-multiselect class="ms-lookup-sm" [cutLongText]="true"
120120
*ngIf="col.type === 'multiselect' && col.filter" placeholder="{{col?.name}} Filter"
121-
[propertiesToShow]="col.lookup.propToShow" [array]="col.lookup.values"
121+
[propertiesToShow]="col.lookup.propToShow" [array]="col.lookup.filterValues ? col.lookup.filterValues : col.lookup.values"
122122
[model]="getLookupFilterValue(col)"
123123
(modelChange)="handleLookupFilterChange(col.property, $event)">
124124
</lookup-autocomplete-multiselect>

src/app/elements/table/tfColumn.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ export class TFCreation {
4242

4343
export class TFLookup {
4444
values: any[];
45+
filterValues?: any[];
4546
entity: string;
4647
objectWithId?: string;
4748
placeholder?: string;

src/app/pages/project/testrun/testrun-list/testruns.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ export class TestRunsComponent implements OnInit {
3939
testRunStatsFiltered: TestRunStat[];
4040
testRuns: TestRun[];
4141
testRun: TestRun;
42+
activeMilestones: Milestone[];
4243
milestones: Milestone[];
4344
suites: TestSuite[];
4445
tbCols: TFColumn[];
@@ -67,7 +68,8 @@ export class TestRunsComponent implements OnInit {
6768
[EGlobalPermissions.manager], [ELocalPermissions.manager, ELocalPermissions.admin]);
6869
this.canEdit = await this.permissions.hasProjectPermissions(this.testRun.project_id,
6970
[EGlobalPermissions.manager], [ELocalPermissions.manager, ELocalPermissions.admin, ELocalPermissions.engineer]);
70-
this.milestones = await this.milestoneService.getMilestone({ project_id: this.route.snapshot.params.projectId, active: 1 });
71+
this.milestones = await this.milestoneService.getMilestone({ project_id: this.route.snapshot.params.projectId});
72+
this.activeMilestones = this.milestones.filter(x => !!x.active);
7173
this.labels = await this.testrunService.getTestsRunLabels(0).toPromise();
7274
this.suites = await this.testSuiteService.getTestSuite({ project_id: this.route.snapshot.params.projectId });
7375
this.testRunStats = await this.testrunService.getTestsRunStats({ project_id: this.route.snapshot.params.projectId });
@@ -132,7 +134,8 @@ export class TestRunsComponent implements OnInit {
132134
sorting: true,
133135
type: TFColumnType.autocomplete,
134136
lookup: {
135-
values: this.milestones,
137+
values: this.activeMilestones,
138+
filterValues: this.milestones,
136139
propToShow: ['name'],
137140
entity: 'milestone',
138141
allowEmpty: true

0 commit comments

Comments
 (0)