Merge remote-tracking branch 'origin/develop' into orcid-openaireId-claim

This commit is contained in:
Konstantina Galouni 2024-09-19 15:57:51 +03:00
commit fa7d878172
5 changed files with 24 additions and 17 deletions

View File

@ -150,7 +150,7 @@ export class BulkClaimComponent {
}
this.loading.open();
this.makeFileRequest(this.properties.utilsService + '/upload', [], this.filesToUpload).then((result) => {
this.makeFileRequest(this.properties.utilsService + '/upload', [], this.filesToUpload).then(async (result) => {
const rows = (result as any).split('\n'); // I have used space, you can use any thing.
this.exceedsLimit = false;
let invalid_rows = 0;
@ -179,6 +179,7 @@ export class BulkClaimComponent {
this.allIds.push(id);
if (currentLength < this.basketLimit){
currentLength++;
await new Promise((resolve) => setTimeout(resolve, 100));
this.fetchResult(id, accessMode, Dates.getDateToString(embargoDate), i + 1);
}else{
this.exceedsLimit = true;

View File

@ -154,7 +154,7 @@
[tabNumber]="resultLandingInfo.relatedResults.length">
</my-tab>
<my-tab *ngIf="resultLandingInfo.relatedServices?.length > 0"
[tabTitle]="openaireEntities.DATASOURCES" [tabId]="'dataProviders'"
[tabTitle]="properties.adminToolsPortalType == 'eosc' ? openaireEntities.SERVICES : openaireEntities.DATASOURCES" [tabId]="'dataProviders'"
[tabNumber]="resultLandingInfo.relatedServices.length">
</my-tab>
<my-tab *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0"
@ -188,7 +188,7 @@
</ng-container>
<div *ngIf="resultLandingInfo.relatedServices?.length > 0"
id="dataProviders" class="landing-section">
<ng-container *ngTemplateOutlet="relation_in_tab; context: { related: filteredRelatedServices, props: relatedServices, type: 'datasource', header: ''}"></ng-container>
<ng-container *ngTemplateOutlet="relation_in_tab; context: { related: filteredRelatedServices, props: relatedServices, type: properties.adminToolsPortalType == 'eosc' ? 'service' : 'datasource', header: ''}"></ng-container>
</div>
<ng-container *ngIf="resultLandingInfo.bioentities && bioentitiesNum> 0">
<div id="bioentities" class="landing-section">
@ -467,8 +467,8 @@
</ng-container>
<ng-container *ngIf="resultLandingInfo.relatedServices?.length > 0">
<div class="clickable uk-flex uk-flex-middle uk-flex-between"
(click)="openFsModal(servicesFsModal, openaireEntities.DATASOURCES); onSelectActiveTab('dataProviders')">
<span>{{openaireEntities.DATASOURCES}}</span>
(click)="openFsModal(servicesFsModal, properties.adminToolsPortalType == 'eosc' ? openaireEntities.SERVICES : openaireEntities.DATASOURCES); onSelectActiveTab('dataProviders')">
<span>{{properties.adminToolsPortalType == 'eosc' ? openaireEntities.SERVICES : openaireEntities.DATASOURCES}}</span>
<icon name="chevron_right" [ratio]="1.5" [flex]="true"></icon>
</div>
<hr>
@ -662,7 +662,7 @@
<fs-modal *ngIf="isMobile" #servicesFsModal classTitle="uk-tile-default uk-border-bottom">
<div *ngIf="activeTab == 'dataProviders' && resultLandingInfo.relatedServices?.length > 0"
class="landing-section">
<ng-container *ngTemplateOutlet="relation_in_tab; context: { related: filteredRelatedServices, props: relatedServices, type: 'datasource', header: ''}"></ng-container>
<ng-container *ngTemplateOutlet="relation_in_tab; context: { related: filteredRelatedServices, props: relatedServices, type: properties.adminToolsPortalType == 'eosc' ? 'service' : 'datasource', header: ''}"></ng-container>
</div>
</fs-modal>
@ -800,7 +800,7 @@
(valueChange)="relatedClassChanged(type)"></div>
<results-and-pages
[type]="((type == 'datasource') ? openaireEntities.DATASOURCES : openaireEntities.RESULTS)"
[type]="((type == 'datasource') ? openaireEntities.DATASOURCES : (type == 'service' ? openaireEntities.SERVICES : openaireEntities.RESULTS))"
[page]="props.page" [pageSize]="pageSize"
[totalResults]="related.length">
</results-and-pages>

View File

@ -210,7 +210,8 @@ export class ResultLandingService {
this.resultLandingInfo.relatedResults = this.parsingFunctions.parseResults(this.resultLandingInfo.relatedResults, relation, provenanceAction, relationName);
} else if (relation['to'].class && relation['to'].class.toLowerCase() == "hasauthorinstitution") {
this.resultLandingInfo.organizations = this.parseRelatedOrganizations(this.resultLandingInfo.organizations, relation);
} else if (relation['to'].scheme && relation['to'].scheme == "dnet:result_datasource_relations") {
} else if (relation['to'].scheme && relation['to'].scheme == "dnet:result_datasource_relations" &&
(relation['datasourcetype']?.classname!== "service" || properties.adminToolsPortalType == "eosc")) {
let relationName: string = relation.to.class;
if (!this.resultLandingInfo.relatedServicesClassFilters.has(relationName)) {
this.resultLandingInfo.relatedServicesClassFilters.add(relationName);

View File

@ -141,7 +141,7 @@ export class WorkV3_0 {
}
}
if(resultLandingInfo.identifiers) {
if(resultLandingInfo.identifiers && resultLandingInfo.identifiers.size > 0) {
work['external-ids'] = { 'external-id': [] };
resultLandingInfo.identifiers.forEach(((values, key) => {
values.forEach(value => {

View File

@ -239,6 +239,12 @@ export class HelpContentService {
// .pipe(catchError(this.handleError));
// }
getCommunityPagesByRoute(pid: string, route: string) {
return this.http.get<Array<Page>>(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/'+pid+'/pages'
+ (route ? '?page_route='+route : ''))
.pipe(map(pages => (pages.length>0?pages[0]:null)), catchError(this.handleError));
}
// Replacing getCommunityPages
getCommunityPagesByType(pid: string, type: string) {
return this.http.get<Array<Page>>(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/'+pid+'/pages'
@ -305,7 +311,7 @@ export class HelpContentService {
.pipe(catchError(this.handleError));
}
togglePages(selectedPortalPid: string, ids : string[], status : boolean) {
togglePages(selectedPortalPid: string, ids : string[], status: boolean) {
return this.http.post(properties.adminToolsAPIURL + properties.adminToolsPortalType + '/' + selectedPortalPid + '/page/toggle?status='+ status.toString(),
JSON.stringify(ids), CustomOptions.getAuthOptionsWithBody())
@ -432,22 +438,21 @@ export class HelpContentService {
.pipe(map(res => res['statistics']));
}
getCommunityAdminStatisticsChoices(apiUrl: string, portalId: string): Observable<StatisticsDisplay> {
const url = `${apiUrl}statistics/${portalId}`;
getCommunityAdminStatisticsChoices(portalId: string): Observable<StatisticsDisplay> {
const url = `${properties.adminToolsAPIURL}statistics/${portalId}`;
//console.log(`getting admin choices for statistics from: ${url}`);
return this.http.get<StatisticsDisplay>(url)
//.map(stats => <StatisticsDisplay>stats.json())
.pipe(catchError(this.handleError));
}
postCommunityAdminStatisticsChoices(apiUrl: string,
portalId: string,
postCommunityAdminStatisticsChoices(portalId: string,
entity: string,
chartsOrNumbers: string,
title: string,
status: boolean,
monitor: boolean): Observable<any> {
const url = `${apiUrl}statistics/${portalId}/${entity}/${chartsOrNumbers}?status=${status.toString()}&monitor=${monitor.toString()}`;
const url = `${properties.adminToolsAPIURL}statistics/${portalId}/${entity}/${chartsOrNumbers}?status=${status.toString()}&monitor=${monitor.toString()}`;
//console.log(`getting admin choices for statistics from: ${url}`);
return this.http.post(url, title, CustomOptions.getAuthOptionsWithBody())
@ -455,8 +460,8 @@ export class HelpContentService {
.pipe(catchError(this.handleError));
}
statisticsIsActiveToggle(apiURL: string, id: string): Observable<boolean> {
const url = apiURL + '/statistics/' + encodeURIComponent(id) + '/toggle';
statisticsIsActiveToggle(id: string): Observable<boolean> {
const url = properties.adminToolsAPIURL + 'statistics/' + encodeURIComponent(id) + '/toggle';
return this.http.post<boolean>(url, {}, CustomOptions.getAuthOptionsWithBody()).pipe(catchError(this.handleError));
}
}