Skip to content

Commit

Permalink
fix broken UX on some edge cases following webarchives options (compl…
Browse files Browse the repository at this point in the history
…ements #432)
  • Loading branch information
boogheta committed Dec 20, 2021
1 parent ba88538 commit 7d3f771
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions hyphe_frontend/app/views/prepareCrawls.js
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,11 @@ angular.module('hyphe.preparecrawlsController', [])
var lookupQB = new QueriesBatcher()
$scope.queriesBatches.push(lookupQB)
unlooked.forEach(function(urlObj){
if (!urlObj.webentity.webarchives) {
urlObj.webentity.webarchives = {}
Object.assign(urlObj.webentity.webarchives, $scope.webarchives)
}

lookupQB.addQuery(
api.urlLookup // Query call
,{ // Query settings
Expand Down Expand Up @@ -612,6 +617,11 @@ angular.module('hyphe.preparecrawlsController', [])
}
})

if (!targetWebentity.webarchives) {
targetWebentity.webarchives = {}
Object.assign(targetWebentity.webarchives, sourceWebentity.webarchives)
}

// Add the target webentity object for reload
var maxid = 0
$scope.list.forEach(function(o){
Expand Down Expand Up @@ -641,6 +651,14 @@ angular.module('hyphe.preparecrawlsController', [])
if(we_list.length > 0){
obj_setStatus(obj, 'loaded')
obj.webentity = we_list[0]
if ($scope.cookies) {
obj.webentity.cookiesString = $scope.cookies
}
obj.webentity.webarchives = {}
Object.assign(obj.webentity.webarchives, $scope.webarchives)
if (obj.webarchives) {
Object.assign(obj.webentity.webarchives, obj.webarchives)
}
lazyLookups(obj.webentity.startpages, obj.webentity)
} else {
obj_setStatus(obj, 'error')
Expand Down

0 comments on commit 7d3f771

Please sign in to comment.