[plugins-functionality | WIP] create plugins on separate folders/components

This commit is contained in:
Alex Martzios 2024-01-31 11:05:46 +02:00
parent a373357ccf
commit 3ec805c51c
24 changed files with 751 additions and 2 deletions

View File

@ -0,0 +1,13 @@
<div>plugin-discover-by-subcommunity</div>
<div class="plugin-discover-by-subcommunity uk-container uk-container-large uk-section">
<h3 class="uk-text-center uk-margin-large-bottom">
Discover content by sub-community
</h3>
<ul class="uk-subnav uk-subnav-pill">
<li *ngFor="let item of [].constructor(16);" class="uk-margin-small-bottom">
<a>
Lorem ipsum
</a>
</li>
</ul>
</div>

View File

@ -0,0 +1,12 @@
import {Component} from '@angular/core';
import {PluginBaseComponent} from "../../utils/base-plugin.component";
@Component({
selector: 'plugin-discover-by-subcommunity',
templateUrl: 'plugin-discover-by-subcommunity.component.html'
})
export class PluginDiscoverBySubcommunityComponent extends PluginBaseComponent{
constructor() {
super()
}
}

View File

@ -0,0 +1,25 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {PluginsService} from "../../../../services/plugins.service";
import {IconsModule} from "../../../../utils/icons/icons.module";
import {NumberRoundModule} from "../../../../utils/pipes/number-round.module";
import {IconsService} from "../../../../utils/icons/icons.service";
import {SearchResearchResultsServiceModule} from "../../../../services/searchResearchResultsService.module";
import {PluginFieldEditModule} from "../../utils/plugin-field-edit.module";
import {PluginDiscoverBySubcommunityComponent} from './plugin-discover-by-subcommunity.component';
@NgModule({
imports: [
CommonModule, RouterModule, FormsModule, IconsModule, NumberRoundModule, SearchResearchResultsServiceModule, PluginFieldEditModule
],
providers:[PluginsService],
declarations: [PluginDiscoverBySubcommunityComponent],
exports: [PluginDiscoverBySubcommunityComponent]
})
export class PluginDiscoverBySubcommunityModule {
constructor(private iconsService: IconsService) {
this.iconsService.registerIcons([])
}
}

View File

@ -0,0 +1,15 @@
<div>plugin-featured-datasets</div>
<div class="plugin-featured-datasets uk-container uk-container-large uk-section">
<div class="uk-flex uk-flex-middle uk-flex-between uk-margin-large-bottom">
<h3 class="uk-margin-remove">
Featured Datasets
</h3>
<a href="" class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default">
View all
</a>
</div>
<div>
<!-- Will we use search-result component? Featured dataset card will need some alterations. Also there is no "View all" page I think -->
content
</div>
</div>

View File

@ -0,0 +1,12 @@
import {Component} from '@angular/core';
import {PluginBaseComponent} from "../../utils/base-plugin.component";
@Component({
selector: 'plugin-featured-datasets',
templateUrl: 'plugin-featured-datasets.component.html'
})
export class PluginFeaturedDatasetsComponent extends PluginBaseComponent{
constructor() {
super()
}
}

View File

@ -0,0 +1,25 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {PluginsService} from "../../../../services/plugins.service";
import {IconsModule} from "../../../../utils/icons/icons.module";
import {NumberRoundModule} from "../../../../utils/pipes/number-round.module";
import {IconsService} from "../../../../utils/icons/icons.service";
import {SearchResearchResultsServiceModule} from "../../../../services/searchResearchResultsService.module";
import {PluginFieldEditModule} from "../../utils/plugin-field-edit.module";
import {PluginFeaturedDatasetsComponent} from './plugin-featured-datasets.component';
@NgModule({
imports: [
CommonModule, RouterModule, FormsModule, IconsModule, NumberRoundModule, SearchResearchResultsServiceModule, PluginFieldEditModule
],
providers:[PluginsService],
declarations: [PluginFeaturedDatasetsComponent],
exports: [PluginFeaturedDatasetsComponent]
})
export class PluginFeaturedDatasetsModule {
constructor(private iconsService: IconsService) {
this.iconsService.registerIcons([])
}
}

View File

@ -0,0 +1,80 @@
<div>plugin-gateway-information</div>
<div class="plugin-gateway-information uk-border-rounded uk-padding uk-margin-medium-bottom">
<img class="plugin-background" src="assets/common-assets/connect_image_faded.png">
<div class="plugin-content">
<div class="uk-text-lead uk-text-large uk-text-bold uk-margin-bottom">
Gateway Information
</div>
<div *ngIf="isRouteEnabled('/curators')" class="uk-text-small uk-margin-xsmall-bottom">
<curators [longView]="false"></curators>
</div>
<div *ngIf="community.date" class="uk-text-small">
<span>Created: </span> {{community.date | date:'dd-MMM-yyyy'}}
</div>
<div class="uk-grid uk-grid-large uk-grid-stack uk-margin-top" uk-grid uk-height-match=".info-number">
<div>
<div *ngIf="projectTotal && projectTotal > 0 && isEntityEnabled('project') && isRouteEnabled(searchLinkToProjects)"
class="uk-flex uk-flex-column uk-margin-bottom info-number">
<a class="uk-h5 uk-margin-remove" [queryParams]=params
routerLinkActive="router-link-active"
[routerLink]="searchLinkToProjects">
{{projectTotal|number}}
</a>
<span class="uk-flex uk-flex-middle uk-text-small">
Projects
<a *ngIf="projectsCalculated && (projectTotal && projectTotal > 0 && isEntityEnabled('project') && isRouteEnabled(searchLinkToProjects))"
[title]="buildProjectsTooltip()"
[attr.uk-tooltip]="'pos: bottom-right; delay: 10;'"
class="uk-link-reset uk-margin-xsmall-left">
<icon [name]="'help_outline'" [type]="'outlined'" [ratio]="0.8" [flex]="true" [customClass]="'uk-text-muted'"></icon>
</a>
</span>
</div>
<div *ngIf="contentProviderTotal && contentProviderTotal > 0 && isEntityEnabled('datasource') && isRouteEnabled(searchLinkToDataProviders)"
class="uk-flex uk-flex-column info-number">
<a class="uk-h5 uk-margin-remove" [queryParams]=params
routerLinkActive="router-link-active"
[routerLink]="searchLinkToDataProviders">
{{contentProviderTotal|number}}
</a>
<span class="uk-flex uk-flex-middle uk-text-small">
Content Providers
<a *ngIf="contentProvidersCalculated && (contentProviderTotal && contentProviderTotal > 0 && isEntityEnabled('datasource') && isRouteEnabled(searchLinkToDataProviders))"
[title]="buildContentProvidersTooltip()"
[attr.uk-tooltip]="'pos: bottom-right; delay: 10;'"
class="uk-link-reset uk-margin-xsmall-left">
<icon [name]="'help_outline'" [type]="'outlined'" [ratio]="0.8" [flex]="true" [customClass]="'uk-text-muted'"></icon>
</a>
</span>
</div>
</div>
<div>
<div *ngIf="(zenodoCommunityIdS.length + ((masterZenodoCommunity) ? 1 : 0) > 0) && isRouteEnabled(shareInZenodoPage)"
class="uk-flex uk-flex-column uk-margin-bottom info-number">
<a class="uk-h5 uk-margin-remove" [queryParams]=params
routerLinkActive="router-link-active" [routerLink]="shareInZenodoPage">
{{zenodoCommunityIdS.length + ((masterZenodoCommunity) ? 1 : 0)}}
</a>
<span class="uk-flex uk-flex-middle uk-text-small">
Linked Zenodo Communities
<a [title]="buildZenodoCommunitiesTooltip()"
[attr.uk-tooltip]="'pos: bottom-right; delay: 10;'"
class="uk-link-reset uk-margin-xsmall-left">
<icon [name]="'help_outline'" [type]="'outlined'" [ratio]="0.8" [flex]="true" [customClass]="'uk-text-muted'"></icon>
</a>
</span>
</div>
<div *ngIf="isRouteEnabled('/subjects') && displayedAllSubjects && displayedAllSubjects.length > 0"
class="uk-flex uk-flex-column uk-margin-bottom info-number">
<a class="uk-h5 uk-margin-remove"
routerLinkActive="router-link-active" [routerLink]="'/subjects'">
{{displayedAllSubjects.length}}
</a>
<span class="uk-text-small">
Subjects
</span>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,16 @@
.plugin-gateway-information {
overflow: hidden;
position: relative;
.plugin-background {
object-fit: cover;
opacity: 0.3;
position: absolute;
left: 0;
top: 0;
width: 100%;
height: 100%;
}
.plugin-content {
position: relative;
}
}

View File

@ -0,0 +1,164 @@
import {Component} from '@angular/core';
import {PluginBaseComponent} from "../../utils/base-plugin.component";
import {ConfigurationService} from '../../../../../openaireLibrary/utils/configuration/configuration.service';
import {CommunityService} from '../../../../../openaireLibrary/connect/community/community.service';
import {SearchCommunityProjectsService} from '../../../../../openaireLibrary/connect/projects/searchProjects.service';
import {SearchCommunityDataprovidersService} from '../../../../../openaireLibrary/connect/contentProviders/searchDataproviders.service';
import {ZenodoCommunitiesService} from '../../../../../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
import {ConnectHelper} from '../../../../../openaireLibrary/connect/connectHelper';
import {User} from '../../../../../openaireLibrary/login/utils/helper.class';
@Component({
selector: 'plugin-gateway-information',
templateUrl: 'plugin-gateway-information.component.html',
styleUrls: ['plugin-gateway-information.component.less']
})
export class PluginGatewayInformationComponent extends PluginBaseComponent{
community = null;
portal = null;
params: any = {};
projectTotal = null;
contentProviderTotal = null;
projectsCalculated: boolean = false;
contentProvidersCalculated: boolean = false;
zenodoCommunityIdS = [];
masterZenodoCommunity = null;
searchLinkToProjects: string = null;
searchLinkToDataProviders: string = null;
shareInZenodoPage: string = null;
displayedAllSubjects = [];
displayedSubjects = [];
displayedSdg = [];
displayedFos = [];
private user: User;
constructor(private config: ConfigurationService,
private communityService: CommunityService,
private searchCommunityProjectsService: SearchCommunityProjectsService,
private searchCommunityDataprovidersService: SearchCommunityDataprovidersService,
private zenodoCommunitiesService: ZenodoCommunitiesService) {
super()
}
ngOnInit() {
this.searchLinkToProjects = this.properties.searchLinkToProjects;
this.searchLinkToDataProviders = this.properties.searchLinkToDataProviders;
this.shareInZenodoPage = this.properties.shareInZenodoPage;
this.subscriptions.push(this.config.portalAsObservable.subscribe(
res => {
console.log(res);
this.portal = res;
},
error => {
console.log(error);
}
));
this.subscriptions.push(this.communityService.getCommunityAsObservable().subscribe(
community => {
console.log(community);
this.community = community;
if(community && !ConnectHelper.isPrivate(community, this.user)) {
this.displayedSubjects = community.subjects;
this.displayedSdg = community.sdg;
this.displayedFos = community.fos;
this.displayedSubjects.forEach(element => {
this.displayedAllSubjects.push({value: element, type: 'resultsubject'});
});
this.displayedSdg.forEach(element => {
this.displayedAllSubjects.push({value: element, type: 'sdg'});
});
this.displayedFos.forEach(element => {
this.displayedAllSubjects.push({value: element, type: 'fos'});
});
if (this.properties.environment == "development") {
this.params = {communityId: community.communityId};
}
if (this.community.zenodoCommunity) {
this.subscriptions.push(this.zenodoCommunitiesService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities + this.community.zenodoCommunity).subscribe(
res => {
this.masterZenodoCommunity = res;
},
error => {
console.log(error);
}
));
}
this.zenodoCommunityIdS = this.community.otherZenodoCommunities;
}
}
));
// Double check below: is `this.community.communityId` correct? the other way was through @input communityID from ConnectHelper service - domain
this.subscriptions.push(this.searchCommunityProjectsService.countTotalProjects(this.properties, this.community.communityId).subscribe(
res => {
this.projectTotal = res;
},
error => {
console.log(error);
},
() => {
this.projectsCalculated = true;
}
));
// Double check below: is `this.community.communityId` correct? the other way was through @input communityID from ConnectHelper service - domain
this.subscriptions.push(this.searchCommunityDataprovidersService.countTotalDataproviders(this.properties, this.community.communityId).subscribe(
res => {
this.contentProviderTotal = res;
},
error => {
console.log(error);
},
() => {
this.contentProvidersCalculated = true;
}
));
}
isEntityEnabled(entity: string) {
return this.portal.entities.some(x => x['pid'] == entity && x['isEnabled'] === true);
}
isRouteEnabled(route: string) {
return this.portal.pages.some(x => x['route'] == route && x['isEnabled'] === true);
}
buildProjectsTooltip(): string {
let tooltipContent: string = "<div>";
if (this.projectTotal != null && this.projectTotal > 0 && this.isEntityEnabled('project') && this.isRouteEnabled(this.searchLinkToProjects)) {
tooltipContent += "<span class='uk-text-bold'>Projects</span>";
}
tooltipContent += " have been selected as relevant for your community by the gateway curators.";
tooltipContent += "</div>";
return tooltipContent;
}
public buildContentProvidersTooltip(): string {
let tooltipContent: string = "<div>";
if (this.contentProviderTotal != null && this.contentProviderTotal > 0 && this.isEntityEnabled('datasource') && this.isRouteEnabled(this.searchLinkToDataProviders)) {
tooltipContent += "<span class='uk-text-bold'>Content Providers</span>";
}
tooltipContent += " have been selected as relevant for your community by the gateway curators.";
tooltipContent += "</div>";
return tooltipContent;
}
public buildZenodoCommunitiesTooltip(): string {
let tooltipContent: string = "<div>";
tooltipContent += "<span class='uk-text-bold'>Zenodo</span> is a catch-all repository for OpenAIRE.";
tooltipContent += "<div class='uk-margin-small-top'>A <span class='uk-text-bold'>Zenodo Community</span> is created and curated by Zenodo users.</div>";
tooltipContent += "</div>";
return tooltipContent;
}
}

View File

@ -0,0 +1,27 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {PluginsService} from "../../../../services/plugins.service";
import {IconsModule} from "../../../../utils/icons/icons.module";
import {NumberRoundModule} from "../../../../utils/pipes/number-round.module";
import {IconsService} from "../../../../utils/icons/icons.service";
import {SearchResearchResultsServiceModule} from "../../../../services/searchResearchResultsService.module";
import {PluginFieldEditModule} from "../../utils/plugin-field-edit.module";
import {PluginGatewayInformationComponent} from './plugin-gateway-information.component';
import {CuratorsModule} from '../../../../../curators/curators.module';
@NgModule({
imports: [
CommonModule, RouterModule, FormsModule, IconsModule, NumberRoundModule, SearchResearchResultsServiceModule, PluginFieldEditModule,
CuratorsModule
],
providers:[PluginsService],
declarations: [PluginGatewayInformationComponent],
exports: [PluginGatewayInformationComponent]
})
export class PluginGatewayInformationModule {
constructor(private iconsService: IconsService) {
this.iconsService.registerIcons([])
}
}

View File

@ -0,0 +1,58 @@
<div>plugin-how-to-use</div>
<div class="plugin-how-to-use uk-container uk-container-large uk-section">
<h3 class="uk-h2 uk-margin-large-bottom">
How to use the gateway?
</h3>
<div class="uk-padding" uk-height-match=".title">
<div class="uk-padding uk-grid uk-child-width-1-3@m uk-child-width-1-1 uk-grid-large" uk-grid uk-height-match=".description">
<!-- icon1, title1, description1, link1 -->
<div class="uk-flex uk-flex-column uk-flex-middle">
<div class="uk-card uk-card-default uk-card-body">
<icon [name]="'description'" [type]="'outlined'" [ratio]="3" [flex]="true"></icon>
</div>
<h5 class="title">
Tutorials
</h5>
<div class="uk-text-center uk-margin-bottom description">
The mini-video tutorials can help you find quick answers on specific gateway functionalities.
</div>
<a href="" class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default">
View all
</a>
</div>
<!-- icon2, title2, description2, link2 -->
<div class="uk-flex uk-flex-column uk-flex-middle">
<div class="uk-card uk-card-default uk-card-body">
<icon [name]="'description'" [type]="'outlined'" [ratio]="3" [flex]="true"></icon>
</div>
<h5 class="title">
Guides
</h5>
<div class="uk-text-center uk-margin-bottom description">
Textual guides to all gateway functionalities.
</div>
<a href="" class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default">
Guide for the users
</a>
<a href="" class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default">
Guide for the managers
</a>
</div>
<!-- icon3, title3, description3, link3 -->
<div class="uk-flex uk-flex-column uk-flex-middle">
<div class="uk-card uk-card-default uk-card-body">
<icon [name]="'description'" [type]="'outlined'" [ratio]="3" [flex]="true"></icon>
</div>
<h5 class="title">
Webinars
</h5>
<div class="uk-text-center uk-margin-bottom description">
Recordings and slides of webinars on OpenAIRE CONNECT and your gateway.
</div>
<a href="" class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default">
View all
</a>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,12 @@
import {Component} from '@angular/core';
import {PluginBaseComponent} from "../../utils/base-plugin.component";
@Component({
selector: 'plugin-how-to-use',
templateUrl: 'plugin-how-to-use.component.html'
})
export class PluginHowToUseComponent extends PluginBaseComponent{
constructor() {
super()
}
}

View File

@ -0,0 +1,25 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {PluginsService} from "../../../../services/plugins.service";
import {IconsModule} from "../../../../utils/icons/icons.module";
import {NumberRoundModule} from "../../../../utils/pipes/number-round.module";
import {IconsService} from "../../../../utils/icons/icons.service";
import {SearchResearchResultsServiceModule} from "../../../../services/searchResearchResultsService.module";
import {PluginFieldEditModule} from "../../utils/plugin-field-edit.module";
import {PluginHowToUseComponent} from './plugin-how-to-use.component';
@NgModule({
imports: [
CommonModule, RouterModule, FormsModule, IconsModule, NumberRoundModule, SearchResearchResultsServiceModule, PluginFieldEditModule
],
providers:[PluginsService],
declarations: [PluginHowToUseComponent],
exports: [PluginHowToUseComponent]
})
export class PluginHowToUseModule {
constructor(private iconsService: IconsService) {
this.iconsService.registerIcons([])
}
}

View File

@ -0,0 +1,57 @@
<div>plugin-learn-and-connect</div>
<div class="plugin-learn-and-connect uk-container uk-container-large uk-section">
<h3 class="uk-h2 uk-margin-large-bottom">
Learn & Connect with Open Science
</h3>
<div class="uk-padding" uk-height-match=".title">
<div class="uk-padding uk-grid uk-child-width-1-3@m uk-child-width-1-1 uk-grid-large" uk-grid uk-height-match=".description">
<!-- icon1, title1, description1, link1 -->
<div class="uk-flex uk-flex-column uk-flex-middle">
<div class="uk-card uk-card-default uk-card-body">
<icon [name]="'description'" [type]="'outlined'" [ratio]="3" [flex]="true"></icon>
</div>
<h5 class="title">
OS Practices
</h5>
<div class="uk-text-center uk-margin-bottom description">
Open Science best practices for your community, policies and mandates.
</div>
<a href="" class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default">
Learn more
</a>
</div>
<!-- icon2, title2, description2, link2 -->
<div class="uk-flex uk-flex-column uk-flex-middle">
<div class="uk-card uk-card-default uk-card-body">
<icon [name]="'description'" [type]="'outlined'" [ratio]="3" [flex]="true"></icon>
</div>
<h5 class="title">
OS Guides for beginners
</h5>
<div class="uk-text-center uk-margin-bottom description">
New to Open Science? Learn the basics!
</div>
<div>
<a href="" class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default">
Learn more
</a>
</div>
</div>
<!-- icon3, title3, description3, link3 -->
<div class="uk-flex uk-flex-column uk-flex-middle">
<div class="uk-card uk-card-default uk-card-body">
<icon [name]="'description'" [type]="'outlined'" [ratio]="3" [flex]="true"></icon>
</div>
<h5 class="title">
Webinars
</h5>
<div class="uk-text-center uk-margin-bottom description">
Recordings and slides of webinars on different aspects of Open Science.
</div>
<a href="" class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default">
Learn more
</a>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,12 @@
import {Component} from '@angular/core';
import {PluginBaseComponent} from "../../utils/base-plugin.component";
@Component({
selector: 'plugin-learn-and-connect',
templateUrl: 'plugin-learn-and-connect.component.html'
})
export class PluginLearnAndConnectComponent extends PluginBaseComponent{
constructor() {
super()
}
}

View File

@ -0,0 +1,25 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {PluginsService} from "../../../../services/plugins.service";
import {IconsModule} from "../../../../utils/icons/icons.module";
import {NumberRoundModule} from "../../../../utils/pipes/number-round.module";
import {IconsService} from "../../../../utils/icons/icons.service";
import {SearchResearchResultsServiceModule} from "../../../../services/searchResearchResultsService.module";
import {PluginFieldEditModule} from "../../utils/plugin-field-edit.module";
import {PluginLearnAndConnectComponent} from './plugin-learn-and-connect.component';
@NgModule({
imports: [
CommonModule, RouterModule, FormsModule, IconsModule, NumberRoundModule, SearchResearchResultsServiceModule, PluginFieldEditModule
],
providers:[PluginsService],
declarations: [PluginLearnAndConnectComponent],
exports: [PluginLearnAndConnectComponent]
})
export class PluginLearnAndConnectModule {
constructor(private iconsService: IconsService) {
this.iconsService.registerIcons([])
}
}

View File

@ -0,0 +1,2 @@
<div>plugin-search-deposit-link</div>
<!-- add slider component -->

View File

@ -0,0 +1,12 @@
import {Component} from '@angular/core';
import {PluginBaseComponent} from "../../utils/base-plugin.component";
@Component({
selector: 'plugin-search-deposit-link',
templateUrl: 'plugin-search-deposit-link.component.html'
})
export class PluginSearchDepositLinkComponent extends PluginBaseComponent{
constructor() {
super()
}
}

View File

@ -0,0 +1,25 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {PluginsService} from "../../../../services/plugins.service";
import {IconsModule} from "../../../../utils/icons/icons.module";
import {NumberRoundModule} from "../../../../utils/pipes/number-round.module";
import {IconsService} from "../../../../utils/icons/icons.service";
import {SearchResearchResultsServiceModule} from "../../../../services/searchResearchResultsService.module";
import {PluginFieldEditModule} from "../../utils/plugin-field-edit.module";
import {PluginSearchDepositLinkComponent} from './plugin-search-deposit-link.component';
@NgModule({
imports: [
CommonModule, RouterModule, FormsModule, IconsModule, NumberRoundModule, SearchResearchResultsServiceModule, PluginFieldEditModule
],
providers:[PluginsService],
declarations: [PluginSearchDepositLinkComponent],
exports: [PluginSearchDepositLinkComponent]
})
export class PluginSearchDepositLinkModule {
constructor(private iconsService: IconsService) {
this.iconsService.registerIcons([])
}
}

View File

@ -0,0 +1,65 @@
<div>plugin-suggested-repositories</div>
<div class="plugin-suggested-repositories uk-container uk-container-large uk-section">
<div class="uk-flex uk-flex-middle uk-flex-between uk-margin-large-bottom">
<h3 class="uk-margin-remove">
<icon [name]="'database'" [type]="'outlined'" [ratio]="3" class="uk-margin-small-right"></icon>
Suggested repositories & journals
</h3>
<a href="" class="uk-display-inline-block uk-text-uppercase uk-button uk-button-text uk-text-default">
View all
</a>
</div>
<div uk-slider class="uk-slider">
<ul class="uk-slider-items" uk-height-match="target: .uk-card; row: false">
<li *ngFor="let slide of [].constructor(3); let i=index" class="uk-width-1-1 uk-padding">
<div class="uk-grid uk-child-width-1-2@m uk-child-width-1-1" uk-grid uk-scrollspy="target: [uk-scrollspy-class]; cls: uk-animation-fade; repeat: true">
<ng-container *ngIf="i === 0">
<div *ngFor="let item of [].constructor(2)" uk-scrollspy-class>
<div class="uk-card uk-card-default uk-card-body uk-card-hover">
Card content from result-preview
<hr>
<div>
Lorem ipsum lorem ipsum
</div>
<div>
Lorem ipsum
</div>
<div class="uk-flex uk-flex-right uk-margin-small-top">
<a href="" class="uk-float-right uk-margin-small-left uk-display-inline-block uk-text-uppercase uk-button uk-button-text">
<span class="uk-flex uk-flex-middle">
<icon [name]="'file_upload'" [type]="'outlined'" class="uk-margin-small-right"></icon>
<span>Go to repository</span>
</span>
</a>
</div>
</div>
</div>
</ng-container>
<ng-container *ngIf="i !== 0">
<div *ngFor="let item of [].constructor(2)">
<div class="uk-card uk-card-default uk-card-body uk-card-hover">
Card content from result-preview
<hr>
<div>
Lorem ipsum lorem ipsum
</div>
<div>
Lorem ipsum
</div>
<div class="uk-flex uk-flex-right uk-margin-small-top">
<a href="" class="uk-float-right uk-margin-small-left uk-display-inline-block uk-text-uppercase uk-button uk-button-text">
<span class="uk-flex uk-flex-middle">
<icon [name]="'file_upload'" [type]="'outlined'" class="uk-margin-small-right"></icon>
<span>Go to repository</span>
</span>
</a>
</div>
</div>
</div>
</ng-container>
</div>
</li>
</ul>
<ul class="uk-slider-nav uk-dotnav uk-flex-center uk-margin-medium-top"></ul>
</div>
</div>

View File

@ -0,0 +1,12 @@
import {Component} from '@angular/core';
import {PluginBaseComponent} from "../../utils/base-plugin.component";
@Component({
selector: 'plugin-suggested-repositories',
templateUrl: 'plugin-suggested-repositories.component.html'
})
export class PluginSuggestedRepositoriesComponent extends PluginBaseComponent{
constructor() {
super()
}
}

View File

@ -0,0 +1,25 @@
import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {PluginsService} from "../../../../services/plugins.service";
import {IconsModule} from "../../../../utils/icons/icons.module";
import {NumberRoundModule} from "../../../../utils/pipes/number-round.module";
import {IconsService} from "../../../../utils/icons/icons.service";
import {SearchResearchResultsServiceModule} from "../../../../services/searchResearchResultsService.module";
import {PluginFieldEditModule} from "../../utils/plugin-field-edit.module";
import {PluginSuggestedRepositoriesComponent} from './plugin-suggested-repositories.component';
@NgModule({
imports: [
CommonModule, RouterModule, FormsModule, IconsModule, NumberRoundModule, SearchResearchResultsServiceModule, PluginFieldEditModule
],
providers:[PluginsService],
declarations: [PluginSuggestedRepositoriesComponent],
exports: [PluginSuggestedRepositoriesComponent]
})
export class PluginSuggestedRepositoriesModule {
constructor(private iconsService: IconsService) {
this.iconsService.registerIcons([])
}
}

View File

@ -17,6 +17,27 @@ import {PluginEditEvent} from "../utils/base-plugin.component";
<ng-container *ngIf="pluginTemplate.code == 'openaire-products'">
<plugin-openaire-products [plugin]="plugin" [pluginTemplate]="pluginTemplate" [editMode]="editMode" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-openaire-products>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'discover-by-subcommunity'">
<plugin-discover-by-subcommunity [plugin]="plugin" [pluginTemplate]="pluginTemplate" [editMode]="editMode" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-discover-by-subcommunity>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'gateway-information'">
<plugin-gateway-information [plugin]="plugin" [pluginTemplate]="pluginTemplate" [editMode]="editMode" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-gateway-information>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'search-deposit-link'">
<plugin-search-deposit-link [plugin]="plugin" [pluginTemplate]="pluginTemplate" [editMode]="editMode" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-search-deposit-link>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'learn-and-connect'">
<plugin-learn-and-connect [plugin]="plugin" [pluginTemplate]="pluginTemplate" [editMode]="editMode" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-learn-and-connect>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'how-to-use'">
<plugin-how-to-use [plugin]="plugin" [pluginTemplate]="pluginTemplate" [editMode]="editMode" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-how-to-use>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'suggested-repositories'">
<plugin-suggested-repositories [plugin]="plugin" [pluginTemplate]="pluginTemplate" [editMode]="editMode" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-suggested-repositories>
</ng-container>
<ng-container *ngIf="pluginTemplate.code == 'featured-datasets'">
<plugin-featured-datasets [plugin]="plugin" [pluginTemplate]="pluginTemplate" [editMode]="editMode" (valuesChanged)="changed.emit($event)" [editTemplate]="editTemplate"></plugin-featured-datasets>
</ng-container>
</div>
</ng-container>
`,

View File

@ -2,14 +2,23 @@ import {NgModule} from '@angular/core';
import {RouterModule} from '@angular/router';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {PluginResultsNumbersModule} from "../components/results-numbers/plugin-results-numbers.module";
import {PluginWrapperComponent} from "./plugin-wrapper.component";
import {PluginTestModule} from "../components/test/plugin-test.module";
import {PluginOpenaireProductsModule} from "../components/openaireProducts/plugin-openaire-products.module";
import {PluginResultsNumbersModule} from "../components/results-numbers/plugin-results-numbers.module";
import {PluginDiscoverBySubcommunityModule} from '../components/discover-by-subcommunity/plugin-discover-by-subcommunity.module';
import {PluginGatewayInformationModule} from '../components/gateway-information/plugin-gateway-information.module';
import {PluginSearchDepositLinkModule} from '../components/search-deposit-link/plugin-search-deposit-link.module';
import {PluginLearnAndConnectModule} from '../components/learn-and-connect/plugin-learn-and-connect.module';
import {PluginHowToUseModule} from '../components/how-to-use/plugin-how-to-use.module';
import {PluginSuggestedRepositoriesModule} from '../components/suggested-repositories/plugin-suggested-repositories.module';
import {PluginFeaturedDatasetsModule} from '../components/featured-datasets/plugin-featured-datasets.module';
@NgModule({
imports: [
CommonModule, RouterModule, FormsModule, PluginResultsNumbersModule, PluginTestModule, PluginOpenaireProductsModule
CommonModule, RouterModule, FormsModule, PluginResultsNumbersModule, PluginTestModule, PluginOpenaireProductsModule,
PluginDiscoverBySubcommunityModule, PluginGatewayInformationModule, PluginSearchDepositLinkModule, PluginLearnAndConnectModule,
PluginHowToUseModule, PluginSuggestedRepositoriesModule, PluginFeaturedDatasetsModule
],
declarations: [PluginWrapperComponent],
exports: [PluginWrapperComponent]