Merge branch 'new-theme' of code-repo.d4science.org:MaDgIK/openaire-library into new-theme

This commit is contained in:
argirok 2022-05-16 17:25:42 +03:00
commit f2ae3fb355
13 changed files with 75 additions and 25 deletions

View File

@ -87,16 +87,6 @@
[types]="dataProviderInfo.type ? [dataProviderInfo.type] : null">
</landing-header>
<!-- Web Page -->
<div *ngIf="dataProviderInfo.title && dataProviderInfo.title.url"
class="uk-margin-bottom uk-text-small">
<span class="uk-text-meta">Web page: </span>
<a [href]="dataProviderInfo.title.url" target="_blank"
class="uk-button uk-button-text uk-text-lowercase uk-text-normal custom-external">
{{dataProviderInfo.title.url}}
</a>
</div>
<!-- Labels -->
<div class="uk-margin-bottom uk-margin-remove-left uk-grid uk-grid-small uk-flex-middle" uk-grid>
<ng-container *ngIf="dataProviderInfo.compatibility">
@ -123,6 +113,24 @@
<span class="uk-label label-country" title="Country">{{country}}</span>&#160;
</ng-container>
</ng-container>
<ng-container *ngIf="dataProviderInfo.thematic">
<span class="uk-label uk-text-truncate">Thematic</span>
</ng-container>
</div>
<!-- Web Page -->
<div *ngIf="dataProviderInfo.title && dataProviderInfo.title.url"
class="uk-text-small uk-margin-small-top">
<span class="uk-text-meta">Web page: </span>
<a [href]="dataProviderInfo.title.url" target="_blank"
class="uk-button uk-button-text uk-text-lowercase uk-text-normal custom-external">
{{dataProviderInfo.title.url}}
</a>
</div>
<!-- Identifiers -->
<div *ngIf="dataProviderInfo.identifiers && dataProviderInfo.identifiers.size > 0" class="uk-margin-small-top uk-text-small">
<showIdentifiers [identifiers]="dataProviderInfo.identifiers" [showViewAll]="true"></showIdentifiers>
</div>
</div>
@ -221,6 +229,16 @@
{{dataProviderInfo.countries.join(", ")}}
</div>
<div *ngIf="dataProviderInfo.jurisdiction" class="uk-margin-medium-bottom">
<div class="uk-text-meta uk-margin-small-bottom">Jurisdiction</div>
{{dataProviderInfo.jurisdiction}}
</div>
<div *ngIf="dataProviderInfo.contentpolicy" class="uk-margin-medium-bottom">
<div class="uk-text-meta uk-margin-small-bottom">Content policy</div>
{{dataProviderInfo.contentpolicy}}
</div>
<!-- Subjects -->
<div *ngIf="dataProviderInfo.subjects && dataProviderInfo.subjects.length > 0"
class="uk-margin-medium-bottom uk-margin-bottom">

View File

@ -33,6 +33,7 @@ import {IconsModule} from "../../utils/icons/icons.module";
import {IconsService} from "../../utils/icons/icons.service";
import {graph} from "../../utils/icons/icons";
import {LoadingModalModule} from "../../utils/modal/loadingModal.module";
import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module";
@NgModule({
imports:
@ -41,7 +42,7 @@ import {LoadingModalModule} from "../../utils/modal/loadingModal.module";
DataProvidersServiceModule, ProjectsServiceModule, SearchResearchResultsServiceModule,
PagingModule, Schema2jsonldModule, SEOServiceModule, ShowPublisherModule, HelperModule,
LandingHeaderModule, AlertModalModule, NoLoadPaging, FeedbackModule,
TabsModule, SearchTabModule, LoadingModule, IconsModule, LoadingModalModule
TabsModule, SearchTabModule, LoadingModule, IconsModule, LoadingModalModule, ResultLandingUtilsModule
],
declarations:
[StatisticsTabComponent,

View File

@ -169,6 +169,20 @@ export class DataProviderService {
// this.dataProviderInfo.description = (data[0]['description'][0]) ? String(data[0]['description'][0]) : "";
// }
this.dataProviderInfo.description = this.parsingFunctions.parseDescription(data[0] && data[0].description?data[0].description:[]);
this.dataProviderInfo.thematic = data[0].thematic;
if(data[0].jurisdiction != null) {
this.dataProviderInfo.jurisdiction = data[0].jurisdiction.classname;
}
if(data[0].contentpolicy != null) {
this.dataProviderInfo.contentpolicy = data[0].contentpolicy.classname;
}
if(data[0].pid != null) {
this.dataProviderInfo.identifiers = this.parsingFunctions.parseIdentifiers(data[0].pid);
}
}
if(data[1] != null) {

View File

@ -551,7 +551,7 @@ export class ParsingFunctions {
let identifiers = new Map<string, string[]>();
if (pid.hasOwnProperty("classid") && pid['classid'] != "") {
if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid") {
if (pid.classid == "doi" || pid.classid == "pmc" || pid.classid == "handle" || pid.classid == "pmid" || pid.classid == "re3data") {
if (!identifiers.has(pid.classid)) {
identifiers.set(pid.classid, new Array<string>());
}
@ -559,7 +559,7 @@ 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") {
if (pid[i].classid == "doi" || pid[i].classid == "pmc" || pid[i].classid == "handle" || pid[i].classid == "pmid" || pid[i].classid == "re3data") {
if (!identifiers.has(pid[i].classid)) {
identifiers.set(pid[i].classid, new Array<string>());
}
@ -583,7 +583,6 @@ export class ParsingFunctions {
for (let i = 0; i < length; i++) {
subject = Array.isArray(_subjects) ? _subjects[i] : _subjects;
console.log(subject);
if (subject.classid != "") {
if (subject.inferred && subject.inferred == true) {
if(subject.classid === "SDG") {
@ -642,7 +641,6 @@ export class ParsingFunctions {
}
}
}
console.log(this.eoscSubjectsFound);
return [subjects, otherSubjects, classifiedSubjects, fos, sdg, this.eoscSubjectsFound];
}

View File

@ -26,7 +26,7 @@ import {properties} from "../../../../environments/environment";
<span class="uk-text-meta uk-text-small uk-text-uppercase">{{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'"
<a *ngIf="key == 'doi' || key == 'pmc' || key == 'pmid' || key == 'handle' || key == 're3data'"
[href]="getUrl(key) + item" target="_blank" class="uk-display-inline-block custom-external">
{{item}}
</a>
@ -115,6 +115,8 @@ export class ShowIdentifiersComponent implements AfterViewInit {
return properties.pmidURL;
} else if(key == "handle") {
return properties.handleURL;
} else if(key == "re3data") {
return properties.r3DataURL;
}
}

View File

@ -369,7 +369,7 @@
<div class="uk-margin-medium-top uk-list uk-list-large uk-padding uk-padding-remove-vertical" [class.uk-list-divider]="!viewAll">
<!-- EOSC Services-->
<!-- 1 link -->
<div *ngIf="resultLandingInfo.eoscSubjects?.length == 1 && properties.adminToolsPortalType == 'explore'
<div *ngIf="resultLandingInfo.eoscSubjects?.length == 1 && (properties.adminToolsPortalType == 'explore' || properties.adminToolsPortalType == 'eosc')
&& (properties.environment == 'beta' || properties.environment == 'development') && (!viewAll || viewAll=='egiNotebook')">
<a class="uk-link-text uk-text-bold custom-external"
target="_blank" [href]="resultLandingInfo.eoscSubjects[0].link">
@ -379,7 +379,7 @@
</a>
</div>
<!-- more than 1 links -->
<div *ngIf="resultLandingInfo.eoscSubjects?.length > 1 && properties.adminToolsPortalType == 'explore'
<div *ngIf="resultLandingInfo.eoscSubjects?.length > 1 && (properties.adminToolsPortalType == 'explore' || properties.adminToolsPortalType == 'eosc')
&& (properties.environment == 'beta' || properties.environment == 'development') && (!viewAll || viewAll=='egiNotebook')">
<a class="uk-link-text uk-text-bold">
<img src="assets/common-assets/eosc-logo.png"

View File

@ -548,7 +548,8 @@ export class ResultLandingComponent {
}
public get hasRightSidebarInfo(): boolean {
return (this.resultLandingInfo.eoscSubjects && this.resultLandingInfo.eoscSubjects.length && properties.adminToolsPortalType == 'explore'
return (this.resultLandingInfo.eoscSubjects && this.resultLandingInfo.eoscSubjects.length
&& (properties.adminToolsPortalType == 'explore' || properties.adminToolsPortalType == 'eosc')
&& (properties.environment == 'beta' || properties.environment == 'development'))
||
(this.resultLandingInfo.sdg && this.resultLandingInfo.sdg.length > 0)

View File

@ -40,7 +40,7 @@ export class EntitiesSelectionComponent {
/** TODO change conditions base on PortalType instead of customFilter */
ngOnInit() {
if ((this.customFilter && this.customFilter.queryFieldName == "communityId") || (['explore', 'aggregator'].includes(this.properties.adminToolsPortalType))) {
if ((this.customFilter && this.customFilter.queryFieldName == "communityId") || (['explore', 'aggregator', 'eosc'].includes(this.properties.adminToolsPortalType))) {
this.subscriptions.push(this.config.communityInformationState.subscribe(data => {
if (data) {
let showEntity = {};

View File

@ -957,7 +957,7 @@ export class NewSearchPageComponent {
let params = "";
let doisParams = "";
var DOIs: Identifier[] = Identifier.getIdentifiersFromString(value);
if ((entityType == 'publication' || entityType == 'dataset' || entityType == 'software' || entityType == 'other' || entityType == "result")) {
if ((entityType == 'publication' || entityType == 'dataset' || entityType == 'software' || entityType == 'other' || entityType == "result" || entityType == "datasource" || entityType == "service")) {
for (let identifier of DOIs) {
// console.log(identifier)
// pidclassid exact \"doi\" and pid exact \"10.1016/j.nima.2015.11.134\"

View File

@ -345,6 +345,11 @@ export class SearchDataprovidersService {
result['countries'] = res[0];
result['subjects'] = this.getDataproviderSubjects(resData);
//console.log(result['subjects']);
if(resData['pid']) {
result.identifiers = this.parsingFunctions.parseIdentifiers(resData['pid']);
}
results.push(result);
}

View File

@ -27,6 +27,10 @@ export class DataProviderInfo {
journal: {"journal": "", "issn": string, "lissn": string, "eissn": string};
description: string[] = [];
subjects: string[];
jurisdiction: string;
thematic: boolean;
contentpolicy: string;
identifiers: Map<string, string[]>; //key is the classname
fundedContent: string; // search query

View File

@ -1,6 +1,6 @@
export type Environment = "development" | "test" | "beta" | "production";
export type Dashboard = "explore" | "connect" | "monitor";
export type PortalType = "explore" | "connect" | "community" | "monitor" | "aggregator";
export type Dashboard = "explore" | "connect" | "monitor" | "aggregator";
export type PortalType = "explore" | "connect" | "community" | "monitor" | "funder" | "ri" | "project" | "organization" | "aggregator" | "eosc";
export interface EnvProperties {
environment?: Environment;

View File

@ -149,7 +149,7 @@ export class DOI {
}
export class Identifier {
class: "doi" | "pmc" | "pmid" | "handle" | "ORCID" = null;
class: "doi" | "pmc" | "pmid" | "handle" | "ORCID" | "re3data" = null;
id: string;
public static getDOIsFromString(str: string): string[] {
@ -200,6 +200,8 @@ export class Identifier {
return {"class": "pmid", "id": pid};
} else if (Identifier.isValidHANDLE(pid)) {
return {"class": "handle", "id": pid};
} else if (Identifier.isValidRe3Data(pid)) {
return {"class": "re3data", "id": pid};
}
//set it as a doi, to catch the case that doi has not valid format
return (strict?null:{"class": "doi", "id": pid});
@ -250,6 +252,11 @@ export class Identifier {
let exp = /^[0-9a-zA-Z-]*\/[0-9a-zA-Z-]*$/g;
return str.match(exp) != null;
}
public static isValidRe3Data(str: string): boolean {
let exp = /(r3d[1-9]\d{0,8})/g;
return str.match(exp) != null;
}
}
export class StringUtils {