Fix typeFiltering parameter

This commit is contained in:
mauriziovitale84
2016-10-25 18:03:28 +01:00
parent 5059436551
commit d58b2f4837
4 changed files with 20 additions and 6 deletions

View File

@@ -16,7 +16,8 @@
</div>
<div *ngSwitchCase="'boolean'">
<br>
<checkbox-widget [field]="field"></checkbox-widget>
<checkbox-widget [field]="field" [group]="reportForm.controls.typeFilteringGroup"
[controllerName]="'typeFiltering'"></checkbox-widget>
</div>
<div *ngSwitchCase="'status'">
<br>

View File

@@ -115,6 +115,9 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges {
taskGroup: new FormGroup({
taskName: new FormControl()
}),
typeFilteringGroup: new FormGroup({
typeFiltering: new FormControl()
}),
dateIntervalGroup: new FormGroup({
dateRangeInterval: new FormControl()
}),
@@ -192,6 +195,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges {
reportParamQuery.duration = values.durationGroup.duration;
reportParamQuery.dateRangeInterval = values.dateIntervalGroup.dateRangeInterval;
reportParamQuery.slowProcessInstanceInteger = this.convertNumber(values.processInstanceGroup.slowProcessInstanceInteger);
reportParamQuery.typeFiltering = values.typeFilteringGroup.typeFiltering;
return reportParamQuery;
}

View File

@@ -1,5 +1,5 @@
<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" [attr.for]="field.id">
<input type="checkbox"
<label class="mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect" [attr.for]="field.id" [formGroup]="formGroup">
<input formControlName="{{controllerName}}" type="checkbox"
[attr.id]="field.id"
class="mdl-checkbox__input"
[checked]="field.value"

View File

@@ -15,8 +15,9 @@
* limitations under the License.
*/
import { Component } from '@angular/core';
import { Component, ElementRef, Input } from '@angular/core';
import { WidgetComponent } from './../widget.component';
import { FormGroup } from '@angular/forms';
@Component({
moduleId: module.id,
@@ -25,8 +26,16 @@ import { WidgetComponent } from './../widget.component';
})
export class CheckboxWidget extends WidgetComponent {
constructor() {
@Input()
field: any;
@Input('group')
public formGroup: FormGroup;
@Input('controllerName')
public controllerName: string;
constructor(public elementRef: ElementRef) {
super();
}
}