Values
diff --git a/ng2-components/ng2-activiti-form/src/components/form.component.scss b/ng2-components/ng2-activiti-form/src/components/form.component.scss
new file mode 100644
index 0000000000..077f689477
--- /dev/null
+++ b/ng2-components/ng2-activiti-form/src/components/form.component.scss
@@ -0,0 +1,38 @@
+.adf {
+ &-form-container {
+ width: 100%;
+ min-height: 100px;
+ overflow: visible;
+ }
+
+ &-form-debug-container {
+ padding: 10px;
+ }
+
+ &-form-debug-container .debug-toggle-text {
+ padding-left: 15px;
+ cursor: pointer;
+ }
+
+ &-form-debug-container .debug-toggle-text:hover {
+ font-weight: bold;
+ }
+
+ &-form-reload-button {
+ position: absolute;
+ right: 0;
+ top: 0;
+ }
+
+ &-form-hide-button {
+ display: none;
+ }
+
+ &-task-title {
+ text-align: center
+ }
+}
+
+form-field {
+ width: 100%;
+}
diff --git a/ng2-components/ng2-activiti-form/src/components/form.component.spec.ts b/ng2-components/ng2-activiti-form/src/components/form.component.spec.ts
index f7ab607e63..d930f46f39 100644
--- a/ng2-components/ng2-activiti-form/src/components/form.component.spec.ts
+++ b/ng2-components/ng2-activiti-form/src/components/form.component.spec.ts
@@ -27,7 +27,6 @@ import { FormFieldModel, FormFieldTypes, FormModel, FormOutcomeEvent, FormOutcom
describe('FormComponent', () => {
- let componentHandler: any;
let formService: FormService;
let formComponent: FormComponent;
let visibilityService: WidgetVisibilityService;
@@ -35,11 +34,6 @@ describe('FormComponent', () => {
let logService: LogService;
beforeEach(() => {
- componentHandler = jasmine.createSpyObj('componentHandler', [
- 'upgradeAllRegistered'
- ]);
- window['componentHandler'] = componentHandler;
-
logService = new LogService();
visibilityService = new WidgetVisibilityService(null, logService);
spyOn(visibilityService, 'refreshVisibility').and.stub();
@@ -48,18 +42,6 @@ describe('FormComponent', () => {
formComponent = new FormComponent(formService, visibilityService, null, nodeService);
});
- it('should upgrade MDL content on view checked', () => {
- formComponent.ngAfterViewChecked();
- expect(componentHandler.upgradeAllRegistered).toHaveBeenCalled();
- });
-
- it('should setup MDL content only if component handler available', () => {
- expect(formComponent.setupMaterialComponents()).toBeTruthy();
-
- window['componentHandler'] = null;
- expect(formComponent.setupMaterialComponents()).toBeFalsy();
- });
-
it('should check form', () => {
expect(formComponent.hasForm()).toBeFalsy();
formComponent.form = new FormModel();
@@ -650,19 +632,6 @@ describe('FormComponent', () => {
expect(formComponent.getFormDefinitionOutcomes).toHaveBeenCalledWith(form);
});
- /*
- it('should update the visibility when the container raise the change event', (valueChanged) => {
- spyOn(formComponent, 'checkVisibility').and.callThrough();
- let widget = new ContainerWidgetComponent();
- let fakeForm = new FormModel();
- let fakeField = new FormFieldModel(fakeForm, {id: 'fakeField', value: 'fakeValue'});
- widget.formValueChanged.subscribe(field => { valueChanged(); });
- widget.fieldChanged(fakeField);
-
- expect(formComponent.checkVisibility).toHaveBeenCalledWith(fakeField);
- });
- */
-
it('should prevent default outcome execution', () => {
let outcome = new FormOutcomeModel(new FormModel(), {
diff --git a/ng2-components/ng2-activiti-form/src/components/form.component.ts b/ng2-components/ng2-activiti-form/src/components/form.component.ts
index bc898b0d9e..15ac9521eb 100644
--- a/ng2-components/ng2-activiti-form/src/components/form.component.ts
+++ b/ng2-components/ng2-activiti-form/src/components/form.component.ts
@@ -16,7 +16,7 @@
*/
/* tslint:disable */
-import { AfterViewChecked, Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';
+import { Component, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges, ViewEncapsulation } from '@angular/core';
import { FormErrorEvent, FormEvent } from './../events/index';
import { EcmModelService } from './../services/ecm-model.service';
import { FormService } from './../services/form.service';
@@ -26,14 +26,13 @@ import { FormFieldModel, FormModel, FormOutcomeEvent, FormOutcomeModel, FormValu
import { WidgetVisibilityService } from './../services/widget-visibility.service';
-declare var componentHandler: any;
-
@Component({
selector: 'adf-form, activiti-form',
templateUrl: './form.component.html',
- styleUrls: ['./form.component.css']
+ styleUrls: ['./form.component.scss'],
+ encapsulation: ViewEncapsulation.None
})
-export class FormComponent implements OnInit, AfterViewChecked, OnChanges {
+export class FormComponent implements OnInit, OnChanges {
static SAVE_OUTCOME_ID: string = '$save';
static COMPLETE_OUTCOME_ID: string = '$complete';
@@ -176,10 +175,6 @@ export class FormComponent implements OnInit, AfterViewChecked, OnChanges {
});
}
- ngAfterViewChecked() {
- this.setupMaterialComponents();
- }
-
ngOnChanges(changes: SimpleChanges) {
let taskId = changes['taskId'];
if (taskId && taskId.currentValue) {
@@ -306,15 +301,6 @@ export class FormComponent implements OnInit, AfterViewChecked, OnChanges {
return taskRepresentation.processDefinitionId && taskRepresentation.processDefinitionDeploymentId !== 'null';
}
- setupMaterialComponents(): boolean {
- // workaround for MDL issues with dynamic components
- if (componentHandler) {
- componentHandler.upgradeAllRegistered();
- return true;
- }
- return false;
- }
-
getFormByTaskId(taskId: string): Promise
{
return new Promise((resolve, reject) => {
this.loadFormProcessVariables(this.taskId).then(_ => {
diff --git a/ng2-components/ng2-activiti-form/src/components/start-form.component.html b/ng2-components/ng2-activiti-form/src/components/start-form.component.html
index d5beaf2334..323d2d9832 100644
--- a/ng2-components/ng2-activiti-form/src/components/start-form.component.html
+++ b/ng2-components/ng2-activiti-form/src/components/start-form.component.html
@@ -1,37 +1,37 @@
-