Compare commits

...

3 Commits

Author SHA1 Message Date
Jingjing Xie
ed50a8f3d3 Merge pull request #93 from qlik-oss/fix/QB-5202-option-in-QCS
fix: Export as XLS in QCS
2021-07-07 16:42:47 +02:00
Jingjing Xie
cca315efbb fix: check for desktop 2021-07-07 14:15:24 +02:00
Jingjing Xie
c888dd9fe4 fix: Export as XLS in QCS 2021-07-06 10:24:00 +02:00
2 changed files with 16 additions and 5 deletions

View File

@@ -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;

View File

@@ -12,7 +12,7 @@ if (!window._babelPolyfill) {
require("@babel/polyfill"); // eslint-disable-line global-require
}
export default {
export default ({ flags }) => ({
design: {
dimensions: {
max: 1,
@@ -104,12 +104,22 @@ export default {
);
return snapshotLayout;
},
getContextMenu (obj, menu) {
async getContextMenu (obj, menu) {
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',
@@ -127,4 +137,4 @@ export default {
return menu;
},
version: 1.0
};
});