|
|
@@ -23,7 +23,7 @@ function wbParseWorkflowInputs(workflowDefinition, userInputs, errors) { |
|
|
|
|
|
|
|
function ensureSubProject(arvHost, arvToken, projectUuid) {
|
|
|
|
const filters = [
|
|
|
|
[ 'type', '=', 'project' ],
|
|
|
|
[ 'group_class', '=', 'project' ],
|
|
|
|
[ 'owner_uuid', '=', projectUuid ],
|
|
|
|
[ 'properties.type', '=', 'daily_process_subproject_container' ]
|
|
|
|
];
|
|
|
@@ -36,13 +36,14 @@ function ensureSubProject(arvHost, arvToken, projectUuid) { |
|
|
|
let prom_1 = new Promise(accept => accept());
|
|
|
|
prom_1 = prom_1.then(() => makeArvadosRequest(arvHost, arvToken,
|
|
|
|
'/arvados/v1/groups', { method: 'POST',
|
|
|
|
data: { owner_uuid: projectUuid,
|
|
|
|
data: JSON.stringify({ owner_uuid: projectUuid,
|
|
|
|
group_class: 'project',
|
|
|
|
name: 'Container for daily sub-projects for processes',
|
|
|
|
properties: { type: 'daily_process_subproject_container' } } }));
|
|
|
|
properties: { type: 'daily_process_subproject_container' } }) }));
|
|
|
|
prom_1 = prom_1.then(xhr_1 => xhr_1.response.uuid);
|
|
|
|
return prom_1;
|
|
|
|
}
|
|
|
|
return xhr.items[0].uuid;
|
|
|
|
return xhr.response.items[0].uuid;
|
|
|
|
});
|
|
|
|
|
|
|
|
let date = new Date();
|
|
|
@@ -50,29 +51,35 @@ function ensureSubProject(arvHost, arvToken, projectUuid) { |
|
|
|
('00' + (date.getMonth() + 1)).slice(-2) + '-' +
|
|
|
|
('00' + date.getDate()).slice(-2);
|
|
|
|
|
|
|
|
prom = prom.then(containerUuid => {
|
|
|
|
let containerUuid;
|
|
|
|
|
|
|
|
prom = prom.then(uuid => {
|
|
|
|
containerUuid = uuid;
|
|
|
|
|
|
|
|
const filters_1 = [
|
|
|
|
[ 'type', '=', 'project'],
|
|
|
|
[ 'group_class', '=', 'project'],
|
|
|
|
[ 'owner_uuid', '=', containerUuid ],
|
|
|
|
[ 'properties.type', '=', 'daily_process_subproject' ],
|
|
|
|
[ 'properties.date', '=', date ]
|
|
|
|
];
|
|
|
|
|
|
|
|
return makeArvadosRequest(arvHost, arvToken,
|
|
|
|
'/arvados/v1/groups?filters=' + encodeURIComponent(JSON.stringify(filters_1)));
|
|
|
|
});
|
|
|
|
|
|
|
|
prom = prom.then(xhr => {
|
|
|
|
if (xhr.reponse.items.length === 0) {
|
|
|
|
if (xhr.response.items.length === 0) {
|
|
|
|
let prom_1 = new Promise(accept => accept());
|
|
|
|
prom_1 = prom_1.then(() => makeArvadosRequest(arvHost, arvToken,
|
|
|
|
'/arvados/v1/groups', { method: 'POST',
|
|
|
|
data: { owner_uuid: containerUuid,
|
|
|
|
data: JSON.stringify({ owner_uuid: containerUuid,
|
|
|
|
group_class: 'project',
|
|
|
|
name: 'Daily processes sub-project for ' + date,
|
|
|
|
properties: { type: 'daily_process_subproject', date } } }));
|
|
|
|
properties: { type: 'daily_process_subproject', date } }) }));
|
|
|
|
prom_1 = prom_1.then(xhr => xhr.response.uuid);
|
|
|
|
return prom_1;
|
|
|
|
}
|
|
|
|
return xhr.items[0].uuid;
|
|
|
|
return xhr.response.items[0].uuid;
|
|
|
|
});
|
|
|
|
return prom;
|
|
|
|
}
|
|
|
|