Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ed50a8f3d3 | ||
|
|
cca315efbb | ||
|
|
c888dd9fe4 | ||
|
|
467948a46c | ||
|
|
315191ccfa | ||
|
|
80a9fdf2a9 |
@@ -24,7 +24,8 @@ gulp.task('qext', function () {
|
||||
repository: pkg.repository,
|
||||
dependencies: {
|
||||
'qlik-sense': '>=5.5.x'
|
||||
}
|
||||
},
|
||||
__next: true
|
||||
};
|
||||
if (pkg.contributors) {
|
||||
qext.contributors = pkg.contributors;
|
||||
|
||||
26
src/index.js
26
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";
|
||||
@@ -13,7 +12,7 @@ if (!window._babelPolyfill) {
|
||||
require("@babel/polyfill"); // eslint-disable-line global-require
|
||||
}
|
||||
|
||||
export default {
|
||||
export default ({ flags }) => ({
|
||||
design: {
|
||||
dimensions: {
|
||||
max: 1,
|
||||
@@ -106,18 +105,21 @@ 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)
|
||||
) {
|
||||
if (!this.$scope.layout.allowexportxls) {
|
||||
return menu;
|
||||
}
|
||||
|
||||
if (this.backendApi.model.layout.qMeta.privileges.indexOf('exportdata') !== -1) {
|
||||
const app = this.backendApi.model.app;
|
||||
const isPersonalResult = await app.global.isPersonalMode();
|
||||
|
||||
// Export as XLS option is removed from desktop because the desktop wrapper blocks downloads.
|
||||
// Enabled for windows and QCS
|
||||
// isPersonalMode returns true for both desktop and QCS
|
||||
// By checking both if has download dialog and if is QCS can enable Export as XLS option on QCS
|
||||
if (
|
||||
(this.backendApi.model.layout.qMeta.privileges.includes('exportdata') && !isPersonalResult) ||
|
||||
(flags.isEnabled('DOWNLOAD_USE_REPORTING') && isPersonalResult)
|
||||
) {
|
||||
menu.addItem({
|
||||
translation: 'Export as XLS',
|
||||
tid: 'export-excel',
|
||||
@@ -135,4 +137,4 @@ export default {
|
||||
return menu;
|
||||
},
|
||||
version: 1.0
|
||||
};
|
||||
});
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user