File

datapoint-explorer/view/send-as-widget-to-report-modal/send-as-widget-to-report-modal.component.ts

Metadata

Index

Properties
Methods

Methods

cancel
cancel()
Returns : void
Async ngOnInit
ngOnInit()
Returns : any
save
save()
Returns : void

Properties

form
Type : ReturnType<>
labels
Type : ModalLabels
Default value : { cancel: gettext('Cancel'), ok: gettext('Send') }
numberOfSelectedReports$
Type : Observable<number>
reports
Type : IManagedObject[]
Default value : []
result
Default value : new Promise<ReturnType<typeof this.initForm>['value']>((resolve, reject) => { this._resolve = resolve; this._reject = reject; })
<c8y-modal
  [title]="'Send as widget to reports' | translate"
  [disabled]="!form || form.invalid"
  [headerClasses]="'dialog-header'"
  (onDismiss)="cancel()"
  (onClose)="save()"
  [labels]="labels"
>
  <ng-container c8y-modal-title>
    <span c8yIcon="c8y-reports"></span>
  </ng-container>

  <c8y-list-group
    class="m-b-0 no-border-last"
    *ngIf="form"
    [formGroup]="form"
  >
    <c8y-li>
      <p
        class="text-center text-medium"
        *ngIf="numberOfSelectedReports$ | async as numberOfReports; else noSelectedReports"
        translate
        [translateParams]="{ numberOfReports: numberOfReports }"
        ngNonBindable
      >
        {{ numberOfReports }} reports selected for widget
      </p>
      <ng-template #noSelectedReports>
        <p
          class="text-center text-medium"
          translate
        >
          Select one or more reports to send the Data points graph widget with the current configuration
        </p>
      </ng-template>
    </c8y-li>
    <c8y-li *ngFor="let report of reports">
      <c8y-li-checkbox
        [attr.data-cy]="'branding-apply-branding-to-app-checkbox-' + report.id"
        [formControlName]="report.id"
      ></c8y-li-checkbox>
      <c8y-li-icon class="p-l-0">
        <i c8yIcon="{{ report.icon }}"></i>
      </c8y-li-icon>
      <div class="text-truncate" title="{{report.name}}">{{ report.name }}</div>
    </c8y-li>
  </c8y-list-group>

  <c8y-ui-empty-state
    [icon]="'c8y-reports'"
    [title]="'There are no reports defined.' | translate"
    [subtitle]="'Add a report first.' | translate"
    *ngIf="reports.length === 0"
  ></c8y-ui-empty-state>
</c8y-modal>

results matching ""

    No results matching ""