Skip to content

Commit f19f8c3

Browse files
- Milestone: Add Due Date to Milestone. -> [View Issue](aquality-automation/aquality-tracking#61)
- Milestone: Add possibility to Close Milestone. -> [View Issue](aquality-automation/aquality-tracking#62) - Test Runs List: Add possibility to Add milestone from Test Runs List. -> [View Issue](aquality-automation/aquality-tracking#59)
1 parent 784e8ce commit f19f8c3

22 files changed

+156
-52
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ Features:
77
- Exclude Debug results from last results column -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/70)
88
- Milestone: Add selected Suites to milestone -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/63)
99
- Milestone: Add not executed suites -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/64)
10+
- Milestone: Add Due Date to Milestone. -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/61)
11+
- Milestone: Add possibility to Close Milestone. -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/62)
12+
- Test Runs List: Add possibility to Add milestone from Test Runs List. -> [View Issue](https://github.com/aquality-automation/aquality-tracking/issues/59)
1013

1114
Bugfixes:
1215

src/app/elements/comments/comments.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</div>
1111
<div *ngFor="let comment of shownComments" class="comment-section">
1212
<div class="comment-author">
13-
<b>{{comment.author.first_name}} {{comment.author.second_name}}</b> added a comment - {{comment.created | date:'dd/MM/yy
13+
<b>{{comment.author.first_name}} {{comment.author.second_name}}</b> added a comment - {{comment.created | date:'MMM dd, yyyy
1414
hh:mm:ss'}}</div>
1515
<div class="comment-body" [showHtml]="comment.body"></div>
1616
</div>

src/app/elements/labeled-element/labeled-switch/labeled-switch.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33
<label for="identifier" [title]="label">{{label}}</label>
44
</div>
55
<div class="switch-element">
6-
<ui-switch size="small" [(ngModel)]="value" [id]="identifier"></ui-switch>
6+
<ui-switch size="small" [(ngModel)]="value" [id]="identifier" [disabled]="disabled"></ui-switch>
77
</div>
88
</div>

src/app/elements/labeled-element/labeled-switch/labeled-switch.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Component, OnInit} from '@angular/core';
1+
import { Component, OnInit, Input} from '@angular/core';
22
import { NG_VALUE_ACCESSOR } from '@angular/forms';
33
import { LabeledBaseComponent } from '../labeled-base.component';
44
let identifier = 0;
@@ -13,6 +13,7 @@ let identifier = 0;
1313
})
1414
export class LabeledSwitchComponent extends LabeledBaseComponent<boolean> implements OnInit {
1515
public identifier = `labeled-switch-${identifier++}`;
16+
@Input() disabled = false;
1617

1718
constructor() {
1819
super();

src/app/elements/lookup/baseLookup.css

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,8 @@ li.default-option {
9494
.disabled-lookup {
9595
color: black;
9696
border: none;
97-
padding: 5px;
98-
padding-bottom: 4px;
99-
padding-top: 4px;
100-
margin-bottom: 2px;
101-
margin-top: 2px;
97+
padding: 0 !important;
98+
margin: 5px 0px;
10299
}
103100

104101
.caret {

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

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -268,15 +268,15 @@
268268
<div *ngIf="!isPropertyShouldBeHidden(entity, col.property)" class="ft-cell"
269269
[title]="transformationsService.getPropertyValue(entity, col.title) || ''">
270270
<inline-editor class="full-width" [placeholder]="col?.name"
271-
*ngIf="(col.type === 'text' || col.type=='email' || col.type=='percent') && col.editable && !entity.constantRow && !transformationsService.getPropertyValue(entity, col.notEditableByProperty)"
271+
*ngIf="(col.type === 'text' || col.type=='email' || col.type=='percent') && col.editable && !entity.constantRow && !notEditableByProperty(entity, col)"
272272
[maxLength]="col.creation ? col.creation.creationLength ? col.creation.creationLength : '100' : '100'"
273273
[name]="col.property" type="text" trim="blur"
274274
[ngModel]="transformationsService.getPropertyValue(entity, col.property)"
275275
(onSave)="setPropertyValue(entity, col.property, $event)">
276276
</inline-editor>
277277

278278
<inline-editor [placeholder]="col?.name"
279-
*ngIf="(col.type === 'textarea') && col.editable && !entity.constantRow && !transformationsService.getPropertyValue(entity, col.notEditableByProperty)"
279+
*ngIf="(col.type === 'textarea') && col.editable && !entity.constantRow && !notEditableByProperty(entity, col)"
280280
[maxLength]="col.creation ? col.creation.creationLength ? col.creation.creationLength : '100' : '100'"
281281
[name]="col.property" [saveOnEnter]=false type="textarea" trim="blur"
282282
[config]="{empty:'Add...'}"
@@ -288,7 +288,7 @@
288288
[small]="true" [allowEmptyValue]="col.lookup.allowEmpty"
289289
[propertiesToShow]="col.lookup.propToShow" [array]="col.lookup.values"
290290
[model]="transformationsService.getPropertyValue(entity, col.lookup.entity)"
291-
[disabled]="!col.editable || entity.constantRow || transformationsService.getPropertyValue(entity, col.notEditableByProperty)"
291+
[disabled]="!col.editable || entity.constantRow || notEditableByProperty(entity, col)"
292292
placeholder="Not Assigned"
293293
(modelChange)="setPropertyValue(entity, col.lookup.entity, $event)">
294294
</lookup-autocomplete>
@@ -297,7 +297,7 @@
297297
[colorProperty]="'color'"
298298
[propertiesToShow]="[getLookupProperty(col.property, col.lookup.values)]"
299299
[array]="col.lookup.values"
300-
[disabled]="!col.editable || entity.constantRow || transformationsService.getPropertyValue(entity, col.notEditableByProperty)"
300+
[disabled]="!col.editable || entity.constantRow || notEditableByProperty(entity, col)"
301301
placeholder="Not Assigned" [allowEmptyValue]="col.lookup.allowEmpty"
302302
[model]="transformationsService.getPropertyValue(entity, col.lookup.entity)"
303303
(modelChange)="setPropertyValue(entity, col.lookup.entity, $event)"></lookup-colored>
@@ -316,7 +316,7 @@
316316
[ngModel]="!!transformationsService.getPropertyValue(entity, col.property)"
317317
(ngModelChange)="setPropertyValue(entity, col.property, $event)"
318318
(change)="sendUpdate(entity)"
319-
[disabled]="!col.editable || entity.constantRow || transformationsService.getPropertyValue(entity, col.notEditableByProperty)" />
319+
[disabled]="!col.editable || entity.constantRow || notEditableByProperty(entity, col)" />
320320

321321
<a *ngIf="col.type === 'link' && transformationsService.getPropertyValue(entity, col.property).link"
322322
[routerLink]="transformationsService.getPropertyValue(entity, col.property).link">{{transformationsService.getPropertyValue(entity, col.property).text}}</a>
@@ -329,39 +329,44 @@
329329
{{transformationsService.getPropertyValue(entity, col.property).text}}</div>
330330

331331
<div
332-
*ngIf="col.type === 'multiselect' && (!col.editable || entity.constantRow || transformationsService.getPropertyValue(entity, col.notEditableByProperty))">
332+
*ngIf="col.type === 'multiselect' && (!col.editable || entity.constantRow || notEditableByProperty(entity, col))">
333333
{{getMultiPropertyValueString(entity, col.property, col.lookup.propToShow)}}</div>
334334

335335
<lookup-autocomplete-multiselect class="ms-lookup-sm" [cutLongText]="true"
336-
*ngIf="col.type === 'multiselect' && (col.editable && !entity.constantRow && !transformationsService.getPropertyValue(entity, col.notEditableByProperty))"
336+
*ngIf="col.type === 'multiselect' && (col.editable && !entity.constantRow && !notEditableByProperty(entity, col))"
337337
placeholder="{{col?.name}}" [propertiesToShow]="col.lookup.propToShow"
338338
[array]="col.lookup.values"
339339
[model]="transformationsService.getPropertyValue(entity, col.property)"
340340
(modelChange)="setPropertyValue(entity, col.lookup.entity, $event)">
341341
</lookup-autocomplete-multiselect>
342342

343-
<div *ngIf="col.type === 'date' && col.format" class="nowrap">
343+
<div *ngIf="col.type === 'date' && col.format && (!col.editable || entity.constantRow || notEditableByProperty(entity, col))" class="nowrap">
344344
{{transformationsService.getPropertyValue(entity, col.property) | date:col.format}}
345345
</div>
346346

347-
<div *ngIf="col.type === 'date' && !col.format" class="nowrap">
347+
<div *ngIf="col.type === 'date' && !col.format && (!col.editable || entity.constantRow || notEditableByProperty(entity, col))" class="nowrap">
348348
{{transformationsService.getPropertyValue(entity, col.property) | date:'MM/dd/yy hh:mm:ss a'}}
349349
</div>
350+
351+
<ng-datepicker *ngIf="col.type === 'date' && col.editable && !entity.constantRow && !notEditableByProperty(entity, col)"
352+
[ngModel]="transformationsService.getPropertyValue(entity, col.property)"
353+
(ngModelChange)="setPropertyValue(entity, col.property, $event)"
354+
[options]="col.format"></ng-datepicker>
350355

351356
<div
352-
*ngIf="col.type === 'time' && (!col.editable || entity.constantRow || transformationsService.getPropertyValue(entity, col.notEditableByProperty))">
357+
*ngIf="col.type === 'time' && (!col.editable || entity.constantRow || notEditableByProperty(entity, col))">
353358
{{transformationsService.msToDurationString(transformationsService.getPropertyValue(entity, col.property))}}
354359
</div>
355360
<input
356-
*ngIf="col.type === 'time' && col.editable && !entity.constantRow && !transformationsService.getPropertyValue(entity, col.notEditableByProperty)"
361+
*ngIf="col.type === 'time' && col.editable && !entity.constantRow && !notEditableByProperty(entity, col)"
357362
class="form-control input-sm ft-duration-input" [name]="col.property + rowNum"
358363
type="text" [textMask]="{mask:durationMask}"
359364
[ngModel]="transformationsService.calculateDuration(transformationsService.getPropertyValue(entity, col.property))"
360365
(ngModelChange)="setDuration(entity, col.property, $event)"
361366
(blur)="sendUpdate(entity)" />
362367

363368
<div
364-
*ngIf="(col.type === 'text' || col.type=='email' || col.type=='percent' || col.type=='textarea') && (!col.editable || entity.constantRow || transformationsService.getPropertyValue(entity, col.notEditableByProperty)) && !col.link">
369+
*ngIf="(col.type === 'text' || col.type=='email' || col.type=='percent' || col.type=='textarea') && (!col.editable || entity.constantRow || notEditableByProperty(entity, col)) && !col.link">
365370
{{transformationsService.getPropertyValue(entity, col.property)}}</div>
366371
<attachment-inline *ngIf="col.type === 'file'" [name]="col.property + rowNum"
367372
[model]="transformationsService.getPropertyValue(entity, col.property)"

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

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -649,4 +649,16 @@ export class TableFilterComponent implements OnInit, AfterViewInit, OnDestroy, O
649649
this.rowClick.emit(entity);
650650
}
651651
}
652+
653+
notEditableByProperty(entity: any, col: TFColumn) {
654+
if (col.notEditableByProperty) {
655+
if (typeof col.notEditableByProperty.value === 'boolean') {
656+
const currentBoolValue = !!this.transformationsService.getPropertyValue(entity, col.notEditableByProperty.property);
657+
return currentBoolValue === col.notEditableByProperty.value;
658+
}
659+
const currentValue = this.transformationsService.getPropertyValue(entity, col.notEditableByProperty.property);
660+
return currentValue === col.notEditableByProperty.value;
661+
}
662+
return false;
663+
}
652664
}

src/app/elements/table/tfColumn.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export class TFColumn {
99
lookup?: TFLookup;
1010
class?: string;
1111
editable?= false;
12-
notEditableByProperty?: string;
12+
notEditableByProperty?: TFNotEditable;
1313
link?: FTLink;
1414
title?: string;
1515
listeners?: string[];
@@ -54,6 +54,11 @@ export class TFDots {
5454
propToShow: string[];
5555
}
5656

57+
export class TFNotEditable {
58+
property: string;
59+
value: any;
60+
}
61+
5762
export enum TFOrder {
5863
desc = 'desc',
5964
asc = 'asc'

src/app/pages/administration/global/users/administration.users.component.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export class AdministrationUsersComponent implements OnInit {
4040
sorting: true,
4141
type: TFColumnType.text,
4242
editable: true,
43-
notEditableByProperty: 'ldap_user',
43+
notEditableByProperty: { property: 'ldap_user', value: true },
4444
creation: {
4545
required: true
4646
}
@@ -52,7 +52,7 @@ export class AdministrationUsersComponent implements OnInit {
5252
sorting: true,
5353
type: TFColumnType.text,
5454
editable: true,
55-
notEditableByProperty: 'ldap_user',
55+
notEditableByProperty: { property: 'ldap_user', value: true },
5656
creation: {
5757
required: true
5858
}
@@ -65,7 +65,7 @@ export class AdministrationUsersComponent implements OnInit {
6565
type: TFColumnType.text,
6666
editable: true,
6767
pattern: '[first_name] [second_name]',
68-
notEditableByProperty: 'ldap_user',
68+
notEditableByProperty: { property: 'ldap_user', value: true },
6969
creation: {
7070
required: true
7171
}
@@ -77,7 +77,7 @@ export class AdministrationUsersComponent implements OnInit {
7777
sorting: true,
7878
type: TFColumnType.email,
7979
editable: true,
80-
notEditableByProperty: 'ldap_user',
80+
notEditableByProperty: { property: 'ldap_user', value: true },
8181
creation: {
8282
required: true
8383
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export class AuditComponent implements OnInit {
138138
filter: true,
139139
sorting: true,
140140
type: TFColumnType.date,
141-
format: 'dd/MM/yy',
141+
format: 'MMM dd, yyyy',
142142
class: 'fit'
143143
},
144144
{

0 commit comments

Comments
 (0)