[pluginsFunctionality | DONE | CHANGED] Deposit add page-enabled check to show links only if page is enabled, updates on the list of zenodo communities that contains master

This commit is contained in:
argirok 2024-06-10 09:08:32 +03:00
parent 04151f5d0b
commit f769567a7e
5 changed files with 16 additions and 10 deletions

View File

@ -11,22 +11,22 @@
<h2 class="uk-margin-top uk-margin-medium-bottom uk-width-1-2@m">Repositories suggested by the curators.</h2>
<div class="uk-flex uk-flex-center uk-flex-middle uk-width-expand@m uk-width-1-1@s">
<div class="uk-padding">
<div class="uk-flex uk-flex-column uk-flex-middle uk-margin-large-bottom">
<div page-enabled [pageRoute]="'/participate/deposit/zenodo'" class="uk-flex uk-flex-column uk-flex-middle uk-margin-large-bottom">
<img src="assets/common-assets/common/logo-zenodo.png" alt="Zenodo logo" class="uk-width-small ">
<div *ngIf="this.community.zenodoCommunity || this.community.otherZenodoCommunities.length > 0" class="">
<div *ngIf="this.community.zenodoCommunity || this.community.otherZenodoCommunities.length > 0" class="">
<a class="uk-button uk-button-text" [routerLink]="['../zenodo']" >
Use related Zenodo communities
</a>
</div>
<div *ngIf="!(this.community.zenodoCommunity || this.community.otherZenodoCommunities.length > 0)"
<div *ngIf="!(this.community.zenodoCommunity || this.community.otherZenodoCommunities.length > 0)"
class="">
<a class="uk-button uk-button-text custom-external" [href]="properties.zenodo" target="_blank">
Zenodo Repository
</a>
</div>
</div>
<div class="uk-flex uk-flex-column uk-flex-middle">
<div page-enabled [pageRoute]="'/participate/deposit/search'" class="uk-flex uk-flex-column uk-flex-middle">
<img src="assets/common-assets/common/Logo_Horizontal.png" alt="OpenAIRE logo" class="uk-width-small uk-margin-bottom">
<a routerLink="/participate/deposit/search" type="submit"
class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text">

View File

@ -18,12 +18,13 @@ import {LoadingModule} from 'src/app/openaireLibrary/utils/loading/loading.modul
import {SuggestedRepositoriesRoutingModule} from "./suggestedRepositories-routing.module";
import {SuggestedRepositoriesComponent} from "./suggestedRepositories.component";
import {SearchCommunityDataprovidersService} from "../../openaireLibrary/connect/contentProviders/searchDataproviders.service";
import {IsPageEnabledModule} from "../../openaireLibrary/utils/isPageEnabled/isPageEnabled.module";
@NgModule({
imports: [
CommonModule, SuggestedRepositoriesRoutingModule, ZenodoCommunitiesServiceModule,
RouterModule, HelperModule, LoadingModule,
PiwikServiceModule, Schema2jsonldModule, SEOServiceModule, BreadcrumbsModule, NoLoadPaging, IconsModule
PiwikServiceModule, Schema2jsonldModule, SEOServiceModule, BreadcrumbsModule, NoLoadPaging, IconsModule, IsPageEnabledModule
],
declarations: [
SuggestedRepositoriesComponent

View File

@ -61,7 +61,8 @@
</div>
<div class="uk-flex uk-flex-center uk-flex-middle">
<div class="uk-padding">
<div class="uk-flex uk-flex-column uk-flex-middle uk-margin-large-bottom">
<div page-enabled [pageRoute]="'/participate/deposit/suggested'"
class="uk-flex uk-flex-column uk-flex-middle uk-margin-large-bottom">
<img src="assets/connect-assets/deposit/suggested-repositories.svg" alt="Suggested Repositories"
class="uk-width-small uk-margin-bottom" style="height: 70px;">
<a routerLink="/participate/deposit/suggested" type="submit"
@ -69,7 +70,7 @@
Suggested Repositories
</a>
</div>
<div class="uk-flex uk-flex-column uk-flex-middle">
<div page-enabled [pageRoute]="'/participate/deposit/search'" class="uk-flex uk-flex-column uk-flex-middle">
<img src="assets/common-assets/common/Logo_Horizontal.png" alt="OpenAIRE logo"
class="uk-width-small uk-margin-bottom">
<a routerLink="/participate/deposit/search" type="submit"

View File

@ -24,7 +24,7 @@ export class ShareInZenodoComponent {
public title: string = "Share in Zenodo";
properties: EnvProperties = properties;
communityId: string = null;
private community: CommunityInfo = null;
community: CommunityInfo = null;
public pageContents = null;
public divContents = null;
@ -89,12 +89,15 @@ export class ShareInZenodoComponent {
},
error => {
this.handleError("Error getting Master Zenodo community with id: " + this.masterZenodoCommunityId, error);
}
));
}
this.zenodoSearchUtils.status = this.errorCodes.LOADING;
this.communityIds = this.community.otherZenodoCommunities;
if(this.communityIds && this.masterZenodoCommunityId && this.communityIds.indexOf(this.masterZenodoCommunityId) !=-1){
this.communityIds.splice(this.communityIds.indexOf(this.masterZenodoCommunityId), 1)
}
this.zenodoSearchUtils.totalResults = this.communityIds.length;
if (this.communityIds.length == 0) {
this.zenodoSearchUtils.status = this.errorCodes.NONE;

View File

@ -18,12 +18,13 @@ import {NoLoadPaging} from "../../openaireLibrary/searchPages/searchUtils/no-loa
import {IconsModule} from 'src/app/openaireLibrary/utils/icons/icons.module';
import {LoadingModule} from 'src/app/openaireLibrary/utils/loading/loading.module';
import {SearchCommunityDataprovidersService} from "../../openaireLibrary/connect/contentProviders/searchDataproviders.service";
import {IsPageEnabledModule} from "../../openaireLibrary/utils/isPageEnabled/isPageEnabled.module";
@NgModule({
imports: [
CommonModule, ShareInZenodoRoutingModule, ZenodoCommunitiesServiceModule,
RouterModule, HelperModule, LoadingModule,
PiwikServiceModule, Schema2jsonldModule, SEOServiceModule, BreadcrumbsModule, NoLoadPaging, IconsModule
PiwikServiceModule, Schema2jsonldModule, SEOServiceModule, BreadcrumbsModule, NoLoadPaging, IconsModule, IsPageEnabledModule
],
declarations: [
ShareInZenodoComponent