Skip to content

Commit 4755e5f

Browse files
authored
SCAL-255933 : Warn user if using viz embed with full height (#222)
1 parent b5ff3d8 commit 4755e5f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/embed/liveboard.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import { getAuthPromise } from './base';
2424
import { TsEmbed, V1Embed } from './ts-embed';
2525
import { addPreviewStylesIfNotPresent } from '../utils/global-styles';
2626
import { TriggerPayload, TriggerResponse } from './hostEventClient/contracts';
27+
import { logger } from 'src/utils/logger';
2728

2829
const liveboardHeightWhitelistedRoutes = [
2930
'/embed/viz/',
@@ -429,11 +430,16 @@ export class LiveboardEmbed extends V1Embed {
429430

430431
private defaultHeight = 500;
431432

432-
// eslint-disable-next-line no-useless-constructor
433+
433434
constructor(domSelector: DOMSelector, viewConfig: LiveboardViewConfig) {
434435
viewConfig.embedComponentType = 'LiveboardEmbed';
435436
super(domSelector, viewConfig);
436437
if (this.viewConfig.fullHeight === true) {
438+
if (this.viewConfig.vizId) {
439+
logger.warn('Full height is currently only supported for Liveboard embeds.' +
440+
'Using full height with vizId might lead to unexpected behavior.');
441+
}
442+
437443
this.on(EmbedEvent.RouteChange, this.setIframeHeightForNonEmbedLiveboard);
438444
this.on(EmbedEvent.EmbedHeight, this.updateIFrameHeight);
439445
this.on(EmbedEvent.EmbedIframeCenter, this.embedIframeCenter);

0 commit comments

Comments
 (0)