mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-4529] Enable form configuration from e2e tests (#4738)
* [ADF-4529] Enable form configuration from e2e tests * Improve linting * Move form methods to new file
This commit is contained in:
committed by
Eugenio Romano
parent
36faed0fab
commit
f2f08a5bf8
@@ -16,9 +16,8 @@
|
||||
*/
|
||||
|
||||
import { Component, Inject, OnInit } from '@angular/core';
|
||||
import { FormModel, FormService, FormOutcomeEvent } from '@alfresco/adf-core';
|
||||
import { FormModel, FormService, FormOutcomeEvent, CoreAutomationService } from '@alfresco/adf-core';
|
||||
import { InMemoryFormService } from '../../services/in-memory-form.service';
|
||||
import { DemoForm } from './demo-form';
|
||||
import { FakeFormService } from './fake-form.service';
|
||||
|
||||
@Component({
|
||||
@@ -37,7 +36,8 @@ export class FormLoadingComponent implements OnInit {
|
||||
radioButtonFieldValue = '';
|
||||
formattedData = {};
|
||||
|
||||
constructor(@Inject(FormService) private formService: InMemoryFormService) {
|
||||
constructor(@Inject(FormService) private formService: InMemoryFormService,
|
||||
private automationService: CoreAutomationService) {
|
||||
formService.executeOutcome.subscribe((formOutcomeEvent: FormOutcomeEvent) => {
|
||||
formOutcomeEvent.preventDefault();
|
||||
});
|
||||
@@ -45,7 +45,7 @@ export class FormLoadingComponent implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.formattedData = {};
|
||||
const formDefinitionJSON: any = DemoForm.getSimpleFormDefinition();
|
||||
const formDefinitionJSON: any = this.automationService.forms.getSimpleFormDefinition();
|
||||
this.form = this.formService.parseForm(formDefinitionJSON);
|
||||
}
|
||||
|
||||
|
@@ -16,9 +16,8 @@
|
||||
*/
|
||||
|
||||
import { Component, Inject, OnDestroy, OnInit, ViewEncapsulation } from '@angular/core';
|
||||
import { FormModel, FormFieldModel, FormService, FormOutcomeEvent, NotificationService } from '@alfresco/adf-core';
|
||||
import { FormModel, FormFieldModel, FormService, FormOutcomeEvent, NotificationService, CoreAutomationService } from '@alfresco/adf-core';
|
||||
import { InMemoryFormService } from '../../services/in-memory-form.service';
|
||||
import { DemoForm } from './demo-form';
|
||||
import { Subscription } from 'rxjs';
|
||||
|
||||
@Component({
|
||||
@@ -48,7 +47,8 @@ export class FormComponent implements OnInit, OnDestroy {
|
||||
};
|
||||
|
||||
constructor(@Inject(FormService) private formService: InMemoryFormService,
|
||||
private notificationService: NotificationService) {
|
||||
private notificationService: NotificationService,
|
||||
private automationService: CoreAutomationService) {
|
||||
|
||||
this.subscriptions.push(
|
||||
formService.executeOutcome.subscribe((formOutcomeEvent: FormOutcomeEvent) => {
|
||||
@@ -62,7 +62,7 @@ export class FormComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
const formDefinitionJSON: any = DemoForm.getDefinition();
|
||||
const formDefinitionJSON: any = this.automationService.forms.getFormDefinition();
|
||||
this.formConfig = JSON.stringify(formDefinitionJSON);
|
||||
this.parseForm();
|
||||
}
|
||||
|
Reference in New Issue
Block a user