Skip to content

Commit 63dc434

Browse files
Added attach button to test result
1 parent 09f1e66 commit 63dc434

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "aquality-tracking-ui",
3-
"version": "1.4.3",
3+
"version": "1.4.4",
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",

src/app/pages/project/results/results-view/testresult-view.component.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,17 @@ <h2 class="col-sm-10" id="test-result-view">Test Result: {{currentState?.id}}</h
3434
<input (change)="changeDebugState($event.srcElement)" id="debug" type="checkbox" name="debug"
3535
[(ngModel)]="currentState.debug" [disabled]="!canEdit">
3636
</div>
37-
</div>
37+
<div *ngIf="currentState.attachments?.length > 0" class="col-sm-2">
38+
<label for="attach">Attach:</label>
39+
<button id="attach" class="btn btn-sm btn-outline-dark"
40+
(click)="openAttachModal(currentState.test.name, currentState.attachments)">
41+
<fa-icon class="icon" [icon]="icons.faFile"></fa-icon>
42+
</button>
43+
</div>
44+
</div>
45+
<attachment-modal [(isHidden)]="hideAttachModal" (attachModalClosed)="attachModalClosed()"
46+
[testResultAttachments]="testResultAttachments" [title]="attachModalTitle">
47+
</attachment-modal>
3848

3949
<div id="tr-result-line" class="row line">
4050
<div class="col-sm-3 margin-y-sm">

src/app/pages/project/results/results-view/testresult-view.component.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Component, OnInit } from '@angular/core';
2-
import { TestResult } from '../../../../shared/models/test-result';
2+
import { faFile } from '@fortawesome/free-solid-svg-icons';
3+
import { TestResult, TestResultAttachment } from '../../../../shared/models/test-result';
34
import { FinalResult } from '../../../../shared/models/final-result';
45
import { ActivatedRoute } from '@angular/router';
56
import { NotificationsService } from 'angular2-notifications';
@@ -38,6 +39,12 @@ export class TestResultViewComponent implements OnInit {
3839
canEdit: boolean;
3940
public types: StepType[];
4041
public tbCols: TFColumn[];
42+
testResultAttachments: TestResultAttachment[];
43+
attachModalTitle: string;
44+
hideAttachModal = true;
45+
icons = {
46+
faFile
47+
};
4148

4249
constructor(
4350
private route: ActivatedRoute,
@@ -159,6 +166,18 @@ export class TestResultViewComponent implements OnInit {
159166
return Promise.all(updates);
160167
}
161168

169+
attachModalClosed() {
170+
this.attachModalTitle = null;
171+
this.testResultAttachments = null;
172+
this.hideAttachModal = true;
173+
}
174+
175+
openAttachModal(testname: string, testResultAttachments: TestResultAttachment[]) {
176+
this.attachModalTitle = testname;
177+
this.testResultAttachments = testResultAttachments;
178+
this.hideAttachModal = false;
179+
}
180+
162181
private fillStepResults(steps: StepResult[]): StepResult[] {
163182
steps.forEach(step => step = this.fillStepResult(step));
164183
return steps;

0 commit comments

Comments
 (0)