Fixed license checkbox style

This commit is contained in:
Giuseppe Digilio
2018-12-20 12:02:54 +01:00
parent 459e41fed0
commit 8e40cfd139
3 changed files with 20 additions and 2 deletions

View File

@@ -3,5 +3,6 @@
<ds-form *ngIf="formModel" #formRef="formComponent"
[formId]="formId"
[formModel]="formModel"
[formLayout]="formLayout"
[displaySubmit]="displaySubmit"
(dfChange)="onChange($event)"></ds-form>

View File

@@ -2,7 +2,12 @@ import { ChangeDetectorRef, Component, Inject, ViewChild } from '@angular/core';
import { Observable, Subscription } from 'rxjs';
import { distinctUntilChanged, filter, flatMap, map, take } from 'rxjs/operators';
import { DynamicCheckboxModel, DynamicFormControlEvent, DynamicFormControlModel } from '@ng-dynamic-forms/core';
import {
DynamicCheckboxModel,
DynamicFormControlEvent,
DynamicFormControlModel,
DynamicFormLayout
} from '@ng-dynamic-forms/core';
import { SectionModelComponent } from '../models/section.model';
import { JsonPatchOperationsBuilder } from '../../../core/json-patch/builder/json-patch-operations-builder';
@@ -11,7 +16,7 @@ import { hasValue, isNotEmpty, isNotNull, isNotUndefined } from '../../../shared
import { License } from '../../../core/shared/license.model';
import { RemoteData } from '../../../core/data/remote-data';
import { Collection } from '../../../core/shared/collection.model';
import { SECTION_LICENSE_FORM_MODEL } from './section-license.model';
import { SECTION_LICENSE_FORM_LAYOUT, SECTION_LICENSE_FORM_MODEL } from './section-license.model';
import { FormBuilderService } from '../../../shared/form/builder/form-builder.service';
import { FormService } from '../../../shared/form/form.service';
import { JsonPatchOperationPathCombiner } from '../../../core/json-patch/builder/json-patch-operation-path-combiner';
@@ -34,6 +39,7 @@ export class LicenseSectionComponent extends SectionModelComponent {
public formId;
public formModel: DynamicFormControlModel[];
public formLayout: DynamicFormLayout = SECTION_LICENSE_FORM_LAYOUT;
public displaySubmit = false;
public licenseText: string;

View File

@@ -1,4 +1,15 @@
export const SECTION_LICENSE_FORM_LAYOUT = {
granted: {
element: {
container: 'custom-control custom-checkbox pl-1',
control: 'custom-control-input',
label: 'custom-control-label pt-1'
}
}
};
export const SECTION_LICENSE_FORM_MODEL = [
{
id: 'granted',