siva kumar 9c2bcdee1a [ADF- 4871][TaskHeaderCloudComponent] Add Candidate Users/Groups properties (#5189)
* [ADF-4871] [TaskHeaderCloudComponent] Add Candidate Users/Groups properties

* Added Candidate users/groups properties to the task heade cloud component.

* * Created CardViewArrayItemComponent
* Modified FullName pipe to return username or email incase fullname missing.
* Added candidate Users/Groups properties to the taskcloudheader component.
* Added two service into task-cloudservice
* Updated Demoshell card-view with new widget

* * Fixed failing unit test

* * Fixed comments.

* * Refactored CardViewArrayItem model
* Fixed comments.

* * Changed candidate group icon
2019-10-29 09:26:34 +00:00

50 lines
2.5 KiB
HTML

<div [attr.data-automation-id]="'card-array-label-' + property.key" class="adf-property-label">{{ property.label | translate }}</div>
<div class="adf-property-value" (click)="clicked()">
<ng-container *ngIf="(property.displayValue | async) as items; else elseEmptyValueBlock">
<mat-chip-list *ngIf="items.length > 0; else elseEmptyValueBlock" data-automation-id="card-arrayitem-chip-list-container">
<ng-container *ngIf="displayCount() > 0; else withOutDisplayCount" >
<mat-chip
*ngFor="let item of items.slice(0, displayCount())"
(click)="clicked()"
[attr.data-automation-id]="'card-arrayitem-chip-' + item">
<mat-icon *ngIf="hasIcon()" class="adf-array-item-icon">{{property.icon}}</mat-icon>
<span>{{item}}</span>
</mat-chip>
<mat-chip
*ngIf="items.length > displayCount()"
data-automation-id="card-arrayitem-more-chip"
[matMenuTriggerFor]="menu">
<span>{{items.length - displayCount()}} {{'CORE.CARDVIEW.MORE' | translate}}</span>
</mat-chip>
</ng-container>
<ng-template #withOutDisplayCount>
<mat-chip
*ngFor="let item of items"
(click)="clicked()"
[attr.data-automation-id]="'card-arrayitem-chip-' + item">
<mat-icon *ngIf="hasIcon()" class="adf-array-item-icon">{{property.icon}}</mat-icon>
<span>{{item}}</span>
</mat-chip>
</ng-template>
</mat-chip-list>
<mat-menu #menu="matMenu">
<mat-card class="adf-array-item-more-chip-container">
<mat-card-content>
<mat-chip-list>
<mat-chip (click)="clicked()"
*ngFor="let item of items.slice(displayCount(), items.length)"
[attr.data-automation-id]="'card-arrayitem-chip-' + item">
<mat-icon *ngIf="hasIcon()" class="adf-array-item-icon">{{property.icon}}</mat-icon>
<span>{{item}}</span>
</mat-chip>
</mat-chip-list>
</mat-card-content>
</mat-card>
</mat-menu>
</ng-container>
<ng-template #elseEmptyValueBlock>
<span data-automation-id="card-arrayitem-default">{{ property.default | translate }}</span>
</ng-template>
</div>