sub-assets/assign-devices/assign-devices.component.ts
selector | c8y-assign-devices |
templateUrl | ./assign-devices.component.html |
Properties |
Methods |
Inputs |
Outputs |
HostListeners |
constructor(alert: AlertService, subAssetsService: SubAssetsService, inventoryService: InventoryService, gainsightService: GainsightService)
|
|||||||||||||||
Parameters :
|
currentGroupId |
Type : string
|
refresh |
Type : any
|
Default value : new EventEmitter<any>()
|
onCancel |
Type : EventEmitter
|
onShowChildDevices |
Type : EventEmitter
|
selectedDevice |
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
|
selectChildren | ||||||
selectChildren(asset: IManagedObject)
|
||||||
Parameters :
Returns :
void
|
setActionControls | ||||||
setActionControls(showChildren: boolean)
|
||||||
Parameters :
Returns :
void
|
setHeaderActionControls |
setHeaderActionControls()
|
Returns :
void
|
setNotIncludedInGroupQuery |
setNotIncludedInGroupQuery()
|
Returns :
void
|
actionControls |
Type : ActionControl[]
|
Default value : []
|
baseQuery |
Type : any
|
canAssignDevice |
Type : boolean
|
Default value : false
|
deviceQueryStringOutput |
Type : string
|
headerActionControls |
Type : HeaderActionControl[]
|
Default value : []
|
Readonly isSelectable |
Default value : true
|
pagination |
Type : Pagination
|
Default value : { pageSize: 20, currentPage: 1 }
|
pendingStatus |
Type : boolean
|
Default value : false
|
selected |
Type : string[]
|
Default value : []
|
showChildren |
Type : boolean
|
Default value : false
|
showDevicesToggle |
Type : TemplateRef<any>
|
Decorators :
@ViewChild('showDevicesToggle', {read: TemplateRef})
|
<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 devices' | translate }}
</h4>
</div>
</div>
</div>
<c8y-device-grid
[title]="'Select devices' | translate"
[actionControls]="actionControls"
[infiniteScroll]="'auto'"
[selectable]="isSelectable"
[pagination]="pagination"
(itemsSelect)="onSelected($event)"
[refresh]="refresh"
[baseQuery]="baseQuery"
[headerActionControls]="headerActionControls"
[withChildren]="true"
class="flex-grow col-xs-12 no-gutter"
>
</c8y-device-grid>
<div class="text-center card-footer p-24 separator">
<button
(click)="onCancel.emit()"
type="button"
class="btn btn-default"
title="{{ 'Cancel' | translate }}"
c8yProductExperience
[actionName]="'assignDevices:Cancel'"
>
<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"
c8yProductExperience
[actionName]="'assignDevices:Assign'"
>
<span>{{ 'Assign' | translate }}</span>
</button>
</div>
<ng-template #showDevicesToggle let-control="headerActionControl">
<label class="c8y-switch">
<input type="checkbox" [(ngModel)]="showChildren" (click)="control.callback()" />
<span></span>
<span>{{ control.text | translate }}</span>
</label>
<button
class="btn-clean m-r-8"
[popover]="childDevicesPop"
placement="bottom"
[outsideClick]="true"
>
<i c8yIcon="question-circle-o" class="text-primary"></i>
</button>
<ng-template #childDevicesPop>
<span translate>
Displays the button
<button class="btn btn-xs btn-icon btn-default no-pointer">
<i class="text-primary dlt-c8y-icon-enter-bottom"></i>
</button>
next to target devices with children. Clicking it displays a list with all child devices of
the selected target device.
</span>
</ng-template>
</ng-template>