Use ecmHost in case of startFormEvent (#5318)

This commit is contained in:
Maurizio Vitale 2019-12-10 11:11:05 +00:00 committed by Eugenio Romano
parent acd5d78662
commit a63e487637
2 changed files with 14 additions and 4 deletions

View File

@ -37,16 +37,23 @@ describe('FormCloudComponent', () => {
let visibilityService: WidgetVisibilityService; let visibilityService: WidgetVisibilityService;
let logService: LogService; let logService: LogService;
let formRenderingService: FormRenderingService; let formRenderingService: FormRenderingService;
let appConfigService: AppConfigService;
setupTestBed({
imports: [ProcessServiceCloudTestingModule]
});
beforeEach(() => { beforeEach(() => {
logService = new LogService(null); logService = new LogService(null);
formRenderingService = TestBed.get(FormRenderingService); formRenderingService = TestBed.get(FormRenderingService);
visibilityService = new WidgetVisibilityService(null, logService); visibilityService = new WidgetVisibilityService(null, logService);
spyOn(visibilityService, 'refreshVisibility').and.stub(); spyOn(visibilityService, 'refreshVisibility').and.stub();
appConfigService = TestBed.get(AppConfigService);
spyOn(appConfigService, 'get').and.returnValue([]);
spyOn(formRenderingService, 'setComponentTypeResolver').and.returnValue(true); spyOn(formRenderingService, 'setComponentTypeResolver').and.returnValue(true);
formCloudService = new FormCloudService(null, new AppConfigService(null)); formCloudService = new FormCloudService(null, new AppConfigService(null));
formService = new FormService(null, null, logService); formService = new FormService(null, null, logService);
formComponent = new FormCloudComponent(formCloudService, formService, null, formRenderingService, visibilityService); formComponent = new FormCloudComponent(formCloudService, formService, null, formRenderingService, visibilityService, appConfigService);
}); });

View File

@ -33,7 +33,8 @@ import {
FORM_FIELD_VALIDATORS, FORM_FIELD_VALIDATORS,
FormFieldValidator, FormFieldValidator,
FormValues, FormValues,
FormModel FormModel,
AppConfigService
} from '@alfresco/adf-core'; } from '@alfresco/adf-core';
import { FormCloudService } from '../services/form-cloud.service'; import { FormCloudService } from '../services/form-cloud.service';
import { TaskVariableCloud } from '../models/task-variable-cloud.model'; import { TaskVariableCloud } from '../models/task-variable-cloud.model';
@ -110,7 +111,8 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
protected formService: FormService, protected formService: FormService,
private notificationService: NotificationService, private notificationService: NotificationService,
private formRenderingService: FormRenderingService, private formRenderingService: FormRenderingService,
protected visibilityService: WidgetVisibilityService) { protected visibilityService: WidgetVisibilityService,
private appConfigService: AppConfigService) {
super(); super();
this.formService.formContentClicked this.formService.formContentClicked
@ -203,7 +205,7 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
this.visibilityService.refreshVisibility(<any> parsedForm); this.visibilityService.refreshVisibility(<any> parsedForm);
parsedForm.validateForm(); parsedForm.validateForm();
this.form = parsedForm; this.form = parsedForm;
this.form.contentHost = this.appConfigService.get('ecmHost');
this.onFormLoaded(this.form); this.onFormLoaded(this.form);
resolve(this.form); resolve(this.form);
}, },
@ -231,6 +233,7 @@ export class FormCloudComponent extends FormBaseComponent implements OnChanges,
this.visibilityService.refreshVisibility(<any> parsedForm); this.visibilityService.refreshVisibility(<any> parsedForm);
parsedForm.validateForm(); parsedForm.validateForm();
this.form = parsedForm; this.form = parsedForm;
this.form.contentHost = this.appConfigService.get('ecmHost');
this.onFormLoaded(this.form); this.onFormLoaded(this.form);
}, },
(error) => { (error) => {