+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UNKNOWN WIDGET TYPE: {{field.type}}
+
diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/container/container.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/container/container.widget.ts
index 1d41214674..6e0b3b88ad 100644
--- a/ng2-components/ng2-activiti-form/src/components/widgets/container/container.widget.ts
+++ b/ng2-components/ng2-activiti-form/src/components/widgets/container/container.widget.ts
@@ -31,6 +31,7 @@ declare var componentHandler;
moduleId: __moduleName,
selector: 'container-widget',
templateUrl: './container.widget.html',
+ styleUrls: ['./container.widget.css'],
directives: [
TextWidget,
NumberWidget,
diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/dropdown/dropdown.widget.ts b/ng2-components/ng2-activiti-form/src/components/widgets/dropdown/dropdown.widget.ts
index c098b801e2..c5d61526e5 100644
--- a/ng2-components/ng2-activiti-form/src/components/widgets/dropdown/dropdown.widget.ts
+++ b/ng2-components/ng2-activiti-form/src/components/widgets/dropdown/dropdown.widget.ts
@@ -15,7 +15,7 @@
* limitations under the License.
*/
-import { Component, OnInit, NgZone } from '@angular/core';
+import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Rx';
import { Http } from '@angular/http';
import { ObjectUtils } from 'ng2-alfresco-core';
@@ -32,8 +32,7 @@ declare var componentHandler;
})
export class DropdownWidget extends WidgetComponent implements OnInit {
- constructor(private http: Http,
- private zone: NgZone) {
+ constructor(private http: Http) {
super();
}
diff --git a/ng2-components/ng2-activiti-form/src/components/widgets/widget.model.ts b/ng2-components/ng2-activiti-form/src/components/widgets/widget.model.ts
index 363efbb0c9..d1c85baa7a 100644
--- a/ng2-components/ng2-activiti-form/src/components/widgets/widget.model.ts
+++ b/ng2-components/ng2-activiti-form/src/components/widgets/widget.model.ts
@@ -15,10 +15,19 @@
* limitations under the License.
*/
-export interface FormValues {
+export interface FormFieldMetadata {
[key: string]: any;
}
+export interface FormValues extends FormFieldMetadata {
+}
+
+export class FormFieldTypes {
+ static CONTAINER: string = 'container';
+ static GROUP: string = 'group';
+ static DROPDOWN: string = 'dropdown';
+}
+
export class FormWidgetModel {
private _form: FormModel;
@@ -64,6 +73,7 @@ export class FormFieldModel extends FormWidgetModel {
hasEmptyValue: boolean;
className: string;
optionType: string;
+ params: FormFieldMetadata = {};
get value(): any {
return this._value;
@@ -95,6 +105,7 @@ export class FormFieldModel extends FormWidgetModel {
this.hasEmptyValue =
json.hasEmptyValue;
this.className = json.className;
this.optionType = json.optionType;
+ this.params = json.params || {};
this._value = this.parseValue(json);
this.updateForm();
@@ -109,7 +120,7 @@ export class FormFieldModel extends FormWidgetModel {
but saving back as object: { id: , name: }
*/
// TODO: needs review
- if (json.fieldType === 'RestFieldRepresentation') {
+ if (json.type === FormFieldTypes.DROPDOWN) {
if (value === '') {
value = 'empty';
}
@@ -123,7 +134,7 @@ export class FormFieldModel extends FormWidgetModel {
This is needed due to Activiti reading dropdown values as string
but saving back as object: { id: , name: }
*/
- if (this.fieldType === 'RestFieldRepresentation') {
+ if (this.type === FormFieldTypes.DROPDOWN) {
if (this.value === 'empty' || this.value === '') {
this.form.values[this.id] = {};
} else {
@@ -159,6 +170,10 @@ export class ContainerModel extends FormWidgetModel {
columns: ContainerColumnModel[] = [];
+ isGroup(): boolean {
+ return this.type == FormFieldTypes.GROUP;
+ }
+
constructor(form: FormModel, json?: any) {
super(form, json);