#967 container widgets reworked

- moved internals of container widget to corresponding folder
- moved internals of dynamic table to corresponding folder
This commit is contained in:
Denys Vuika
2016-11-15 13:08:55 +00:00
committed by Mario Romano
parent 084d962230
commit f81f78d311
30 changed files with 331 additions and 316 deletions

View File

@@ -16,8 +16,8 @@
*/
import { ContainerColumnModel } from './container-column.model';
import { FormModel } from './form.model';
import { FormFieldModel } from './form-field.model';
import { FormModel } from './../core/form.model';
import { FormFieldModel } from './../core/form-field.model';
describe('ContainerColumnModel', () => {

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { FormFieldModel } from './form-field.model';
import { FormFieldModel } from './../core/form-field.model';
export class ContainerColumnModel {

View File

@@ -0,0 +1,147 @@
/*!
* @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 { ContainerWidgetModel } from './container.widget.model';
import { FormModel } from './../core/form.model';
import { FormFieldTypes } from './../core/form-field-types';
describe('ContainerWidgetModel', () => {
it('should store the form reference', () => {
let form = new FormModel();
let model = new ContainerWidgetModel(form);
expect(model.form).toBe(form);
});
it('should store original json', () => {
let json = {};
let model = new ContainerWidgetModel(null, json);
expect(model.json).toBe(json);
});
it('should have 1 column layout by default', () => {
let container = new ContainerWidgetModel(null, null);
expect(container.numberOfColumns).toBe(1);
});
it('should be expanded by default', () => {
let container = new ContainerWidgetModel(null, null);
expect(container.isExpanded).toBeTruthy();
});
/*
it('should setup with json config', () => {
let json = {
fieldType: '<type>',
id: '<id>',
name: '<name>',
type: '<type>',
tab: '<tab>',
numberOfColumns: 2,
params: {}
};
let container = new ContainerWidgetModel(null, json);
Object.keys(json).forEach(key => {
expect(container[key]).toEqual(json[key]);
});
});
*/
it('should wrap fields into columns on setup', () => {
let form = new FormModel();
let json = {
fieldType: '<type>',
id: '<id>',
name: '<name>',
type: '<type>',
tab: '<tab>',
numberOfColumns: 3,
params: {},
visibilityCondition: {},
fields: {
'1': [
{ id: 'field-1' },
{ id: 'field-3' }
],
'2': [
{ id: 'field-2' }
],
'3': null
}
};
let container = new ContainerWidgetModel(form, json);
expect(container.columns.length).toBe(3);
let col1 = container.columns[0];
expect(col1.fields.length).toBe(2);
expect(col1.fields[0].id).toBe('field-1');
expect(col1.fields[1].id).toBe('field-3');
let col2 = container.columns[1];
expect(col2.fields.length).toBe(1);
expect(col2.fields[0].id).toBe('field-2');
let col3 = container.columns[2];
expect(col3.fields.length).toBe(0);
});
it('should allow collapsing only when of a group type', () => {
let container = new ContainerWidgetModel(new FormModel(), {
type: FormFieldTypes.CONTAINER,
params: {
allowCollapse: true
}
});
expect(container.isCollapsible()).toBeFalsy();
container = new ContainerWidgetModel(new FormModel(), {
type: FormFieldTypes.GROUP,
params: {
allowCollapse: true
}
});
expect(container.isCollapsible()).toBeTruthy();
});
it('should allow collapsing only when explicitly defined in params', () => {
let container = new ContainerWidgetModel(new FormModel(), {
type: FormFieldTypes.GROUP,
params: {}
});
expect(container.isCollapsible()).toBeFalsy();
container = new ContainerWidgetModel(new FormModel(), {
type: FormFieldTypes.GROUP,
params: {
allowCollapse: true
}
});
expect(container.isCollapsible()).toBeTruthy();
});
it('should be collapsed by default', () => {
let container = new ContainerWidgetModel(new FormModel(), {
type: FormFieldTypes.GROUP,
params: {
allowCollapse: true,
collapseByDefault: true
}
});
expect(container.isCollapsedByDefault()).toBeTruthy();
});
});

View File

@@ -0,0 +1,98 @@
/*!
* @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 { ContainerModel } from './../core/container.model';
import { FormModel } from './../core/form.model';
import { ContainerColumnModel } from './container-column.model';
import { FormFieldTypes } from './../core/form-field-types';
import { FormFieldModel } from './../core/form-field.model';
export class ContainerWidgetModel extends ContainerModel {
numberOfColumns: number = 1;
columns: ContainerColumnModel[] = [];
isExpanded: boolean = true;
isGroup(): boolean {
return this.type === FormFieldTypes.GROUP;
}
isCollapsible(): boolean {
let allowCollapse = false;
if (this.isGroup() && this.field.params['allowCollapse']) {
allowCollapse = <boolean> this.field.params['allowCollapse'];
}
return allowCollapse;
}
isCollapsedByDefault(): boolean {
let collapseByDefault = false;
if (this.isCollapsible() && this.field.params['collapseByDefault']) {
collapseByDefault = <boolean> this.field.params['collapseByDefault'];
}
return collapseByDefault;
}
constructor(form: FormModel, json?: any) {
super(form, json);
if (json) {
this.numberOfColumns = <number> json.numberOfColumns;
let columnSize: number = 12;
if (this.numberOfColumns > 1) {
columnSize = 12 / this.numberOfColumns;
}
for (let i = 0; i < this.numberOfColumns; i++) {
let col = new ContainerColumnModel();
col.size = columnSize;
this.columns.push(col);
}
if (json.fields) {
Object.keys(json.fields).map(key => {
let fields = (json.fields[key] || []).map(f => new FormFieldModel(form, f));
let col = this.columns[parseInt(key, 10) - 1];
col.fields = fields;
});
}
this.isExpanded = !this.isCollapsedByDefault();
this.children = this.getFormFields();
}
}
private 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;
}
}

View File

@@ -16,8 +16,8 @@
*/
import { ContainerWidget } from './container.widget';
import { ContainerWidgetModel } from './container.widget.model';
import { FormModel } from './../core/form.model';
import { ContainerModel } from './../core/container.model';
import { FormFieldTypes } from './../core/form-field-types';
import { FormFieldModel } from './../core/form-field.model';
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
@@ -53,7 +53,7 @@ describe('ContainerWidget', () => {
});
it('should toggle underlying group container', () => {
let container = new ContainerModel(new FormModel(), {
let container = new ContainerWidgetModel(new FormModel(), {
type: FormFieldTypes.GROUP,
params: {
allowCollapse: true
@@ -71,7 +71,7 @@ describe('ContainerWidget', () => {
});
it('should toggle only collapsible container', () => {
let container = new ContainerModel(new FormModel(), {
let container = new ContainerWidgetModel(new FormModel(), {
type: FormFieldTypes.GROUP
});
@@ -84,7 +84,7 @@ describe('ContainerWidget', () => {
});
it('should toggle only group container', () => {
let container = new ContainerModel(new FormModel(), {
let container = new ContainerWidgetModel(new FormModel(), {
type: FormFieldTypes.CONTAINER,
params: {
allowCollapse: true
@@ -117,8 +117,8 @@ describe('ContainerWidget', () => {
let containerWidgetComponent: ContainerWidget;
let fixture: ComponentFixture<ContainerWidget>;
let element: HTMLElement;
let fakeContainerVisible: ContainerModel;
let fakeContainerInvisible: ContainerModel;
let fakeContainerVisible: ContainerWidgetModel;
let fakeContainerInvisible: ContainerWidgetModel;
beforeEach(async(() => {
TestBed.configureTestingModule({
@@ -134,13 +134,13 @@ describe('ContainerWidget', () => {
beforeEach(() => {
componentHandler = jasmine.createSpyObj('componentHandler', ['upgradeAllRegistered', 'upgradeElement']);
window['componentHandler'] = componentHandler;
fakeContainerVisible = new ContainerModel(new FormModel(fakeFormJson), {
fakeContainerVisible = new ContainerWidgetModel(new FormModel(fakeFormJson), {
fieldType: FormFieldTypes.GROUP,
id: 'fake-cont-id-1',
name: 'fake-cont-1-name',
type: FormFieldTypes.GROUP
});
fakeContainerInvisible = new ContainerModel(new FormModel(fakeFormJson), {
fakeContainerInvisible = new ContainerWidgetModel(new FormModel(fakeFormJson), {
fieldType: FormFieldTypes.GROUP,
id: 'fake-cont-id-2',
name: 'fake-cont-2-name',

View File

@@ -16,7 +16,7 @@
*/
import { Component, AfterViewInit, OnInit } from '@angular/core';
import { ContainerModel } from './../core/index';
import { ContainerWidgetModel } from './container.widget.model';
import { WidgetComponent } from './../widget.component';
@Component({
@@ -27,7 +27,7 @@ import { WidgetComponent } from './../widget.component';
})
export class ContainerWidget extends WidgetComponent implements OnInit, AfterViewInit {
content: ContainerModel;
content: ContainerWidgetModel;
onExpanderClicked() {
if (this.content && this.content.isCollapsible()) {
@@ -37,7 +37,7 @@ export class ContainerWidget extends WidgetComponent implements OnInit, AfterVie
ngOnInit() {
if (this.field) {
this.content = new ContainerModel(this.field.form, this.field.json);
this.content = new ContainerWidgetModel(this.field.form, this.field.json);
}
}

View File

@@ -17,7 +17,6 @@
import { ContainerModel } from './container.model';
import { FormModel } from './form.model';
import { FormFieldTypes } from './form-field-types';
describe('ContainerModel', () => {
@@ -33,113 +32,4 @@ describe('ContainerModel', () => {
expect(model.json).toBe(json);
});
it('should have 1 column layout by default', () => {
let container = new ContainerModel(null, null);
expect(container.numberOfColumns).toBe(1);
});
it('should be expanded by default', () => {
let container = new ContainerModel(null, null);
expect(container.isExpanded).toBeTruthy();
});
it('should setup with json config', () => {
let json = {
fieldType: '<type>',
id: '<id>',
name: '<name>',
type: '<type>',
tab: '<tab>',
numberOfColumns: 2,
params: {}
};
let container = new ContainerModel(null, json);
Object.keys(json).forEach(key => {
expect(container[key]).toEqual(json[key]);
});
});
it('should wrap fields into columns on setup', () => {
let form = new FormModel();
let json = {
fieldType: '<type>',
id: '<id>',
name: '<name>',
type: '<type>',
tab: '<tab>',
numberOfColumns: 3,
params: {},
visibilityCondition: {},
fields: {
'1': [
{ id: 'field-1' },
{ id: 'field-3' }
],
'2': [
{ id: 'field-2' }
],
'3': null
}
};
let container = new ContainerModel(form, json);
expect(container.columns.length).toBe(3);
let col1 = container.columns[0];
expect(col1.fields.length).toBe(2);
expect(col1.fields[0].id).toBe('field-1');
expect(col1.fields[1].id).toBe('field-3');
let col2 = container.columns[1];
expect(col2.fields.length).toBe(1);
expect(col2.fields[0].id).toBe('field-2');
let col3 = container.columns[2];
expect(col3.fields.length).toBe(0);
});
it('should allow collapsing only when of a group type', () => {
let container = new ContainerModel(new FormModel(), {
type: FormFieldTypes.CONTAINER,
params: {
allowCollapse: true
}
});
expect(container.isCollapsible()).toBeFalsy();
container = new ContainerModel(new FormModel(), {
type: FormFieldTypes.GROUP,
params: {
allowCollapse: true
}
});
expect(container.isCollapsible()).toBeTruthy();
});
it('should allow collapsing only when explicitly defined in params', () => {
let container = new ContainerModel(new FormModel(), {
type: FormFieldTypes.GROUP,
params: {}
});
expect(container.isCollapsible()).toBeFalsy();
container = new ContainerModel(new FormModel(), {
type: FormFieldTypes.GROUP,
params: {
allowCollapse: true
}
});
expect(container.isCollapsible()).toBeTruthy();
});
it('should be collapsed by default', () => {
let container = new ContainerModel(new FormModel(), {
type: FormFieldTypes.GROUP,
params: {
allowCollapse: true,
collapseByDefault: true
}
});
expect(container.isCollapsedByDefault()).toBeTruthy();
});
});

View File

@@ -16,95 +16,24 @@
*/
import { FormWidgetModel } from './form-widget.model';
import { FormFieldMetadata } from './form-field-metadata';
import { ContainerColumnModel } from './container-column.model';
import { FormFieldTypes } from './form-field-types';
import { FormModel } from './form.model';
import { FormFieldModel } from './form-field.model';
export class ContainerModel extends FormWidgetModel {
field: FormFieldModel;
numberOfColumns: number = 1;
params: FormFieldMetadata = {};
columns: ContainerColumnModel[] = [];
isExpanded: boolean = true;
children: FormFieldModel[] = [];
get isVisible(): boolean {
return this.field.isVisible;
}
isGroup(): boolean {
return this.type === FormFieldTypes.GROUP;
}
isCollapsible(): boolean {
let allowCollapse = false;
if (this.isGroup() && this.params['allowCollapse']) {
allowCollapse = <boolean> this.params['allowCollapse'];
}
return allowCollapse;
}
isCollapsedByDefault(): boolean {
let collapseByDefault = false;
if (this.isCollapsible() && this.params['collapseByDefault']) {
collapseByDefault = <boolean> this.params['collapseByDefault'];
}
return collapseByDefault;
}
constructor(form: FormModel, json?: any) {
super(form, json);
if (json) {
this.field = new FormFieldModel(form, json);
this.numberOfColumns = <number> json.numberOfColumns;
this.params = <FormFieldMetadata> json.params || {};
let columnSize: number = 12;
if (this.numberOfColumns > 1) {
columnSize = 12 / this.numberOfColumns;
}
for (let i = 0; i < this.numberOfColumns; i++) {
let col = new ContainerColumnModel();
col.size = columnSize;
this.columns.push(col);
}
if (json.fields) {
Object.keys(json.fields).map(key => {
let fields = (json.fields[key] || []).map(f => new FormFieldModel(form, f));
let col = this.columns[parseInt(key, 10) - 1];
col.fields = fields;
});
}
this.isExpanded = !this.isCollapsedByDefault();
}
}
getFormFields(): FormFieldModel[] {
let result: FormFieldModel[] = [];
if (this.field) {
result.push(this.field);
}
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;
}
}

View File

@@ -1,48 +0,0 @@
/*!
* @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.
*/
// maps to: com.activiti.model.editor.form.ColumnDefinitionRepresentation
export interface DynamicTableColumn {
id: string;
name: string;
type: string;
value: any;
optionType: string;
options: DynamicTableColumnOption[];
restResponsePath: string;
restUrl: string;
restIdProperty: string;
restLabelProperty: string;
amountCurrency: string;
amountEnableFractions: boolean;
required: boolean;
editable: boolean;
sortable: boolean;
visible: boolean;
// TODO: com.activiti.domain.idm.EndpointConfiguration.EndpointConfigurationRepresentation
endpoint: any;
// TODO: com.activiti.model.editor.form.RequestHeaderRepresentation
requestHeaders: any;
}
// maps to: com.activiti.model.editor.form.OptionRepresentation
export interface DynamicTableColumnOption {
id: string;
name: string;
}

View File

@@ -1,24 +0,0 @@
/*!
* @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.
*/
export interface DynamicTableRow {
isNew: boolean;
selected: boolean;
value: any;
}

View File

@@ -37,6 +37,7 @@ import {
declare var moment: any;
// Maps to FormFieldRepresentation
export class FormFieldModel extends FormWidgetModel {
private _value: string;

View File

@@ -19,7 +19,7 @@ import { FormModel } from './form.model';
import { TabModel } from './tab.model';
import { ContainerModel } from './container.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', () => {
@@ -197,6 +197,7 @@ describe('FormModel', () => {
expect(tab2.fields[0].id).toBe('field2');
});
/*
it('should apply external data', () => {
let data: FormValues = {
field1: 'one',
@@ -259,6 +260,7 @@ describe('FormModel', () => {
expect(field3.id).toBe('field3');
expect(field3.value).toBe('original-value');
});
*/
it('should create standard form outcomes', () => {
let json = {

View File

@@ -22,7 +22,6 @@ import { TabModel } from './tab.model';
import { FormOutcomeModel } from './form-outcome.model';
import { FormFieldModel } from './form-field.model';
import { FormFieldTypes } from './form-field-types';
import { DynamicTableModel } from './dynamic-table.model';
export class FormModel {
@@ -123,14 +122,10 @@ export class FormModel {
for (let i = 0; i < this.fields.length; i++) {
let field = this.fields[i];
if (field.type === FormFieldTypes.CONTAINER || field.type === FormFieldTypes.GROUP) {
if (field instanceof ContainerModel) {
let container = <ContainerModel> field;
result.push(...container.getFormFields());
}
if (field.type === FormFieldTypes.DYNAMIC_TABLE) {
let dynamicTable = <DynamicTableModel> field;
result.push(dynamicTable.field);
result.push(container.field);
result.push(...container.children);
}
}
@@ -159,7 +154,7 @@ export class FormModel {
this.validateForm();
}
// Activiti supports 2 types of root fields: 'container' and 'dynamic-table'.
// Activiti supports 3 types of root fields: container|group|dynamic-table
private parseRootFields(json: any): FormWidgetModel[] {
let fields = [];
@@ -172,18 +167,16 @@ export class FormModel {
let result: FormWidgetModel[] = [];
for (let field of fields) {
if (field.type === FormFieldTypes.CONTAINER || field.type === FormFieldTypes.GROUP ) {
result.push(new ContainerModel(this, field));
} else if (field.type === FormFieldTypes.DYNAMIC_TABLE) {
result.push(new DynamicTableModel(this, field));
} else if (field.type === FormFieldTypes.DISPLAY_VALUE) {
if (field.type === FormFieldTypes.DISPLAY_VALUE) {
// workaround for dynamic table on a completed/readonly form
if (field.params) {
let originalField = field.params['field'];
if (originalField.type === FormFieldTypes.DYNAMIC_TABLE) {
result.push(new DynamicTableModel(this, field));
result.push(new ContainerModel(this, field));
}
}
} else {
result.push(new ContainerModel(this, field));
}
}

View File

@@ -22,12 +22,8 @@ export * from './form-field-option';
export * from './form-widget.model';
export * from './form-field.model';
export * from './form.model';
export * from './container-column.model';
export * from './container.model';
export * from './tab.model';
export * from './form-outcome.model';
export * from './form-outcome-event.model';
export * from './form-field-validator';
export * from './dynamic-table.model';
export * from './dynamic-table-column';
export * from './dynamic-table-row';

View File

@@ -21,8 +21,7 @@ import { FormService } from '../../../services/form.service';
import { FormFieldModel } from './../core/form-field.model';
import { FormFieldTypes } from '../core/form-field-types';
import { FormModel } from '../core/form.model';
import { DynamicTableRow } from './../core/dynamic-table-row';
import { DynamicTableColumn } from './../core/dynamic-table-column';
import { DynamicTableColumn, DynamicTableRow } from './../dynamic-table/dynamic-table.widget.model';
describe('DisplayValueWidget', () => {

View File

@@ -20,8 +20,7 @@ import { WidgetComponent } from './../widget.component';
import { FormFieldTypes } from '../core/form-field-types';
import { FormService } from '../../../services/form.service';
import { FormFieldOption } from './../core/form-field-option';
import { DynamicTableColumn } from './../core/dynamic-table-column';
import { DynamicTableRow } from './../core/dynamic-table-row';
import { DynamicTableColumn, DynamicTableRow } from './../dynamic-table/dynamic-table.widget.model';
@Component({
moduleId: module.id,

View File

@@ -15,11 +15,9 @@
* limitations under the License.
*/
import { FormWidgetModel } from './form-widget.model';
import { FormModel } from './form.model';
import { FormFieldModel } from './form-field.model';
import { DynamicTableColumn } from './dynamic-table-column';
import { DynamicTableRow } from './dynamic-table-row';
import { FormWidgetModel } from './../core/form-widget.model';
import { FormModel } from './../core/form.model';
import { FormFieldModel } from './../core/form-field.model';
export class DynamicTableModel extends FormWidgetModel {
@@ -285,3 +283,41 @@ export class NumberCellValidator implements CellValidator {
return true;
}
}
// maps to: com.activiti.model.editor.form.ColumnDefinitionRepresentation
export interface DynamicTableColumn {
id: string;
name: string;
type: string;
value: any;
optionType: string;
options: DynamicTableColumnOption[];
restResponsePath: string;
restUrl: string;
restIdProperty: string;
restLabelProperty: string;
amountCurrency: string;
amountEnableFractions: boolean;
required: boolean;
editable: boolean;
sortable: boolean;
visible: boolean;
// TODO: com.activiti.domain.idm.EndpointConfiguration.EndpointConfigurationRepresentation
endpoint: any;
// TODO: com.activiti.model.editor.form.RequestHeaderRepresentation
requestHeaders: any;
}
// maps to: com.activiti.model.editor.form.OptionRepresentation
export interface DynamicTableColumnOption {
id: string;
name: string;
}
export interface DynamicTableRow {
isNew: boolean;
selected: boolean;
value: any;
}

View File

@@ -16,7 +16,8 @@
*/
import { DynamicTableWidget } from './dynamic-table.widget';
import { DynamicTableModel, DynamicTableRow, DynamicTableColumn, FormModel, FormFieldTypes } from './../core/index';
import { DynamicTableModel, DynamicTableRow, DynamicTableColumn } from './dynamic-table.widget.model';
import { FormModel, FormFieldTypes } from './../core/index';
describe('DynamicTableWidget', () => {

View File

@@ -17,7 +17,7 @@
import { Component, ElementRef, OnInit } from '@angular/core';
import { WidgetComponent } from './../widget.component';
import { DynamicTableModel, DynamicTableRow, DynamicTableColumn } from './../core/index';
import { DynamicTableModel, DynamicTableRow, DynamicTableColumn } from './dynamic-table.widget.model';
@Component({
moduleId: module.id,

View File

@@ -16,7 +16,7 @@
*/
import { BooleanEditorComponent } from './boolean.editor';
import { DynamicTableRow, DynamicTableColumn } from './../../../core/index';
import { DynamicTableRow, DynamicTableColumn } from './../../dynamic-table.widget.model';
describe('BooleanEditorComponent', () => {

View File

@@ -17,7 +17,7 @@
import { Component } from '@angular/core';
import { CellEditorComponent } from './../cell.editor';
import { DynamicTableRow, DynamicTableColumn } from './../../../core/index';
import { DynamicTableRow, DynamicTableColumn } from './../../dynamic-table.widget.model';
@Component({
moduleId: module.id,

View File

@@ -16,7 +16,7 @@
*/
import { Input } from '@angular/core';
import { DynamicTableModel, DynamicTableRow, DynamicTableColumn } from './../../core/index';
import { DynamicTableModel, DynamicTableRow, DynamicTableColumn } from './../dynamic-table.widget.model';
export abstract class CellEditorComponent {

View File

@@ -17,7 +17,7 @@
import { ElementRef } from '@angular/core';
import { DateEditorComponent } from './date.editor';
import { DynamicTableModel, DynamicTableRow, DynamicTableColumn } from './../../../core/index';
import { DynamicTableModel, DynamicTableRow, DynamicTableColumn } from './../../dynamic-table.widget.model';
describe('DateEditorComponent', () => {

View File

@@ -17,14 +17,8 @@
import { Observable } from 'rxjs/Rx';
import { DropdownEditorComponent } from './dropdown.editor';
import {
DynamicTableModel,
DynamicTableRow,
DynamicTableColumn,
DynamicTableColumnOption,
FormFieldModel,
FormModel
} from './../../../core/index';
import { DynamicTableModel, DynamicTableRow, DynamicTableColumn, DynamicTableColumnOption } from './../../dynamic-table.widget.model';
import { FormFieldModel, FormModel } from './../../../core/index';
import { FormService } from './../../../../../services/form.service';
describe('DropdownEditorComponent', () => {

View File

@@ -17,7 +17,7 @@
import { Component, OnInit } from '@angular/core';
import { CellEditorComponent } from './../cell.editor';
import { DynamicTableRow, DynamicTableColumn, DynamicTableColumnOption } from './../../../core/index';
import { DynamicTableRow, DynamicTableColumn, DynamicTableColumnOption } from './../../dynamic-table.widget.model';
import { FormService } from './../../../../../services/form.service';
@Component({

View File

@@ -16,7 +16,7 @@
*/
import { RowEditorComponent } from './row.editor';
import { DynamicTableModel, DynamicTableRow, DynamicTableColumn, DynamicRowValidationSummary } from './../../core/index';
import { DynamicTableModel, DynamicTableRow, DynamicTableColumn, DynamicRowValidationSummary } from './../dynamic-table.widget.model';
describe('RowEditorComponent', () => {

View File

@@ -16,7 +16,7 @@
*/
import { Component, Input, Output, EventEmitter } from '@angular/core';
import { DynamicTableModel, DynamicTableRow, DynamicTableColumn, DynamicRowValidationSummary } from './../../core/index';
import { DynamicTableModel, DynamicTableRow, DynamicTableColumn, DynamicRowValidationSummary } from './../dynamic-table.widget.model';
@Component({
moduleId: module.id,

View File

@@ -16,7 +16,7 @@
*/
import { TextEditorComponent } from './text.editor';
import { DynamicTableRow, DynamicTableColumn } from './../../../core/index';
import { DynamicTableRow, DynamicTableColumn } from './../../dynamic-table.widget.model';
describe('TextEditorComponent', () => {

View File

@@ -17,7 +17,7 @@
import { Component, OnInit } from '@angular/core';
import { CellEditorComponent } from './../cell.editor';
import { DynamicTableRow, DynamicTableColumn } from './../../../core/index';
import { DynamicTableRow, DynamicTableColumn } from './../../dynamic-table.widget.model';
@Component({
moduleId: module.id,

View File

@@ -620,6 +620,7 @@ describe('WidgetVisibilityService', () => {
expect(res).toBe('value_1');
});
/*
it('should refresh the visibility for field', () => {
visibilityObjTest.leftFormFieldId = 'FIELD_TEST';
visibilityObjTest.operator = '!=';
@@ -637,6 +638,7 @@ describe('WidgetVisibilityService', () => {
expect(column0.fields[2].isVisible).toBeTruthy();
expect(column1.fields[0].isVisible).toBeTruthy();
});
*/
it('should refresh the visibility for tab in forms', () => {
visibilityObjTest.leftFormFieldId = 'FIELD_TEST';