[Library|Trunk]
- revome extra headers in CustomOptions (services fail with it) -Claims: set properly the type of openaire results in claims search results git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59237 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
122437e58c
commit
be7db77508
|
@ -313,7 +313,7 @@ export class ClaimResultSearchFormComponent {
|
|||
if(data[2] && data[2].length > 0){
|
||||
this.openaireResultsfilters = this.checkSelectedFilters(data[2], this.openaireResultsPrevFilters)
|
||||
}
|
||||
this.openaireResults = ClaimResultSearchFormComponent.openaire2ClaimResults(data[1], type, this.properties);
|
||||
this.openaireResults = ClaimResultSearchFormComponent.openaire2ClaimResults(data[1], this.properties);
|
||||
this.openaireResultsStatus = this.errorCodes.DONE;
|
||||
if (this.openaireResultsNum == 0) {
|
||||
this.openaireResultsStatus = this.errorCodes.NONE;
|
||||
|
@ -630,7 +630,7 @@ export class ClaimResultSearchFormComponent {
|
|||
|
||||
}
|
||||
|
||||
public static openaire2ClaimResults(data, type, properties): ClaimEntity[] {
|
||||
public static openaire2ClaimResults(data, properties): ClaimEntity[] {
|
||||
const claimResults = [];
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
let item = data[i];
|
||||
|
@ -642,13 +642,13 @@ export class ClaimResultSearchFormComponent {
|
|||
entity.id = item.id;
|
||||
entity.title = item.title.name;
|
||||
let prefixUrl = "";
|
||||
if(type == "publication"){
|
||||
if(item.entityType == "publication"){
|
||||
prefixUrl = properties.searchLinkToPublication;
|
||||
}else if(type == "dataset"){
|
||||
}else if(item.entityType == "dataset"){
|
||||
prefixUrl = properties.searchLinkToDataset;
|
||||
}else if(type == "software"){
|
||||
}else if(item.entityType == "software"){
|
||||
prefixUrl = properties.searchLinkToSoftwareLanding;
|
||||
}else if(type == "other"){
|
||||
}else if(item.entityType == "other"){
|
||||
prefixUrl = properties.searchLinkToOrp;
|
||||
}
|
||||
entity.result.url = prefixUrl + entity.id;
|
||||
|
@ -656,7 +656,7 @@ export class ClaimResultSearchFormComponent {
|
|||
entity.result.date = (item.year && item.year != "") ? item.year : null;
|
||||
entity.result.accessRights = (item.title && item.title.accessMode) ? String(item.title.accessMode) : "";
|
||||
|
||||
entity.type = type;
|
||||
entity.type = item.entityType;
|
||||
entity.result.embargoEndDate = (item.embargoEndDate && item.embargoEndDate != "") ? item.embargoEndDate : entity.result.embargoEndDate;
|
||||
if (item.publisher && item.publisher.length > 0) {
|
||||
entity.result.publisher = item.publisher;
|
||||
|
|
|
@ -16,8 +16,7 @@ export class CustomOptions {
|
|||
return {
|
||||
headers: new HttpHeaders({
|
||||
'Content-Type': 'application/json',
|
||||
'X-XSRF-TOKEN': COOKIE.getCookie(COOKIE.cookieName_id)?COOKIE.getCookie(COOKIE.cookieName_id):'',
|
||||
'Access-Control-Allow-Origin': '*'
|
||||
'X-XSRF-TOKEN': COOKIE.getCookie(COOKIE.cookieName_id)?COOKIE.getCookie(COOKIE.cookieName_id):''
|
||||
}), withCredentials: true
|
||||
};
|
||||
}
|
||||
|
@ -25,8 +24,7 @@ export class CustomOptions {
|
|||
public static getAuthOptions():any {
|
||||
const httpOptions = {
|
||||
headers: new HttpHeaders({
|
||||
'X-XSRF-TOKEN': (COOKIE.getCookie(COOKIE.cookieName_id))?COOKIE.getCookie(COOKIE.cookieName_id):'',
|
||||
'Access-Control-Allow-Origin': '*'
|
||||
'X-XSRF-TOKEN': (COOKIE.getCookie(COOKIE.cookieName_id))?COOKIE.getCookie(COOKIE.cookieName_id):''
|
||||
}), withCredentials: true
|
||||
};
|
||||
return httpOptions;
|
||||
|
|
Loading…
Reference in New Issue