2019-08-29 02:16:39 +00:00
|
|
|
PluginsAPI.Dashboard.addNewTaskButton(
|
|
|
|
["cloudimport/build/ImportView.js"],
|
|
|
|
function(args, ImportView) {
|
2019-09-07 14:00:26 +00:00
|
|
|
return React.createElement(ImportView, {
|
|
|
|
onNewTaskAdded: args.onNewTaskAdded,
|
|
|
|
projectId: args.projectId,
|
|
|
|
apiURL: "{{ api_url }}",
|
|
|
|
});
|
2019-08-29 02:16:39 +00:00
|
|
|
}
|
|
|
|
);
|
2019-08-31 15:28:29 +00:00
|
|
|
|
|
|
|
PluginsAPI.Dashboard.addTaskActionButton(
|
2019-11-07 16:22:49 +00:00
|
|
|
["cloudimport/build/TaskView.js", "cloudimport/build/TaskView.css"],
|
2019-09-08 21:36:07 +00:00
|
|
|
function(args, TaskView) {
|
|
|
|
var reactElement;
|
2019-09-07 15:31:27 +00:00
|
|
|
$.ajax({
|
2019-09-07 16:56:15 +00:00
|
|
|
url: "{{ api_url }}/projects/" + args.task.project + "/tasks/" + args.task.id + "/checkforurl",
|
2019-09-07 15:31:27 +00:00
|
|
|
dataType: 'json',
|
|
|
|
async: false,
|
|
|
|
success: function(data) {
|
|
|
|
if (data.folder_url) {
|
2019-09-08 21:36:07 +00:00
|
|
|
reactElement = React.createElement(TaskView, {
|
2019-09-07 15:31:27 +00:00
|
|
|
folderUrl: data.folder_url,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
2019-09-08 21:36:07 +00:00
|
|
|
return reactElement;
|
2019-08-31 15:28:29 +00:00
|
|
|
}
|
|
|
|
);
|