Skip to content

Commit e85c3b3

Browse files
author
potterve
committed
Fixes which prevent configBase (default code specified config values) from overriding those specified in the json configuration file loaded via the deployed website. Remove "shouldLoadIframeMinizmied" from configBase. Validate existence of shouldLoadIframeMinimized in configuration and set to default to "true" if not configured. Re-ordered when a a default "iframeSrcPath" is merged to configuration so as to not override that specified in the web based json configuration file.
1 parent 731bb59 commit e85c3b3

File tree

4 files changed

+15
-4
lines changed

4 files changed

+15
-4
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
out/
22
node_modules/
3+
.idea/

src/lex-web-ui-loader/js/defaults/lex-web-ui.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export const configBase = {
2727
iframe: {
2828
iframeOrigin: '',
2929
iframeSrcPath: '',
30-
shouldLoadIframeMinimized: true,
3130
},
3231
};
3332

src/lex-web-ui-loader/js/index.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,16 @@ export class IframeLoader extends Loader {
156156
}
157157

158158
load(configParam = {}) {
159-
this.config.iframe = this.config.iframe || {};
160-
this.config.iframe.iframeSrcPath = this.mergeSrcPath(configParam);
161-
162159
return super.load(configParam)
163160
.then(() => {
164161
// assign API to this object to make calls more succint
165162
this.api = this.compLoader.api;
163+
// make sure iframe and iframeSrcPath are set to values if not
164+
// configured by standard mechanisms. At this point, default
165+
// values from ./defaults/loader.js will be used.
166+
this.config.iframe = this.config.iframe || {};
167+
this.config.iframe.iframeSrcPath = this.config.iframe.iframeSrcPath ||
168+
this.mergeSrcPath(configParam);
166169
});
167170
}
168171

src/lex-web-ui-loader/js/lib/iframe-component-loader.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ export class IframeComponentLoader {
6161
this.config.iframe.iframeOrigin =
6262
this.config.parentOrigin || window.location.origin;
6363
}
64+
if (iframeConfig.shouldLoadIframeMinimized === undefined) {
65+
this.config.iframe.shouldLoadIframeMinimized = true;
66+
}
6467
// assign parentOrigin if not found in config
6568
if (!(this.config.parentOrigin)) {
6669
this.config.parentOrigin =
@@ -102,6 +105,11 @@ export class IframeComponentLoader {
102105
console.error('missing parentOrigin config field');
103106
return false;
104107
}
108+
if (!('shouldLoadIframeMinimized' in iframeConfig)) {
109+
console.error('missing shouldLoadIframeMinimized config field');
110+
return false;
111+
}
112+
105113
return true;
106114
}
107115

0 commit comments

Comments
 (0)