mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
Dynamic-table widget placeholder
- project structure for dynamic-table widget - support for multiple root element types (container, dynamic table, etc) - code improvements and updates
This commit is contained in:
parent
3fb0da0e0b
commit
cf9053ab46
@ -14,7 +14,19 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="!form.hasTabs() && form.hasFields()">
|
<div *ngIf="!form.hasTabs() && form.hasFields()">
|
||||||
<container-widget *ngFor="let field of form.fields" [content]="field" (formValueChanged)="checkVisibility($event);"></container-widget>
|
<div *ngFor="let field of form.fields">
|
||||||
|
<div [ngSwitch]="field.type">
|
||||||
|
<div *ngSwitchCase="'container'">
|
||||||
|
<container-widget [content]="field" (formValueChanged)="checkVisibility($event);"></container-widget>
|
||||||
|
</div>
|
||||||
|
<div *ngSwitchCase="'dynamic-table'">
|
||||||
|
<dynamic-table-widget [field]="field"></dynamic-table-widget>
|
||||||
|
</div>
|
||||||
|
<div *ngSwitchDefault>
|
||||||
|
<span>UNKNOWN WIDGET TYPE: {{field.type}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="form.hasOutcomes()" class="mdl-card__actions mdl-card--border">
|
<div *ngIf="form.hasOutcomes()" class="mdl-card__actions mdl-card--border">
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
import { Observable } from 'rxjs/Rx';
|
import { Observable } from 'rxjs/Rx';
|
||||||
import { SimpleChange } from '@angular/core';
|
import { SimpleChange } from '@angular/core';
|
||||||
import { ActivitiForm } from './activiti-form.component';
|
import { ActivitiForm } from './activiti-form.component';
|
||||||
import { FormModel, FormOutcomeModel, FormFieldModel, FormOutcomeEvent } from './widgets/index';
|
import { FormModel, FormOutcomeModel, FormFieldModel, FormOutcomeEvent, FormFieldTypes } from './widgets/index';
|
||||||
import { FormService } from './../services/form.service';
|
import { FormService } from './../services/form.service';
|
||||||
import { WidgetVisibilityService } from './../services/widget-visibility.service';
|
import { WidgetVisibilityService } from './../services/widget-visibility.service';
|
||||||
import { NodeService } from './../services/node.service';
|
import { NodeService } from './../services/node.service';
|
||||||
@ -554,7 +554,7 @@ describe('ActivitiForm', () => {
|
|||||||
let form = formComponent.parseForm({
|
let form = formComponent.parseForm({
|
||||||
id: '<id>',
|
id: '<id>',
|
||||||
fields: [
|
fields: [
|
||||||
{ id: 'field1' }
|
{ id: 'field1', type: FormFieldTypes.CONTAINER }
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -87,4 +87,18 @@ export class ContainerModel extends FormWidgetModel {
|
|||||||
this.isExpanded = !this.isCollapsedByDefault();
|
this.isExpanded = !this.isCollapsedByDefault();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getFormFields(): FormFieldModel[] {
|
||||||
|
let result: FormFieldModel[] = [];
|
||||||
|
|
||||||
|
for (let j = 0; j < this.columns.length; j++) {
|
||||||
|
let column = this.columns[j];
|
||||||
|
for (let k = 0; k < column.fields.length; k++) {
|
||||||
|
let field = column.fields[k];
|
||||||
|
result.push(field);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,34 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2016 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { FormWidgetModel } from './form-widget.model';
|
||||||
|
import { FormModel } from './form.model';
|
||||||
|
import { FormFieldModel } from './form-field.model';
|
||||||
|
|
||||||
|
export class DynamicTableModel extends FormWidgetModel {
|
||||||
|
|
||||||
|
field: FormFieldModel;
|
||||||
|
|
||||||
|
constructor(form: FormModel, json?: any) {
|
||||||
|
super(form, json);
|
||||||
|
|
||||||
|
if (json) {
|
||||||
|
this.field = new FormFieldModel(form, json);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -20,15 +20,21 @@ import { FormWidgetModel } from './form-widget.model';
|
|||||||
|
|
||||||
describe('FormWidgetModel', () => {
|
describe('FormWidgetModel', () => {
|
||||||
|
|
||||||
|
class FormWidgetModelMock extends FormWidgetModel {
|
||||||
|
constructor(form: FormModel, json: any) {
|
||||||
|
super(form, json);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
it('should store the form reference', () => {
|
it('should store the form reference', () => {
|
||||||
let form = new FormModel();
|
let form = new FormModel();
|
||||||
let model = new FormWidgetModel(form, null);
|
let model = new FormWidgetModelMock(form, null);
|
||||||
expect(model.form).toBe(form);
|
expect(model.form).toBe(form);
|
||||||
});
|
});
|
||||||
|
|
||||||
it('should store original json', () => {
|
it('should store original json', () => {
|
||||||
let json = {};
|
let json = {};
|
||||||
let model = new FormWidgetModel(null, json);
|
let model = new FormWidgetModelMock(null, json);
|
||||||
expect(model.json).toBe(json);
|
expect(model.json).toBe(json);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
import { FormModel } from './form.model';
|
import { FormModel } from './form.model';
|
||||||
|
|
||||||
export class FormWidgetModel {
|
export abstract class FormWidgetModel {
|
||||||
|
|
||||||
readonly fieldType: string;
|
readonly fieldType: string;
|
||||||
readonly id: string;
|
readonly id: string;
|
||||||
|
@ -20,6 +20,7 @@ import { TabModel } from './tab.model';
|
|||||||
import { ContainerModel } from './container.model';
|
import { ContainerModel } from './container.model';
|
||||||
import { FormOutcomeModel } from './form-outcome.model';
|
import { FormOutcomeModel } from './form-outcome.model';
|
||||||
import { FormValues } from './form-values';
|
import { FormValues } from './form-values';
|
||||||
|
import { FormFieldTypes } from './form-field-types';
|
||||||
|
|
||||||
describe('FormModel', () => {
|
describe('FormModel', () => {
|
||||||
|
|
||||||
@ -118,8 +119,14 @@ describe('FormModel', () => {
|
|||||||
it('should parse fields', () => {
|
it('should parse fields', () => {
|
||||||
let json = {
|
let json = {
|
||||||
fields: [
|
fields: [
|
||||||
{ id: 'field1' },
|
{
|
||||||
{ id: 'field2' }
|
id: 'field1',
|
||||||
|
type: FormFieldTypes.CONTAINER
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'field2',
|
||||||
|
type: FormFieldTypes.CONTAINER
|
||||||
|
}
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -134,8 +141,14 @@ describe('FormModel', () => {
|
|||||||
fields: null,
|
fields: null,
|
||||||
formDefinition: {
|
formDefinition: {
|
||||||
fields: [
|
fields: [
|
||||||
{ id: 'field1' },
|
{
|
||||||
{ id: 'field2' }
|
id: 'field1',
|
||||||
|
type: FormFieldTypes.CONTAINER
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: 'field2',
|
||||||
|
type: FormFieldTypes.CONTAINER
|
||||||
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -163,10 +176,10 @@ describe('FormModel', () => {
|
|||||||
{ id: 'tab2' }
|
{ id: 'tab2' }
|
||||||
],
|
],
|
||||||
fields: [
|
fields: [
|
||||||
{ id: 'field1', tab: 'tab1' },
|
{ id: 'field1', tab: 'tab1', type: FormFieldTypes.CONTAINER },
|
||||||
{ id: 'field2', tab: 'tab2' },
|
{ id: 'field2', tab: 'tab2', type: FormFieldTypes.CONTAINER },
|
||||||
{ id: 'field3', tab: 'tab1' },
|
{ id: 'field3', tab: 'tab1', type: FormFieldTypes.DYNAMIC_TABLE },
|
||||||
{ id: 'field4', tab: 'missing-tab' }
|
{ id: 'field4', tab: 'missing-tab', type: FormFieldTypes.DYNAMIC_TABLE }
|
||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -226,7 +239,7 @@ describe('FormModel', () => {
|
|||||||
let form = new FormModel(json, data);
|
let form = new FormModel(json, data);
|
||||||
expect(form.fields.length).toBe(1);
|
expect(form.fields.length).toBe(1);
|
||||||
|
|
||||||
let container = form.fields[0];
|
let container = <ContainerModel> form.fields[0];
|
||||||
expect(container.columns.length).toBe(2);
|
expect(container.columns.length).toBe(2);
|
||||||
|
|
||||||
let column1 = container.columns[0];
|
let column1 = container.columns[0];
|
||||||
|
@ -15,12 +15,14 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { FormWidgetModelCache } from './form-widget.model';
|
import { FormWidgetModel, FormWidgetModelCache } from './form-widget.model';
|
||||||
import { FormValues } from './form-values';
|
import { FormValues } from './form-values';
|
||||||
import { ContainerModel } from './container.model';
|
import { ContainerModel } from './container.model';
|
||||||
import { TabModel } from './tab.model';
|
import { TabModel } from './tab.model';
|
||||||
import { FormOutcomeModel } from './form-outcome.model';
|
import { FormOutcomeModel } from './form-outcome.model';
|
||||||
import { FormFieldModel } from './form-field.model';
|
import { FormFieldModel } from './form-field.model';
|
||||||
|
import { FormFieldTypes } from './form-field-types';
|
||||||
|
import { DynamicTableModel } from './dynamic-table.model';
|
||||||
|
|
||||||
export class FormModel {
|
export class FormModel {
|
||||||
|
|
||||||
@ -41,7 +43,7 @@ export class FormModel {
|
|||||||
|
|
||||||
readOnly: boolean = false;
|
readOnly: boolean = false;
|
||||||
tabs: TabModel[] = [];
|
tabs: TabModel[] = [];
|
||||||
fields: ContainerModel[] = [];
|
fields: FormWidgetModel[] = [];
|
||||||
outcomes: FormOutcomeModel[] = [];
|
outcomes: FormOutcomeModel[] = [];
|
||||||
|
|
||||||
values: FormValues = {};
|
values: FormValues = {};
|
||||||
@ -62,6 +64,7 @@ export class FormModel {
|
|||||||
|
|
||||||
constructor(json?: any, data?: FormValues, readOnly: boolean = false) {
|
constructor(json?: any, data?: FormValues, readOnly: boolean = false) {
|
||||||
this.readOnly = readOnly;
|
this.readOnly = readOnly;
|
||||||
|
|
||||||
if (json) {
|
if (json) {
|
||||||
this.json = json;
|
this.json = json;
|
||||||
|
|
||||||
@ -78,7 +81,7 @@ export class FormModel {
|
|||||||
return model;
|
return model;
|
||||||
});
|
});
|
||||||
|
|
||||||
this.fields = this.parseContainerFields(json);
|
this.fields = this.parseRootFields(json);
|
||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
this.loadData(data);
|
this.loadData(data);
|
||||||
@ -89,7 +92,6 @@ export class FormModel {
|
|||||||
if (field.tab) {
|
if (field.tab) {
|
||||||
let tab = tabCache[field.tab];
|
let tab = tabCache[field.tab];
|
||||||
if (tab) {
|
if (tab) {
|
||||||
// tab.fields.push(new ContainerModel(this, field.json));
|
|
||||||
tab.fields.push(field);
|
tab.fields.push(field);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -112,18 +114,21 @@ export class FormModel {
|
|||||||
this.validateField(field);
|
this.validateField(field);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: evaluate and cache once the form is loaded
|
// TODO: consider evaluating and caching once the form is loaded
|
||||||
private getFormFields(): FormFieldModel[] {
|
getFormFields(): FormFieldModel[] {
|
||||||
let result: FormFieldModel[] = [];
|
let result: FormFieldModel[] = [];
|
||||||
|
|
||||||
for (let i = 0; i < this.fields.length; i++) {
|
for (let i = 0; i < this.fields.length; i++) {
|
||||||
let container = this.fields[i];
|
let field = this.fields[i];
|
||||||
for (let j = 0; j < container.columns.length; j++) {
|
|
||||||
let column = container.columns[j];
|
if (field.type === FormFieldTypes.CONTAINER) {
|
||||||
for (let k = 0; k < column.fields.length; k++) {
|
let container = <ContainerModel> field;
|
||||||
let field = column.fields[k];
|
result.push(...container.getFormFields());
|
||||||
result.push(field);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (field.type === FormFieldTypes.DYNAMIC_TABLE) {
|
||||||
|
let dynamicTable = <DynamicTableModel> field;
|
||||||
|
result.push(dynamicTable.field);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +157,8 @@ export class FormModel {
|
|||||||
this.validateForm();
|
this.validateForm();
|
||||||
}
|
}
|
||||||
|
|
||||||
private parseContainerFields(json: any): ContainerModel[] {
|
// Activiti supports 2 types of root fields: 'container' and 'dynamic-table'.
|
||||||
|
private parseRootFields(json: any): FormWidgetModel[] {
|
||||||
let fields = [];
|
let fields = [];
|
||||||
|
|
||||||
if (json.fields) {
|
if (json.fields) {
|
||||||
@ -161,24 +167,27 @@ export class FormModel {
|
|||||||
fields = json.formDefinition.fields;
|
fields = json.formDefinition.fields;
|
||||||
}
|
}
|
||||||
|
|
||||||
return fields.map(obj => new ContainerModel(this, obj));
|
let result: FormWidgetModel[] = [];
|
||||||
|
|
||||||
|
for (let field of fields) {
|
||||||
|
if (field.type === FormFieldTypes.CONTAINER) {
|
||||||
|
result.push(new ContainerModel(this, field));
|
||||||
|
} else if (field.type === FormFieldTypes.DYNAMIC_TABLE) {
|
||||||
|
result.push(new DynamicTableModel(this, field));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loads external data and overrides field values
|
// Loads external data and overrides field values
|
||||||
// Typically used when form definition and form data coming from different sources
|
// Typically used when form definition and form data coming from different sources
|
||||||
private loadData(data: FormValues) {
|
private loadData(data: FormValues) {
|
||||||
for (let i = 0; i < this.fields.length; i++) {
|
for (let field of this.getFormFields()) {
|
||||||
let container = this.fields[i];
|
|
||||||
for (let i = 0; i < container.columns.length; i++) {
|
|
||||||
let column = container.columns[i];
|
|
||||||
for (let i = 0; i < column.fields.length; i++) {
|
|
||||||
let field = column.fields[i];
|
|
||||||
if (data[field.id]) {
|
if (data[field.id]) {
|
||||||
field.json.value = data[field.id];
|
field.json.value = data[field.id];
|
||||||
field.value = data[field.id];
|
field.value = data[field.id];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@ -28,3 +28,4 @@ export * from './tab.model';
|
|||||||
export * from './form-outcome.model';
|
export * from './form-outcome.model';
|
||||||
export * from './form-outcome-event.model';
|
export * from './form-outcome-event.model';
|
||||||
export * from './form-field-validator';
|
export * from './form-field-validator';
|
||||||
|
export * from './dynamic-table.model';
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { FormWidgetModel } from './form-widget.model';
|
import { FormWidgetModel } from './form-widget.model';
|
||||||
import { ContainerModel } from './container.model';
|
|
||||||
import { FormModel } from './form.model';
|
import { FormModel } from './form.model';
|
||||||
import { WidgetVisibilityModel } from '../../../models/widget-visibility.model';
|
import { WidgetVisibilityModel } from '../../../models/widget-visibility.model';
|
||||||
|
|
||||||
@ -26,7 +25,7 @@ export class TabModel extends FormWidgetModel {
|
|||||||
isVisible: boolean = true;
|
isVisible: boolean = true;
|
||||||
visibilityCondition: WidgetVisibilityModel;
|
visibilityCondition: WidgetVisibilityModel;
|
||||||
|
|
||||||
fields: ContainerModel[] = [];
|
fields: FormWidgetModel[] = [];
|
||||||
|
|
||||||
hasContent(): boolean {
|
hasContent(): boolean {
|
||||||
return this.fields && this.fields.length > 0;
|
return this.fields && this.fields.length > 0;
|
||||||
|
@ -0,0 +1,19 @@
|
|||||||
|
.dynamic-table-widget {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dynamic-table-widget__invalid .mdl-textfield__input {
|
||||||
|
border-color: #d50000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dynamic-table-widget__invalid .mdl-textfield__label {
|
||||||
|
color: #d50000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dynamic-table-widget__invalid .mdl-textfield__label:after {
|
||||||
|
background-color: #d50000;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dynamic-table-widget__invalid .mdl-textfield__error {
|
||||||
|
visibility: visible !important;
|
||||||
|
}
|
@ -0,0 +1,6 @@
|
|||||||
|
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label dynamic-table-widget"
|
||||||
|
[class.dynamic-table-widget__invalid]="!field.isValid">
|
||||||
|
<div>{{field.name}}</div>
|
||||||
|
<div>DYNAMIC TABLE PLACEHOLDER</div>
|
||||||
|
<span *ngIf="field.validationSummary" class="mdl-textfield__error">{{field.validationSummary}}</span>
|
||||||
|
</div>
|
@ -0,0 +1,30 @@
|
|||||||
|
/*!
|
||||||
|
* @license
|
||||||
|
* Copyright 2016 Alfresco Software, Ltd.
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
import { Component } from '@angular/core';
|
||||||
|
import { WidgetComponent } from './../widget.component';
|
||||||
|
// import { DynamicTableModel } from './../core/index';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
moduleId: module.id,
|
||||||
|
selector: 'dynamic-table-widget',
|
||||||
|
templateUrl: './dynamic-table.widget.html',
|
||||||
|
styleUrls: ['./dynamic-table.widget.css']
|
||||||
|
})
|
||||||
|
export class DynamicTableWidget extends WidgetComponent {
|
||||||
|
|
||||||
|
}
|
@ -34,6 +34,7 @@ import { FunctionalGroupWidget } from './functional-group/functional-group.widge
|
|||||||
import { PeopleWidget } from './people/people.widget';
|
import { PeopleWidget } from './people/people.widget';
|
||||||
import { DateWidget } from './date/date.widget';
|
import { DateWidget } from './date/date.widget';
|
||||||
import { AmountWidget } from './amount/amount.widget';
|
import { AmountWidget } from './amount/amount.widget';
|
||||||
|
import { DynamicTableWidget } from './dynamic-table/dynamic-table.widget';
|
||||||
|
|
||||||
// core
|
// core
|
||||||
export * from './widget.component';
|
export * from './widget.component';
|
||||||
@ -60,6 +61,7 @@ export * from './functional-group/functional-group.widget';
|
|||||||
export * from './people/people.widget';
|
export * from './people/people.widget';
|
||||||
export * from './date/date.widget';
|
export * from './date/date.widget';
|
||||||
export * from './amount/amount.widget';
|
export * from './amount/amount.widget';
|
||||||
|
export * from './dynamic-table/dynamic-table.widget';
|
||||||
|
|
||||||
export const WIDGET_DIRECTIVES: any[] = [
|
export const WIDGET_DIRECTIVES: any[] = [
|
||||||
TabsWidget,
|
TabsWidget,
|
||||||
@ -79,5 +81,6 @@ export const WIDGET_DIRECTIVES: any[] = [
|
|||||||
FunctionalGroupWidget,
|
FunctionalGroupWidget,
|
||||||
PeopleWidget,
|
PeopleWidget,
|
||||||
DateWidget,
|
DateWidget,
|
||||||
AmountWidget
|
AmountWidget,
|
||||||
|
DynamicTableWidget
|
||||||
];
|
];
|
||||||
|
@ -12,10 +12,16 @@
|
|||||||
class="mdl-tabs__panel"
|
class="mdl-tabs__panel"
|
||||||
[class.is-active]="isFirst"
|
[class.is-active]="isFirst"
|
||||||
[attr.id]="tab.id">
|
[attr.id]="tab.id">
|
||||||
<container-widget
|
<div *ngFor="let field of tab.fields">
|
||||||
*ngFor="let field of tab.fields"
|
<div [ngSwitch]="field.type">
|
||||||
[content]="field" (formValueChanged)="tabChanged($event);">
|
<div *ngSwitchCase="'container'">
|
||||||
</container-widget>
|
<container-widget [content]="field" (formValueChanged)="tabChanged($event);"></container-widget>
|
||||||
|
</div>
|
||||||
|
<div *ngSwitchDefault>
|
||||||
|
<span>UNKNOWN WIDGET TYPE: {{field.type}}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -37,12 +37,9 @@ export class WidgetVisibilityService {
|
|||||||
if (form && form.tabs && form.tabs.length > 0) {
|
if (form && form.tabs && form.tabs.length > 0) {
|
||||||
form.tabs.map(tabModel => this.refreshEntityVisibility(tabModel));
|
form.tabs.map(tabModel => this.refreshEntityVisibility(tabModel));
|
||||||
}
|
}
|
||||||
if (form && form.fields.length > 0) {
|
|
||||||
form.fields.map(contModel => {
|
if (form) {
|
||||||
this.refreshEntityVisibility(contModel);
|
form.getFormFields().map(field => this.refreshEntityVisibility(field));
|
||||||
contModel.columns.map(contColModel =>
|
|
||||||
contColModel.fields.map(field => this.refreshEntityVisibility(field)));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user