Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions ckanext/scheming/assets/js/scheming-suggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -383,12 +383,12 @@ ckan.module('scheming-suggestions', function($) {
if (!status || !self.options.terminalStatuses.includes(status.toUpperCase())) {
self._showProcessingBanner();
}
} else {
self._showProcessingBanner();
}
// If dpp_suggestions doesn't exist, don't show the banner
// (dataset has no resources being processed)
},
error: function() {
self._showProcessingBanner();
// Don't show banner on error - dataset might just be new
}
});
}
Expand All @@ -405,6 +405,14 @@ ckan.module('scheming-suggestions', function($) {
var datasetObject = response.result;
var dppSuggestionsData = datasetObject.dpp_suggestions; // This is the direct JSON object

// If dpp_suggestions doesn't exist at all, this dataset has no resources being processed
if (!dppSuggestionsData) {
console.log("SchemingSuggestions: No dpp_suggestions field found. Dataset has no resources being processed.");
self._showAllButtonsAsNoSuggestion();
globalState.isPolling = false;
return;
}

if (dppSuggestionsData && dppSuggestionsData.package) {
self._processDppButtonSuggestions(dppSuggestionsData.package);
} else {
Expand Down