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}}"> <input matInput formControlName="sourceAttribute" placeholder="{{'filter.source-attribute' | translate}}">
</mat-form-field> </mat-form-field>
</div> </div>
<div [tb-help-popup]="helpId"></div>
</div> </div>
</div> </div>
</ng-template> </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. /// limitations under the License.
/// ///
import { Component, forwardRef, OnInit } from '@angular/core'; import { Component, forwardRef, Input, OnInit } from '@angular/core';
import { import {
AbstractControl,
ControlValueAccessor, ControlValueAccessor,
FormBuilder, FormBuilder,
FormGroup, FormGroup,
@ -43,12 +44,14 @@ export class AlarmDynamicValue implements ControlValueAccessor, OnInit{
public dynamicValueSourceTypeTranslations = dynamicValueSourceTypeTranslationMap; public dynamicValueSourceTypeTranslations = dynamicValueSourceTypeTranslationMap;
private propagateChange = (v: any) => { }; private propagateChange = (v: any) => { };
@Input() helpId: string;
constructor(private fb: FormBuilder) { constructor(private fb: FormBuilder) {
} }
ngOnInit(): void { ngOnInit(): void {
this.dynamicValue = this.fb.group({ this.dynamicValue = this.fb.group({
sourceType: [null], sourceType: [null, []],
sourceAttribute: [null] sourceAttribute: [null]
}) })

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

@ -34,7 +34,7 @@
formControlName="timezone"> formControlName="timezone">
</tb-timezone-select> </tb-timezone-select>
<section *ngIf="alarmScheduleForm.get('type').value === alarmScheduleType.SPECIFIC_TIME"> <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 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="column" fxLayout.gt-md="row" fxLayoutGap="16px">
<div fxLayout="row" fxLayoutGap="16px"> <div fxLayout="row" fxLayoutGap="16px">
@ -74,7 +74,7 @@
</div> </div>
</section> </section>
<section *ngIf="alarmScheduleForm.get('type').value === alarmScheduleType.CUSTOM"> <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 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 *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"> <div fxLayout.xs="column" fxLayout="row" fxLayoutGap="8px" [formGroupName]="''+day" fxLayoutAlign="start center" fxLayoutAlign.xs="center start">

Loading…
Cancel
Save