diff --git a/dashboard/plugins/components/gateway-information/plugin-gateway-information.component.html b/dashboard/plugins/components/gateway-information/plugin-gateway-information.component.html index 5070f685..dda73ebe 100644 --- a/dashboard/plugins/components/gateway-information/plugin-gateway-information.component.html +++ b/dashboard/plugins/components/gateway-information/plugin-gateway-information.component.html @@ -7,6 +7,7 @@
No community info available available
+
@@ -81,10 +82,11 @@ +
-
+
diff --git a/dashboard/plugins/components/gateway-information/plugin-gateway-information.component.ts b/dashboard/plugins/components/gateway-information/plugin-gateway-information.component.ts index 4c0d9761..9911b279 100644 --- a/dashboard/plugins/components/gateway-information/plugin-gateway-information.component.ts +++ b/dashboard/plugins/components/gateway-information/plugin-gateway-information.component.ts @@ -80,7 +80,7 @@ export class PluginGatewayInformationComponent extends PluginBaseComponent { this.community = community; - if(community && !ConnectHelper.isPrivate(community, this.user)) { + if (community) { this.displayedSubjects = community.subjects; this.displayedSdg = community.sdg; this.displayedFos = community.fos; @@ -97,7 +97,7 @@ export class PluginGatewayInformationComponent extends PluginBaseComponent { this.masterZenodoCommunity = res; }, @@ -107,36 +107,38 @@ export class PluginGatewayInformationComponent extends PluginBaseComponent { + 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; + } + )); + this.subscriptions.push(this.http.get(this.properties.utilsService + "/portals/countResults?field=communityid&value=" + this.community.communityId).subscribe(res => { + this.resultCounts = res; + })); } } )); - // 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; - } - )); - this.subscriptions.push(this.http.get(this.properties.utilsService + "/portals/countResults?field=communityid&value=" + this.community.communityId).subscribe(res => { - this.resultCounts = res; - })); + } @@ -145,7 +147,7 @@ export class PluginGatewayInformationComponent extends PluginBaseComponent x['route'] == route && x['isEnabled'] === true); + return this.portal && this.portal.pages.some(x => x['route'] == route && x['isEnabled'] === true); } buildProjectsTooltip(): string { diff --git a/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.html b/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.html index 12d14855..b55aa0d5 100644 --- a/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.html +++ b/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.html @@ -1,60 +1,38 @@ -
plugin-search-deposit-link
- -
+

- Find the best for your community. + {{pluginObject.title}}

- + - ipad - - ipad - - - ipad - - - ipad - - - ipad - + + + + + + + - -
- Find a repository - to deposit your {{entities.RESULT | lowercase}} - . -
-
- -
- Link your {{entities.RESULT | lowercase}} - with your community, funding, and other {{entities.RESULTS | lowercase}} - . -
-
- -
- View community's - overview at a glance. -
-
- -
- Search & browse - your community's {{entities.RESULTS | lowercase}} - . -
-
+ + + +
{{card.tag}}
+
+ {{card.title}} +
+
{{card.description}}
+
+
+
diff --git a/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.less b/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.less new file mode 100644 index 00000000..77723ecb --- /dev/null +++ b/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.less @@ -0,0 +1,3 @@ +//slider-column slider-nav-item .uk-active{ +// border-left: solid 2px @primary-color; +//} diff --git a/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.ts b/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.ts index 6af442b7..3c4607fd 100644 --- a/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.ts +++ b/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.component.ts @@ -1,13 +1,30 @@ import {Component} from '@angular/core'; -import {PluginBaseComponent} from "../../utils/base-plugin.component"; +import {PluginBaseComponent, PluginInfoCards, PluginURL} from "../../utils/base-plugin.component"; import {OpenaireEntities} from "../../../../utils/properties/searchFields"; +import {properties} from "../../../../../../environments/environment"; export class PluginSearchDepositLink{ title:string ="Search, link and deposit your research in one place."; - description: string = "Lorem ipsum"; + // description: string = "Lorem ipsum"; + cardInfoArray: PluginInfoCards[] = [ + {tag: "SEARCH & BROWSE", title: "Discover research products in your community.", description: + "A view of the OpenAIRE Graph, configured by experts of your research community, who want to help you out with the data and literature deluge.", + urls:[ new PluginURL("/search/find/research-outcomes","Start searching", null, true)], + image:'https://' + (properties.environment == 'production'?'':'beta.') + + 'connect.openaire.eu/assets/connect-assets/home/4.png',show:true}, + {tag: "DEPOSIT YOUR RESEARCH OUTCOME", title: "Publish your research in Open Access.", description:"" + , urls:[ new PluginURL("/participate/deposit/learn-how","Start searching", null, true)], + image:'https://' + (properties.environment == 'production'?'':'beta.') + + 'connect.openaire.eu/assets/connect-assets/home/1.png',show:true}, + {tag: "LINK YOUR RESEARCH", title: "Contribute to your community.", description:"" + , urls:[ new PluginURL("/participate/claim","Start searching", null, true)], + image:'https://' + (properties.environment == 'production'?'':'beta.') + + 'connect.openaire.eu/assets/connect-assets/home/2.png',show:true}, + ]; } @Component({ selector: 'plugin-search-deposit-link', - templateUrl: 'plugin-search-deposit-link.component.html' + templateUrl: 'plugin-search-deposit-link.component.html', + styleUrls:[`plugin-search-deposit-link.component.less`] }) export class PluginSearchDepositLinkComponent extends PluginBaseComponent{ entities= OpenaireEntities; @@ -15,4 +32,8 @@ export class PluginSearchDepositLinkComponent extends PluginBaseComponent card.show); + } } diff --git a/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.form.component.ts b/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.form.component.ts new file mode 100644 index 00000000..9306264b --- /dev/null +++ b/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.form.component.ts @@ -0,0 +1,54 @@ +import {Component} from '@angular/core'; +import {PluginBaseComponent, PluginEditEvent} from "../../utils/base-plugin.component"; +import {HttpClient} from "@angular/common/http"; +import {PluginSearchDepositLink} from "./plugin-search-deposit-link.component"; + +@Component({ + selector: 'plugin-search-deposit-link-form', + template: ` +
+ + +
+ Cards: +
+ +
+
{{card.tag}}
+ +
+ + + +
+ +
+ + +
+
+ + `, + + +}) +export class PluginSearchDepositLinkFormComponent extends PluginBaseComponent /*implements OnChanges*/{ + constructor(http:HttpClient) { + super() + } + + cardShowChanged(i,$event:PluginEditEvent){ + if(this.editTemplate){ + this.pluginTemplate.object.cardInfoArray[i].show=$event.value; + $event.value =this.pluginTemplate.object.cardInfoArray; + }else{ + this.plugin.object.cardInfoArray[i].show=$event.value; + $event.value =this.plugin.object.cardInfoArray; + } + + this.valuesChanged.emit({field:$event.field, value: $event.value, type: 'parent'}) + } + +} diff --git a/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.module.ts b/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.module.ts index a3923f36..edcce0db 100644 --- a/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.module.ts +++ b/dashboard/plugins/components/search-deposit-link/plugin-search-deposit-link.module.ts @@ -13,7 +13,8 @@ import {SliderUtilsModule} from "../../../../sharedComponents/slider-utils/slide @NgModule({ imports: [ - CommonModule, RouterModule, FormsModule, IconsModule, NumberRoundModule, SearchResearchResultsServiceModule, PluginFieldEditModule, SliderUtilsModule + CommonModule, RouterModule, FormsModule, IconsModule, NumberRoundModule, SearchResearchResultsServiceModule, + PluginFieldEditModule, SliderUtilsModule ], providers:[PluginsService], declarations: [PluginSearchDepositLinkComponent], diff --git a/dashboard/plugins/templates/pluginTemplates.component.ts b/dashboard/plugins/templates/pluginTemplates.component.ts index cb22a91d..19532e06 100644 --- a/dashboard/plugins/templates/pluginTemplates.component.ts +++ b/dashboard/plugins/templates/pluginTemplates.component.ts @@ -119,6 +119,7 @@ export class PluginTemplatesComponent implements OnInit { } for(let template of templates){ let defaultObj = PluginUtils.initializeObject(template.code); + console.log(defaultObj) template.object = PluginUtils.updateExistingObject(template.object, defaultObj) this.templatesByPlacement.get(template.placement).push(template); } diff --git a/dashboard/plugins/utils/base-plugin.component.ts b/dashboard/plugins/utils/base-plugin.component.ts index b4675816..eff1711a 100644 --- a/dashboard/plugins/utils/base-plugin.component.ts +++ b/dashboard/plugins/utils/base-plugin.component.ts @@ -20,15 +20,18 @@ export class PluginURL { url:string; linkText:string; target:string; - constructor(url,linkText, target = "_blank") { + route:boolean; + constructor(url,linkText, target = "_blank",route = false) { this.url = url; this.linkText = linkText; this.target = target; + this.route = route; } } export class PluginInfoCards{ + tag?:string; title:string; description:string; urls:PluginURL[]; diff --git a/dashboard/plugins/utils/pluginUtils.ts b/dashboard/plugins/utils/pluginUtils.ts index efea7d89..d262b9f8 100644 --- a/dashboard/plugins/utils/pluginUtils.ts +++ b/dashboard/plugins/utils/pluginUtils.ts @@ -6,6 +6,7 @@ import {PluginGatewayInformation} from "../components/gateway-information/plugin import {PluginLearnAndConnect} from "../components/learn-and-connect/plugin-learn-and-connect.component"; import {PluginFeaturedDatasets} from "../components/featured-datasets/plugin-featured-datasets.component"; import {PluginHowToUse} from "../components/how-to-use/plugin-how-to-use.component"; +import {PluginSearchDepositLink} from "../components/search-deposit-link/plugin-search-deposit-link.component"; export class PluginUtils{ public attrTypeOptions: Option[] = [ @@ -52,7 +53,7 @@ export class PluginUtils{ return new PluginGatewayInformation(); } case 'search-deposit-link': { - return new PluginBaseInfo(); + return new PluginSearchDepositLink(); } case 'learn-and-connect': { return new PluginLearnAndConnect(); diff --git a/dashboard/plugins/wrapper/plugin-edit-wrapper.component.ts b/dashboard/plugins/wrapper/plugin-edit-wrapper.component.ts index 7411539e..3c0a04c3 100644 --- a/dashboard/plugins/wrapper/plugin-edit-wrapper.component.ts +++ b/dashboard/plugins/wrapper/plugin-edit-wrapper.component.ts @@ -17,7 +17,7 @@ import {PluginEditEvent} from "../utils/base-plugin.component"; - + diff --git a/dashboard/plugins/wrapper/plugin-edit-wrapper.module.ts b/dashboard/plugins/wrapper/plugin-edit-wrapper.module.ts index 4dca57f1..a2474457 100644 --- a/dashboard/plugins/wrapper/plugin-edit-wrapper.module.ts +++ b/dashboard/plugins/wrapper/plugin-edit-wrapper.module.ts @@ -9,13 +9,14 @@ import {PluginFieldEditModule} from "../utils/plugin-field-edit.module"; import {PluginDiscoverBySubcommunityFormComponent} from "../components/discover-by-subcommunity/plugin-discover-by-subcommunity.form.component"; import {PluginFeaturedDatasetsFormComponent} from "../components/featured-datasets/plugin-featured-datasets.form.component"; import {PluginGatewayInformationFormComponent} from "../components/gateway-information/plugin-gateway-information.form.component"; +import {PluginSearchDepositLinkFormComponent} from "../components/search-deposit-link/plugin-search-deposit-link.form.component"; @NgModule({ imports: [ CommonModule, RouterModule, FormsModule, PluginFieldEditModule ], declarations: [PluginEditWrapperComponent, PluginOpenaireProductsFormComponent, PluginLearnAndConnectFormComponent, - PluginDiscoverBySubcommunityFormComponent, PluginDiscoverBySubcommunityFormComponent, PluginDiscoverBySubcommunityFormComponent, PluginDiscoverBySubcommunityFormComponent, PluginDiscoverBySubcommunityFormComponent, PluginDiscoverBySubcommunityFormComponent, PluginFeaturedDatasetsFormComponent, PluginGatewayInformationFormComponent], + PluginDiscoverBySubcommunityFormComponent, PluginDiscoverBySubcommunityFormComponent, PluginDiscoverBySubcommunityFormComponent, PluginDiscoverBySubcommunityFormComponent, PluginDiscoverBySubcommunityFormComponent, PluginDiscoverBySubcommunityFormComponent, PluginFeaturedDatasetsFormComponent, PluginGatewayInformationFormComponent, PluginSearchDepositLinkFormComponent], exports: [PluginEditWrapperComponent] })