Skip to content

Commit 60e245c

Browse files
Merge pull request #104 from aquality-automation/feature/fix_external_issue_link
Feature/fix external issue link
2 parents 497138c + 7cfe4aa commit 60e245c

File tree

9 files changed

+58
-30
lines changed

9 files changed

+58
-30
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ Features:
66

77
Bugfixes:
88
- Test run View Page performance is bad -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/99)
9+
- External Link does not work on Issues List -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/97)
910

1011
## 0.3.9 (2020-04-21)
1112

e2e/pages/issues/list.po/constants.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export const columns = {
1616
resolution: 'Resolution',
1717
status: 'Status',
1818
title: 'Title',
19-
assignee: 'Assignee'
19+
assignee: 'Assignee',
20+
externalIssue: 'External Issue'
2021
};
2122

e2e/pages/issues/list.po/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ class IssuesList extends BasePage {
5858
isIssuePresent(title: string): any {
5959
return elements.issuesTable.isRowExists(title, columns.title);
6060
}
61+
62+
openExternalIssueLink(title: string) {
63+
return elements.issuesTable.clickCellLink(columns.externalIssue, title, columns.title)
64+
}
6165
}
6266

6367
export const issuesList = new IssuesList();

e2e/specs/issues/issues.list.spec.ts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import { issueView } from '../../pages/issues/view.po';
99
import usersTestData from '../../data/users.json';
1010
import using from 'jasmine-data-provider';
1111
import resolutions from '../../data/resolutions.json';
12+
import { browser } from 'protractor';
1213

1314
const editorExamples = {
1415
localManager: usersTestData.localManager,
@@ -24,8 +25,10 @@ const notEditorExamples = {
2425
const issue: Issue = {
2526
resolution_id: 1,
2627
title: 'Issue list example',
27-
status_id: 1
28+
status_id: 1,
29+
external_url: 'https://github.com/aquality-automation/aquality-tracking',
2830
};
31+
2932
let createdIssue: Issue;
3033

3134
describe('Issues List:', () => {
@@ -101,6 +104,15 @@ describe('Issues List:', () => {
101104
.toBe(`${usersTestData.localEngineer.first_name} ${usersTestData.localEngineer.second_name}`
102105
, 'Status was not updated!');
103106
});
107+
108+
it('I can open external issue link', async () => {
109+
browser.ignoreSynchronization = true;
110+
await issuesList.openExternalIssueLink(createdIssue.title);
111+
await expect(browser.getCurrentUrl()).toBe(createdIssue.external_url, 'Should be navigated to github!');
112+
await browser.navigate().back();
113+
browser.ignoreSynchronization = false;
114+
115+
});
104116

105117
it('I can open Issue by clicking row', async () => {
106118
await issuesList.openIssue(createdIssue.title);

e2e/specs/milestone/milestoneView.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,15 +224,15 @@ describe('Milestone:', () => {
224224
await milestoneView.notification.assertIsSuccess(`The milestone '${milestones.version3.name}' was updated.`);
225225
await expect(milestoneView.isWarningPresent()).toBe(true, 'Warning should present when due date is today!');
226226
return expect(milestoneView.getWarningTitle())
227-
.toBe(`Today is the last day for the '${milestones.version3.name}' Milestone`);
227+
.toBe(`Today is the last day for the '${milestones.version3.name}' Milestone`, `Title is wrong! Current date: ${new Date()}, Due date: ${date}`);
228228
});
229229

230230
it('I can see warning when Due date is in past', async () => {
231231
const date = new Date();
232232
date.setDate(date.getDate() - 1);
233233
await milestoneView.setDueDate(date);
234234
await milestoneView.notification.assertIsSuccess(`The milestone '${milestones.version3.name}' was updated.`);
235-
await expect(milestoneView.isWarningPresent()).toBe(true, 'Warning should present when due date is in past!');
235+
await expect(milestoneView.isWarningPresent()).toBe(true, `Warning should present when due date is in past! Current date: ${new Date()}, Due date: ${date}`);
236236
return expect(milestoneView.getWarningTitle())
237237
.toBe(`Past due by 1 day`);
238238
});

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

Lines changed: 33 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,18 @@
4040
</tr>
4141
<tr class="names-header">
4242
<th *ngFor="let col of columns" [setClass]="col.class" [id]="'tf_header_' + col.property"
43-
[sorter]="getDefaultSorter(col)"
44-
(sorted)="sort($event)" class="{{col.property}}" [ngClass]="{
43+
[sorter]="getDefaultSorter(col)" (sorted)="sort($event)" class="{{col.property}}" [ngClass]="{
4544
'fit': col.type === 'checkbox' || col.property === 'action',
4645
'percent':col.type === 'percent' || col.type === 'number'
4746
}">
4847
<fa-icon class="icon up sorter" [icon]="icons.faArrowUp" style="display: none"></fa-icon>
4948
<fa-icon class="icon down sorter" [icon]="icons.faArrowDown" style="display: none"></fa-icon>
5049

51-
<div *ngIf="!col.headerlink && col.type !== 'selector'" class="pull-left">{{col?.name}}{{col?.type === 'percent' ? ', %' : ''}}</div>
50+
<div *ngIf="!col.headerlink && col.type !== 'selector'" class="pull-left">
51+
{{col?.name}}{{col?.type === 'percent' ? ', %' : ''}}</div>
5252
<a *ngIf="col.headerlink" class="pull-left" oncontextmenu="return false;"
53-
(contextmenu)="openlink(col.headerlink)" title="Right click to open">{{col?.name}}{{col?.type === 'percent' ? ', %' : ''}}</a>
53+
(contextmenu)="openlink(col.headerlink)"
54+
title="Right click to open">{{col?.name}}{{col?.type === 'percent' ? ', %' : ''}}</a>
5455
<input *ngIf="col.type === 'selector'" name="select_all" type="checkbox"
5556
[title]="selectAll ? 'Deselect All' : 'Select All'" [ngModel]="selectAll"
5657
(ngModelChange)="toggleSelectAll($event)" />
@@ -77,12 +78,12 @@
7778
</div>
7879
<lookup class="ms-lookup-sm" [small]="true" [cutLongText]="true"
7980
[model]="textFilterData(col.property)" *ngIf="col.type === 'link' && col.filter"
80-
placeholder="{{col?.name}} Filter" [allowEmptyValue]="true" [array]="col.lookup.filterValues ? col.lookup.filterValues : col.lookup.values"
81+
placeholder="{{col?.name}} Filter" [allowEmptyValue]="true"
82+
[array]="col.lookup.filterValues ? col.lookup.filterValues : col.lookup.values"
8183
(modelChange)="handleFilterChange(col, $event)"></lookup>
8284

8385
<lookup-colored *ngIf="col.type === 'lookup-colored' && col.filter" [cutLongText]="true"
84-
[small]="true" [colorProperty]="'color'"
85-
[propertiesToShow]="col.lookup.propToShow"
86+
[small]="true" [colorProperty]="'color'" [propertiesToShow]="col.lookup.propToShow"
8687
[array]="col.lookup.values"
8788
[placeholder]="col.lookup.placeholder ? col.lookup.placeholder : 'None'"
8889
[allowEmptyValue]="true" [model]="getLookupFilterValue(col)[0]"
@@ -107,18 +108,21 @@
107108
<input placeholder="from" class="inline form-control input-sm ft-range-selector"
108109
(keyup)="rangeKeyUp($event, col)"
109110
(ngModelChange)="handleRangeFilterChange(col, $event, 'from')"
110-
[ngModel]="rangeFilterData(col.property, 'from')" type="number" min="0" [max]="col.type === 'percent' ? 100 : undefined"
111+
[ngModel]="rangeFilterData(col.property, 'from')" type="number" min="0"
112+
[max]="col.type === 'percent' ? 100 : undefined"
111113
oninput="this.value = this.value.replace(/[^0-9]/g, '');">
112114
<input placeholder="to" class="inline form-control input-sm ft-range-selector"
113115
(ngModelChange)="handleRangeFilterChange(col, $event, 'to')"
114-
[ngModel]="rangeFilterData(col.property, 'to')" type="number" min="0" [max]="col.type === 'percent' ? 100 : undefined"
115-
(keyup)="rangeKeyUp($event, col)" oninput="this.value = this.value.replace(/[^0-9]/g, '');">
116+
[ngModel]="rangeFilterData(col.property, 'to')" type="number" min="0"
117+
[max]="col.type === 'percent' ? 100 : undefined" (keyup)="rangeKeyUp($event, col)"
118+
oninput="this.value = this.value.replace(/[^0-9]/g, '');">
116119
<fa-icon class="icon" [icon]="icons.faTimes" (click)="removeRangeFilter(col.property)">
117120
</fa-icon>
118121
</div>
119122
<lookup-autocomplete-multiselect class="ms-lookup-sm" [cutLongText]="true"
120123
*ngIf="col.type === 'multiselect' && col.filter" placeholder="{{col?.name}} Filter"
121-
[propertiesToShow]="col.lookup.propToShow" [array]="col.lookup.filterValues ? col.lookup.filterValues : col.lookup.values"
124+
[propertiesToShow]="col.lookup.propToShow"
125+
[array]="col.lookup.filterValues ? col.lookup.filterValues : col.lookup.values"
122126
[model]="getLookupFilterValue(col)"
123127
(modelChange)="handleLookupFilterChange(col.property, $event)">
124128
</lookup-autocomplete-multiselect>
@@ -176,8 +180,8 @@
176180

177181
<lookup-colored *ngIf="col.creation && col.type === 'lookup-colored'" [cutLongText]="true"
178182
[small]="true" placeholder="col?.name" [allowEmptyValue]="!col.creation.required"
179-
[propertiesToShow]="col.lookup.propToShow"
180-
[array]="col.lookup.values" [model]="getFilterLookupModel(col.property)"
183+
[propertiesToShow]="col.lookup.propToShow" [array]="col.lookup.values"
184+
[model]="getFilterLookupModel(col.property)"
181185
(modelChange)="setNewValueFromLookup(col.property, $event)" [colorProperty]="'color'">
182186
</lookup-colored>
183187

@@ -227,8 +231,7 @@
227231
</lookup-autocomplete>
228232

229233
<lookup-colored *ngIf="col.type === 'lookup-colored'" [cutLongText]="true" [small]="true"
230-
[colorProperty]="'color'"
231-
[propertiesToShow]="col.lookup.propToShow"
234+
[colorProperty]="'color'" [propertiesToShow]="col.lookup.propToShow"
232235
[array]="col.lookup.values" placeholder="Not Assigned"
233236
[allowEmptyValue]="col.lookup.allowEmpty"
234237
[model]="transformationsService.getPropertyValue(bulkChangeEntity, col.property)"
@@ -286,8 +289,8 @@
286289

287290
<lookup-autocomplete *ngIf="col.type === 'lookup-autocomplete'" [cutLongText]="true"
288291
[small]="true" [allowEmptyValue]="col.lookup.allowEmpty"
289-
[allowCreation]="col.lookup.allowCreation"
290-
[propertiesToShow]="col.lookup.propToShow" [array]="col.lookup.values"
292+
[allowCreation]="col.lookup.allowCreation" [propertiesToShow]="col.lookup.propToShow"
293+
[array]="col.lookup.values"
291294
[model]="transformationsService.getPropertyValue(entity, col.property)"
292295
[disabled]="!col.editable || entity.constantRow || notEditableByProperty(entity, col)"
293296
placeholder="Not Assigned" [addAction]="col.lookup.addAction"
@@ -297,8 +300,7 @@
297300
</lookup-autocomplete>
298301

299302
<lookup-colored *ngIf="col.type === 'lookup-colored'" [cutLongText]="true" [small]="true"
300-
[colorProperty]="'color'"
301-
[propertiesToShow]="col.lookup.propToShow"
303+
[colorProperty]="'color'" [propertiesToShow]="col.lookup.propToShow"
302304
[array]="col.lookup.values"
303305
[disabled]="!col.editable || entity.constantRow || notEditableByProperty(entity, col)"
304306
placeholder="Not Assigned" [allowEmptyValue]="col.lookup.allowEmpty"
@@ -327,6 +329,9 @@
327329
<a *ngIf="!col.editable && col.link" [routerLink]="createRouterLink(col, entity)"
328330
[queryParams]="col?.link.params">{{transformationsService.getPropertyValue(entity, col.property)}}</a>
329331

332+
<a *ngIf="col.type === 'externalLink' && transformationsService.getPropertyValue(entity, col.property).link"
333+
[href]="transformationsService.getPropertyValue(entity, col.property).link">{{transformationsService.getPropertyValue(entity, col.property).text}}</a>
334+
330335
<div
331336
*ngIf="col.type === 'link' && !transformationsService.getPropertyValue(entity, col.property).link">
332337
{{transformationsService.getPropertyValue(entity, col.property).text}}</div>
@@ -343,18 +348,21 @@
343348
(modelChange)="setPropertyValue(entity, col.property, $event)">
344349
</lookup-autocomplete-multiselect>
345350

346-
<div *ngIf="col.type === 'date' && col.format && (!col.editable || entity.constantRow || notEditableByProperty(entity, col))" class="nowrap">
351+
<div *ngIf="col.type === 'date' && col.format && (!col.editable || entity.constantRow || notEditableByProperty(entity, col))"
352+
class="nowrap">
347353
{{transformationsService.getPropertyValue(entity, col.property) | date:col.format}}
348354
</div>
349355

350-
<div *ngIf="col.type === 'date' && !col.format && (!col.editable || entity.constantRow || notEditableByProperty(entity, col))" class="nowrap">
356+
<div *ngIf="col.type === 'date' && !col.format && (!col.editable || entity.constantRow || notEditableByProperty(entity, col))"
357+
class="nowrap">
351358
{{transformationsService.getPropertyValue(entity, col.property) | date:'MM/dd/yy hh:mm:ss a'}}
352359
</div>
353-
354-
<ng-datepicker *ngIf="col.type === 'date' && col.editable && !entity.constantRow && !notEditableByProperty(entity, col)"
360+
361+
<ng-datepicker
362+
*ngIf="col.type === 'date' && col.editable && !entity.constantRow && !notEditableByProperty(entity, col)"
355363
[ngModel]="transformationsService.getPropertyValue(entity, col.property)"
356-
(ngModelChange)="setPropertyValue(entity, col.property, $event)"
357-
[options]="col.format"></ng-datepicker>
364+
(ngModelChange)="setPropertyValue(entity, col.property, $event)" [options]="col.format">
365+
</ng-datepicker>
358366

359367
<div
360368
*ngIf="col.type === 'time' && (!col.editable || entity.constantRow || notEditableByProperty(entity, col))">

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ export class TableFilterComponent implements OnInit, AfterViewInit, OnDestroy, O
662662
const el: HTMLElement = $event.target;
663663
const canClick = (!col.editable || this.notEditableByProperty(entity, col) || el.classList.contains('ft-cell'))
664664
&& col.type !== TFColumnType.link
665+
&& col.type !== TFColumnType.externalLink
665666
&& col.type !== TFColumnType.longtext
666667
&& col.type !== TFColumnType.autocomplete
667668
&& !col.link;

src/app/elements/table/tfColumn.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ export enum TFColumnType {
8484
selector = 'selector',
8585
date = 'date',
8686
link = 'link',
87+
externalLink = 'externalLink',
8788
file = 'file',
8889
dots = 'dots'
8990
}

src/app/pages/project/issue/issue-list/issue-list.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ export class IssueListComponent implements OnInit {
164164
}, {
165165
name: 'External Issue',
166166
property: 'external_link',
167-
type: TFColumnType.link,
167+
type: TFColumnType.externalLink,
168168
class: 'ft-width-250'
169169
},
170170
];

0 commit comments

Comments
 (0)