[Library | new-theme]: Organizations: Use openorgs identifier when available | In social sharing button and modal (landing) use OpenaireEntities.

1. organization.service.ts & searchOrganizations.service.ts: When "objIdentifier" starts with "openorgs____", set canonicalId and id to openorgs id.
2. dataProvider.component & organization.component & project.component: In button and modal for social media sharing, use name of entity by OpenaireEntities.
This commit is contained in:
Konstantina Galouni 2022-07-12 13:20:28 +03:00
parent ccd220b68a
commit 14bd18c9d8
8 changed files with 16 additions and 11 deletions

View File

@ -22,7 +22,7 @@
<!-- Share -->
<li class="uk-text-center">
<a (click)="openAddThisModal()"
[title]="'Share this '+openaireEntities.PROJECT+' in your social networks'"
[title]="'Share this '+openaireEntities.DATASOURCE+' in your social networks'"
[attr.uk-tooltip]="'pos: right; cls: uk-active landing-action-tooltip landing-action-tooltip-portal 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>
@ -83,7 +83,7 @@
<div class="uk-flex uk-flex-right uk-margin-medium-bottom uk-hidden@s">
<div>
<a (click)="openAddThisModal()"
[title]="'Share this '+openaireEntities.PROJECT+' in your social networks'"
[title]="'Share this '+openaireEntities.DATASOURCE+' in your social networks'"
[attr.uk-tooltip]="'pos: right; cls: uk-active landing-action-tooltip landing-action-tooltip-portal 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>

View File

@ -683,7 +683,7 @@ export class DataProviderComponent {
public openAddThisModal() {
this.addThisModal.cancelButton = false;
this.addThisModal.okButton = false;
this.addThisModal.alertTitle = "Share this project in your social networks";
this.addThisModal.alertTitle = "Share this "+OpenaireEntities.DATASOURCE+" in your social networks";
this.addThisModal.open();
}

View File

@ -11,7 +11,7 @@
<ul class="uk-list">
<!-- Share -->
<li class="uk-text-center">
<a (click)="openAddThisModal()" [title]="'Share this organization in your social networks'"
<a (click)="openAddThisModal()" [title]="'Share this '+openaireEntities.ORGANIZATION+' in your social networks'"
[attr.uk-tooltip]="'pos: right; cls: uk-active landing-action-tooltip landing-action-tooltip-portal 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>
@ -80,7 +80,7 @@
<!-- 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 organization in your social networks'"
<a (click)="openAddThisModal()" [title]="'Share this '+openaireEntities.ORGANIZATION+' in your social networks'"
[attr.uk-tooltip]="'pos: right; cls: uk-active landing-action-tooltip landing-action-tooltip-portal 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>

View File

@ -686,7 +686,7 @@ export class OrganizationComponent {
public openAddThisModal() {
this.addThisModal.cancelButton = false;
this.addThisModal.okButton = false;
this.addThisModal.alertTitle = "Share this organization in your social networks";
this.addThisModal.alertTitle = "Share this "+OpenaireEntities.ORGANIZATION+" in your social networks";
this.addThisModal.open();
}

View File

@ -22,7 +22,7 @@
<!-- Share -->
<li class="uk-text-center">
<a (click)="openAddThisModal()"
[title]="'Share this project in your social networks'"
[title]="'Share this '+openaireEntities.PROJECT+' in your social networks'"
[attr.uk-tooltip]="'pos: right; cls: uk-active landing-action-tooltip landing-action-tooltip-portal 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>
@ -120,7 +120,7 @@
<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 project in your social networks'"
[title]="'Share this '+openaireEntities.PROJECT+' in your social networks'"
[attr.uk-tooltip]="'pos: right; cls: uk-active landing-action-tooltip landing-action-tooltip-portal 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>

View File

@ -571,7 +571,7 @@ export class ProjectComponent {
public openAddThisModal() {
this.addThisModal.cancelButton = false;
this.addThisModal.okButton = false;
this.addThisModal.alertTitle = "Share this project in your social networks";
this.addThisModal.alertTitle = "Share this "+OpenaireEntities.PROJECT+" in your social networks";
this.addThisModal.open();
}

View File

@ -54,6 +54,9 @@ export class OrganizationService {
if(data != null) {
organization = data['result']['metadata']['oaf:entity']['oaf:organization'];
this.organizationInfo.objIdentifier = data["result"]["header"]["dri:objIdentifier"];
if(this.organizationInfo.objIdentifier.startsWith("openorgs____::")) {
this.organizationInfo.relcanId = this.organizationInfo.objIdentifier;
}
relations = data['result']['metadata']['oaf:entity']['oaf:organization']['rels']['rel'];
} else {
return null;

View File

@ -102,9 +102,11 @@ export class SearchOrganizationsService {
//result['title'].url = OpenaireProperties.getsearchLinkToOrganization();
//result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
result['id'] = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
let canId = ParsingFunctions.parseRelCanonicalId(Array.isArray(data) ? data[i] : data, "organization");
if(canId){
if(!result['id'].startsWith("openorgs____::")) {
let canId = ParsingFunctions.parseRelCanonicalId(Array.isArray(data) ? data[i] : data, "organization");
if(canId){
result['id'] = canId;
}
}
if(resData['rels'].hasOwnProperty("rel")) {
let relLength = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'].length : 1;