diff --git a/claims/claim-utils/claimResultSearchForm.component.ts b/claims/claim-utils/claimResultSearchForm.component.ts index 19a4979a..e4e7d525 100644 --- a/claims/claim-utils/claimResultSearchForm.component.ts +++ b/claims/claim-utils/claimResultSearchForm.component.ts @@ -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; diff --git a/services/servicesUtils/customOptions.class.ts b/services/servicesUtils/customOptions.class.ts index 8671e781..be56ba77 100644 --- a/services/servicesUtils/customOptions.class.ts +++ b/services/servicesUtils/customOptions.class.ts @@ -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;