Browse Source

Add ui-help

pull/5818/head
Kalutka Zhenya 5 years ago
parent
commit
6267430dd9
  1. 1
      ui-ngx/src/app/modules/home/components/profile/alarm/alarm-dynamic-value.component.html
  2. 7
      ui-ngx/src/app/modules/home/components/profile/alarm/alarm-dynamic-value.component.ts
  3. 4
      ui-ngx/src/app/modules/home/components/profile/alarm/alarm-schedule.component.html

1
ui-ngx/src/app/modules/home/components/profile/alarm/alarm-dynamic-value.component.html

@ -48,6 +48,7 @@
<input matInput formControlName="sourceAttribute" placeholder="{{'filter.source-attribute' | translate}}">
</mat-form-field>
</div>
<div [tb-help-popup]="helpId"></div>
</div>
</div>
</ng-template>

7
ui-ngx/src/app/modules/home/components/profile/alarm/alarm-dynamic-value.component.ts

@ -14,8 +14,9 @@
/// limitations under the License.
///
import { Component, forwardRef, OnInit } from '@angular/core';
import { Component, forwardRef, Input, OnInit } from '@angular/core';
import {
AbstractControl,
ControlValueAccessor,
FormBuilder,
FormGroup,
@ -43,12 +44,14 @@ export class AlarmDynamicValue implements ControlValueAccessor, OnInit{
public dynamicValueSourceTypeTranslations = dynamicValueSourceTypeTranslationMap;
private propagateChange = (v: any) => { };
@Input() helpId: string;
constructor(private fb: FormBuilder) {
}
ngOnInit(): void {
this.dynamicValue = this.fb.group({
sourceType: [null],
sourceType: [null, []],
sourceAttribute: [null]
})

4
ui-ngx/src/app/modules/home/components/profile/alarm/alarm-schedule.component.html

@ -34,7 +34,7 @@
formControlName="timezone">
</tb-timezone-select>
<section *ngIf="alarmScheduleForm.get('type').value === alarmScheduleType.SPECIFIC_TIME">
<tb-alarm-dynamic-value formControlName = 'dynamicValue'></tb-alarm-dynamic-value>
<tb-alarm-dynamic-value formControlName = 'dynamicValue' helpId = 'device-profile/alarm_specific_schedule_format'></tb-alarm-dynamic-value>
<div class="tb-small" style="margin-bottom: 0.5em" translate>device-profile.schedule-days</div>
<div fxLayout="column" fxLayout.gt-md="row" fxLayoutGap="16px">
<div fxLayout="row" fxLayoutGap="16px">
@ -74,7 +74,7 @@
</div>
</section>
<section *ngIf="alarmScheduleForm.get('type').value === alarmScheduleType.CUSTOM">
<tb-alarm-dynamic-value formControlName = 'dynamicValue'></tb-alarm-dynamic-value>
<tb-alarm-dynamic-value formControlName = 'dynamicValue' helpId = 'device-profile/alarm_сustom_schedule_format'></tb-alarm-dynamic-value>
<div class="tb-small" style="margin-bottom: 0.5em" translate>device-profile.schedule-days</div>
<div *ngFor="let day of allDays" fxLayout="column" formArrayName="items" fxLayoutGap="1em">
<div fxLayout.xs="column" fxLayout="row" fxLayoutGap="8px" [formGroupName]="''+day" fxLayoutAlign="start center" fxLayoutAlign.xs="center start">

Loading…
Cancel
Save