[develop | DONE | FIXED ] fix checks for deposit pages in explore

This commit is contained in:
argirok 2024-06-13 10:57:19 +03:00
parent ac25509dac
commit 1b7179207d
2 changed files with 38 additions and 27 deletions

View File

@ -105,7 +105,7 @@ import {FullScreenModalComponent} from '../utils/modal/full-screen-modal/full-sc
Find the appropriate repository. Find the appropriate repository.
</h2> </h2>
<div class="uk-grid uk-flex uk-flex-middle" uk-height-match="target: .uk-card-body, .uk-tile-primary;" uk-grid> <div class="uk-grid uk-flex uk-flex-middle" uk-height-match="target: .uk-card-body, .uk-tile-primary;" uk-grid>
<div page-enabled [pageRoute]="'/participate/deposit/search'"> <div page-enabled [pageRoute]="'/participate/deposit/search'" [communityId]="communityId">
<div class="uk-card uk-card-default uk-text-center" style="width: 360px;"> <div class="uk-card uk-card-default uk-text-center" style="width: 360px;">
<div class="uk-card-body uk-text-small"> <div class="uk-card-body uk-text-small">
<img src="assets/common-assets/common/Logo_Horizontal.png" alt="OpenAIRE logo" class="uk-width-small uk-margin-bottom"> <img src="assets/common-assets/common/Logo_Horizontal.png" alt="OpenAIRE logo" class="uk-width-small uk-margin-bottom">
@ -120,27 +120,40 @@ import {FullScreenModalComponent} from '../utils/modal/full-screen-modal/full-sc
</div> </div>
</div> </div>
</div> </div>
<div page-enabled [pageRoute]="'/participate/deposit/zenodo'"> <ng-container *ngIf="zenodoInformation.shareInZenodoUrl">
<div class="uk-card uk-card-default uk-text-center" style="width: 360px;"> <div page-enabled [pageRoute]="'/participate/deposit/zenodo'" [communityId]="communityId">
<div class="uk-card-body uk-text-small"> <div class="uk-card uk-card-default uk-text-center" style="width: 360px;">
<img src="assets/common-assets/common/logo-zenodo.png" alt="Zenodo logo" class="uk-width-small uk-margin-bottom"> <div class="uk-card-body uk-text-small">
<div class="uk-width-2-3@m uk-margin-auto"> <img src="assets/common-assets/common/logo-zenodo.png" alt="Zenodo logo" class="uk-width-small uk-margin-bottom">
Deposit your research in <span class="uk-text-bold">Zenodo repository</span> <div class="uk-width-2-3@m uk-margin-auto">
</div> Deposit your research in <span class="uk-text-bold">Zenodo repository</span>
</div> </div>
<div *ngIf="zenodoInformation.shareInZenodoUrl" class="uk-card-footer uk-padding-small uk-tile-primary uk-flex uk-flex-center uk-light"> </div>
<a class="uk-button uk-button-text" [routerLink]="zenodoInformation.shareInZenodoUrl" (click)="closeFsModal()"> <div class="uk-card-footer uk-padding-small uk-tile-primary uk-flex uk-flex-center uk-light">
Use related Zenodo communities <a class="uk-button uk-button-text" [routerLink]="zenodoInformation.shareInZenodoUrl" (click)="closeFsModal()">
</a> Use related Zenodo communities
</div> </a>
<div *ngIf="!zenodoInformation.shareInZenodoUrl" </div>
class="uk-card-footer uk-padding-small uk-tile-primary uk-flex uk-flex-center uk-light">
<a class="uk-button uk-button-text custom-external" [href]="zenodoInformation.url" target="_blank"> </div>
Zenodo Repository </div>
</a> </ng-container>
</div> <div *ngIf="!zenodoInformation.shareInZenodoUrl">
</div> <div class="uk-card uk-card-default uk-text-center" style="width: 360px;">
</div> <div class="uk-card-body uk-text-small">
<img src="assets/common-assets/common/logo-zenodo.png" alt="Zenodo logo" class="uk-width-small uk-margin-bottom">
<div class="uk-width-2-3@m uk-margin-auto">
Deposit your research in <span class="uk-text-bold">Zenodo repository</span>
</div>
</div>
<div
class="uk-card-footer uk-padding-small uk-tile-primary uk-flex uk-flex-center uk-light">
<a class="uk-button uk-button-text custom-external" [href]="zenodoInformation.url" target="_blank">
Zenodo Repository
</a>
</div>
</div>
</div>
<div page-enabled [pageRoute]="'/participate/deposit/suggested'" *ngIf="zenodoInformation.hasSuggestedRepositories"> <div page-enabled [pageRoute]="'/participate/deposit/suggested'" *ngIf="zenodoInformation.hasSuggestedRepositories">
<div class="uk-card uk-card-default uk-text-center" style="width: 360px;"> <div class="uk-card uk-card-default uk-text-center" style="width: 360px;">
<div class="uk-card-body uk-text-small"> <div class="uk-card-body uk-text-small">

View File

@ -18,6 +18,7 @@ import {Subscription} from "rxjs";
}) })
export class IsPageEnabledComponent implements OnInit, OnDestroy { export class IsPageEnabledComponent implements OnInit, OnDestroy {
@Input() pageRoute:string; @Input() pageRoute:string;
@Input() communityId:string;
public properties: EnvProperties = properties; public properties: EnvProperties = properties;
pageEnabled = false; pageEnabled = false;
@ -33,10 +34,7 @@ export class IsPageEnabledComponent implements OnInit, OnDestroy {
ngOnInit() { ngOnInit() {
this.subs.push(this.communityService.getCommunityAsObservable().subscribe( community => { this.getPageStatus();
this.community = community;
this.getPageStatus();
}));
} }
ngOnDestroy() { ngOnDestroy() {
@ -51,7 +49,7 @@ export class IsPageEnabledComponent implements OnInit, OnDestroy {
private getPageStatus() { private getPageStatus() {
this.configurationService.isPageEnabled(this.properties, this.community.communityId, '/' + this.pageRoute).subscribe((page) => { this.configurationService.isPageEnabled(this.properties, this.communityId, '/' + this.pageRoute).subscribe((page) => {
this.pageEnabled = page; this.pageEnabled = page;
}) })
} }