File

alarm-event-selector/alarm-event-attributes-form/alarm-event-attributes-form.component.ts

Implements

ControlValueAccessor Validator OnInit

Metadata

Index

Properties
Methods
Inputs

Constructor

constructor(formBuilder: FormBuilder, alarmEventAttributesFormService: AlarmEventAttributesFormService)
Parameters :
Name Type Optional
formBuilder FormBuilder No
alarmEventAttributesFormService AlarmEventAttributesFormService No

Inputs

datapoints
Type : KPIDetails[]
Default value : []
omitProperties
Type : OmitSelectorProperties
Default value : {}
selectedItems
Type : AlarmOrEvent[]
Default value : []
target
Type : IIdentified
timelineType
Type : TimelineType

Methods

changeDatapointSelection
changeDatapointSelection(event: Event)
Parameters :
Name Type Optional
event Event No
Returns : void
ngOnInit
ngOnInit()
Returns : void
registerOnChange
registerOnChange(fn: any)
Parameters :
Name Type Optional
fn any No
Returns : void
registerOnTouched
registerOnTouched(fn: any)
Parameters :
Name Type Optional
fn any No
Returns : void
setDisabledState
setDisabledState(isDisabled: boolean)
Parameters :
Name Type Optional
isDisabled boolean No
Returns : void
trackByFn
trackByFn(_index: number, item: KPIDetails)
Parameters :
Name Type Optional
_index number No
item KPIDetails No
Returns : string
validate
validate(_control: AbstractControl)
Parameters :
Name Type Optional
_control AbstractControl No
Returns : ValidationErrors
writeValue
writeValue(obj: any)
Parameters :
Name Type Optional
obj any No
Returns : void

Properties

formGroup
Type : FormGroup<AlarmEventAttributeForm>
<div [formGroup]="formGroup">
  <c8y-form-group
    class="form-group-sm"
    *ngIf="formGroup.controls.label"
  >
    <label class="m-0">{{ 'Label' | translate }}</label>
    <input
      class="form-control flex-grow"
      name="label"
      formControlName="label"
      [placeholder]="
        'e.g. {{ example }}'
          | translate
            : {
                example: timelineType === 'ALARM' ? 'Alarm unavailable' : 'Location update'
              }
      "
    />
  </c8y-form-group>

  <div formGroupName="filters">
    <c8y-form-group class="form-group-sm">
      <label class="m-0">{{ 'Type' | translate }}</label>
      <input
        class="form-control flex-grow"
        name="type"
        formControlName="type"
        [placeholder]="
          'e.g. {{ example }}'
            | translate
              : {
                  example:
                    timelineType === 'ALARM' ? 'c8y_UnavailabilityAlarm' : 'c8y_LocationUpdate'
                }
        "
      />
      <c8y-messages>
        <c8y-message
          name="duplicateType"
          [text]="'Type already used.' | translate"
        ></c8y-message>
      </c8y-messages>
    </c8y-form-group>
  </div>

  <c8y-form-group
    class="form-group-sm"
    *ngIf="datapoints?.length > 0"
  >
    <label>{{ 'Select data point' | translate }}</label>
    <div class="c8y-select-wrapper">
      <select
        class="form-control input-sm"
        (change)="changeDatapointSelection($event)"
      >
        <option
          title="{{ 'Widget configuration' | translate }}"
          *ngFor="let datapoint of datapoints; trackBy: trackByFn"
          [ngValue]="{
            target: datapoint.__target.id,
            fragment: datapoint.fragment,
            series: datapoint.series
          }"
          [selected]="
            datapoint.__target.id === formGroup.value.selectedDatapoint?.target &&
            datapoint.fragment === formGroup.value.selectedDatapoint?.fragment &&
            datapoint.series === formGroup.value.selectedDatapoint?.series
          "
        >
          {{ datapoint?.label }}
        </option>
      </select>
    </div>
  </c8y-form-group>
</div>

results matching ""

    No results matching ""