[Explore & Library | new-theme]: Updates of paging in claims and orcid links pages | Fixes for server side rendering.

1. fos.component.ts & sdg.component.ts: [Bug fix] Added properties.domain as prefix in request for vocabulary - Network error on server.
2. displayClaims.component.html: Used <results-and-pages> before results and <paging-no-load> after results.
3. searchMyOrcidResults.component.html: After results use <paging-no-load>.
4. displayClaims.module.ts & searchMyOrcidResults.module.ts: Imported NoLoadPaging.
5. dataProvider.component.ts & organization.component.ts & project.component.ts & resultLanding.component.ts: [Bug fix] Fixed checks in ngAfterContentChecked, not to run on server.
6. dataProvider.service.ts: Added check if there are subjects.
7. orcid-work.component.ts: [Bug fix] On search view, add classes uk-button uk-button-link in orcid actions.
8. newSearchPage.component.ts: Removed console.log.
This commit is contained in:
Konstantina Galouni 2022-05-17 00:31:28 +03:00
parent 2fac23fd10
commit 7d563c19a8
11 changed files with 68 additions and 58 deletions

View File

@ -62,14 +62,16 @@
</div>
<div *ngIf="resultsNum" class="uk-width-1-2 uk-grid uk-flex-right uk-flex-middle ">
<div class="uk-text-muted uk-text-uppercase">
<span class="uk-text-bold">{{resultsNum|number}}</span> links, page <span
class="uk-text-bold">{{page | number}}</span> of <span
class="uk-text-bold">{{totalPages(resultsNum)|number}}</span>
</div>
<paging-no-load [currentPage]="page" [totalResults]="resultsNum" [size]="size"
[loading]="pageLoading"
(pageChange)="pageChange($event)" class="uk-float-right"></paging-no-load>
<!-- <div class="uk-text-muted uk-text-uppercase">-->
<!-- <span class="uk-text-bold">{{resultsNum|number}}</span> links, page <span-->
<!-- class="uk-text-bold">{{page | number}}</span> of <span-->
<!-- class="uk-text-bold">{{totalPages(resultsNum)|number}}</span>-->
<!-- </div>-->
<results-and-pages type="links" [page]="page" [pageSize]="size" [totalResults]="resultsNum"></results-and-pages>
<!-- <paging-no-load [currentPage]="page" [totalResults]="resultsNum" [size]="size"-->
<!-- [loading]="pageLoading"-->
<!-- (pageChange)="pageChange($event)" class="uk-float-right"></paging-no-load>-->
</div>
</div>
@ -134,36 +136,39 @@
<div *ngIf="!( showErrorMessage || showForbiddenMessage || userValidMessage.length > 0 || (claims
&& claims.length
==0))" class="paging-hr uk-margin-top">
<div class="uk-grid ">
<div *ngIf="resultsNum>0" class="uk-width-1-2 uk-text-muted uk-text-uppercase">
<span class="uk-text-bold">{{resultsNum|number}}</span> links, page <span
class="uk-text-bold">{{page | number}}</span> of <span
class="uk-text-bold">{{totalPages(resultsNum)|number}}</span>
<!-- <div class="uk-grid ">-->
<!-- <div *ngIf="resultsNum>0" class="uk-width-1-2 uk-text-muted uk-text-uppercase">-->
<!-- <span class="uk-text-bold">{{resultsNum|number}}</span> links, page <span-->
<!-- class="uk-text-bold">{{page | number}}</span> of <span-->
<!-- class="uk-text-bold">{{totalPages(resultsNum)|number}}</span>-->
<!---->
<!-- </div>-->
<!-- <div *ngIf="resultsNum" class="uk-width-1-2 ">-->
<!-- <paging-no-load [currentPage]="page" [totalResults]="resultsNum" [size]="size"-->
<!-- (pageChange)="pageChange($event)" class="uk-float-right"></paging-no-load>-->
<!-- </div>-->
<!-- </div>-->
<!-- <no-load-paging *ngIf="resultsNum" type="links" [totalResults]="resultsNum" [pageSize]="size" [page]="page" (pageChange)="pageChange($event)"></no-load-paging>-->
<paging-no-load *ngIf="resultsNum" [currentPage]="page" [totalResults]="resultsNum" [size]="size"
(pageChange)="pageChange($event)" class="uk-float-right"></paging-no-load>
</div>
</div>
</div>
<helper *ngIf="pageContents && pageContents['right'] && pageContents['right'].length > 0"
[texts]="pageContents['right']" class="uk-width-1-5"></helper>
</div>
<div *ngIf="resultsNum" class="uk-width-1-2 ">
<paging-no-load [currentPage]="page" [totalResults]="resultsNum" [size]="size"
(pageChange)="pageChange($event)" class="uk-float-right"></paging-no-load>
</div>
</div>
</div>
</div>
</div>
<helper *ngIf="pageContents && pageContents['right'] && pageContents['right'].length > 0"
[texts]="pageContents['right']" class="uk-width-1-5"></helper>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']"></helper>
<modal-alert (alertOutput)="confirmClose()">
<h4 class="modal-title uk-text-bold " id="myModalLabel">Are you sure?</h4>
<p>
You are about to delete {{this.selected.length}} link(s) you selected. <br>
<span class="uk-text-bold">
Usually it takes 2-4 weeks for the links to permanently disappear from the Openaire platfrom.
</span>
</p>
</div>
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
[texts]="pageContents['bottom']"></helper>
<modal-alert (alertOutput)="confirmClose()">
<h4 class="modal-title uk-text-bold " id="myModalLabel">Are you sure?</h4>
<p>
You are about to delete {{this.selected.length}} link(s) you selected. <br>
<span class="uk-text-bold">
Usually it takes 2-4 weeks for the links to permanently disappear from the Openaire platfrom.
</span>
</p>
<p>Do you want to delete the link(s)?</p>
</modal-alert>
<modal-loading [message]="'Please wait...'"></modal-loading>
<p>Do you want to delete the link(s)?</p>
</modal-alert>
<modal-loading [message]="'Please wait...'"></modal-loading>

View File

@ -21,12 +21,13 @@ import {PiwikServiceModule} from "../../../utils/piwik/piwikService.module";
import {SearchInputModule} from '../../../sharedComponents/search-input/search-input.module';
import {InputModule} from '../../../sharedComponents/input/input.module';
import {LoadingModule} from '../../../utils/loading/loading.module';
import {NoLoadPaging} from "../../../searchPages/searchUtils/no-load-paging.module";
@NgModule({
imports: [
CommonModule, FormsModule, RouterModule, ClaimServiceModule, LoadingModalModule, AlertModalModule,
ClaimEntityFormatterModule, PagingModule, HelperModule, Schema2jsonldModule, SEOServiceModule, PiwikServiceModule,
IndexInfoServiceModule, MatSelectModule, SearchInputModule, MatAutocompleteModule, MatChipsModule, MatFormFieldModule, MatSlideToggleModule, InputModule, LoadingModule
IndexInfoServiceModule, MatSelectModule, SearchInputModule, MatAutocompleteModule, MatChipsModule, MatFormFieldModule, MatSlideToggleModule, InputModule, LoadingModule, NoLoadPaging
],
declarations: [

View File

@ -222,7 +222,7 @@ export class DataProviderComponent {
}
ngAfterContentChecked() {
if(this.graph_and_feedback && window) {
if(this.graph_and_feedback && typeof document !== 'undefined') {
this.graph_offset = this.calcGraphOffset(this.graph_and_feedback.nativeElement);
}
}

View File

@ -155,11 +155,13 @@ export class DataProviderService {
}
this.dataProviderInfo.subjects = [];
length = Array.isArray(data[0]['subjects']) ? data[0]['subjects'].length : 1;
for(let i=0; i<length; i++) {
let subject = Array.isArray(data[0]['subjects']) ? data[0]['subjects'][i] :data[0]['subjects'];
if(subject && subject.content) {
this.dataProviderInfo.subjects.push(subject.content);
if(data[0].subjects) {
let length = Array.isArray(data[0]['subjects']) ? data[0]['subjects'].length : 1;
for (let i = 0; i < length; i++) {
let subject = Array.isArray(data[0]['subjects']) ? data[0]['subjects'][i] : data[0]['subjects'];
if (subject && subject.content) {
this.dataProviderInfo.subjects.push(subject.content);
}
}
}

View File

@ -208,7 +208,7 @@ export class OrganizationComponent {
}
ngAfterContentChecked() {
if(this.graph_and_feedback && window) {
if(this.graph_and_feedback && typeof document !== 'undefined') {
this.graph_offset = this.calcGraphOffset(this.graph_and_feedback.nativeElement);
}
}

View File

@ -250,7 +250,7 @@ export class ProjectComponent {
}
ngAfterContentChecked() {
if(this.graph_and_feedback && window) {
if(this.graph_and_feedback && typeof document !== 'undefined') {
this.graph_offset = this.calcGraphOffset(this.graph_and_feedback.nativeElement);
}
}

View File

@ -239,7 +239,7 @@ export class ResultLandingComponent {
}
ngAfterContentChecked() {
if(this.graph_and_feedback && window) {
if(this.graph_and_feedback && typeof document !== 'undefined') {
this.graph_offset = this.calcGraphOffset(this.graph_and_feedback.nativeElement);
}
}

View File

@ -33,9 +33,12 @@
</li>
</ul>
<no-load-paging *ngIf="totalResults > 0 && previewResults && previewResults.length" [type]="openaireEntities.RESULTS"
(pageChange)="pageChanged($event)"
[page]="currentPage" [pageSize]="resultsPerPage"
[totalResults]="totalResults">
</no-load-paging>
<!-- <no-load-paging *ngIf="totalResults > 0 && previewResults && previewResults.length" [type]="openaireEntities.RESULTS"-->
<!-- (pageChange)="pageChanged($event)"-->
<!-- [page]="currentPage" [pageSize]="resultsPerPage"-->
<!-- [totalResults]="totalResults">-->
<!-- </no-load-paging>-->
<paging-no-load *ngIf="totalResults > 0 && previewResults && previewResults.length"
[totalResults]="totalResults" [currentPage]="currentPage" [size]="resultsPerPage"
(pageChange)="pageChanged($event)" class="uk-float-right"></paging-no-load>
</div>

View File

@ -8,12 +8,13 @@ import {ErrorMessagesModule} from "../../utils/errorMessages.module";
import {searcMyOrcidResultsComponent} from "./searchMyOrcidResults.component";
import {OrcidModule} from "../orcid.module";
import {NoLoadPaging} from "../../searchPages/searchUtils/no-load-paging.module";
import {PagingModule} from "../../utils/paging.module";
@NgModule({
imports: [
CommonModule, FormsModule,
RouterModule, ErrorMessagesModule,
ResultPreviewModule, OrcidModule, NoLoadPaging
ResultPreviewModule, OrcidModule, NoLoadPaging, PagingModule
],
declarations: [
searcMyOrcidResultsComponent

View File

@ -26,7 +26,7 @@ declare var UIkit: any;
class="uk-align-right uk-margin-remove-bottom">
<a (click)="currentAction='add'; saveWorkPreparation();"
[class]="'uk-flex uk-flex-middle uk-flex-right uk-margin-right '+ ((showLoading || !isLoggedIn) ? 'uk-disabled ' : '') + (!isLoggedIn ? 'half-opacity' : '')">
[class]="'uk-button uk-button-link uk-flex uk-flex-middle uk-flex-right uk-margin-right '+ ((showLoading || !isLoggedIn) ? 'uk-disabled ' : '') + (!isLoggedIn ? 'half-opacity' : '')">
<icon *ngIf="!showLoading" name="add" ratio="1" flex="true"></icon>
<span *ngIf="showLoading" class="uk-icon icon-button"><loading [top_margin]="false"></loading></span>
<span class="uk-margin-small-left uk-flex uk-flex-middle">Add to&#160;
@ -42,7 +42,7 @@ declare var UIkit: any;
[attr.uk-tooltip]="(!isLoggedIn) ? tooltipNoLoggedInUser : tooltipDelete"
class="uk-align-right uk-margin-remove-bottom">
<a (click)="currentAction='delete'; deleteWorks();"
[class]="'uk-flex uk-flex-middle uk-flex-right uk-margin-right '+ (showLoading ? 'uk-disabled' : '')">
[class]="'uk-button uk-button-link uk-flex uk-flex-middle uk-flex-right uk-margin-right '+ (showLoading ? 'uk-disabled' : '')">
<icon *ngIf="!showLoading" name="delete" ratio="0.8" flex="true"></icon>
<span *ngIf="showLoading" class="uk-icon icon-button"><loading [top_margin]="false"></loading></span>
<span class="uk-margin-small-left uk-flex uk-flex-middle">Delete from&#160;

View File

@ -940,7 +940,6 @@ export class NewSearchPageComponent {
if (types.indexOf("datasources") == -1 || types.indexOf("services") == -1) {
for (let type of types) {
console.log("add type: " + type);
params += (params ? ' and ' : '') + ("eosctype exact " + (types.indexOf("datasources") != -1 ? "\"Data Source\"" : "\"Service\""));
// allFqs += "&type=" + StringUtils.unquote(StringUtils.URIDecode(type));
}
@ -1366,7 +1365,6 @@ export class NewSearchPageComponent {
//this.parameterValues.push(this.searchUtils.sortBy);
this.parameterValues.push(this.sortedByChanged);
}
console.log(this.resultTypes);
if (this.resultTypes &&
(
(this.entityType == 'publication' || this.entityType == 'dataset' || this.entityType == 'software' || this.entityType == 'other' || this.entityType == "result")