From 80a9fdf2a97d5c1321a32c5f3d16f6018bb4a76a Mon Sep 17 00:00:00 2001 From: Jingjing Xie Date: Wed, 23 Jun 2021 10:26:36 +0200 Subject: [PATCH 1/2] fix: enable Export as XLS option on qcs --- src/index.js | 14 +------------- webpack.config.js | 5 +++-- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/src/index.js b/src/index.js index b6e7264..7bb7f8b 100644 --- a/src/index.js +++ b/src/index.js @@ -2,7 +2,6 @@ import definition from "./definition"; import { exportXLS } from "./excel-export"; import { initializeDataCube, initializeDesignList } from "./dataset"; import initializeStore from "./store"; -import qlik from "qlik"; import React from "react"; import ReactDOM from "react-dom"; import Root from "./root.jsx"; @@ -105,18 +104,7 @@ export default { ); return snapshotLayout; }, - async getContextMenu (obj, menu) { - const app = qlik.currApp(this); - const isPersonalResult = await app.global.isPersonalMode(); - // This check is done because the desktop wrapper blocks downloads. - // It also blocks this feature in QCS currently as isPersonalMode returns true - if ( - !this.$scope.layout.allowexportxls || - (isPersonalResult && isPersonalResult.qReturn) - ) { - return menu; - } - + getContextMenu (obj, menu) { if (this.backendApi.model.layout.qMeta.privileges.indexOf('exportdata') !== -1) { menu.addItem({ translation: 'Export as XLS', diff --git a/webpack.config.js b/webpack.config.js index a18a52b..3b11542 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -3,9 +3,10 @@ const packageJSON = require('./package.json'); const path = require('path'); const DIST = path.resolve("./dist"); +// eslint-disable-next-line no-process-env const MODE = process.env.NODE_ENV || 'development'; -const SOURCE_MAP = 'sourec-map'; -const DEVTOOL = (process.env.NODE_ENV === 'development') ? SOURCE_MAP : false; +const SOURCE_MAP = 'source-map'; +const DEVTOOL = MODE === 'development' ? SOURCE_MAP : false; console.log('Webpack mode:', MODE); // eslint-disable-line no-console From 315191ccfa987eaf8032331a6845752ba2c94f65 Mon Sep 17 00:00:00 2001 From: Jingjing Xie Date: Wed, 23 Jun 2021 12:29:23 +0200 Subject: [PATCH 2/2] fix: comment --- src/index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/index.js b/src/index.js index 7bb7f8b..28ae720 100644 --- a/src/index.js +++ b/src/index.js @@ -105,6 +105,10 @@ export default { return snapshotLayout; }, getContextMenu (obj, menu) { + if (!this.$scope.layout.allowexportxls) { + return menu; + } + if (this.backendApi.model.layout.qMeta.privileges.indexOf('exportdata') !== -1) { menu.addItem({ translation: 'Export as XLS',