Skip to content

Commit

Permalink
Merge branch 'release-3.2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
oat-github-bot committed Mar 1, 2024
2 parents bd10e0e + 20603e3 commit aea29b2
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 14 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oat-sa/tao-core-ui",
"version": "3.1.1",
"version": "3.2.0",
"displayName": "TAO Core UI",
"description": "UI libraries of TAO",
"scripts": {
Expand Down
45 changes: 34 additions & 11 deletions src/taskQueue/taskQueueModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -496,17 +496,40 @@ export default function taskQueueModel(config) {
throw new TypeError('config.url.download is not configured while download() is being called');
}

return new Promise(function(resolve, reject) {
$.fileDownload(config.url.download, {
httpMethod: 'POST',
data: { taskId: taskId },
successCallback: function(result) {
resolve(result);
},
failCallback: function(err) {
reject(err);
}
});
return this.getCached(taskId).then(function (taskData) {
let redirectUrl = (taskData || {}).redirectUrl;

if (redirectUrl) {
return new Promise(function (resolve) {
$.fileDownload(redirectUrl, {
httpMethod: 'GET',
data: {},
successCallback: function (result) {
resolve(result);
},
failCallback: function (err) {
resolve(err);
// Security issue : Failed to read a named property 'document' from 'Window':
// Blocked a frame with origin "https://[domain]" from accessing a cross-origin frame.
}
});
});
} else {
return new Promise(function (resolve, reject) {
$.fileDownload(config.url.download, {
httpMethod: 'POST',
data: {
taskId: taskId
},
successCallback: function (result) {
resolve(result);
},
failCallback: function (err) {
reject(err);
}
});
});
}
});
},

Expand Down

0 comments on commit aea29b2

Please sign in to comment.