[AAE-15522] Fix - Dropdown variable error messages are displayed at modeling part 2 (#8734)

* Revert preview flag changes

* add get preview state method to form cloud service
This commit is contained in:
Tomasz Gnyp
2023-07-04 14:39:02 +02:00
committed by GitHub
parent b50b701da8
commit 0ffbf9fbe2
9 changed files with 9 additions and 80 deletions

View File

@@ -103,29 +103,6 @@ describe('FormFieldComponent', () => {
});
});
it('should set field preview state', () => {
const field = new FormFieldModel(form, {
type: FormFieldTypes.DROPDOWN,
id: 'FAKE-DROPDOWN-WIDGET'
});
component.field = field;
component.preview = true;
fixture.detectChanges();
expect(component.field.preview).toBe(true);
});
it('should field preview state be false as default', () => {
const field = new FormFieldModel(form, {
type: FormFieldTypes.DROPDOWN,
id: 'FAKE-DROPDOWN-WIDGET'
});
component.field = field;
fixture.detectChanges();
expect(component.field.preview).toBe(false);
});
it('should hide the field when it is not visible', (done) => {
const field = new FormFieldModel(form, {
type: FormFieldTypes.TEXT,

View File

@@ -63,9 +63,6 @@ export class FormFieldComponent implements OnInit, OnDestroy {
@Input()
field: FormFieldModel = null;
@Input()
preview: boolean = false;
componentRef: ComponentRef<any>;
focus: boolean = false;
@@ -83,7 +80,6 @@ export class FormFieldComponent implements OnInit, OnDestroy {
}
const originalField = this.getField();
if (originalField) {
this.setFieldPreviewState();
const customTemplate = this.field.form.customFieldTemplates[originalField.type];
if (customTemplate && this.hasController(originalField.type)) {
const factory = this.getComponentFactorySync(originalField.type, customTemplate);
@@ -158,10 +154,6 @@ export class FormFieldComponent implements OnInit, OnDestroy {
return module.componentFactories.find((x) => x.componentType === decoratedCmp);
}
private setFieldPreviewState(): void {
this.field.preview = this.preview;
}
focusToggle() {
setTimeout(() => {
this.focus = !this.focus;

View File

@@ -83,7 +83,6 @@ export class FormFieldModel extends FormWidgetModel {
groupsRestriction: string[];
leftLabels: boolean = false;
variableConfig: VariableConfig;
preview: boolean = false;
// container model members
numberOfColumns: number = 1;

View File

@@ -90,7 +90,6 @@ export class FormModel implements ProcessFormModel {
isValid = true;
processVariables: ProcessVariableModel[] = [];
variables: FormVariableModel[] = [];
preview: boolean = false;
constructor(
json?: any,