@oat-sa/tao-core-ui 3.9.1 → 3.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -449,9 +449,16 @@ define(['jquery', 'lodash', 'i18n', 'core/eventifier', 'core/polling', 'core/dat
|
|
|
449
449
|
if (!config.url || !config.url.download) {
|
|
450
450
|
throw new TypeError('config.url.download is not configured while download() is being called');
|
|
451
451
|
}
|
|
452
|
-
return this.getCached(taskId).then(function (
|
|
453
|
-
let
|
|
454
|
-
|
|
452
|
+
return this.getCached(taskId).then(function () {
|
|
453
|
+
let taskData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
454
|
+
const {
|
|
455
|
+
redirectUrl,
|
|
456
|
+
category
|
|
457
|
+
} = taskData;
|
|
458
|
+
|
|
459
|
+
// if the task is an update task, we should not use redirectUrl for download
|
|
460
|
+
// it only uses for DOCX file download (export category)
|
|
461
|
+
if (redirectUrl && category !== 'update') {
|
|
455
462
|
return new Promise(function (resolve) {
|
|
456
463
|
$.fileDownload(redirectUrl, {
|
|
457
464
|
httpMethod: 'GET',
|
package/package.json
CHANGED
|
@@ -496,10 +496,12 @@ export default function taskQueueModel(config) {
|
|
|
496
496
|
throw new TypeError('config.url.download is not configured while download() is being called');
|
|
497
497
|
}
|
|
498
498
|
|
|
499
|
-
return this.getCached(taskId).then(function (taskData) {
|
|
500
|
-
|
|
499
|
+
return this.getCached(taskId).then(function (taskData = {}) {
|
|
500
|
+
const { redirectUrl, category } = taskData;
|
|
501
501
|
|
|
502
|
-
if
|
|
502
|
+
// if the task is an update task, we should not use redirectUrl for download
|
|
503
|
+
// it only uses for DOCX file download (export category)
|
|
504
|
+
if (redirectUrl && category !== 'update') {
|
|
503
505
|
return new Promise(function (resolve) {
|
|
504
506
|
$.fileDownload(redirectUrl, {
|
|
505
507
|
httpMethod: 'GET',
|