Skip to content

Commit

Permalink
Support UUID with URL special characters / Fix advanced view.
Browse files Browse the repository at this point in the history
  • Loading branch information
fxprunayre committed Jun 11, 2021
1 parent d1fe50d commit a936d44
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,9 @@
var f = gnSearchLocation.getFormatterPath();
$scope.currentFormatter = '';
if (f != undefined) {
var uuid = gnSearchLocation.getUuid();
$scope.currentFormatter = f.replace(/.*(\/formatters.*)/, '$1');
$scope.loadFormatter(f);
$scope.loadFormatter(f.replace(uuid, encodeURIComponent(uuid)));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
gnMdViewObj.previousRecords.push(md);

if (!gnMdViewObj.usingFormatter) {
$http.post('../api/records/' + md.uuid + '/popularity');
$http.post('../api/records/' + encodeURIComponent(md.uuid) + '/popularity');
}
this.setLocationUuid(md.uuid, formatter);
gnMdViewObj.recordsLoaded = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@
$location.path() == '';
};
this.getFormatter = function() {
var tokens = $location.path().split('/');
if (tokens.length > 2 && tokens[3] === 'formatters') {
return '/formatters/' + $location.url().split('/formatters/')[1];
var tokens = $location.path().split('/formatters/');
if (tokens.length === 2) {
return '/formatters/' + tokens[1];
} else {
return undefined;
}
};
this.getFormatterPath = function() {
var tokens = $location.path().split('/');
if (tokens.length > 2 && tokens[3] === 'formatters') {
var tokens = $location.path().split('/formatters/');
if (tokens.length === 2) {
return '../api/records/' + $location.url().split(/^metadraf|metadata\//)[1];
} else {
return undefined;
Expand Down

0 comments on commit a936d44

Please sign in to comment.