diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 3aff9ee..e5a9884 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 3aff9ee76e9bd06ee6beffa660dbccde3eef2cd1 +Subproject commit e5a98845a76ffdaeeceaa7bd87f14fc427c7df29 diff --git a/src/app/pages/admin-tools/admin-tools-routing.module.ts b/src/app/pages/admin-tools/admin-tools-routing.module.ts index a835137..fa8b075 100644 --- a/src/app/pages/admin-tools/admin-tools-routing.module.ts +++ b/src/app/pages/admin-tools/admin-tools-routing.module.ts @@ -29,6 +29,16 @@ import {RouterModule} from '@angular/router'; loadChildren: () => import('../../openaireLibrary/dashboard/helpTexts/page-help-content-form.module').then(m => m.PageHelpContentFormModule), pathMatch: 'full' }, + { + path: 'plugins', + loadChildren: () => import('../../openaireLibrary/dashboard/plugins/plugins.module').then(m => m.PluginsModule), + pathMatch: 'full', data: {hasInternalSidebar: false, hasHeader: false} + }, + { + path: 'plugins/edit', + loadChildren: () => import('../../openaireLibrary/dashboard/plugins/plugins-form/pluginsForm.module').then(m => m.PluginsFormModule), + pathMatch: 'full', data: {hasInternalSidebar: true, hasHeader: false} + }, { path: 'pages', loadChildren: () => import('../../openaireLibrary/dashboard/page/pages.module').then(m => m.PagesModule), diff --git a/src/app/pages/admin-tools/portal-admin-tools-routing.module.ts b/src/app/pages/admin-tools/portal-admin-tools-routing.module.ts index b92f457..58ef5e8 100644 --- a/src/app/pages/admin-tools/portal-admin-tools-routing.module.ts +++ b/src/app/pages/admin-tools/portal-admin-tools-routing.module.ts @@ -5,7 +5,9 @@ import {RouterModule} from "@angular/router"; imports: [RouterModule.forChild([ {path: '', loadChildren: () => import('./admin-tools-routing.module').then(m => m.AdminToolsRoutingModule)}, {path: 'portals', loadChildren: () => import('../../openaireLibrary/dashboard/portal/portals.module').then(m => m.PortalsModule)}, - {path: 'classes', loadChildren: () => import('../../openaireLibrary/dashboard/divId/divIds.module').then(m => m.DivIdsModule)} + {path: 'classes', loadChildren: () => import('../../openaireLibrary/dashboard/divId/divIds.module').then(m => m.DivIdsModule)}, + {path: 'templates', loadChildren: () => import('../../openaireLibrary/dashboard/plugins/templates/pluginTemplates.module').then(m => m.PluginTemplatesModule)}, + {path: 'templates/plugins', loadChildren: () => import('../../openaireLibrary/dashboard/plugins/plugins.module').then(m => m.PluginsModule)}, ])] }) export class PortalAdminToolsRoutingModule { diff --git a/src/app/pages/advanced-criteria/advanced-criteria.component.ts b/src/app/pages/advanced-criteria/advanced-criteria.component.ts index 01366f6..e7dd57c 100644 --- a/src/app/pages/advanced-criteria/advanced-criteria.component.ts +++ b/src/app/pages/advanced-criteria/advanced-criteria.component.ts @@ -36,7 +36,7 @@ import {CommunityInfo} from "../../openaireLibrary/connect/community/communityIn
Criteria
-
+
No criteria yet
diff --git a/src/app/pages/affiliations/affiliations.component.html b/src/app/pages/affiliations/affiliations.component.html index ccfdef9..4570444 100644 --- a/src/app/pages/affiliations/affiliations.component.html +++ b/src/app/pages/affiliations/affiliations.component.html @@ -2,10 +2,6 @@
- +
- - +
+
Purge ICM cache for all communities
- + +
+
+
+
Reload cache requests either per community or for all communities
+
+
+ + +
+
@@ -45,6 +59,7 @@ export class ConnectAdminCustomizationComponent implements OnInit { cssCreated: number = 0; totalLayouts: number = 0; community; + route; properties = properties; constructor( private customizationService: CustomizationService, private _clearCacheService: ClearCacheService, @@ -133,4 +148,20 @@ export class ConnectAdminCustomizationComponent implements OnInit { })); } } + + forceReloadCache() { + if (this.community) { + this._clearCacheService.clearCacheInRoute("Clear cache", this.community, this.route ? this.route : "/") + } else { + this.savingChanges = true; + this.subscriptions.push(this.communitiesService.getCommunities(this.properties, this.properties.communityAPI + 'communities').subscribe( + communities => { + communities.forEach(community => { + this._clearCacheService.clearCacheInRoute("Clear cache for "+ community.communityId, community.communityId, this.route ? this.route : "/") + }); + this.savingChanges = false; + } + )); + } + } } diff --git a/src/app/pages/content-providers/add-content-providers.component.html b/src/app/pages/content-providers/add-content-providers.component.html index 5c064b6..a9f23a9 100644 --- a/src/app/pages/content-providers/add-content-providers.component.html +++ b/src/app/pages/content-providers/add-content-providers.component.html @@ -36,12 +36,21 @@
diff --git a/src/app/pages/content-providers/add-content-providers.component.ts b/src/app/pages/content-providers/add-content-providers.component.ts index 32f8584..b4a3f11 100644 --- a/src/app/pages/content-providers/add-content-providers.component.ts +++ b/src/app/pages/content-providers/add-content-providers.component.ts @@ -102,8 +102,8 @@ export class AddContentProvidersComponent implements OnInit { "
" } - public addContentProvider(contentProvider: SearchResult) { - this.subscriptions.push(this.manageCommunityContentProvidersService.addContentProvider(this.properties, this.community.communityId, contentProvider).subscribe( + public addContentProvider(contentProvider: SearchResult, content = true, deposit =false) { + this.subscriptions.push(this.manageCommunityContentProvidersService.addContentProvider(this.properties, this.community.communityId, contentProvider, content, deposit).subscribe( data => { this.communityContentProviders.push(data); this._clearCacheService.purgeBrowserCache(this.openAIREEntities.DATASOURCE+" added", this.community.communityId); @@ -120,7 +120,7 @@ export class AddContentProvidersComponent implements OnInit { public removeContentProvider(contentProvider) { let communityContentProvider = this.getCommunityContentProvider(contentProvider); - let contentProviderId: string = communityContentProvider['id']; + let contentProviderId: string = communityContentProvider['openaireId']; this.subscriptions.push(this.manageCommunityContentProvidersService.removeContentProvider(this.properties, this.community.communityId, contentProviderId).subscribe( data => { let index = this.communityContentProviders.indexOf(communityContentProvider); diff --git a/src/app/pages/content-providers/communityContentProviders.module.ts b/src/app/pages/content-providers/communityContentProviders.module.ts index 4a0708e..2de48bb 100644 --- a/src/app/pages/content-providers/communityContentProviders.module.ts +++ b/src/app/pages/content-providers/communityContentProviders.module.ts @@ -28,6 +28,9 @@ import {AddContentProvidersComponent} from "./add-content-providers.component"; import {ManageCommunityContentProvidersService} from "../../services/manageContentProviders.service"; import {SearchDataprovidersService} from "../../openaireLibrary/services/searchDataproviders.service"; import {CriteriaModule} from "./criteria/criteria.module"; +import {MatSlideToggleModule} from "@angular/material/slide-toggle"; +import {CKEditorModule} from "ng2-ckeditor"; +import {ValidateEnabledPageModule} from "../../utils/validateEnabledPage.module"; @NgModule({ imports: [ @@ -48,7 +51,7 @@ import {CriteriaModule} from "./criteria/criteria.module"; path: '', component: ManageContentProvidersComponent } ]), - NoLoadPaging, LoadingModule, IconsModule, FullScreenModalModule, ResultPreviewModule, CriteriaModule + NoLoadPaging, LoadingModule, IconsModule, FullScreenModalModule, ResultPreviewModule, CriteriaModule, MatSlideToggleModule, CKEditorModule, ReactiveFormsModule, ValidateEnabledPageModule ], declarations: [ ManageContentProvidersComponent, diff --git a/src/app/pages/content-providers/criteria-utils.ts b/src/app/pages/content-providers/criteria-utils.ts index c8eee7d..e069da3 100644 --- a/src/app/pages/content-providers/criteria-utils.ts +++ b/src/app/pages/content-providers/criteria-utils.ts @@ -7,7 +7,7 @@ export class CriteriaUtils { {value: 'title', label: 'Title'}, {value: 'orcid', label: 'Author\'s ORCID'}, {value: 'contributor', label: 'Contributor'}, - {value: 'description', label: 'Description'}, + {value: 'description', label: 'Abstract'}, {value: 'subject', label: 'Subject'}, {value: 'fos', label: 'Field of Science'}, {value: 'sdg', label: 'SDG'}, @@ -28,8 +28,8 @@ export class CriteriaUtils { {value: 'greater_than', label: 'greater than'} ] - public getFiltersAsText(criteria: Criteria[]): string { - let text = criteria.slice(0, 3).map((criterion, index) => (index + 1) + ". " + criterion.constraint.map(constraint => { + public getFiltersAsText(criteria: Criteria[], shortVersion=true): string { + let text = criteria.slice(0, shortVersion?3:criteria.length).map((criterion, index) => (index + 1) + ". " + criterion.constraint.map(constraint => { let field = this.fields.find(field => field.value === constraint.field)?.label; let matchCase = false; if (!constraint.verb.includes('_caseinsensitive')) { @@ -37,7 +37,9 @@ export class CriteriaUtils { } let verb = [...this.verbs,...this.verbsForNumbers].find(verb => verb.value === constraint.verb.replace("_caseinsensitive", "")).label; let value = '"' + constraint.value + '"' + (matchCase ? " (Match case)" : ""); - return field + " " + verb + " " + value; + let expFeature = field =='Publisher' || field == 'Publication Year'? `experimental feature`:'' + return field + " " + verb + " " + value + expFeature; }).join(" and ")); return text.join("
"); } diff --git a/src/app/pages/content-providers/criteria/criteria.component.html b/src/app/pages/content-providers/criteria/criteria.component.html index 74469a3..21e26fd 100644 --- a/src/app/pages/content-providers/criteria/criteria.component.html +++ b/src/app/pages/content-providers/criteria/criteria.component.html @@ -1,4 +1,4 @@ -
+
@@ -32,6 +32,8 @@
+ experimental feature
+ experimental feature
diff --git a/src/app/pages/content-providers/manage-content-providers.component.ts b/src/app/pages/content-providers/manage-content-providers.component.ts index f211f4f..88fab9d 100644 --- a/src/app/pages/content-providers/manage-content-providers.component.ts +++ b/src/app/pages/content-providers/manage-content-providers.component.ts @@ -1,4 +1,4 @@ -import {ChangeDetectorRef, Component, OnInit, ViewChild} from '@angular/core'; +import {ChangeDetectorRef, Component, OnInit, SimpleChanges, ViewChild} from '@angular/core'; import {RemoveContentProvidersComponent} from './remove-content-providers.component'; import {Title} from '@angular/platform-browser'; import { @@ -15,6 +15,7 @@ import {OpenaireEntities} from "../../openaireLibrary/utils/properties/searchFie import {CriteriaComponent} from "./criteria/criteria.component"; import {NotificationHandler} from "../../openaireLibrary/utils/notification-handler"; import {ManageCommunityContentProvidersService} from "../../services/manageContentProviders.service"; +import {UntypedFormBuilder} from "@angular/forms"; @Component({ selector: 'manage-content-providers', @@ -23,6 +24,7 @@ import {ManageCommunityContentProvidersService} from "../../services/manageConte [communityContentProviders]="communityContentProviders" [loading]="showLoadingInRemove" [community]="community" (editCriteria)="openCriteria($event)" + (communityContentProvidersChanged)="communityContentProvidersChanged($event)"> @@ -30,10 +32,23 @@ import {ManageCommunityContentProvidersService} from "../../services/manageConte [community]="community" (communityContentProvidersChanged)="communityContentProvidersChanged($event)"> - +
- {{dataProvider.officialname}}
+
+
+ + +
+
+ + +
+
+
+
Content filters
+
No Filters for {{dataProvider.officialname}} yet
@@ -42,6 +57,24 @@ import {ManageCommunityContentProvidersService} from "../../services/manageConte
+
+
+ + +
Type a message or instruction for researchers about deposition in this datasource
+ + +
` @@ -53,6 +86,7 @@ export class ManageContentProvidersComponent implements OnInit { @ViewChild('criteria') criteria: CriteriaComponent; @ViewChild('addContentProvidersModal', { static: true }) addContentProvidersModal: FullScreenModalComponent; @ViewChild('filtersModal', { static: true }) filtersModal: FullScreenModalComponent; + @ViewChild('depositModal', { static: true }) depositModal: FullScreenModalComponent; private subscriptions: any[] = []; public showLoadingInRemove: boolean = true; public body: string = "Send from page"; @@ -60,11 +94,16 @@ export class ManageContentProvidersComponent implements OnInit { public openaireEntities = OpenaireEntities; public community: CommunityInfo; public dataProvider: ContentProvider; - + message = ""; + deposit= false; + enabled = false; + depositInfoChanged =false; + messageForm = this.fb.control(""); constructor(private title: Title, private cdr: ChangeDetectorRef, private communityService: CommunityService, - private manageCommunityContentProvidersService: ManageCommunityContentProvidersService) { + private manageCommunityContentProvidersService: ManageCommunityContentProvidersService, + private fb: UntypedFormBuilder) { } ngOnInit() { @@ -96,17 +135,26 @@ export class ManageContentProvidersComponent implements OnInit { public openCriteria(contentProvider: ContentProvider) { this.dataProvider = contentProvider; - this.filtersModal.title = 'Filters'; + this.deposit = this.dataProvider.deposit; + this.message = this.dataProvider.message; + this.enabled = this.dataProvider.enabled; + this.messageForm = this.fb.control(this.message); + this.depositInfoChanged = false; + this.filtersModal.title = 'Edit datasource options'; this.filtersModal.okButtonText = "Save"; this.filtersModal.back = true; this.filtersModal.okButton = true; + this.filtersModal.open(); this.cdr.detectChanges(); } - public saveCriteria() { let callback = (selectionCriteria): void => { this.dataProvider.selectioncriteria = selectionCriteria; + this.dataProvider.deposit = this.deposit; + this.dataProvider.message = this.message; + this.dataProvider.enabled = this.enabled; + console.log(this.dataProvider) this.manageCommunityContentProvidersService.saveContentProvider(this.properties, this.dataProvider).subscribe(() => { this.criteria.reset(); this.removeContentProvidersComponent.getCommunityContentProviders(); @@ -118,6 +166,7 @@ export class ManageContentProvidersComponent implements OnInit { }); } this.removeContentProvidersComponent.loading = true; + console.log() this.criteria.save(callback); } @@ -128,4 +177,17 @@ export class ManageContentProvidersComponent implements OnInit { this.removeContentProvidersComponent.applyFilters(); } } + + + depositReset(){ + this.message = this.dataProvider.message; + this.messageForm.setValue(this.message); + this.deposit = this.dataProvider.deposit; + this.enabled = this.dataProvider.enabled; + } + + messageChanged(){ + this.message = this.messageForm.value; + this.depositInfoChanged = true; + } } diff --git a/src/app/pages/content-providers/remove-content-providers.component.html b/src/app/pages/content-providers/remove-content-providers.component.html index 6156177..04dc383 100644 --- a/src/app/pages/content-providers/remove-content-providers.component.html +++ b/src/app/pages/content-providers/remove-content-providers.component.html @@ -22,6 +22,8 @@
+ +
No {{openAIREEntities.DATASOURCES}} @@ -54,7 +56,13 @@ [no title available] -
+
Content source
+
Suggested for deposit
+
+
Deposit info:
+
+
+
Filters
@@ -64,18 +72,24 @@