Skip to content

Miscellaneous changes that have to wait for YASGUI reintegration #1046

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion src/js/angular/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,9 @@ function homeCtrl($scope, $rootScope, $http, $repositories, $jwtAuth, $licenseSe
function refreshRepositoryInfo() {
if ($scope.getActiveRepository()) {
$scope.getNamespacesPromise = RDF4JRepositoriesRestService.getNamespaces($scope.getActiveRepository())
.success(function () {
.then(function(result) {
checkAutocompleteStatus();
return result;
});
// Getting the repository size should not be related to license
$scope.getActiveRepositorySize();
Expand Down
13 changes: 7 additions & 6 deletions src/js/angular/core/directives.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,28 +325,29 @@ function searchResourceInput($location, toastr, ClassInstanceDetailsService, Aut

$scope.$watch('namespacespromise', function () {
if (angular.isDefined($scope.namespacespromise)) {
$scope.namespacespromise.success(function (data) {
element.namespaces = data.results.bindings.map(function (e) {
$scope.namespacespromise.then(function({data}) {
element.namespaces = data.results.bindings.map(function(e) {
return {
prefix: e.prefix.value,
uri: e.namespace.value
};
});
}).error(function (data) {
}).catch(function(data) {
const msg = getError(data);
toastr.error(msg, $translate.instant('error.getting.namespaces.for.repo'));
});
}
});

$scope.$watch('autocompletepromisestatus', function () {
$scope.$watch('autocompletepromisestatus', function() {
if (!$repositories.isActiveRepoFedXType() && angular.isDefined($scope.autocompletepromisestatus)) {
$scope.autocompletepromisestatus.success(function (response) {
$scope.autocompletepromisestatus.then(function(response) {
element.autoCompleteStatus = !!response;
if ($scope.searchInput !== '') {
$scope.onChange();
}
}).error(function () {
return response;
}).catch(function () {
toastr.error($translate.instant('explore.error.autocomplete'));
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ function rdfResourceSearchDirective($rootScope, $timeout,

function refreshRepositoryInfo() {
if ($scope.getActiveRepository()) {
$scope.getNamespacesPromise = RDF4JRepositoriesRestService.getNamespaces(
$scope.getActiveRepository())
.success(function () {
$scope.getNamespacesPromise = RDF4JRepositoriesRestService.getNamespaces($scope.getActiveRepository())
.then(function (result) {
checkAutocompleteStatus();
return result;
});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,8 @@ function GraphsVisualizationsCtrl($scope, $rootScope, $repositories, $licenseSer

// Inits namespaces for repo
$scope.getNamespacesPromise = RDF4JRepositoriesRestService.getNamespaces($scope.getActiveRepository())
.success(function (data) {
.then(function (result) {
const {data} = result;
const nss = _.map(data.results.bindings, function (o) {
return {"uri": o.namespace.value, "prefix": o.prefix.value};
});
Expand All @@ -1133,7 +1134,8 @@ function GraphsVisualizationsCtrl($scope, $rootScope, $repositories, $licenseSer
});

checkAutocompleteStatus();
}).error(function (data) {
return result;
}).catch(function (data) {
toastr.error(getError(data), $translate.instant('graphexplore.error.view.will.not.work'));
});
}
Expand Down
1 change: 1 addition & 0 deletions src/js/angular/repositories/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ function LocationsAndRepositoriesCtrl($scope, $rootScope, $uibModal, toastr, $re
return $repositories.getLocations(getLocationsAbortRequestPromise)
.then((locations) => {
$scope.locations = locations;
return locations;
})
.finally(() => $scope.loader = false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ function SimilarityCtrl($scope, $interval, toastr, $repositories, $licenseServic
// Don't try to get namespaces for ontop or fedx repository
if ($scope.getActiveRepository() && !$scope.isActiveRepoOntopType() && !$scope.isActiveRepoFedXType()) {
$scope.getNamespacesPromise = RDF4JRepositoriesRestService.getNamespaces($scope.getActiveRepository())
.success(function (data) {
.then(function (result) {
const {data} = result;
checkAutocompleteStatus();
$scope.usedPrefixes = {};
data.results.bindings.forEach(function (e) {
Expand All @@ -120,7 +121,8 @@ function SimilarityCtrl($scope, $interval, toastr, $repositories, $licenseServic
hideHeader: true,
pluginsOptions: YasrUtils.getYasrConfiguration()
});
}).error(function (data) {
return result;
}).catch(function (data) {
toastr.error(getError(data), $translate.instant('get.namespaces.error.msg'));
});
}
Expand Down