[Library | new-theme]: Fix display of errorMessages | Use <landing-header> instead of <showTitle> in all landing pages | Stop sticky header before graph & feedback line | Fix bug in eoscSubjectsFound intialization - set it as local variable.
1. resultLanding.component.html & project.component.html & organization.component.html & dataProvider.component.html:
a. Move errorMessages and loading inside center box.
b. In center box, after graph & feedback line, set [style]="'margin-bottom: '+graph_height+'px'", so that sticky header stop before graph & feedback.
2. resultLanding.component.html: Removed "uk-height-1-1" class from center box.
3. organization.component.html & project.component.html: In sticky header use <landing-header> instead of <showTitle> (forgotten in commit 8b94b7f98a
).
4. organization.component.ts & project.component.ts & resultLanding.component.ts: In errorMessage, use OpenaireEntities in singular.
5. parsingFunctions.class.ts: [Bug fix] Removed "eoscSubjectsFound" from class fields and set it as local variable - bug fixed on back and again on landing.
This commit is contained in:
parent
fd68a2cb10
commit
0946bd73b5
|
@ -1,13 +1,5 @@
|
|||
<div class="landing uk-section uk-padding-remove tm-middle">
|
||||
<div class="tm-main">
|
||||
<div *ngIf="errorMessage.length > 0 || showLoading" class="landing-background-default-color">
|
||||
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top"
|
||||
role="alert">{{errorMessage}}</div>
|
||||
<div *ngIf="showLoading" class="uk-position-center">
|
||||
<loading></loading>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="dataprovider">
|
||||
<div *ngIf="!showFeedback" class="uk-grid">
|
||||
|
||||
|
@ -44,6 +36,14 @@
|
|||
|
||||
<!-- center box-->
|
||||
<div class="uk-width-expand uk-padding-remove uk-background-default">
|
||||
<div *ngIf="errorMessage.length > 0 || showLoading" class="uk-container uk-flex uk-flex-center uk-flex-middle">
|
||||
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-width-2-3 uk-margin-xlarge-top"
|
||||
role="alert">{{errorMessage}}</div>
|
||||
<div *ngIf="showLoading" class="uk-position-center">
|
||||
<loading></loading>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ng-template #graph_and_feedback_template>
|
||||
<div class="uk-flex uk-margin-small-top uk-margin-small-bottom" [class.uk-invisible]="!dataProviderInfo">
|
||||
<!-- Last Index Info-->
|
||||
|
@ -69,7 +69,7 @@
|
|||
<ng-container *ngTemplateOutlet="graph_and_feedback_template"></ng-container>
|
||||
</div>
|
||||
|
||||
<div class="uk-margin-large-left uk-margin-large-right">
|
||||
<div class="uk-margin-large-left uk-margin-large-right" [style]="'margin-bottom: '+graph_height+'px'">
|
||||
|
||||
<ng-container *ngIf="dataProviderInfo">
|
||||
<div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')">
|
||||
|
|
|
@ -14,7 +14,6 @@ export class ParsingFunctions {
|
|||
{label: 'EOSC::Galaxy Workflow', link: 'https://' + (properties.environment == 'beta'?'beta.':'') + 'marketplace.eosc-portal.eu/services?tag=EOSC%3A%3AGalaxy+Workflow', value: 'Galaxy Workflow'},
|
||||
{label: 'EOSC::Twitter Data', link: 'https://' + (properties.environment == 'beta'?'beta.':'') + 'marketplace.eosc-portal.eu/services?tag=EOSC%3A%3ATwitter+Data', value: 'Twitter Data'}
|
||||
]
|
||||
public eoscSubjectsFound = [];
|
||||
|
||||
public notebookInSubjects: boolean = false;
|
||||
private notebookKeyword: string = "eosc jupyter notebook";
|
||||
|
@ -572,6 +571,7 @@ export class ParsingFunctions {
|
|||
|
||||
// publication & dataset landing : for subjects and otherSubjects and classifiedSubjects
|
||||
parseAllSubjects(_subjects: any): [string[], Map<string, string[]>, Map<string, string[]>, string[], string[], any[]] {
|
||||
let eoscSubjectsFound = [];
|
||||
let subjects: string[];
|
||||
let otherSubjects: Map<string, string[]>;
|
||||
let classifiedSubjects: Map<string, string[]>;
|
||||
|
@ -603,11 +603,12 @@ export class ParsingFunctions {
|
|||
}
|
||||
|
||||
let content: string = subject.content+"";
|
||||
let checkAndAddEoscSubjectResp = this.checkAndAddEoscSubject(setOfEoscSubjects, classifiedSubjects, subject, content);
|
||||
let checkAndAddEoscSubjectResp = this.checkAndAddEoscSubject(setOfEoscSubjects, classifiedSubjects, eoscSubjectsFound, subject, content);
|
||||
let found: boolean = checkAndAddEoscSubjectResp["found"];
|
||||
if(found) {
|
||||
setOfEoscSubjects = checkAndAddEoscSubjectResp["setOfEoscSubject"];
|
||||
classifiedSubjects = checkAndAddEoscSubjectResp["classifiedSubjects"];
|
||||
eoscSubjectsFound = checkAndAddEoscSubjectResp["eoscSubjectsFound"];
|
||||
} else {
|
||||
if (!classifiedSubjects.has(subject.classname)) {
|
||||
classifiedSubjects.set(subject.classname, new Array<string>());
|
||||
|
@ -618,11 +619,12 @@ export class ParsingFunctions {
|
|||
} else {
|
||||
if (subject.classid == "keyword") {
|
||||
let content: string = subject.content+"";
|
||||
let checkAndAddEoscSubjectResp = this.checkAndAddEoscSubject(setOfEoscSubjects, classifiedSubjects, subject, content);
|
||||
let checkAndAddEoscSubjectResp = this.checkAndAddEoscSubject(setOfEoscSubjects, classifiedSubjects, eoscSubjectsFound, subject, content);
|
||||
let found: boolean = checkAndAddEoscSubjectResp["found"];
|
||||
if(found) {
|
||||
setOfEoscSubjects = checkAndAddEoscSubjectResp["setOfEoscSubject"];
|
||||
classifiedSubjects = checkAndAddEoscSubjectResp["classifiedSubjects"];
|
||||
eoscSubjectsFound = checkAndAddEoscSubjectResp["eoscSubjectsFound"];
|
||||
} else {
|
||||
if (subjects == undefined) {
|
||||
subjects = new Array<string>();
|
||||
|
@ -631,11 +633,12 @@ export class ParsingFunctions {
|
|||
}
|
||||
} else {
|
||||
let content: string = subject.content+"";
|
||||
let checkAndAddEoscSubjectResp = this.checkAndAddEoscSubject(setOfEoscSubjects, classifiedSubjects, subject, content);
|
||||
let checkAndAddEoscSubjectResp = this.checkAndAddEoscSubject(setOfEoscSubjects, classifiedSubjects, eoscSubjectsFound, subject, content);
|
||||
let found: boolean = checkAndAddEoscSubjectResp["found"];
|
||||
if(found) {
|
||||
setOfEoscSubjects = checkAndAddEoscSubjectResp["setOfEoscSubject"];
|
||||
classifiedSubjects = checkAndAddEoscSubjectResp["classifiedSubjects"];
|
||||
eoscSubjectsFound = checkAndAddEoscSubjectResp["eoscSubjectsFound"];
|
||||
} else {
|
||||
let classname: string = subject.classname + "";
|
||||
if (subjects == undefined) {
|
||||
|
@ -647,10 +650,10 @@ export class ParsingFunctions {
|
|||
}
|
||||
}
|
||||
}
|
||||
return [subjects, otherSubjects, classifiedSubjects, fos, sdg, this.eoscSubjectsFound];
|
||||
return [subjects, otherSubjects, classifiedSubjects, fos, sdg, eoscSubjectsFound];
|
||||
}
|
||||
|
||||
checkAndAddEoscSubject(setOfEoscSubjects: Set<string>, classifiedSubjects, subject, content) {
|
||||
checkAndAddEoscSubject(setOfEoscSubjects: Set<string>, classifiedSubjects, eoscSubjectsFound, subject, content) {
|
||||
let found: boolean = false;
|
||||
|
||||
if(!setOfEoscSubjects.has(content)) {
|
||||
|
@ -666,13 +669,13 @@ export class ParsingFunctions {
|
|||
}
|
||||
|
||||
found = true;
|
||||
this.eoscSubjectsFound.push(item);
|
||||
eoscSubjectsFound.push(item);
|
||||
setOfEoscSubjects.add(content);
|
||||
classifiedSubjects.get("EOSC").push(item.value);
|
||||
}
|
||||
});
|
||||
}
|
||||
return {"found": found, "setOfEoscSubject": setOfEoscSubjects, "classifiedSubjects": classifiedSubjects};
|
||||
return {"found": found, "setOfEoscSubject": setOfEoscSubjects, "classifiedSubjects": classifiedSubjects, "eoscSubjectsFound": eoscSubjectsFound};
|
||||
}
|
||||
|
||||
parseContexts(_contexts: any): Context[] {
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
<div id="tm-main" class="landing uk-section uk-padding-remove tm-middle">
|
||||
<div class="tm-main">
|
||||
<!-- TODO: Error messages -->
|
||||
<div></div>
|
||||
|
||||
<div class="organization">
|
||||
<div *ngIf="!showFeedback" class="uk-grid" uk-grid>
|
||||
<!-- left column -->
|
||||
|
@ -37,6 +34,14 @@
|
|||
</div>
|
||||
<!-- center/right column -->
|
||||
<div class="uk-width-expand uk-padding-remove uk-background-default">
|
||||
<div *ngIf="errorMessage.length > 0 || showLoading" class="uk-container uk-flex uk-flex-center uk-flex-middle">
|
||||
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-width-2-3 uk-margin-xlarge-top"
|
||||
role="alert">{{errorMessage}}</div>
|
||||
<div *ngIf="showLoading" class="uk-position-center">
|
||||
<loading></loading>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Graph and feedback -->
|
||||
<ng-template #graph_and_feedback_template>
|
||||
<div class="uk-flex uk-margin-small-top uk-margin-small-bottom" [class.uk-invisible]="!organizationInfo">
|
||||
|
@ -62,7 +67,7 @@
|
|||
<ng-container *ngTemplateOutlet="graph_and_feedback_template"></ng-container>
|
||||
</div>
|
||||
|
||||
<div class="uk-margin-large-left uk-margin-large-right">
|
||||
<div class="uk-margin-large-left uk-margin-large-right" [style]="'margin-bottom: '+graph_height+'px'">
|
||||
<ng-container *ngIf="organizationInfo">
|
||||
<!-- Main content -->
|
||||
<div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')">
|
||||
|
@ -105,7 +110,13 @@
|
|||
<!-- Tabs section -->
|
||||
<div id="main-tabs-div" uk-sticky="bottom: true; media: @m" [attr.offset]="offset" cls-active="active">
|
||||
<div class="uk-padding uk-padding-remove-horizontal uk-padding-remove-bottom">
|
||||
<showTitle *ngIf="stickyHeader" [titleName]="organizationInfo.title.name" classNames="uk-margin-remove-bottom" class="uk-visible@m"></showTitle>
|
||||
<!-- <showTitle *ngIf="stickyHeader" [titleName]="organizationInfo.title.name" classNames="uk-margin-remove-bottom" class="uk-visible@m"></showTitle>-->
|
||||
<landing-header *ngIf="stickyHeader" class="uk-visible@m"
|
||||
[properties]="properties" [title]="organizationInfo.title.name"
|
||||
[subTitle]="(organizationInfo.name
|
||||
&& organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null"
|
||||
[entityType]="'organization'" isSticky="true">
|
||||
</landing-header>
|
||||
<my-tabs (selectedActiveTab)="onSelectActiveTab($event)" [offsetForSticky]="offset" [(isSticky)]="stickyHeader">
|
||||
<my-tab [active]="true" [tabTitle]="'Funding / ' +openaireEntities.PROJECTS" [tabId]="'projects'"
|
||||
[tabNumber]="fetchProjects.searchUtils.totalResults > 0 ? fetchProjects.searchUtils.totalResults : ''">
|
||||
|
|
|
@ -369,7 +369,7 @@ export class OrganizationComponent {
|
|||
"page_type": "organization"
|
||||
}
|
||||
});
|
||||
this.errorMessage = 'No organization found';
|
||||
this.errorMessage = 'No '+OpenaireEntities.ORGANIZATION+' found';
|
||||
} else {
|
||||
this.organizationInfo = data;
|
||||
this.organizationId = this.organizationInfo.objIdentifier; // reset in case the parameter was a canonical url. The related queries and reports should have the dedup id
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
<div class="landing uk-section uk-padding-remove tm-middle">
|
||||
<div class="tm-main">
|
||||
<div *ngIf="errorMessage.length > 0 || showLoading" class="landing-background-default-color">
|
||||
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top"
|
||||
role="alert">{{errorMessage}}</div>
|
||||
<div *ngIf="showLoading" class="uk-position-center">
|
||||
<loading></loading>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="project">
|
||||
<div *ngIf="!showFeedback" class="uk-grid">
|
||||
|
||||
|
@ -83,6 +75,14 @@
|
|||
|
||||
<!-- center box-->
|
||||
<div class="uk-width-expand uk-padding-remove uk-background-default">
|
||||
<div *ngIf="errorMessage.length > 0 || showLoading" class="uk-container uk-flex uk-flex-center uk-flex-middle">
|
||||
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-width-2-3 uk-margin-xlarge-top"
|
||||
role="alert">{{errorMessage}}</div>
|
||||
<div *ngIf="showLoading" class="uk-position-center">
|
||||
<loading></loading>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ng-template #graph_and_feedback_template>
|
||||
<div class="uk-flex uk-margin-small-top uk-margin-small-bottom" [class.uk-invisible]="!projectInfo">
|
||||
<!-- Last Index Info-->
|
||||
|
@ -108,7 +108,7 @@
|
|||
<ng-container *ngTemplateOutlet="graph_and_feedback_template"></ng-container>
|
||||
</div>
|
||||
|
||||
<div class="uk-margin-large-left uk-margin-large-right">
|
||||
<div class="uk-margin-large-left uk-margin-large-right" [style]="'margin-bottom: '+graph_height+'px'">
|
||||
<ng-container *ngIf="projectInfo">
|
||||
<div [attr.style]="'margin-top: '+(graph_height? 'calc(40px + 20px - '+graph_height+'px)': '40px')">
|
||||
<!-- schema.org-->
|
||||
|
@ -240,7 +240,16 @@
|
|||
uk-sticky="bottom: true; media: @m" [attr.offset]="offset"
|
||||
cls-active="active">
|
||||
<div class="uk-padding uk-padding-remove-horizontal uk-padding-remove-bottom">
|
||||
<showTitle *ngIf="stickyHeader" [titleName]="projectName" classNames="uk-margin-remove-bottom" class="uk-visible@m"></showTitle>
|
||||
<!-- <showTitle *ngIf="stickyHeader" [titleName]="projectName" classNames="uk-margin-remove-bottom" class="uk-visible@m"></showTitle>-->
|
||||
<landing-header *ngIf="stickyHeader" class="uk-visible@m"
|
||||
[properties]="properties" [title]="projectName"
|
||||
[subTitle]="projectInfo.acronym ? projectInfo.title : ''"
|
||||
[entityType]="'project'"
|
||||
[startDate]="projectInfo.startDate"
|
||||
[endDate]="projectInfo.endDate"
|
||||
[status]="projectInfo.status"
|
||||
isSticky="true">
|
||||
</landing-header>
|
||||
<my-tabs (selectedActiveTab)="onSelectActiveTab($event)" [offsetForSticky]="offset" [(isSticky)]="stickyHeader">
|
||||
<my-tab tabTitle="Summary" [tabId]="'summary'" [active]="true"></my-tab>
|
||||
<my-tab *ngIf="fetchPublications.searchUtils.totalResults > 0"
|
||||
|
|
|
@ -442,7 +442,7 @@ export class ProjectComponent {
|
|||
this.errorMessage = 'An error occurred please try again later';
|
||||
}else {
|
||||
this.seoService.createLinkForCanonicalURL(this.properties.domain + this.properties.baseLink + this.properties.searchLinkToProjects);
|
||||
this.errorMessage = 'No project found';
|
||||
this.errorMessage = 'No '+OpenaireEntities.PROJECT+' found';
|
||||
}
|
||||
this.showLoading = false;
|
||||
}
|
||||
|
|
|
@ -1,13 +1,5 @@
|
|||
<div id="tm-main" class="landing uk-section uk-padding-remove tm-middle">
|
||||
<div class="tm-main">
|
||||
<div *ngIf="errorMessage.length > 0 || showLoading" class="landing-background-default-color">
|
||||
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top"
|
||||
role="alert">{{errorMessage}}</div>
|
||||
<div *ngIf="showLoading" class="uk-position-center">
|
||||
<loading></loading>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="publication">
|
||||
<div *ngIf="!showFeedback" class="uk-grid">
|
||||
|
||||
|
@ -80,6 +72,14 @@
|
|||
|
||||
<!-- center box-->
|
||||
<div class="uk-width-expand uk-padding-remove uk-background-default">
|
||||
<div *ngIf="errorMessage.length > 0 || showLoading" class="uk-container uk-flex uk-flex-center uk-flex-middle">
|
||||
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-width-2-3 uk-margin-xlarge-top"
|
||||
role="alert">{{errorMessage}}</div>
|
||||
<div *ngIf="showLoading" class="uk-position-center">
|
||||
<loading></loading>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ng-template #graph_and_feedback_template>
|
||||
<div class="uk-flex uk-margin-small-bottom uk-margin-small-top" [class.uk-invisible]="!resultLandingInfo">
|
||||
<!-- Last Index Info-->
|
||||
|
@ -105,7 +105,7 @@
|
|||
<ng-container *ngTemplateOutlet="graph_and_feedback_template"></ng-container>
|
||||
</div>
|
||||
|
||||
<div class="uk-margin-large-left uk-margin-large-right uk-height-1-1">
|
||||
<div class="uk-margin-large-left uk-margin-large-right" [style]="'margin-bottom: '+graph_height+'px'">
|
||||
<ng-container *ngIf="resultLandingInfo">
|
||||
<!-- in small screens there is no sticky #graph_and_feedback so margin-top is medium (40px) -->
|
||||
<!-- else margin is medium (40px) - the actual height of uk-sticky-placeholder (graph_height - 20px -> margins of #graph_and_feedback) -->
|
||||
|
|
|
@ -522,13 +522,13 @@ export class ResultLandingComponent {
|
|||
this.errorMessage = 'An error occurred please try again later';
|
||||
}else{
|
||||
if (this.type == "publication") {
|
||||
this.errorMessage = "No "+ this.openaireEntities.PUBLICATIONS +" found";
|
||||
this.errorMessage = "No "+ this.openaireEntities.PUBLICATION +" found";
|
||||
} else if (this.type == "software") {
|
||||
this.errorMessage = 'No ' + this.openaireEntities.SOFTWARE + ' found';
|
||||
this.errorMessage = 'No ' + this.openaireEntities.SOFTWARE_SINGULAR + ' found';
|
||||
} else if (this.type == "dataset") {
|
||||
this.errorMessage += "No "+this.openaireEntities.DATASETS+" found";
|
||||
this.errorMessage += "No "+this.openaireEntities.DATASET+" found";
|
||||
} else if (this.type == "orp") {
|
||||
this.errorMessage += "No "+this.openaireEntities.OTHER+" found";
|
||||
this.errorMessage += "No "+this.openaireEntities.OTHER_SINGULAR+" found";
|
||||
}
|
||||
this.seoService.createLinkForCanonicalURL(this.properties.domain+ properties.baseLink + this.linkToSearchPage);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue