mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
AAE-1938 - added first stack of visibility tests for form (#5489)
* AAE-1938 - added first stack of visibility tests for form * AAE-1938 - fixed unit test after form service changes * AAE-1938 - rebased with last development * AAE-1938 - fixed failing e2e * AAE-1938 - fixed mock definition to match updated service behaviour * Fixed failing e2e * AAE-1938 - try to fix cancel uploads
This commit is contained in:
@@ -70,10 +70,21 @@ export class InMemoryFormService extends FormService {
|
||||
|
||||
parseForm(json: any, data?: FormValues, readOnly: boolean = false): FormModel {
|
||||
if (json) {
|
||||
const form = new FormModel(json, data, readOnly, this);
|
||||
const flattenForm = {
|
||||
...json.formRepresentation,
|
||||
...json.formRepresentation.formDefinition
|
||||
};
|
||||
delete flattenForm.formDefinition;
|
||||
|
||||
const formValues: FormValues = {};
|
||||
(data || []).forEach(variable => {
|
||||
formValues[variable.name] = variable.value;
|
||||
});
|
||||
|
||||
const form = new FormModel(flattenForm, formValues, readOnly, this);
|
||||
if (!json.fields) {
|
||||
form.outcomes = [
|
||||
new FormOutcomeModel(form, {
|
||||
new FormOutcomeModel(<any> form, {
|
||||
id: '$save',
|
||||
name: FormOutcomeModel.SAVE_ACTION,
|
||||
isSystem: true
|
||||
|
Reference in New Issue
Block a user