sub-assets/assign-devices/assign-child-devices.component.ts
selector | c8y-assign-child-devices |
templateUrl | ./assign-child-devices.component.html |
Properties |
Methods |
Inputs |
Outputs |
HostListeners |
constructor(alert: AlertService, subAssetsService: SubAssetsService, inventoryService: InventoryService)
|
||||||||||||
Parameters :
|
currentGroupId |
Type : string
|
parentDevice |
Type : IManagedObject
|
refresh |
Type : any
|
Default value : new EventEmitter<any>()
|
onCancel |
Type : EventEmitter
|
document:keydown.enter |
Arguments : '$event'
|
document:keydown.enter(event: KeyboardEvent)
|
document:keydown.escape |
Arguments : '$event'
|
document:keydown.escape(event: KeyboardEvent)
|
Async assignDevices |
assignDevices()
|
Returns :
any
|
Async ngOnInit |
ngOnInit()
|
Returns :
any
|
onEnterKeyDown | ||||||
onEnterKeyDown(event: KeyboardEvent)
|
||||||
Decorators :
@HostListener('document:keydown.enter', ['$event'])
|
||||||
Parameters :
Returns :
void
|
onEscapeKeyDown | ||||||
onEscapeKeyDown(event: KeyboardEvent)
|
||||||
Decorators :
@HostListener('document:keydown.escape', ['$event'])
|
||||||
Parameters :
Returns :
void
|
onSelected | ||||||
onSelected(selectedDevicesIDs: string[])
|
||||||
Parameters :
Returns :
void
|
setNotIncludedInGroupQuery |
setNotIncludedInGroupQuery()
|
Returns :
void
|
baseQuery |
Type : any
|
canAssignDevice |
Type : boolean
|
Default value : false
|
pendingStatus |
Type : boolean
|
Default value : false
|
selected |
Type : string[]
|
Default value : []
|
<div class="card-block flex-no-shrink separator-bottom col-xs-12 large-padding p-t-24 p-b-24">
<div class="row">
<div class="col-md-6 col-md-offset-3 col-lg-4 col-lg-offset-4">
<h4 class="text-center text-medium">
{{ 'Assign child devices' | translate }}
</h4>
</div>
</div>
</div>
<div class="d-flex d-col no-align-items fit-h">
<c8y-sub-assets-grid
[title]="'Select child devices' | translate"
[emptyStateText]="'All child devices are already assigned to the group' | translate"
[refresh]="refresh"
[actionControls]="[]"
[selectable]="true"
[parent-group]="parentDevice"
[baseQuery]="baseQuery"
(itemsSelect)="onSelected($event)"
>
</c8y-sub-assets-grid>
</div>
<div class="text-center card-footer p-24 separator">
<button
(click)="onCancel.emit()"
type="button"
class="btn btn-default"
title="{{ 'Cancel' | translate }}"
>
<span>{{ 'Cancel' | translate }}</span>
</button>
<button
(click)="assignDevices()"
type="button"
class="btn btn-primary"
[ngClass]="{ 'btn-pending': pendingStatus }"
title="{{ 'Assign' | translate }}"
[disabled]="selected.length === 0 || !canAssignDevice"
>
<span>{{ 'Assign' | translate }}</span>
</button>
</div>