Skip to content

Commit 80706e2

Browse files
authored
Merge pull request #168 from aquality-automation/hotfixes
Hotfixes
2 parents 7fe7d0b + e073b24 commit 80706e2

31 files changed

+190
-48
lines changed

CHANGELOG.md

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

3+
## 1.4.5
4+
- onlyWithIssues parameter is added for testrunstatistic for issues page
5+
6+
## 1.4.4 (2024-10-04)
7+
fixed issues:
8+
aquality-automation/aquality-tracking#145
9+
aquality-automation/aquality-tracking#144
10+
aquality-automation/aquality-tracking#143
11+
aquality-automation/aquality-tracking#142
12+
aquality-automation/aquality-tracking#140
13+
aquality-automation/aquality-tracking#136
14+
aquality-automation/aquality-tracking#102
15+
316
## 1.4.3 (2023-07-10)
417
- Changed the logic of the Affected Tests Amount column on the Issues List page, so it is adaptive to the filtering in the Test Runs column now
518

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.5",
44
"scripts": {
55
"ng": "ng",
66
"start": "ng serve",

src/app/elements/lookup/attachment-modal/attachment-modal.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ <h6 class="modal-sub-title col-sm-8">{{subTitle}}</h6>
2121
</div>
2222
<div class="col-sm-4 line-margin">
2323
<div class="col-sm-12 btnGroup">
24-
<button *ngFor="let attach of testResultAttachments" (click)="showAttachment(attach)"
24+
<button *ngFor="let attach of sortedTestResultAttachmentsById" (click)="showAttachment(attach)"
2525
[class.selected]="attach === selectedTestResultAttachment"
2626
class="btn btn-group-item bg-light">{{attach['name']}}</button>
2727
</div>

src/app/elements/lookup/attachment-modal/attachment-modal.component.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ export class AttachmentModalComponent implements OnChanges {
2424
selectedTestResultAttachment: TestResultAttachment;
2525
supportedPreviewTypes = ['text', 'image', 'message'];
2626
icon = faFile;
27+
private readonly maxFileSizeBytes = 10 * 1024 * 1024;
28+
private readonly base64SizeMultiplier = 4 / 3;
2729

2830
constructor(private sanitizer: DomSanitizer, private testResultService: TestResultService) {
2931
}
@@ -35,6 +37,10 @@ export class AttachmentModalComponent implements OnChanges {
3537
}
3638
}
3739

40+
get sortedTestResultAttachmentsById(): TestResultAttachment[] {
41+
return this.testResultAttachments?.sort((a, b) => a.id - b.id) || [];
42+
}
43+
3844
isSupportedPreviewFileType(): boolean {
3945
let isSupported = false;
4046
this.supportedPreviewTypes.forEach(type => {
@@ -48,7 +54,16 @@ export class AttachmentModalComponent implements OnChanges {
4854
}
4955

5056
isSupportedPreviewFileSize(): boolean {
51-
return this.testResultAttachment.attachment.toString().length / 1024 / 1024 < 5;
57+
let attachmentSize = 0;
58+
59+
if (typeof this.testResultAttachment?.attachment === 'string') {
60+
const base64Length = this.testResultAttachment.attachment.length;
61+
attachmentSize = base64Length / this.base64SizeMultiplier;
62+
} else if (this.testResultAttachment?.attachment instanceof ArrayBuffer) {
63+
attachmentSize = this.testResultAttachment.attachment.byteLength;
64+
}
65+
66+
return attachmentSize <= this.maxFileSizeBytes;
5267
}
5368

5469
getNotSupportedMessage(): string {
@@ -57,7 +72,7 @@ export class AttachmentModalComponent implements OnChanges {
5772
message = 'Preview is not available for this file type.';
5873
}
5974
if (!this.isSupportedPreviewFileSize()) {
60-
message = 'Preview is not available, the file size should be less than 5Mb.';
75+
message = 'Preview is not available, the file size should be less than 10MB.';
6176
} else { message = 'Preview is not available for the file.'; }
6277
return `${message} You can download the file.`;
6378
}

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export class TableFilterComponent implements OnInit, AfterViewInit, OnDestroy, O
6161
@Input() allowBulkUpdate = false;
6262
@Input() allowBulkDelete = false;
6363
@Input() withSelector = false;
64+
@Input() urlGenerator!: (entity: any) => string;
6465

6566
@Output() createEntity = new EventEmitter();
6667
@Output() dataChange = new EventEmitter();
@@ -727,13 +728,19 @@ export class TableFilterComponent implements OnInit, AfterViewInit, OnDestroy, O
727728
col.type !== TFColumnType.externalLink &&
728729
col.type !== TFColumnType.longtext &&
729730
col.type !== TFColumnType.autocomplete &&
731+
col.type !== TFColumnType.attachmentModals &&
730732
!col.link;
731733
const notEditable = !col.editable || this.notEditableByProperty(entity, col) || el.classList.contains('ft-cell');
732734

733735
const canClick = notInlineEditorButton || (notClickableElement && notEditable);
734736

735737
if (canClick) {
736-
this.rowClick.emit(entity);
738+
if (typeof this.urlGenerator == 'function' && ($event.ctrlKey || $event.metaKey)) {
739+
const url = this.urlGenerator(entity);
740+
window.open(`/#${url}`, '_blank');
741+
} else {
742+
this.rowClick.emit(entity);
743+
}
737744
}
738745
}
739746

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<app-modal *ngIf="tbCols && !hideModal" [title]="removeModalTitle" [message]="removeModalMessage" [type]="'warning'" [buttons]="[{name:'yes', execute:true }, {name:'no', execute:false}]"
22
(execute)="execute($event)" (closed)="wasClosed()">
33
</app-modal>
4-
<table-filter id="users-table" *ngIf="tbCols" [data]="users" [queryParams]="true" [columns]="tbCols" [hide]="hideVal" (rowClick)="rowClicked($event)" (customEvent)="resetPassword()" [allowCreate]="true" [allowDelete]="true" (dataChange)="updateUser($event)"
5-
(action)="handleAction($event)" (createEntity)="createEntityChange($event)"></table-filter>
4+
<table-filter id="users-table" *ngIf="tbCols" [data]="users" [queryParams]="true" [columns]="tbCols" [hide]="hideVal"
5+
(rowClick)="rowClicked($event)" (customEvent)="resetPassword()" [allowCreate]="true"
6+
[allowDelete]="true" (dataChange)="updateUser($event)" (action)="handleAction($event)"
7+
(createEntity)="createEntityChange($event)"></table-filter>

src/app/pages/audit/audit-list/audit.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ <h2>Audits Dashboard</h2>
2222
</div>
2323
<div *ngIf="stats && auditors && columns && services" class="col-sm-12 no-padding">
2424
<table-filter [data]="stats" [rowColors]="rowColors" [columns]="columns" [defaultSortBy]="defSort"
25-
[queryParams]="true" (rowClick)="rowClicked($event)" rowsOnPage="20"></table-filter>
25+
[queryParams]="true" [urlGenerator]="generateAuditUrl" (rowClick)="rowClicked($event)" rowsOnPage="20"></table-filter>
2626
</div>

src/app/pages/audit/audit-list/audit.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,12 @@ export class AuditComponent implements OnInit {
9898
BlobUtils.download(result.blob, filename);
9999
}
100100

101-
rowClicked($event) {
102-
this.router.navigate([`/audit/${$event.id}`]);
101+
generateAuditUrl(entity: AuditStat) {
102+
return`/audit/${entity.id}`;
103+
}
104+
105+
rowClicked($event: AuditStat) {
106+
this.router.navigate([this.generateAuditUrl($event)]);
103107
}
104108

105109
createColumns() {

src/app/pages/customer/customer-list/customer.component.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ <h2>Customers Dashboard</h2>
1313

1414
<div class="col-sm-12 no-padding">
1515
<table-filter *ngIf="customers && columns" [data]="customers" [columns]="columns" [defaultSortBy]="defSort"
16-
(action)="handleAction($event)" [allowDelete]="allowCreate" [queryParams]="true" (rowClick)="rowClicked($event)"
17-
rowsOnPage="20"></table-filter>
16+
(action)="handleAction($event)" [allowDelete]="allowCreate" [queryParams]="true" [urlGenerator]="generateCustomerUrl"
17+
(rowClick)="rowClicked($event)" rowsOnPage="20"></table-filter>
1818
</div>

src/app/pages/customer/customer-list/customer.component.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,12 @@ export class CustomerComponent implements OnInit {
6262
];
6363
}
6464

65-
rowClicked($event) {
66-
this.router.navigate([`/customer/${$event.id}`]);
65+
generateCustomerUrl(entity: Customer) {
66+
return`/customer/${entity.id}`;
67+
}
68+
69+
rowClicked($event: Customer) {
70+
this.router.navigate([this.generateCustomerUrl($event)]);
6771
}
6872

6973
handleAction($event) {

0 commit comments

Comments
 (0)