Skip to content

Commit 0a508f0

Browse files
Fix pages related to resolutions
1 parent d487989 commit 0a508f0

File tree

7 files changed

+51
-14
lines changed

7 files changed

+51
-14
lines changed

src/app/elements/charts/resultResolutions/resultResolutions.charts.component.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,19 @@ export class ResultResolutionsChartsComponent implements OnChanges, OnInit, OnDe
112112
for (const resultResolution of this.listOfResultResolutions) {
113113
this.doughnutChartData.push(
114114
this.shownTestResults.filter(
115-
x => x.issue.resolution.name === resultResolution.name
115+
x => resultResolution.id === 1
116+
? !x.issue
117+
: x.issue ? x.issue.resolution.id === resultResolution.id : false
116118
).length
117119
);
118120
}
119121
}
120122

121-
calculatePrecentageAndCount(resultResolution: String): String {
123+
calculatePrecentageAndCount(resultResolutionName: String): String {
122124
const num = this.shownTestResults.filter(
123-
x => x.issue.resolution.name === resultResolution
125+
x => resultResolutionName === 'Not Assigned'
126+
? !x.issue
127+
: x.issue ? x.issue.resolution.name === resultResolutionName : false
124128
).length;
125129
const percentage = (num / this.shownTestResults.length) * 100;
126130
return ` | ${percentage.toFixed(1)}% | ${num}`;

src/app/elements/lookup/autocomplete/lookupAutocomplete.component.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,15 @@
1717
<div [hidden]="hidden" class="selector-suggestions cut-long-text"
1818
*ngIf="filteredArray && filteredArray.length > 20">
1919
<ul>
20+
<li tabindex="0" [title]="placeholder" *ngIf="allowEmptyValue"
21+
class="selector-button btn-default default-option" (keyup.enter)="select(emptyValue)"
22+
(mousedown)="select(emptyValue)">{{placeholder}}</li>
23+
<li tabindex="0" title="Add" *ngIf="allowCreation && !inList() "
24+
class="selector-button btn-default default-option" (keyup.enter)="sendSearchText()"
25+
(mousedown)="sendSearchText()">Add</li>
26+
<li tabindex="0" title="Not Assigned" *ngIf="emptyForFilter"
27+
class="selector-button btn-default default-option" (keyup.enter)="select(emptyValueForFilter)"
28+
(mousedown)="select(emptyValueForFilter)">Not Assigned</li>
2029
<li tabindex="0" class="selector-button btn-default default-option wrap-text"
2130
title="To many items. Type something to search.">To many items. Type something to search.</li>
2231
</ul>

src/app/pages/project/milestone/view-milestone/view-milestone.component.ts

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import { TFColumn, TFColumnType, TFOrder } from '../../../../elements/table/tfCo
2121
import { Subscription } from 'rxjs/Subscription';
2222
import { PermissionsService, ELocalPermissions, EGlobalPermissions } from '../../../../services/current-permissions.service';
2323
import { faExclamationTriangle } from '@fortawesome/free-solid-svg-icons';
24+
import { Issue } from '../../../../shared/models/issue';
25+
import { IssueService } from '../../../../services/issue.service';
2426

2527
@Component({
2628
templateUrl: './view-milestone.component.html',
@@ -39,7 +41,8 @@ export class ViewMilestoneComponent implements OnInit, OnDestroy {
3941
private suitesService: TestSuiteService,
4042
private testRunService: TestRunService,
4143
private transformationsService: TransformationsService,
42-
private permissions: PermissionsService
44+
private permissions: PermissionsService,
45+
private issueService: IssueService
4346
) { }
4447

4548
@ViewChild(ResultResolutionsChartsComponent) resultResolutionsChart: ResultResolutionsChartsComponent;
@@ -49,6 +52,7 @@ export class ViewMilestoneComponent implements OnInit, OnDestroy {
4952
resolutions: ResultResolution[];
5053
finalResults: FinalResult[];
5154
testRuns: TestRun[];
55+
issues: Issue[];
5256
resultsToShow: TestResult[];
5357
latestResults: TestResult[];
5458
suites: TestSuite[];
@@ -91,7 +95,8 @@ export class ViewMilestoneComponent implements OnInit, OnDestroy {
9195
this.resolutions,
9296
this.finalResults,
9397
this.latestResults,
94-
this.tests
98+
this.tests,
99+
this.issues
95100
] = await this.getInitialInfo();
96101

97102
this.columns = this.getColumns();
@@ -119,7 +124,8 @@ export class ViewMilestoneComponent implements OnInit, OnDestroy {
119124
this.resultResolutionService.getResolution(this.milestone.project_id).toPromise(),
120125
this.finalResultService.getFinalResult({}),
121126
this.milestoneService.getMilestoneResults(this.milestone),
122-
this.testService.getTest({ project_id: this.milestone.project_id })
127+
this.testService.getTest({ project_id: this.milestone.project_id }),
128+
this.issueService.getIssues({ project_id: this.milestone.project_id })
123129
]);
124130
}
125131

@@ -172,10 +178,13 @@ export class ViewMilestoneComponent implements OnInit, OnDestroy {
172178
}
173179

174180
resolutionChartClick(resolution: ResultResolution) {
181+
const queryParams = resolution.id === 1
182+
? { 'f_result.issue_opt': 'null' }
183+
: { 'f_result.issue.resolution_opt': resolution.id };
184+
175185
this.router.navigate(
176186
[`/project/${this.milestone.project_id}/milestone/${this.milestone.id}`],
177-
{ queryParams: { 'f_result.test_resolution_opt': resolution.id } }
178-
);
187+
{ queryParams });
179188
}
180189

181190
async updateMilestone() {
@@ -233,7 +242,6 @@ export class ViewMilestoneComponent implements OnInit, OnDestroy {
233242
private getNotExecutedResult(): TestResult {
234243
return {
235244
final_result: this.finalResults.find(x => x.id === 3),
236-
issue: { resolution: this.resolutions.find(x => x.id === 1) },
237245
start_date: undefined
238246
};
239247
}
@@ -286,7 +294,18 @@ export class ViewMilestoneComponent implements OnInit, OnDestroy {
286294
},
287295
class: 'fit'
288296
},
289-
{ name: 'Issue', property: 'result.issue.title', filter: true, type: TFColumnType.text, class: 'ft-width-150' },
297+
{
298+
name: 'Issue',
299+
property: 'result.issue.title',
300+
filter: true,
301+
type: TFColumnType.autocomplete,
302+
lookup: {
303+
entity: 'result.issue',
304+
values: this.issues,
305+
propToShow: ['title']
306+
},
307+
class: 'ft-width-150'
308+
},
290309
{ name: 'Finished', property: 'result.finish_date', filter: true, sorting: true, type: TFColumnType.date, class: 'fit' }
291310
];
292311
}

src/app/pages/project/results/results-grid/results.grid.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ export class ResultGridComponent implements OnInit {
273273
sorting: false,
274274
type: TFColumnType.autocomplete,
275275
editable: this.canEdit,
276+
nullFilter: true,
276277
lookup: {
277278
allowCreation: true,
278279
allowEmpty: true,

src/app/pages/project/results/results-searcher/results.searcher.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ export class ResultSearcherComponent {
103103
},
104104
class: 'fit'
105105
},
106-
{ name: 'Comment', property: 'comment', filter: true, type: TFColumnType.text, class: 'ft-width-250' }
106+
{ name: 'Issue', property: 'issue.title', filter: true, type: TFColumnType.text, class: 'ft-width-250' }
107107
];
108108
if (this.failReasonSearch.length > 150) {
109109
this.failReasonSearch = this.failReasonSearch.slice(0, 150);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ export class TestRunsComponent implements OnInit {
160160
},
161161
{ name: 'Total', property: 'totalTests', sorting: true, type: TFColumnType.text, class: 'fit' },
162162
{
163-
name: 'No Resolution',
163+
name: 'No Issue',
164164
property: 'not_assigned',
165165
filter: true,
166166
sorting: true,
@@ -169,7 +169,7 @@ export class TestRunsComponent implements OnInit {
169169
link: {
170170
template: `/project/${this.route.snapshot.params.projectId}/testrun/{id}`,
171171
properties: ['id'],
172-
params: { f_test_resolution_opt: 1 }
172+
params: { f_issue_opt: 'null' }
173173
},
174174
class: 'ft-width-250'
175175
},

src/app/pages/project/testrun/testrun-view/testrun.view.component.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,13 @@ export class TestRunViewComponent implements OnInit {
168168
}
169169

170170
resolutionChartClick(resolution: ResultResolution) {
171+
const queryParams = resolution.id === 1
172+
? { 'f_issue_opt': 'null' }
173+
: { 'f_issue.resolution_opt': resolution.id };
174+
171175
this.router.navigate(
172176
[`/project/${this.projectId}/testrun/${this.testRun.id}`],
173-
{ queryParams: { f_test_resolution_opt: resolution.id } });
177+
{ queryParams });
174178
}
175179

176180
canFinish() {

0 commit comments

Comments
 (0)