operations/operations-list/operations-list-item.component.ts
OnInit
ProductExperienceEventSource
providers |
{
provide: PRODUCT_EXPERIENCE_EVENT_SOURCE, useExisting: forwardRef(() => OperationsListItemComponent)
}
|
selector | c8y-operations-list-item |
templateUrl | ./operations-list-item.component.html |
Properties |
Methods |
Inputs |
constructor(bulkOperationListItemService: BulkOperationListItemService, sharedService: OperationsService, operationsListService: OperationsListService, route: ActivatedRoute, router: Router)
|
||||||||||||||||||
Parameters :
|
collapsed |
Type : boolean
|
Default value : true
|
isSmartRulesMicroserviceAvailable |
Type : boolean
|
noExpandToggle |
Type : boolean
|
Default value : false
|
operation |
Type : Partial<IOperation>
|
readOnly |
Type : boolean
|
Default value : false
|
createCustomizedBulkOperation | ||||||
createCustomizedBulkOperation($event?: Event)
|
||||||
Parameters :
Returns :
void
|
ngOnInit |
ngOnInit()
|
Returns :
void
|
Public bulkOperationListItemService |
Type : BulkOperationListItemService
|
deviceId |
Type : string | number
|
Default value : this.route.snapshot.parent?.data.contextData?.id ||
this.route.snapshot.firstChild?.data.contextData?.id
|
inventoryPermissions |
Type : string[]
|
listItem |
Type : ListItemComponent
|
Decorators :
@ViewChild('listItem', {static: true})
|
OPERATION_STATUS |
Default value : OperationStatus
|
OPERATION_STATUS_OPTIONS_MAP |
Type : OperationStatusOptionsMapShared
|
Default value : OPERATION_STATUS_OPTIONS_MAP
|
Public operationsListService |
Type : OperationsListService
|
operationTitle |
Type : string
|
productExperienceEvent |
Type : ProductExperienceEvent
|
refreshLoading |
Default value : false
|
Public sharedService |
Type : OperationsService
|
smartRuleAdminPermissions |
Type : string[]
|
<c8y-li
class="c8y-list__item--double-actions"
[ngClass]="{ 'c8y-list__item--no-expand': noExpandToggle }"
[collapsed]="collapsed"
#listItem
id="{{ operation.id }}"
>
<c8y-li-icon>
<button
class="btn-clean"
type="button"
[attr.aria-label]="OPERATION_STATUS_OPTIONS_MAP[operation.status].label | translate"
[tooltip]="OPERATION_STATUS_OPTIONS_MAP[operation.status].label | translate"
placement="right"
container="body"
[delay]="500"
>
<i
[c8yIcon]="OPERATION_STATUS_OPTIONS_MAP[operation.status].icon"
[ngClass]="OPERATION_STATUS_OPTIONS_MAP[operation.status].styleClass"
></i>
</button>
</c8y-li-icon>
<div [ngClass]="{ 'content-flex-58': !readOnly, 'content-flex-50': readOnly }">
<div class="col-5">
<span title="{{ operationTitle | translate }}" class="text-truncate">
{{ operationTitle | translate }}
</span>
</div>
<div class="col-3" *ngIf="!deviceId">
<a
title="{{ operation.deviceName }}"
[routerLink]="['/device', operation.deviceId, 'device-info']"
routerLinkActive="active"
class="text-truncate"
>
{{ operation.deviceName }}
</a>
</div>
<div class="col-3">
<small class="icon-flex text-muted">
<i c8yIcon="calendar" class="m-r-4"></i>
{{ operation.creationTime | c8yDate }}
</small>
</div>
</div>
<ng-container *ngIf="!readOnly">
<c8y-li-action
label="{{ 'Schedule as bulk operation' | translate }}"
(click)="createCustomizedBulkOperation($event)"
icon="c8y-icon c8y-icon-energy"
c8yProductExperience
inherit
></c8y-li-action>
<ng-container *c8yIfAllowed="inventoryPermissions; allowAny: true">
<ng-container *c8yIfAllowed="smartRuleAdminPermissions; allowAny: true">
<c8y-li-action
*ngIf="isSmartRulesMicroserviceAvailable"
label="{{ 'Create smart rule' | translate }}"
(click)="operationsListService.createSmartRule(operation)"
icon="sliders"
c8yProductExperience
inherit
></c8y-li-action>
</ng-container>
</ng-container>
<c8y-li-action
*ngIf="operation.status === OPERATION_STATUS.PENDING"
label="{{ 'Cancel operation' | translate }}"
(click)="$event.stopPropagation(); sharedService.cancel(operation)"
icon="times-circle"
c8yProductExperience
inherit
></c8y-li-action>
</ng-container>
<c8y-li-collapse class="m-b-16">
<c8y-operation-details-tabs
*ngIf="!listItem.collapsed"
[operation]="operation"
[bulkOperationModalDetailsService]="bulkOperationListItemService"
></c8y-operation-details-tabs>
</c8y-li-collapse>
</c8y-li>