From 70b072f770890e21198d487a39ca975ad96b07a3 Mon Sep 17 00:00:00 2001 From: Jalinson Diaz Date: Wed, 10 Jan 2024 15:21:47 -0300 Subject: [PATCH] hot fixes for QA --- .../lib/edit-ema-editor/edit-ema-editor.component.html | 4 +++- .../lib/edit-ema-editor/edit-ema-editor.component.scss | 2 +- .../edit-ema-editor/edit-ema-editor.component.spec.ts | 5 +---- .../lib/edit-ema-editor/edit-ema-editor.component.ts | 10 ++++------ 4 files changed, 9 insertions(+), 12 deletions(-) diff --git a/core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/edit-ema-editor.component.html b/core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/edit-ema-editor.component.html index 8611c62da0f4..d771d0e2d011 100644 --- a/core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/edit-ema-editor.component.html +++ b/core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/edit-ema-editor.component.html @@ -71,8 +71,10 @@ #iframe [src]="es.iframeURL | safeUrl" [title]="host" + [ngStyle]="{ + pointerEvents: this.rows.length ? 'none' : 'auto' + }" data-testId="iframe" - style="border: none" width="100%" height="100%"> { spectator.detectComponentChanges(); - expect(postMessageSpy).toHaveBeenCalledWith( - 'ema-request-bounds', - 'http://localhost:3000' - ); + expect(postMessageSpy).toHaveBeenCalledWith('ema-request-bounds', '*'); }); it('should show drop zone on iframe message', () => { diff --git a/core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/edit-ema-editor.component.ts b/core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/edit-ema-editor.component.ts index 0675f4c83697..188149b93303 100644 --- a/core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/edit-ema-editor.component.ts +++ b/core-web/libs/portlets/edit-ema/portlet/src/lib/edit-ema-editor/edit-ema-editor.component.ts @@ -42,7 +42,7 @@ import { } from './components/ema-page-dropzone/ema-page-dropzone.component'; import { EditEmaStore } from '../dot-ema-shell/store/dot-ema.store'; -import { DEFAULT_PERSONA, HOST, WINDOW } from '../shared/consts'; +import { DEFAULT_PERSONA, WINDOW } from '../shared/consts'; import { NG_CUSTOM_EVENTS, NOTIFY_CUSTOMER } from '../shared/enums'; import { ActionPayload, SetUrlPayload } from '../shared/models'; import { deleteContentletFromContainer, insertContentletInContainer } from '../utils'; @@ -115,7 +115,7 @@ export class EditEmaEditorComponent implements OnInit, OnDestroy { readonly editorState$ = this.store.editorState$; readonly destroy$ = new Subject(); - readonly host = HOST; + readonly host = '*'; private savePayload: ActionPayload; private draggedPayload: DraggedPalettePayload; @@ -516,7 +516,7 @@ export class EditEmaEditorComponent implements OnInit, OnDestroy { * @memberof DotEmaComponent */ private handlePostMessage({ - origin = this.host, + origin: _origin = this.host, data }: { origin: string; @@ -525,8 +525,6 @@ export class EditEmaEditorComponent implements OnInit, OnDestroy { payload: ActionPayload | SetUrlPayload | Row[] | ContentletArea; }; }): () => void { - const action = origin !== this.host ? CUSTOMER_ACTIONS.NOOP : data.action; - return ( void>>{ [CUSTOMER_ACTIONS.SET_URL]: () => { const payload = data.payload; @@ -557,7 +555,7 @@ export class EditEmaEditorComponent implements OnInit, OnDestroy { [CUSTOMER_ACTIONS.NOOP]: () => { /* Do Nothing because is not the origin we are expecting */ } - })[action]; + })[data.action]; } /**