File

repository/software/device-tab/device-software-changes.component.ts

Implements

OnChanges

Metadata

Index

Properties
Methods
Inputs
Outputs
Accessors

Inputs

changes
Type : DeviceSoftwareChange[]
changesInProgress
Type : boolean

Outputs

apply
Type : EventEmitter<void>
clear
Type : EventEmitter<void>
drop
Type : EventEmitter<DeviceSoftwareChange>
hideSoftwareChanges
Type : EventEmitter

Methods

ngOnChanges
ngOnChanges(changes: SimpleChanges)
Parameters :
Name Type Optional
changes SimpleChanges No
Returns : void

Properties

changes$
Default value : new BehaviorSubject<DeviceSoftwareChange[]>([])
installations$
Default value : this.changes$.pipe( map(changes => { return changes.filter(change => change.action === 'install'); }) )
removals$
Default value : this.changes$.pipe( map(changes => { return changes.filter(change => change.action === 'delete'); }) )

Accessors

applyButtonLabel
getapplyButtonLabel()
<div class="inner-scroll d-flex d-col">
  <div class="card-header separator sticky-top visible-sm visible-xs">
    <button
      class="btn btn-clean text-primary"
      [title]="'Back' | translate"
      (click)="hideSoftwareChanges.emit()"
    >
      <i c8yIcon="chevron-left"></i><span translate>Back</span>
    </button>
  </div>
  <div class="card-header separator large-padding sticky-top">
    <h4 class="card-title" translate>Software changes</h4>
  </div>
  <div id="software-changes-list" class="flex-grow inner-scroll">
    <div class="card-block large-padding" *ngIf="(changes$ | async).length === 0; else changesList">
      <div class="c8y-empty-state text-center">
        <h1 class="c8y-icon c8y-icon-device-control c8y-icon-duocolor"></h1>
        <p>
          <strong translate>No software changes.</strong> <br />
          <small translate>Selected actions will be displayed here.</small>
        </p>
      </div>
    </div>

    <ng-template #changesList>
      <fieldset
        class="card-block p-t-0 p-b-0"
        *ngIf="(installations$ | async).length > 0"
        [disabled]="changesInProgress"
      >
        <div class="form-block legend" translate>Installations`software`</div>
        <c8y-device-software-list
          [softwareList]="installations$ | async"
          (remove)="drop.emit($event)"
        ></c8y-device-software-list>
      </fieldset>

      <fieldset
        class="card-block p-t-0 p-b-0"
        *ngIf="(removals$ | async).length > 0"
        [disabled]="changesInProgress"
      >
        <div class="form-block legend" translate>Removals`software`</div>
        <c8y-device-software-list
          [softwareList]="removals$ | async"
          (remove)="drop.emit($event)"
        ></c8y-device-software-list>
      </fieldset>
    </ng-template>
  </div>
  <div
    class="card-footer separator large-padding sticky-bottom"
    *ngIf="(changes$ | async).length > 0"
  >
    <button
      class="btn btn-default"
      (click)="clear.emit()"
      title="{{ 'Clear changes' | translate }}"
      [disabled]="changesInProgress"
      translate
    >
      Clear`changes`
    </button>
    <button
      class="btn btn-primary"
      [ngClass]="{ 'btn-pending': changesInProgress }"
      [disabled]="changesInProgress"
      (click)="apply.emit(); hideSoftwareChanges.emit()"
      title="{{ applyButtonLabel | translate }}"
    >
      {{ applyButtonLabel | translate }}
    </button>
  </div>
</div>

results matching ""

    No results matching ""