Skip to content

Commit

Permalink
Editor / Associated resource / DOI search. (#8363)
Browse files Browse the repository at this point in the history
* Add tooltip with API query to inform user which fields are used for the
search.
* Ignore https://doi.org prefix as most of the time user search using
  the DOI URL but the API https://support.datacite.org/docs/api-queries
search is only based on prefix/id
  • Loading branch information
fxprunayre committed Sep 13, 2024
1 parent 3f3a196 commit 796385c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@
linksAndRelatedPromises.push(
$http.get(
apiPrefix +
"/related?type=" +
relatedTypes.join("&type=") +
(!isApproved ? "&approved=false" : ""),
"/related?type=" +
relatedTypes.join("&type=") +
(!isApproved ? "&approved=false" : ""),
{
headers: {
Accept: "application/json"
Expand All @@ -281,9 +281,9 @@
linksAndRelatedPromises.push(
$http.get(
apiPrefix +
"/associated?type=" +
associatedTypes.join(",") +
(!isApproved ? "&approved=false" : ""),
"/associated?type=" +
associatedTypes.join(",") +
(!isApproved ? "&approved=false" : ""),
{
headers: {
Accept: "application/json"
Expand Down Expand Up @@ -610,8 +610,8 @@
scopedName: params.remote
? ""
: params.name === qParams.name
? ""
: qParams.name,
? ""
: qParams.name,
uuidref: qParams.uuidDS,
uuid: qParams.uuidSrv,
url: qParams.remote ? qParams.url : "",
Expand Down Expand Up @@ -932,7 +932,13 @@
function ($http) {
return {
search: function (url, prefix, query) {
return $http.get(url + "?prefix=" + prefix + "&query=" + query);
return $http.get(
url +
"?prefix=" +
prefix +
"&query=" +
query.replaceAll("https://doi.org/", "")
);
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
data-ng-model-options="{ debounce: 1000 }"
data-ng-readonly="isSearching"
type="text"
title="{{'selectDOIResource' | translate}} - {{doiQueryPattern}}"
autocomplete="off"
placeholder="{{'anyPlaceHolder' | translate}}"
aria-label="{{'anyPlaceHolder' | translate}}"
Expand Down

0 comments on commit 796385c

Please sign in to comment.