From 967df6106223ce65917f81107bf6264e00bcf7c3 Mon Sep 17 00:00:00 2001 From: Yauheniya Taleika Date: Wed, 13 Nov 2024 16:56:49 +0100 Subject: [PATCH] correct rounding height of powerBi block --- .../js/qh_core-power-bi-customizer.js | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/modules/quanthub_core/js/qh_core-power-bi-customizer.js b/modules/quanthub_core/js/qh_core-power-bi-customizer.js index 05d80d8..eb00c3b 100644 --- a/modules/quanthub_core/js/qh_core-power-bi-customizer.js +++ b/modules/quanthub_core/js/qh_core-power-bi-customizer.js @@ -28,21 +28,21 @@ function checkTokenAndUpdate($, context) { function updateToken($, context) { console.log('updating embed token'); $.ajax({ - type: "POST", - dataType: "json", - contentType: "application/json", - processData: false, - url: `/powerbi/embedconfig/${context.reportId}`, - data: JSON.stringify({ extraDatasets: context.extraDatasets }), - headers: {'Content-Type': 'application/json'}, - error: (request, error) => { - console.error(error); - context.tokenExpiration = null; - }, - success: async (response) => { - context.tokenExpiration = response.embed_token.expiration; - await context.report.setAccessToken(response.embed_token.token) - } + type: "POST", + dataType: "json", + contentType: "application/json", + processData: false, + url: `/powerbi/embedconfig/${context.reportId}`, + data: JSON.stringify({ extraDatasets: context.extraDatasets }), + headers: { 'Content-Type': 'application/json' }, + error: (request, error) => { + console.error(error); + context.tokenExpiration = null; + }, + success: async (response) => { + context.tokenExpiration = response.embed_token.expiration; + await context.report.setAccessToken(response.embed_token.token) + } }); } @@ -56,8 +56,8 @@ function powerbi_embed_customizeReport($, context, title = '', name = '') { checkTokenAndUpdate($, context); setInterval(() => { - checkTokenAndUpdate($, context); - }, + checkTokenAndUpdate($, context); + }, INTERVAL_TIME ); @@ -73,8 +73,8 @@ function updateReportSize($, context) { .then(([activePage, zoomLevel]) => { const { defaultSize } = activePage; const zoom = zoomLevel === 0 ? 1 : zoomLevel; - const scaledWidth = Math.round(defaultSize.width * zoom); - const scaledHeight = Math.round(defaultSize.height * zoom); + const scaledWidth = Math.ceil(defaultSize.width * zoom); + const scaledHeight = Math.ceil(defaultSize.height * zoom); $(`#${context.selector}`) .css('height', scaledHeight)