Changeset View
Changeset View
Standalone View
Standalone View
swh/web/assets/src/bundles/vault/vault-create-tasks.js
Show All 27 Lines | .then(data => { | ||||
// it will be asked to cook it again if it is not | // it will be asked to cook it again if it is not | ||||
} else if (data.status === 'done') { | } else if (data.status === 'done') { | ||||
$(`#vault-fetch-${objectType}-modal`).modal('show'); | $(`#vault-fetch-${objectType}-modal`).modal('show'); | ||||
} | } | ||||
}); | }); | ||||
} | } | ||||
function addVaultCookingTask(cookingTask) { | function addVaultCookingTask(cookingTask) { | ||||
const swhidsContext = swh.webapp.getSwhIdsContext(); | |||||
cookingTask.origin = swhidsContext[cookingTask.object_type].context.origin; | |||||
cookingTask.path = swhidsContext[cookingTask.object_type].context.path; | |||||
cookingTask.browse_url = swhidsContext[cookingTask.object_type].swhid_with_context_url; | |||||
if (!cookingTask.browse_url) { | |||||
cookingTask.browse_url = swhidsContext[cookingTask.object_type].swhid_url; | |||||
} | |||||
let vaultCookingTasks = JSON.parse(localStorage.getItem('swh-vault-cooking-tasks')); | let vaultCookingTasks = JSON.parse(localStorage.getItem('swh-vault-cooking-tasks')); | ||||
if (!vaultCookingTasks) { | if (!vaultCookingTasks) { | ||||
vaultCookingTasks = []; | vaultCookingTasks = []; | ||||
} | } | ||||
if (vaultCookingTasks.find(val => { | if (vaultCookingTasks.find(val => { | ||||
return val.object_type === cookingTask.object_type && | return val.object_type === cookingTask.object_type && | ||||
val.object_id === cookingTask.object_id; | val.object_id === cookingTask.object_id; | ||||
}) === undefined) { | }) === undefined) { | ||||
▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines |