Skip to content

Commit

Permalink
hot fixes for QA
Browse files Browse the repository at this point in the history
  • Loading branch information
zJaaal committed Jan 10, 2024
1 parent 1587df5 commit 70b072f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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%"></iframe>
<dot-ema-contentlet-tools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ dot-edit-ema-toolbar {
margin: 0 auto;

iframe {
outline: solid 1px $color-palette-gray-300;
border: solid 1px $color-palette-gray-300;
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1247,10 +1247,7 @@ describe('EditEmaEditorComponent', () => {

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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -115,7 +115,7 @@ export class EditEmaEditorComponent implements OnInit, OnDestroy {
readonly editorState$ = this.store.editorState$;
readonly destroy$ = new Subject<boolean>();

readonly host = HOST;
readonly host = '*';

private savePayload: ActionPayload;
private draggedPayload: DraggedPalettePayload;
Expand Down Expand Up @@ -516,7 +516,7 @@ export class EditEmaEditorComponent implements OnInit, OnDestroy {
* @memberof DotEmaComponent
*/
private handlePostMessage({
origin = this.host,
origin: _origin = this.host,
data
}: {
origin: string;
Expand All @@ -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 (<Record<CUSTOMER_ACTIONS, () => void>>{
[CUSTOMER_ACTIONS.SET_URL]: () => {
const payload = <SetUrlPayload>data.payload;
Expand Down Expand Up @@ -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];
}

/**
Expand Down

0 comments on commit 70b072f

Please sign in to comment.