[develop | DONE | CHANGED & ADDED]: env-properties.ts & environment.ts: Added properties "rorURL", "isniURL", "wikiDataURL", "fundRefURL" | organizationInfo.ts: Added identifiers | searchOrganizations.service.ts & organization.service.ts: Parse identifiers (pid) [BETA ONLY] | organization.module.ts: Import ResultLandingUtilsModule (to call <showIdentifiers> | organization.component: Removed old unused code & Added <showIdentifiers> & In mobile added country and website url | parsingFunctions.class.ts: Added parsing for organization pids | showIdentifiers.component.ts: Added cases for organization pids & check if pid value is a url, do not add prefix.

This commit is contained in:
Konstantina Galouni 2024-03-04 13:14:09 +02:00
parent 00a5150042
commit 6a41954109
10 changed files with 89 additions and 99 deletions

View File

@ -538,7 +538,8 @@ export class ParsingFunctions {
if (pid.hasOwnProperty("classid") && pid['classid'] != "") {
if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid" || pid.classid == "re3data"
|| pid.classid == "swhid") {
|| pid.classid == "swhid"
|| pid.classid == "ROR" || pid.classid == "ISNI" || pid.classid == "Wikidata" || pid.classid == "FundRef") {
if (!identifiers.has(pid.classid)) {
identifiers.set(pid.classid, new Array<string>());
}
@ -547,7 +548,8 @@ export class ParsingFunctions {
} else {
for (let i = 0; i < pid.length; i++) {
if (pid[i].classid == "doi" || pid[i].classid == "pmc" || pid[i].classid == "handle" || pid[i].classid == "pmid" || pid[i].classid == "re3data"
|| pid[i].classid == "swhid") {
|| pid[i].classid == "swhid"
|| pid[i].classid == "ROR" || pid[i].classid == "ISNI" || pid[i].classid == "Wikidata" || pid[i].classid == "FundRef") {
if (!identifiers.has(pid[i].classid)) {
identifiers.set(pid[i].classid, new Array<string>());
}

View File

@ -26,8 +26,9 @@ import {properties} from "../../../../environments/environment";
<span class="uk-text-meta uk-text-small" [class.uk-text-uppercase]="key != 're3data'">{{key}}: </span>
<span [class.uk-margin-small-left]="modal">
<ng-container *ngFor="let item of identifiers.get(key) let j=index">
<a *ngIf="key == 'doi' || key == 'pmc' || key == 'pmid' || key == 'handle' || key == 're3data' || key == 'swhid'"
[href]="getUrl(key) + item" target="_blank" class="uk-display-inline-block custom-external">
<a *ngIf="key == 'doi' || key == 'pmc' || key == 'pmid' || key == 'handle' || key == 're3data' || key == 'swhid'
|| key == 'ROR' || key == 'ISNI' || key == 'Wikidata' || key == 'FundRef'"
[href]="getUrl(key, item) + item" target="_blank" class="uk-display-inline-block custom-external">
{{item}}
</a>
<ng-container *ngIf="(j !== (identifiers.get(key).length - 1))">, </ng-container>
@ -113,7 +114,10 @@ export class ShowIdentifiersComponent implements AfterViewInit {
});
}
public getUrl(key: string): string {
public getUrl(key: string, value: string): string {
if(value.includes("http://") || value.includes("https://")) {
return "";
}
if(key == "doi") {
return properties.doiURL;
} else if(key == "pmc") {
@ -126,6 +130,14 @@ export class ShowIdentifiersComponent implements AfterViewInit {
return properties.r3DataURL;
} else if(key == "swhid") {
return properties.swhURL;
} else if(key == "ROR") {
return properties.rorURL;
} else if(key == "ISNI") {
return properties.isniURL;
} else if(key == "Wikidata") {
return properties.wikiDataURL;
} else if(key == "FundRef") {
return properties.fundRefURL;
}
}

View File

@ -19,35 +19,6 @@
</div>
</div>
<div *ngIf="!showFeedback" class="uk-grid uk-margin-remove-left" uk-grid>
<!-- left column -->
<!-- <div id="landing-left-sidebar" *ngIf="organizationInfo" class="uk-visible@s uk-padding-remove-horizontal">
<div class="uk-flex uk-flex-column uk-flex-right uk-sticky"
uk-sticky="end: true" [attr.offset]="offset">
<div class="uk-margin-large-bottom uk-align-center">
<div class="uk-text-meta uk-text-uppercase">Actions</div>
<ul class="uk-list">
<li class="uk-text-center">
<a (click)="openAddThisModal()" [title]="'Share this '+openaireEntities.ORGANIZATION+' in your social networks'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="share" visuallyHidden="share"></icon>
</span>
</a>
</li>
<li class="uk-text-center"
[title]="'Download reports'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="buildFunderOptions(); openDownloadReportsModal()">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="download" visuallyHidden="download"></icon>
</span>
</a>
</li>
</ul>
</div>
</div>
</div> -->
<!-- center/right column -->
<div id="landing-center-content" class="uk-width-expand uk-padding-remove uk-background-default">
@ -123,35 +94,10 @@
<!-- Main content -->
<div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')">
<!-- Actions for mobile viewport -->
<div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s">
<div class="uk-margin-small-right">
<a (click)="openAddThisModal()" [title]="'Share this '+openaireEntities.ORGANIZATION+' in your social networks'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="share" visuallyHidden="share"></icon>
</span>
</a>
</div>
<div [title]="'Download reports'"
[attr.uk-tooltip]="'pos: right; cls: uk-active uk-text-small uk-padding-small'">
<a class="uk-link-text uk-text-bold uk-text-uppercase" (click)="buildFunderOptions(); openDownloadReportsModal()">
<span class="uk-icon-button uk-icon landing-action-button landing-action-button-portal">
<icon name="download" visuallyHidden="download"></icon>
</span>
</a>
</div>
</div>
<!-- Helper -->
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
[texts]="pageContents['top']"></helper>
<!-- Versions -->
<!-- <span *ngIf="organizationInfo.deletedByInferenceIds" class="uk-text-primary uk-flex uk-flex-middle">
<icon flex="true" ratio="0.8" name="auto_awesome_motion"></icon>
<a (click)="openDeletedByInference()" class="uk-text-primary uk-text-small uk-margin-small-left">
View all {{organizationInfo.deletedByInferenceIds.length}} versions
</a>
</span> -->
<!-- Landing header -->
<landing-header [properties]="properties" [title]="organizationInfo.title.name"
[subTitle]="(organizationInfo.name
@ -171,6 +117,10 @@
<div *ngIf="organizationInfo.country && !organizationInfo.country.toLowerCase().includes('unknown')">
<span class="uk-text-meta">Country: </span>{{organizationInfo.country}}
</div>
<!-- Identifiers -->
<div *ngIf="organizationInfo.identifiers && organizationInfo.identifiers.size > 0" class="uk-margin-small-top">
<showIdentifiers [identifiers]="organizationInfo.identifiers" [showViewAll]="true"></showIdentifiers>
</div>
</div>
</div>
<!-- Tabs section -->
@ -257,9 +207,7 @@
</search-tab>
</div>
</div>
<div class="uk-text-xsmall uk-hidden@m">
<ng-container *ngTemplateOutlet="graph_and_feedback_template"></ng-container>
</div>
<!-- Helper -->
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']">
@ -270,13 +218,13 @@
</div>
</div>
</div>
</div>
<!-- Feedback -->
<feedback *ngIf="organizationInfo && properties.reCaptchaSiteKey" [organizationInfo]="organizationInfo"
<feedback *ngIf="showFeedback && organizationInfo && properties.reCaptchaSiteKey" [organizationInfo]="organizationInfo"
[properties]="properties" [entityType]="'organization'" [fields]="feedbackFields"
[(showForm)]="showFeedback">
</feedback>
</div>
</div>
<!-- Mobile view -->
<div *ngIf="isMobile" class="uk-hidden@m uk-position-relative landing">
@ -287,6 +235,23 @@
&& organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null"
[entityType]="'organization'" [prevPath]="prevPath">
</landing-header>
<div class="uk-text-small">
<!-- Web Page -->
<div *ngIf="organizationInfo.title && organizationInfo.title.url" class="uk-margin-small-bottom uk-display-inline-block">
<span class="uk-text-meta">Web page: </span>
<a [href]="organizationInfo.title.url" target="_blank" class="uk-button uk-button-text uk-text-lowercase uk-text-normal custom-external">
{{organizationInfo.title.url}}
</a>
</div>
<!-- Country -->
<div *ngIf="organizationInfo.country && !organizationInfo.country.toLowerCase().includes('unknown')">
<span class="uk-text-meta">Country: </span>{{organizationInfo.country}}
</div>
<!-- Identifiers -->
<div *ngIf="organizationInfo.identifiers && organizationInfo.identifiers.size > 0" class="uk-margin-small-top">
<showIdentifiers [identifiers]="organizationInfo.identifiers" [showViewAll]="true" [isMobile]="true"></showIdentifiers>
</div>
</div>
<div class="uk-section uk-margin-top uk-text-large uk-text-empashis uk-text-bold">
<hr>
<ng-container>
@ -406,10 +371,7 @@
[type]="'organizations'" [prevPath]="prevPath">
</organizationsDeletedByInference>
</modal-alert>
<!-- Share -->
<modal-alert *ngIf="organizationInfo" #addThisModal classBody="uk-flex uk-flex-center uk-flex-middle">
<addThis></addThis>
</modal-alert>
<!-- Download -->
<modal-alert *ngIf="organizationInfo" #downloadReportsModal large="true">
<div class="uk-padding-small uk-margin-small-left uk-margin-small-right">

View File

@ -77,7 +77,6 @@ export class OrganizationComponent {
@ViewChild('downloadReportsFsModal') downloadReportsFsModal: FullScreenModalComponent;
// @ViewChild('downloadReportModal') downloadReportModal;
// @ViewChild('downloadFunderReportModal') downloadFunderReportModal;
@ViewChild('addThisModal') addThisModal;
@ViewChild('addThisFsModal') addThisFsModal: FullScreenModalComponent;
@ViewChild(ModalLoading) loading: ModalLoading;
@ -717,13 +716,6 @@ export class OrganizationComponent {
this.downloadReportsModal.cancel();
}
public openAddThisModal() {
this.addThisModal.cancelButton = false;
this.addThisModal.okButton = false;
this.addThisModal.alertTitle = "Share this "+OpenaireEntities.ORGANIZATION+" in your social networks";
this.addThisModal.open();
}
public getParamsForSearchLink(type: string = "") {
if(type) {
return this.routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf', 'sortBy'], ['relorganizationid', this.organizationId, type, 'false', 'resultdateofacceptance,descending']);

View File

@ -34,6 +34,7 @@ import {FullScreenModalModule} from "../../utils/modal/full-screen-modal/full-sc
import {EGIDataTransferModule} from "../../utils/dataTransfer/transferData.module";
import {EntityActionsModule} from "../../utils/entity-actions/entity-actions.module";
import {OrganizationRoutingModule} from "./organization-routing.module";
import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module";
@NgModule({
@ -51,7 +52,7 @@ import {OrganizationRoutingModule} from "./organization-routing.module";
ProjectsServiceModule,
Schema2jsonldModule, SEOServiceModule, HelperModule,
OrganizationsDeletedByInferenceModule, LandingHeaderModule, FeedbackModule,
TabsModule, SearchTabModule, LoadingModule, IconsModule, InputModule, FullScreenModalModule, EGIDataTransferModule, EntityActionsModule
TabsModule, SearchTabModule, LoadingModule, IconsModule, InputModule, FullScreenModalModule, EntityActionsModule, ResultLandingUtilsModule
],
declarations: [
OrganizationComponent,

View File

@ -8,9 +8,11 @@ import {OrganizationInfo} from '../utils/entities/organizationInfo';
import{EnvProperties} from '../utils/properties/env-properties';
import {map} from "rxjs/operators";
import {ParsingFunctions} from "../landingPages/landing-utils/parsingFunctions.class";
import {properties} from "../../../environments/environment";
@Injectable()
export class OrganizationService {
public parsingFunctions: ParsingFunctions = new ParsingFunctions();
constructor(private http: HttpClient ) {}
@ -92,6 +94,10 @@ export class OrganizationService {
}
}
}
if(organization['pid'] && properties.environment != "production") {
this.organizationInfo.identifiers = this.parsingFunctions.parseIdentifiers(organization['pid']);
}
}
//Comment Parsing Projects info

View File

@ -9,9 +9,11 @@ import{EnvProperties} from '../utils/properties/env-properties';
import {StringUtils} from '../utils/string-utils.class';
import {map} from "rxjs/operators";
import {ParsingFunctions} from "../landingPages/landing-utils/parsingFunctions.class";
import {properties} from "../../../environments/environment";
@Injectable()
export class SearchOrganizationsService {
public parsingFunctions: ParsingFunctions = new ParsingFunctions();
constructor(private http: HttpClient ) {}
@ -173,6 +175,10 @@ export class SearchOrganizationsService {
result.country = resData.country.classname;
}
if(resData['pid'] && properties.environment != "production") {
result.identifiers = this.parsingFunctions.parseIdentifiers(resData['pid']);
}
results.push(result);
}

View File

@ -26,4 +26,5 @@ export class OrganizationInfo {
// organizations: {name: string; url: string}[]}[];
deletedByInferenceIds: string[];
identifiers: Map<string, string[]>; //key is the classname
}

View File

@ -45,6 +45,10 @@ export interface EnvProperties {
openDoarURL?: string;
r3DataURL?: string;
swhURL?: string;
rorURL?: string;
isniURL?: string;
wikiDataURL?: string;
fundRefURL?: string;
fairSharingURL?: string,
eoscMarketplaceURL?: string,
sherpaURL?: string;

View File

@ -20,6 +20,10 @@ export let common: EnvProperties = {
openDoarURL: "http://v2.sherpa.ac.uk/id/repository/",
r3DataURL: "http://service.re3data.org/repository/",
swhURL: "https://archive.softwareheritage.org/",
rorURL: "https://ror.org/",
isniURL: "https://isni.org/isni/",
wikiDataURL: "https://www.wikidata.org/wiki/",
fundRefURL: "https://api.crossref.org/funders/",
fairSharingURL: "https://fairsharing.org/",
eoscMarketplaceURL: "https://marketplace.eosc-portal.eu/services/",
sherpaURL: "http://sherpa.ac.uk/romeo/issn/",