Compare commits
25 Commits
master
...
plugins-fu
Author | SHA1 | Date |
---|---|---|
argirok | 488ac615d4 | |
argirok | c7ce678915 | |
argirok | ba0bfeb356 | |
argirok | 30def2150b | |
argirok | 99e8f727b0 | |
argirok | ce1b87aaa3 | |
argirok | 5f8d9f32f6 | |
argirok | 1114ce4e36 | |
argirok | 6f323f8111 | |
argirok | c033102dcf | |
argirok | b6e803b56e | |
argirok | 75b4328623 | |
argirok | 7a43b29617 | |
argirok | b12ce55b20 | |
argirok | ed512f6f05 | |
argirok | 2a27c1caf7 | |
argirok | 49e8e56e92 | |
argirok | 044d5da78a | |
argirok | 1435c5c718 | |
argirok | 9a49371a39 | |
argirok | 80c6b47c1b | |
argirok | 47201b9dff | |
argirok | a1754df0b3 | |
argirok | 703b163803 | |
argirok | 10cad849a9 |
|
@ -1 +1 @@
|
||||||
Subproject commit 3aff9ee76e9bd06ee6beffa660dbccde3eef2cd1
|
Subproject commit e2b34b13ee3cf7e360e02fe85f79cea99954e78f
|
|
@ -29,6 +29,16 @@ import {RouterModule} from '@angular/router';
|
||||||
loadChildren: () => import('../../openaireLibrary/dashboard/helpTexts/page-help-content-form.module').then(m => m.PageHelpContentFormModule),
|
loadChildren: () => import('../../openaireLibrary/dashboard/helpTexts/page-help-content-form.module').then(m => m.PageHelpContentFormModule),
|
||||||
pathMatch: 'full'
|
pathMatch: 'full'
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: 'plugins',
|
||||||
|
loadChildren: () => import('../../openaireLibrary/dashboard/plugins/plugins.module').then(m => m.PluginsModule),
|
||||||
|
pathMatch: 'full', data: {hasInternalSidebar: true, hasHeader: false}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: 'plugin-edit',
|
||||||
|
loadChildren: () => import('../../openaireLibrary/dashboard/plugins/plugins-form/pluginsForm.module').then(m => m.PluginsFormModule),
|
||||||
|
pathMatch: 'full', data: {hasInternalSidebar: true, hasHeader: false}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
path: 'pages',
|
path: 'pages',
|
||||||
loadChildren: () => import('../../openaireLibrary/dashboard/page/pages.module').then(m => m.PagesModule),
|
loadChildren: () => import('../../openaireLibrary/dashboard/page/pages.module').then(m => m.PagesModule),
|
||||||
|
|
|
@ -5,7 +5,9 @@ import {RouterModule} from "@angular/router";
|
||||||
imports: [RouterModule.forChild([
|
imports: [RouterModule.forChild([
|
||||||
{path: '', loadChildren: () => import('./admin-tools-routing.module').then(m => m.AdminToolsRoutingModule)},
|
{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: '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 {
|
export class PortalAdminToolsRoutingModule {
|
||||||
|
|
|
@ -36,7 +36,7 @@ import {CommunityInfo} from "../../openaireLibrary/connect/community/communityIn
|
||||||
<div *ngIf="!loading">
|
<div *ngIf="!loading">
|
||||||
<div *ngIf="selectionCriteria?.criteria?.length > 0" class="uk-margin-small-bottom">
|
<div *ngIf="selectionCriteria?.criteria?.length > 0" class="uk-margin-small-bottom">
|
||||||
<div class="uk-text-meta uk-margin-small-bottom">Criteria</div>
|
<div class="uk-text-meta uk-margin-small-bottom">Criteria</div>
|
||||||
<div [innerHTML]="criteriaUtils.getFiltersAsText(selectionCriteria.criteria)"></div>
|
<div [innerHTML]="criteriaUtils.getFiltersAsText(selectionCriteria.criteria,false)"></div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="selectionCriteria?.criteria?.length === 0" class="message">
|
<div *ngIf="selectionCriteria?.criteria?.length === 0" class="message">
|
||||||
<h5 class="uk-margin-small-bottom">No criteria yet</h5>
|
<h5 class="uk-margin-small-bottom">No criteria yet</h5>
|
||||||
|
|
|
@ -20,11 +20,19 @@ import {ClearCacheService} from "../../../../openaireLibrary/services/clear-cach
|
||||||
<div class="uk-grid uk-grid-large" uk-grid>
|
<div class="uk-grid uk-grid-large" uk-grid>
|
||||||
<div class="uk-width-1-2@m">
|
<div class="uk-width-1-2@m">
|
||||||
<div input id="name" [formInput]="communityFb.get('name')"
|
<div input id="name" [formInput]="communityFb.get('name')"
|
||||||
placeholder="Name of the community profile."></div>
|
placeholder="Index name of the community."></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-1-2@m">
|
<div class="uk-width-1-2@m">
|
||||||
<div input [formInput]="communityFb.get('shortName')"
|
<div input [formInput]="communityFb.get('shortName')"
|
||||||
placeholder="Short name of the community."></div>
|
placeholder="Index short name of the community."></div>
|
||||||
|
</div>
|
||||||
|
<div class="uk-width-1-2@m">
|
||||||
|
<div input id="name" [formInput]="communityFb.get('displayName')"
|
||||||
|
placeholder="Display name of the community."></div>
|
||||||
|
</div>
|
||||||
|
<div class="uk-width-1-2@m">
|
||||||
|
<div input [formInput]="communityFb.get('displayShortName')"
|
||||||
|
placeholder="Display short name of the community."></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-width-1-1">
|
<div class="uk-width-1-1">
|
||||||
<div class="uk-text-bold uk-margin-bottom uk-form-hint">Description of the community</div>
|
<div class="uk-text-bold uk-margin-bottom uk-form-hint">Description of the community</div>
|
||||||
|
@ -35,7 +43,7 @@ import {ClearCacheService} from "../../../../openaireLibrary/services/clear-cach
|
||||||
removeButtons: 'Save,NewPage,DocProps,Preview,Print,' +
|
removeButtons: 'Save,NewPage,DocProps,Preview,Print,' +
|
||||||
'Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,' +
|
'Form,Checkbox,Radio,TextField,Textarea,Select,Button,ImageButton,HiddenField,' +
|
||||||
'CreateDiv,Flash,PageBreak,' +
|
'CreateDiv,Flash,PageBreak,' +
|
||||||
'Subscript,Superscript,Anchor,Smiley,Iframe,Styles,Font,About,Language',
|
'Subscript,Superscript,Anchor,Smiley,Iframe,Styles,Font,About,Language,JustifyLeft,JustifyRight,JustifyCenter,JustifyBlock,FontSize,TextColor,BGColor',
|
||||||
extraPlugins: 'divarea'}">
|
extraPlugins: 'divarea'}">
|
||||||
</ckeditor>
|
</ckeditor>
|
||||||
</div>
|
</div>
|
||||||
|
@ -153,6 +161,8 @@ export class EditCommunityComponent {
|
||||||
communityId: this.fb.control(this.community.communityId),
|
communityId: this.fb.control(this.community.communityId),
|
||||||
name: this.fb.control(this.community.title, Validators.required),
|
name: this.fb.control(this.community.title, Validators.required),
|
||||||
shortName: this.fb.control(this.community.shortTitle, Validators.required),
|
shortName: this.fb.control(this.community.shortTitle, Validators.required),
|
||||||
|
displayName: this.fb.control(this.community.title, Validators.required),
|
||||||
|
displayShortName: this.fb.control(this.community.shortTitle, Validators.required),
|
||||||
description: this.fb.control(this.community.description),
|
description: this.fb.control(this.community.description),
|
||||||
status: this.fb.control(this.community.status),
|
status: this.fb.control(this.community.status),
|
||||||
claim: this.fb.control(this.community.claim),
|
claim: this.fb.control(this.community.claim),
|
||||||
|
@ -182,6 +192,7 @@ export class EditCommunityComponent {
|
||||||
if (!this.isAdmin) {
|
if (!this.isAdmin) {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.communityFb.get('shortName').disable();
|
this.communityFb.get('shortName').disable();
|
||||||
|
this.communityFb.get('name').disable();
|
||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -190,9 +201,9 @@ export class EditCommunityComponent {
|
||||||
}
|
}
|
||||||
|
|
||||||
public get isAdmin() {
|
public get isAdmin() {
|
||||||
return Session.isPortalAdministrator(this.user);
|
return Session.isPortalAdministrator(this.user) || Session.isCommunityCurator(this.user);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get disabled(): boolean {
|
public get disabled(): boolean {
|
||||||
return (this.communityFb && this.communityFb.invalid) ||
|
return (this.communityFb && this.communityFb.invalid) ||
|
||||||
(this.communityFb && this.communityFb.pristine && !this.isNew && !this.file) ||
|
(this.communityFb && this.communityFb.pristine && !this.isNew && !this.file) ||
|
||||||
|
@ -237,8 +248,7 @@ export class EditCommunityComponent {
|
||||||
this.removePhoto();
|
this.removePhoto();
|
||||||
this.subscriptions.push(this.communityService.updateCommunity(
|
this.subscriptions.push(this.communityService.updateCommunity(
|
||||||
this.properties.communityAPI + this.community.communityId, this.communityFb.getRawValue()).subscribe(() => {
|
this.properties.communityAPI + this.community.communityId, this.communityFb.getRawValue()).subscribe(() => {
|
||||||
this._clearCacheService.clearCache("Community saved");
|
this._clearCacheService.clearCacheInRoute("Community saved",this.community.communityId,"/");
|
||||||
this._clearCacheService.purgeBrowserCache("Community saved", this.community.communityId);
|
|
||||||
this.communityService.getCommunity(this.community.communityId, true).subscribe(community => {
|
this.communityService.getCommunity(this.community.communityId, true).subscribe(community => {
|
||||||
NotificationHandler.rise(community.shortTitle + ' has been <b>successfully created</b>');
|
NotificationHandler.rise(community.shortTitle + ' has been <b>successfully created</b>');
|
||||||
callback(community);
|
callback(community);
|
||||||
|
@ -251,8 +261,7 @@ export class EditCommunityComponent {
|
||||||
}));
|
}));
|
||||||
} else {
|
} else {
|
||||||
this.subscriptions.push(this.communityService.updateCommunity(this.properties.communityAPI + this.community.communityId, this.communityFb.getRawValue()).subscribe(() => {
|
this.subscriptions.push(this.communityService.updateCommunity(this.properties.communityAPI + this.community.communityId, this.communityFb.getRawValue()).subscribe(() => {
|
||||||
this._clearCacheService.clearCache("Community updated");
|
this._clearCacheService.clearCacheInRoute("Community saved",this.community.communityId,"/");
|
||||||
this._clearCacheService.purgeBrowserCache("Community updated", this.community.communityId);
|
|
||||||
this.communityService.getCommunity(this.community.communityId, true).subscribe(community => {
|
this.communityService.getCommunity(this.community.communityId, true).subscribe(community => {
|
||||||
NotificationHandler.rise(community.shortTitle + ' has been <b>successfully saved</b>');
|
NotificationHandler.rise(community.shortTitle + ' has been <b>successfully saved</b>');
|
||||||
callback(community);
|
callback(community);
|
||||||
|
|
|
@ -16,14 +16,28 @@ declare var UIkit;
|
||||||
<admin-tabs tab="customization" portal="connect"></admin-tabs>
|
<admin-tabs tab="customization" portal="connect"></admin-tabs>
|
||||||
</div>
|
</div>
|
||||||
<div inner>
|
<div inner>
|
||||||
<div class="uk-alert uk-alert-warning uk-margin-top ">
|
<div>
|
||||||
<div class="uk-text-large">Use only after connect deployment. And only if there are css updates!</div>
|
<div class="uk-alert uk-alert-warning uk-margin-top ">
|
||||||
Press the following button to update the timestamp in the saved layouts and recreate the css files.
|
<div class="uk-text-large">Use only after connect deployment. And only if there are css updates!</div>
|
||||||
|
Press the following button to update the timestamp in the saved layouts and recreate the css files.
|
||||||
|
</div>
|
||||||
|
<button (click)="updateCss()" class="uk-button uk-button-danger" [class.uk-disabled]="savingChanges"> Update CSS</button>
|
||||||
|
<hr>
|
||||||
</div>
|
</div>
|
||||||
<button (click)="updateCss()" class="uk-button uk-button-danger" [class.uk-disabled]="savingChanges"> Update CSS</button>
|
<div class="uk-margin-medium-top">
|
||||||
<button (click)="purgeBrowserCache()" class="uk-button uk-button-danger uk-margin-left" [class.uk-disabled]="savingChanges"> Purge Browser Cache</button>
|
<div>Purge ICM cache for all communities</div>
|
||||||
|
|
||||||
<ng-container *ngIf="properties.domain != 'production'">
|
<button (click)="purgeBrowserCache()" class="uk-button uk-button-danger uk-margin-top" [class.uk-disabled]="savingChanges"> Purge Browser Cache</button>
|
||||||
|
<hr>
|
||||||
|
</div>
|
||||||
|
<div class="uk-margin-medium-top">
|
||||||
|
<div>Reload cache requests either per community or for all communities</div>
|
||||||
|
<div input [(value)]="community" [placeholder]="'e.g. galaxy'" class="uk-width-1-2 uk-margin-top"></div>
|
||||||
|
<div input [(value)]="route" [placeholder]="'Route e.g. /'" class="uk-width-1-2 uk-margin-top"></div>
|
||||||
|
|
||||||
|
<button (click)="forceReloadCache()" class="uk-button uk-button-danger uk-margin-top" [class.uk-disabled]="savingChanges"> Reload Cache</button>
|
||||||
|
</div>
|
||||||
|
<!--<ng-container *ngIf="properties.domain != 'production'">
|
||||||
<hr>
|
<hr>
|
||||||
<div class="uk-alert uk-alert-danger uk-margin-top ">
|
<div class="uk-alert uk-alert-danger uk-margin-top ">
|
||||||
Delete after next deployment
|
Delete after next deployment
|
||||||
|
@ -33,7 +47,7 @@ declare var UIkit;
|
||||||
</div>
|
</div>
|
||||||
<div input [(value)]="community" [placeholder]="'e.g. galaxy'"></div>
|
<div input [(value)]="community" [placeholder]="'e.g. galaxy'"></div>
|
||||||
<button (click)="deleteLayout()" class="uk-button uk-button-danger" [class.uk-disabled]="!community"> Delete layout</button>
|
<button (click)="deleteLayout()" class="uk-button uk-button-danger" [class.uk-disabled]="!community"> Delete layout</button>
|
||||||
</ng-container>
|
</ng-container>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -45,6 +59,7 @@ export class ConnectAdminCustomizationComponent implements OnInit {
|
||||||
cssCreated: number = 0;
|
cssCreated: number = 0;
|
||||||
totalLayouts: number = 0;
|
totalLayouts: number = 0;
|
||||||
community;
|
community;
|
||||||
|
route;
|
||||||
properties = properties;
|
properties = properties;
|
||||||
|
|
||||||
constructor( private customizationService: CustomizationService, private _clearCacheService: ClearCacheService,
|
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;
|
||||||
|
}
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,12 +36,21 @@
|
||||||
<div class="uk-grid uk-grid-small uk-flex-nowrap uk-grid-divider uk-flex-right" uk-grid>
|
<div class="uk-grid uk-grid-small uk-flex-nowrap uk-grid-divider uk-flex-right" uk-grid>
|
||||||
<div *ngIf="!getCommunityContentProvider(result)">
|
<div *ngIf="!getCommunityContentProvider(result)">
|
||||||
<div class="uk-padding-small uk-padding-remove-horizontal">
|
<div class="uk-padding-small uk-padding-remove-horizontal">
|
||||||
<a (click)="addContentProvider(result)" class="uk-button uk-button-link uk-flex uk-flex-middle">
|
<a class="uk-button uk-button-link uk-flex uk-flex-middle">
|
||||||
<icon name="add" [flex]="true"></icon>
|
<icon name="add" [flex]="true"></icon>
|
||||||
<span class="uk-margin-small-left">
|
<span class="uk-margin-small-left">
|
||||||
Add
|
Add
|
||||||
</span>
|
</span>
|
||||||
</a>
|
</a>
|
||||||
|
<div uk-dropdown="mode:click">
|
||||||
|
<ul class="uk-nav uk-dropdown-nav">
|
||||||
|
<li class="uk-nav-header uk-margin-left">Add</li>
|
||||||
|
<li><a (click)="addContentProvider(result,true, false)"> as content source</a></li>
|
||||||
|
<li ><a (click)="addContentProvider(result,false, true)">as suggestion for deposit</a></li>
|
||||||
|
<li ><a (click)="addContentProvider(result,true, true)"> both</a></li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="getCommunityContentProvider(result)">
|
<div *ngIf="getCommunityContentProvider(result)">
|
||||||
|
|
|
@ -102,8 +102,8 @@ export class AddContentProvidersComponent implements OnInit {
|
||||||
"</div>"
|
"</div>"
|
||||||
}
|
}
|
||||||
|
|
||||||
public addContentProvider(contentProvider: SearchResult) {
|
public addContentProvider(contentProvider: SearchResult, content = true, deposit =false) {
|
||||||
this.subscriptions.push(this.manageCommunityContentProvidersService.addContentProvider(this.properties, this.community.communityId, contentProvider).subscribe(
|
this.subscriptions.push(this.manageCommunityContentProvidersService.addContentProvider(this.properties, this.community.communityId, contentProvider, content, deposit).subscribe(
|
||||||
data => {
|
data => {
|
||||||
this.communityContentProviders.push(data);
|
this.communityContentProviders.push(data);
|
||||||
this._clearCacheService.purgeBrowserCache(this.openAIREEntities.DATASOURCE+" added", this.community.communityId);
|
this._clearCacheService.purgeBrowserCache(this.openAIREEntities.DATASOURCE+" added", this.community.communityId);
|
||||||
|
@ -120,7 +120,7 @@ export class AddContentProvidersComponent implements OnInit {
|
||||||
|
|
||||||
public removeContentProvider(contentProvider) {
|
public removeContentProvider(contentProvider) {
|
||||||
let communityContentProvider = this.getCommunityContentProvider(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(
|
this.subscriptions.push(this.manageCommunityContentProvidersService.removeContentProvider(this.properties, this.community.communityId, contentProviderId).subscribe(
|
||||||
data => {
|
data => {
|
||||||
let index = this.communityContentProviders.indexOf(communityContentProvider);
|
let index = this.communityContentProviders.indexOf(communityContentProvider);
|
||||||
|
|
|
@ -28,6 +28,7 @@ import {AddContentProvidersComponent} from "./add-content-providers.component";
|
||||||
import {ManageCommunityContentProvidersService} from "../../services/manageContentProviders.service";
|
import {ManageCommunityContentProvidersService} from "../../services/manageContentProviders.service";
|
||||||
import {SearchDataprovidersService} from "../../openaireLibrary/services/searchDataproviders.service";
|
import {SearchDataprovidersService} from "../../openaireLibrary/services/searchDataproviders.service";
|
||||||
import {CriteriaModule} from "./criteria/criteria.module";
|
import {CriteriaModule} from "./criteria/criteria.module";
|
||||||
|
import {MatSlideToggleModule} from "@angular/material/slide-toggle";
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
@ -48,7 +49,7 @@ import {CriteriaModule} from "./criteria/criteria.module";
|
||||||
path: '', component: ManageContentProvidersComponent
|
path: '', component: ManageContentProvidersComponent
|
||||||
}
|
}
|
||||||
]),
|
]),
|
||||||
NoLoadPaging, LoadingModule, IconsModule, FullScreenModalModule, ResultPreviewModule, CriteriaModule
|
NoLoadPaging, LoadingModule, IconsModule, FullScreenModalModule, ResultPreviewModule, CriteriaModule, MatSlideToggleModule
|
||||||
],
|
],
|
||||||
declarations: [
|
declarations: [
|
||||||
ManageContentProvidersComponent,
|
ManageContentProvidersComponent,
|
||||||
|
|
|
@ -7,7 +7,7 @@ export class CriteriaUtils {
|
||||||
{value: 'title', label: 'Title'},
|
{value: 'title', label: 'Title'},
|
||||||
{value: 'orcid', label: 'Author\'s ORCID'},
|
{value: 'orcid', label: 'Author\'s ORCID'},
|
||||||
{value: 'contributor', label: 'Contributor'},
|
{value: 'contributor', label: 'Contributor'},
|
||||||
{value: 'description', label: 'Description'},
|
{value: 'description', label: 'Abstract'},
|
||||||
{value: 'subject', label: 'Subject'},
|
{value: 'subject', label: 'Subject'},
|
||||||
{value: 'fos', label: 'Field of Science'},
|
{value: 'fos', label: 'Field of Science'},
|
||||||
{value: 'sdg', label: 'SDG'},
|
{value: 'sdg', label: 'SDG'},
|
||||||
|
@ -28,8 +28,8 @@ export class CriteriaUtils {
|
||||||
{value: 'greater_than', label: 'greater than'}
|
{value: 'greater_than', label: 'greater than'}
|
||||||
]
|
]
|
||||||
|
|
||||||
public getFiltersAsText(criteria: Criteria[]): string {
|
public getFiltersAsText(criteria: Criteria[], shortVersion=true): string {
|
||||||
let text = criteria.slice(0, 3).map((criterion, index) => (index + 1) + ". " + criterion.constraint.map(constraint => {
|
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 field = this.fields.find(field => field.value === constraint.field)?.label;
|
||||||
let matchCase = false;
|
let matchCase = false;
|
||||||
if (!constraint.verb.includes('_caseinsensitive')) {
|
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 verb = [...this.verbs,...this.verbsForNumbers].find(verb => verb.value === constraint.verb.replace("_caseinsensitive", "")).label;
|
||||||
let value = '"' + constraint.value + '"' + (matchCase ? " (Match case)" : "");
|
let value = '"' + constraint.value + '"' + (matchCase ? " (Match case)" : "");
|
||||||
return field + " " + verb + " " + value;
|
let expFeature = field =='Publisher' || field == 'Publication Year'? `<span *ngIf="constraint.get('field').value == 'publisher' || constraint.get('field').value == 'publicationyear'" class="
|
||||||
|
uk-margin-xsmall-left uk-padding-remove-vertical uk-label uk-label-warning uk-text-lowercase uk-padding-xsmall">experimental feature</span>`:''
|
||||||
|
return field + " " + verb + " " + value + expFeature;
|
||||||
}).join(" <b>and</b> "));
|
}).join(" <b>and</b> "));
|
||||||
return text.join("<br>");
|
return text.join("<br>");
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div *ngFor="let constraint of getConstraint(i).controls; let j=index" [formGroupName]="j.toString()"
|
<div *ngFor="let constraint of getConstraint(i).controls; let j=index" [formGroupName]="j.toString()"
|
||||||
class="uk-margin-bottom uk-hidden@l">
|
class="uk-margin-bottom uk-hidden@l">
|
||||||
|
<span *ngIf="constraint.get('field').value == 'publisher' || constraint.get('field').value == 'publicationyear'" class="
|
||||||
|
uk-padding-remove-vertical uk-label uk-label-warning uk-text-lowercase uk-float-left uk-padding-xsmall">experimental feature</span>
|
||||||
<div class="uk-flex-middle uk-grid-small uk-margin-medium-bottom" uk-grid>
|
<div class="uk-flex-middle uk-grid-small uk-margin-medium-bottom" uk-grid>
|
||||||
<div class="uk-flex uk-flex-right uk-width-1-1">
|
<div class="uk-flex uk-flex-right uk-width-1-1">
|
||||||
<button class="uk-close uk-icon" (click)="removeConstraint(i, j)">
|
<button class="uk-close uk-icon" (click)="removeConstraint(i, j)">
|
||||||
|
@ -70,6 +72,8 @@
|
||||||
</div>
|
</div>
|
||||||
<div *ngFor="let constraint of getConstraint(i).controls; let j=index"
|
<div *ngFor="let constraint of getConstraint(i).controls; let j=index"
|
||||||
[formGroupName]="j.toString()" class="uk-margin-bottom uk-visible@l">
|
[formGroupName]="j.toString()" class="uk-margin-bottom uk-visible@l">
|
||||||
|
<span *ngIf="constraint.get('field').value == 'publisher' || constraint.get('field').value == 'publicationyear'" class="
|
||||||
|
uk-padding-remove-vertical uk-label uk-label-warning uk-text-lowercase uk-padding-xsmall">experimental feature</span>
|
||||||
<div class="uk-flex uk-flex-middle uk-grid" uk-grid>
|
<div class="uk-flex uk-flex-middle uk-grid" uk-grid>
|
||||||
<div class="uk-width-1-4" input type="select" inputClass="border-bottom" [placeholder]="{static: true, label: 'Choose a field'}"
|
<div class="uk-width-1-4" input type="select" inputClass="border-bottom" [placeholder]="{static: true, label: 'Choose a field'}"
|
||||||
[options]="criteriaUtils.fields" [formInput]="constraint.get('field')"></div>
|
[options]="criteriaUtils.fields" [formInput]="constraint.get('field')"></div>
|
||||||
|
|
|
@ -23,6 +23,7 @@ import {ManageCommunityContentProvidersService} from "../../services/manageConte
|
||||||
[communityContentProviders]="communityContentProviders"
|
[communityContentProviders]="communityContentProviders"
|
||||||
[loading]="showLoadingInRemove" [community]="community"
|
[loading]="showLoadingInRemove" [community]="community"
|
||||||
(editCriteria)="openCriteria($event)"
|
(editCriteria)="openCriteria($event)"
|
||||||
|
|
||||||
(communityContentProvidersChanged)="communityContentProvidersChanged($event)">
|
(communityContentProvidersChanged)="communityContentProvidersChanged($event)">
|
||||||
</remove-content-providers>
|
</remove-content-providers>
|
||||||
<fs-modal #addContentProvidersModal>
|
<fs-modal #addContentProvidersModal>
|
||||||
|
@ -30,10 +31,19 @@ import {ManageCommunityContentProvidersService} from "../../services/manageConte
|
||||||
[community]="community"
|
[community]="community"
|
||||||
(communityContentProvidersChanged)="communityContentProvidersChanged($event)"></add-content-providers>
|
(communityContentProvidersChanged)="communityContentProvidersChanged($event)"></add-content-providers>
|
||||||
</fs-modal>
|
</fs-modal>
|
||||||
<fs-modal #filtersModal (okEmitter)="saveCriteria()" (cancelEmitter)="criteria.reset()"
|
<fs-modal #filtersModal (okEmitter)="saveCriteria()" (cancelEmitter)="criteria.reset(); depositReset();"
|
||||||
[okButtonDisabled]="criteria && criteria.disabled">
|
[okButtonDisabled]="(criteria && criteria.disabled && !depositInfoChanged)">
|
||||||
<div class="uk-container uk-container-large">
|
<div class="uk-container uk-container-large">
|
||||||
<criteria #criteria *ngIf="dataProvider" [height]="filtersModal.bodyHeight"
|
<mat-slide-toggle [checked]="enabled" (change)="enabled = !enabled; depositInfoChanged = true;"></mat-slide-toggle>
|
||||||
|
<label class="uk-margin-medium-top uk-margin-small-left ">Content source</label>
|
||||||
|
<br>
|
||||||
|
<mat-slide-toggle [checked]="deposit" (change)="deposit = !deposit; depositInfoChanged = true;"></mat-slide-toggle>
|
||||||
|
<label class="uk-margin-medium-top uk-margin-small-left ">Suggest for deposit</label>
|
||||||
|
<div class="uk-width-1-1 uk-margin-medium-top" input placeholder="Type a message or instruction for researchers about deposition in this datasource"
|
||||||
|
[value]="message" (valueChange)="message=$event; depositInfoChanged = true;">
|
||||||
|
</div>
|
||||||
|
<div class="uk-text-center uk-text-bold uk-text-large uk-margin-medium-top">Content filters</div>
|
||||||
|
<criteria #criteria *ngIf="dataProvider" [height]="filtersModal.bodyHeight - 200"
|
||||||
[selectionCriteria]="dataProvider.selectioncriteria">
|
[selectionCriteria]="dataProvider.selectioncriteria">
|
||||||
<div no-criteria>
|
<div no-criteria>
|
||||||
<h5 class="uk-margin-small-bottom">No Filters for {{dataProvider.officialname}} yet</h5>
|
<h5 class="uk-margin-small-bottom">No Filters for {{dataProvider.officialname}} yet</h5>
|
||||||
|
@ -53,6 +63,7 @@ export class ManageContentProvidersComponent implements OnInit {
|
||||||
@ViewChild('criteria') criteria: CriteriaComponent;
|
@ViewChild('criteria') criteria: CriteriaComponent;
|
||||||
@ViewChild('addContentProvidersModal', { static: true }) addContentProvidersModal: FullScreenModalComponent;
|
@ViewChild('addContentProvidersModal', { static: true }) addContentProvidersModal: FullScreenModalComponent;
|
||||||
@ViewChild('filtersModal', { static: true }) filtersModal: FullScreenModalComponent;
|
@ViewChild('filtersModal', { static: true }) filtersModal: FullScreenModalComponent;
|
||||||
|
@ViewChild('depositModal', { static: true }) depositModal: FullScreenModalComponent;
|
||||||
private subscriptions: any[] = [];
|
private subscriptions: any[] = [];
|
||||||
public showLoadingInRemove: boolean = true;
|
public showLoadingInRemove: boolean = true;
|
||||||
public body: string = "Send from page";
|
public body: string = "Send from page";
|
||||||
|
@ -60,7 +71,10 @@ export class ManageContentProvidersComponent implements OnInit {
|
||||||
public openaireEntities = OpenaireEntities;
|
public openaireEntities = OpenaireEntities;
|
||||||
public community: CommunityInfo;
|
public community: CommunityInfo;
|
||||||
public dataProvider: ContentProvider;
|
public dataProvider: ContentProvider;
|
||||||
|
message = "";
|
||||||
|
deposit= false;
|
||||||
|
enabled = false;
|
||||||
|
depositInfoChanged =false;
|
||||||
constructor(private title: Title,
|
constructor(private title: Title,
|
||||||
private cdr: ChangeDetectorRef,
|
private cdr: ChangeDetectorRef,
|
||||||
private communityService: CommunityService,
|
private communityService: CommunityService,
|
||||||
|
@ -96,17 +110,24 @@ export class ManageContentProvidersComponent implements OnInit {
|
||||||
|
|
||||||
public openCriteria(contentProvider: ContentProvider) {
|
public openCriteria(contentProvider: ContentProvider) {
|
||||||
this.dataProvider = contentProvider;
|
this.dataProvider = contentProvider;
|
||||||
this.filtersModal.title = 'Filters';
|
this.deposit = this.dataProvider.deposit;
|
||||||
|
this.message = this.dataProvider.message;
|
||||||
|
this.enabled = this.dataProvider.enabled;
|
||||||
|
this.depositInfoChanged = false;
|
||||||
|
this.filtersModal.title = 'Edit datasource options';
|
||||||
this.filtersModal.okButtonText = "Save";
|
this.filtersModal.okButtonText = "Save";
|
||||||
this.filtersModal.back = true;
|
this.filtersModal.back = true;
|
||||||
this.filtersModal.okButton = true;
|
this.filtersModal.okButton = true;
|
||||||
|
|
||||||
this.filtersModal.open();
|
this.filtersModal.open();
|
||||||
this.cdr.detectChanges();
|
this.cdr.detectChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
public saveCriteria() {
|
public saveCriteria() {
|
||||||
let callback = (selectionCriteria): void => {
|
let callback = (selectionCriteria): void => {
|
||||||
this.dataProvider.selectioncriteria = selectionCriteria;
|
this.dataProvider.selectioncriteria = selectionCriteria;
|
||||||
|
this.dataProvider.deposit = this.deposit;
|
||||||
|
this.dataProvider.message = this.message;
|
||||||
|
this.dataProvider.enabled = this.enabled;
|
||||||
this.manageCommunityContentProvidersService.saveContentProvider(this.properties, this.dataProvider).subscribe(() => {
|
this.manageCommunityContentProvidersService.saveContentProvider(this.properties, this.dataProvider).subscribe(() => {
|
||||||
this.criteria.reset();
|
this.criteria.reset();
|
||||||
this.removeContentProvidersComponent.getCommunityContentProviders();
|
this.removeContentProvidersComponent.getCommunityContentProviders();
|
||||||
|
@ -128,4 +149,11 @@ export class ManageContentProvidersComponent implements OnInit {
|
||||||
this.removeContentProvidersComponent.applyFilters();
|
this.removeContentProvidersComponent.applyFilters();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
depositReset(){
|
||||||
|
this.message = this.dataProvider.message;
|
||||||
|
this.deposit = this.dataProvider.deposit;
|
||||||
|
this.enabled = this.dataProvider.enabled;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,12 @@
|
||||||
<span *ngIf="!item.officialname && !item.name">[no title available]</span>
|
<span *ngIf="!item.officialname && !item.name">[no title available]</span>
|
||||||
</span>
|
</span>
|
||||||
</h6>
|
</h6>
|
||||||
<div *ngIf="item.selectioncriteria?.criteria?.length > 0" class="uk-margin-small-bottom uk-text-small">
|
<div *ngIf="item.enabled" class="uk-label uk-text-primary uk-margin-small-right uk-padding-xsmall ">Content source</div>
|
||||||
|
<div *ngIf="item.deposit" class="uk-label uk-label-success uk-padding-xsmall">Suggested for deposit</div>
|
||||||
|
<div *ngIf="item.deposit && item.message" class=" uk-text-small uk-margin-top">
|
||||||
|
<span class="uk-text-muted uk-text-xsmall">Deposit info:</span>
|
||||||
|
{{item.message}}</div>
|
||||||
|
<div *ngIf="item.selectioncriteria?.criteria?.length > 0" class="uk-margin-small-bottom uk-margin-small-top uk-text-small">
|
||||||
<div class="uk-text-meta uk-margin-small-bottom">Filters</div>
|
<div class="uk-text-meta uk-margin-small-bottom">Filters</div>
|
||||||
<div [innerHTML]="criteriaUtils.getFiltersAsText(item.selectioncriteria.criteria)"></div>
|
<div [innerHTML]="criteriaUtils.getFiltersAsText(item.selectioncriteria.criteria)"></div>
|
||||||
<div *ngIf="item.selectioncriteria.criteria.length > 3" class="uk-margin-small-top">
|
<div *ngIf="item.selectioncriteria.criteria.length > 3" class="uk-margin-small-top">
|
||||||
|
@ -64,18 +69,24 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-card-footer uk-padding-remove-vertical">
|
<div class="uk-card-footer uk-padding-remove-vertical">
|
||||||
<div class="uk-grid uk-grid-small uk-flex-nowrap uk-grid-divider uk-flex-right" uk-grid>
|
<div class="uk-grid uk-grid-small uk-flex-nowrap uk-grid-divider uk-flex-right" uk-grid>
|
||||||
|
<div>
|
||||||
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div class="uk-padding-small uk-padding-remove-horizontal">
|
<div class="uk-padding-small uk-padding-remove-horizontal">
|
||||||
<a (click)="openCriteria(item)" class="uk-button uk-button-link uk-flex uk-flex-middle">
|
<a (click)="openCriteria(item)" class="uk-button uk-button-link uk-flex uk-flex-middle">
|
||||||
<icon name="filters" [flex]="true"></icon>
|
<icon name="edit" [flex]="true"></icon>
|
||||||
<span *ngIf="item.selectioncriteria?.criteria?.length > 0" class="uk-margin-small-left"
|
<!--<span *ngIf="item.selectioncriteria?.criteria?.length > 0" class="uk-margin-small-left"
|
||||||
uk-tooltip="<div>Edit filters to limit research results.<br>Results which satisfy any of the selected filters will be included in your community.</div>">
|
uk-tooltip="<div>Edit filters to limit research results.<br>Results which satisfy any of the selected filters will be included in your community.</div>">
|
||||||
Edit filters
|
Edit filters
|
||||||
</span>
|
</span>
|
||||||
<span *ngIf="!(item.selectioncriteria?.criteria?.length > 0)" class="uk-margin-small-left"
|
<span *ngIf="!(item.selectioncriteria?.criteria?.length > 0)" class="uk-margin-small-left"
|
||||||
uk-tooltip="<div>Add filter to limit research results.<br>Results which satisfy any of the selected filters will be included in your community.</div>">
|
uk-tooltip="<div>Add filter to limit research results.<br>Results which satisfy any of the selected filters will be included in your community.</div>">
|
||||||
Add filters
|
Add filters
|
||||||
</span>
|
</span>-->
|
||||||
|
<span class="uk-margin-small-left"
|
||||||
|
uk-tooltip="<div>Select datasource as content source and/or suggest for deposit. Add filters to limit research results.<br>Results which satisfy any of the selected filters will be included in your community.</div>">
|
||||||
|
Edit Options
|
||||||
|
</span>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -49,7 +49,7 @@ export class RemoveContentProvidersComponent implements OnInit {
|
||||||
public keyword: string = '';
|
public keyword: string = '';
|
||||||
@Output() addContentProviders: EventEmitter<void> = new EventEmitter();
|
@Output() addContentProviders: EventEmitter<void> = new EventEmitter();
|
||||||
@Output() editCriteria: EventEmitter<ContentProvider> = new EventEmitter<ContentProvider>();
|
@Output() editCriteria: EventEmitter<ContentProvider> = new EventEmitter<ContentProvider>();
|
||||||
|
|
||||||
constructor(private route: ActivatedRoute, private _router: Router,
|
constructor(private route: ActivatedRoute, private _router: Router,
|
||||||
private _fb: UntypedFormBuilder,
|
private _fb: UntypedFormBuilder,
|
||||||
private _manageCommunityContentProvidersService: ManageCommunityContentProvidersService,
|
private _manageCommunityContentProvidersService: ManageCommunityContentProvidersService,
|
||||||
|
@ -87,6 +87,7 @@ export class RemoveContentProvidersComponent implements OnInit {
|
||||||
let index = this.communityContentProviders.indexOf(this.selectedCommunityContentProvider);
|
let index = this.communityContentProviders.indexOf(this.selectedCommunityContentProvider);
|
||||||
this.communityContentProviders.splice(index, 1);
|
this.communityContentProviders.splice(index, 1);
|
||||||
this.applyFilters();
|
this.applyFilters();
|
||||||
|
this._clearCacheService.clearCacheInRoute(this.openAIREEntities.DATASOURCE+" removed", this.community.communityId)
|
||||||
this._clearCacheService.purgeBrowserCache(this.openAIREEntities.DATASOURCE+" removed", this.community.communityId);
|
this._clearCacheService.purgeBrowserCache(this.openAIREEntities.DATASOURCE+" removed", this.community.communityId);
|
||||||
this.handleSuccess(this.openAIREEntities.DATASOURCE + ' successfully removed!')
|
this.handleSuccess(this.openAIREEntities.DATASOURCE + ' successfully removed!')
|
||||||
this.communityContentProvidersChanged.emit({
|
this.communityContentProvidersChanged.emit({
|
||||||
|
@ -183,4 +184,5 @@ export class RemoveContentProvidersComponent implements OnInit {
|
||||||
openCriteria(contentProvider: ContentProvider) {
|
openCriteria(contentProvider: ContentProvider) {
|
||||||
this.editCriteria.emit(contentProvider);
|
this.editCriteria.emit(contentProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,12 +208,12 @@
|
||||||
[light]="false"></background>
|
[light]="false"></background>
|
||||||
<background label="Light" [background]="draftCustomizationOptions.backgrounds.light"
|
<background label="Light" [background]="draftCustomizationOptions.backgrounds.light"
|
||||||
[light]="true"></background>
|
[light]="true"></background>
|
||||||
<background label="Hero section" [background]="draftCustomizationOptions.backgrounds.form"
|
<background label="Custom section" [background]="draftCustomizationOptions.backgrounds.form"
|
||||||
[light]="draftCustomizationOptions.backgrounds.form.fontsDarkMode"
|
[light]="draftCustomizationOptions.backgrounds.form.fontsDarkMode"
|
||||||
[oldBackground]="publishedCustomizationOptions.backgrounds.form"
|
[oldBackground]="publishedCustomizationOptions.backgrounds.form"
|
||||||
[communityId]="communityId" description="The area under menu"></background>
|
[communityId]="communityId"></background>
|
||||||
<div class="uk-margin-xsmall-bottom uk-text-uppercase uk-text-meta uk-text-bold uk-margin-large-top uk-flex uk-flex-middle uk-heading-divider">
|
<div class="uk-margin-xsmall-bottom uk-text-uppercase uk-text-meta uk-text-bold uk-margin-large-top uk-flex uk-flex-middle uk-heading-divider">
|
||||||
Hero section
|
Custom section
|
||||||
</div>
|
</div>
|
||||||
<div class="uk-margin-xsmall-bottom uk-text-uppercase uk-text-meta uk-text-bold uk-margin-medium-top uk-flex uk-flex-middle">
|
<div class="uk-margin-xsmall-bottom uk-text-uppercase uk-text-meta uk-text-bold uk-margin-medium-top uk-flex uk-flex-middle">
|
||||||
Fonts
|
Fonts
|
||||||
|
@ -231,7 +231,7 @@
|
||||||
[checked]="draftCustomizationOptions.backgrounds.form.fontsDarkMode"
|
[checked]="draftCustomizationOptions.backgrounds.form.fontsDarkMode"
|
||||||
(change)="draftCustomizationOptions.backgrounds.form.fontsDarkMode=!draftCustomizationOptions.backgrounds.form.fontsDarkMode;"
|
(change)="draftCustomizationOptions.backgrounds.form.fontsDarkMode=!draftCustomizationOptions.backgrounds.form.fontsDarkMode;"
|
||||||
[attr.uk-tooltip]="'title:<div class=\'uk-width-large\'>' +
|
[attr.uk-tooltip]="'title:<div class=\'uk-width-large\'>' +
|
||||||
(draftCustomizationOptions.backgrounds.form.fontsDarkMode?'Change to light color mode if the hero section background is dark':'Change to dark mode if the hero section background is light')+'</div>'"
|
(draftCustomizationOptions.backgrounds.form.fontsDarkMode?'Change to light color mode if the custom section background is dark':'Change to dark mode if the custom section background is light')+'</div>'"
|
||||||
>
|
>
|
||||||
</mat-slide-toggle>
|
</mat-slide-toggle>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -164,11 +164,6 @@ sidebarItems = [{name:"Identity", id : "identity", icon: "desktop_windows" },
|
||||||
return JSON.stringify(object1) != JSON.stringify(object2);
|
return JSON.stringify(object1) != JSON.stringify(object2);
|
||||||
}
|
}
|
||||||
saveLayout() {
|
saveLayout() {
|
||||||
if (!Session.isLoggedIn()) {
|
|
||||||
this._router.navigate(['/user-info'], {
|
|
||||||
queryParams: {'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.publishedLayout.layoutOptions = this.copyObject(this.draftCustomizationOptions);
|
this.publishedLayout.layoutOptions = this.copyObject(this.draftCustomizationOptions);
|
||||||
this.publishedCustomizationOptions = this.copyObject(this.publishedLayout.layoutOptions)
|
this.publishedCustomizationOptions = this.copyObject(this.publishedLayout.layoutOptions)
|
||||||
this.publishedLayout.date = new Date();
|
this.publishedLayout.date = new Date();
|
||||||
|
|
|
@ -123,6 +123,7 @@ export class AddProjectsComponent implements OnInit {
|
||||||
this.subscriptions.push(this._manageCommunityProjectsService.addProject(this.properties, this.community.communityId, project).subscribe(
|
this.subscriptions.push(this._manageCommunityProjectsService.addProject(this.properties, this.community.communityId, project).subscribe(
|
||||||
data => {
|
data => {
|
||||||
// this.communityProjects.push(data);
|
// this.communityProjects.push(data);
|
||||||
|
this._clearCacheService.clearCacheInRoute(this.openaireEntities.PROJECT+" added", this.community.communityId);
|
||||||
this._clearCacheService.purgeBrowserCache(this.openaireEntities.PROJECT+" added", this.community.communityId);
|
this._clearCacheService.purgeBrowserCache(this.openaireEntities.PROJECT+" added", this.community.communityId);
|
||||||
|
|
||||||
UIkit.notification(this.openaireEntities.PROJECT+' successfully added!', {
|
UIkit.notification(this.openaireEntities.PROJECT+' successfully added!', {
|
||||||
|
|
|
@ -131,7 +131,7 @@ export class RemoveProjectsComponent implements OnInit {
|
||||||
public confirmedDeleteProject(data: any) {
|
public confirmedDeleteProject(data: any) {
|
||||||
this.subscriptions.push(this._manageCommunityProjectsService.removeProject(this.properties, this.community.communityId, this.selectedCommunityProject.openaireId).subscribe(
|
this.subscriptions.push(this._manageCommunityProjectsService.removeProject(this.properties, this.community.communityId, this.selectedCommunityProject.openaireId).subscribe(
|
||||||
data => {
|
data => {
|
||||||
|
this._clearCacheService.clearCacheInRoute(this.openaireEntiites.PROJECT+" removed", this.community.communityId);
|
||||||
this._clearCacheService.purgeBrowserCache(this.openaireEntiites.PROJECT+" removed", this.community.communityId);
|
this._clearCacheService.purgeBrowserCache(this.openaireEntiites.PROJECT+" removed", this.community.communityId);
|
||||||
NotificationHandler.rise(OpenaireEntities.PROJECT+' successfully removed!');
|
NotificationHandler.rise(OpenaireEntities.PROJECT+' successfully removed!');
|
||||||
this._getCommunityProjects(this.communitySearchUtils.page, this.keyword,null);
|
this._getCommunityProjects(this.communitySearchUtils.page, this.keyword,null);
|
||||||
|
|
|
@ -344,6 +344,7 @@ export class SubjectsEditFormComponent implements OnInit {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this._communityService.updateSubjects(this.community.subjects, this.community.fos, this.community.sdg);
|
this._communityService.updateSubjects(this.community.subjects, this.community.fos, this.community.sdg);
|
||||||
|
this._clearCacheService.clearCacheInRoute("Subjects " + message, this.communityId);
|
||||||
this._clearCacheService.purgeBrowserCache("Subjects " + message, this.communityId);
|
this._clearCacheService.purgeBrowserCache("Subjects " + message, this.communityId);
|
||||||
NotificationHandler.rise('Subjects successfully ' + message + '!')
|
NotificationHandler.rise('Subjects successfully ' + message + '!')
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
|
|
@ -5,7 +5,7 @@ import {
|
||||||
Input,
|
Input,
|
||||||
OnDestroy,
|
OnDestroy,
|
||||||
OnInit,
|
OnInit,
|
||||||
Output,
|
Output, SimpleChanges,
|
||||||
ViewChild,
|
ViewChild,
|
||||||
ViewEncapsulation
|
ViewEncapsulation
|
||||||
} from '@angular/core';
|
} from '@angular/core';
|
||||||
|
@ -33,8 +33,8 @@ export class ManageZenodoCommunitiesComponent implements OnInit, OnDestroy {
|
||||||
@Input() searchUtils: SearchUtilsClass = null;
|
@Input() searchUtils: SearchUtilsClass = null;
|
||||||
errorCodes: ErrorCodes;
|
errorCodes: ErrorCodes;
|
||||||
public rowsOnPage = 10;
|
public rowsOnPage = 10;
|
||||||
@Input() masterCommunity = null;
|
@Input() masterCommunity;
|
||||||
@Input() selectedCommunities = [];
|
@Input() selectedCommunities;
|
||||||
previewCommunities = [];
|
previewCommunities = [];
|
||||||
@ViewChild('AlertModalDeleteCommunity') alertModalDeleteCommunity;
|
@ViewChild('AlertModalDeleteCommunity') alertModalDeleteCommunity;
|
||||||
selectedToDelete = null;
|
selectedToDelete = null;
|
||||||
|
@ -53,12 +53,12 @@ export class ManageZenodoCommunitiesComponent implements OnInit, OnDestroy {
|
||||||
private _manageZenodoCommunitiesService: ManageZenodoCommunitiesService) {
|
private _manageZenodoCommunitiesService: ManageZenodoCommunitiesService) {
|
||||||
this.errorCodes = new ErrorCodes();
|
this.errorCodes = new ErrorCodes();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.init();
|
this.init();
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
this.subscriptions.forEach(subscription => {
|
this.subscriptions.forEach(subscription => {
|
||||||
if (subscription instanceof Subscription) {
|
if (subscription instanceof Subscription) {
|
||||||
subscription.unsubscribe();
|
subscription.unsubscribe();
|
||||||
|
@ -67,6 +67,7 @@ export class ManageZenodoCommunitiesComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
|
|
||||||
private init() {
|
private init() {
|
||||||
|
console.log(this.selectedCommunities.length)
|
||||||
this.filterForm = this._fb.control('');
|
this.filterForm = this._fb.control('');
|
||||||
this.filterPreviewCommunities("");
|
this.filterPreviewCommunities("");
|
||||||
this.subscriptions.push(this.filterForm.valueChanges.subscribe(value => {
|
this.subscriptions.push(this.filterForm.valueChanges.subscribe(value => {
|
||||||
|
@ -75,15 +76,18 @@ export class ManageZenodoCommunitiesComponent implements OnInit, OnDestroy {
|
||||||
}));
|
}));
|
||||||
this.searchUtils.keyword = "";
|
this.searchUtils.keyword = "";
|
||||||
this.searchUtils.totalResults = this.selectedCommunities.length;
|
this.searchUtils.totalResults = this.selectedCommunities.length;
|
||||||
|
console.log(this.selectedCommunities.length, this.previewCommunities.length)
|
||||||
}
|
}
|
||||||
|
|
||||||
public filterPreviewCommunities(value: string) {
|
public filterPreviewCommunities(value: string) {
|
||||||
this.previewCommunities = this.selectedCommunities.filter(community => {
|
this.previewCommunities = this.selectedCommunities.filter(community => {
|
||||||
return !value || community.title.toLowerCase().indexOf(value.toLowerCase()) != -1
|
return !value || community.title.toLowerCase().indexOf(value.toLowerCase()) != -1
|
||||||
});
|
});
|
||||||
|
console.log("filter", this.previewCommunities.length)
|
||||||
if (this.previewCommunities.slice((this.page - 1) * this.rowsOnPage, this.page * this.rowsOnPage).length == 0) {
|
if (this.previewCommunities.slice((this.page - 1) * this.rowsOnPage, this.page * this.rowsOnPage).length == 0) {
|
||||||
this.page = 1;
|
this.page = 1;
|
||||||
}
|
}
|
||||||
|
console.log("filter - slice", this.previewCommunities.length)
|
||||||
this.cdr.detectChanges();
|
this.cdr.detectChanges();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,12 +37,12 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
|
||||||
masterZenodoCommunity = null;
|
masterZenodoCommunity = null;
|
||||||
public properties: EnvProperties = null;
|
public properties: EnvProperties = null;
|
||||||
selectedCommunityIds = null;
|
selectedCommunityIds = null;
|
||||||
selectedCommunities = [];
|
selectedCommunities = null;
|
||||||
zenodocommunitiesloadedCount = 0;
|
zenodocommunitiesloadedCount = 0;
|
||||||
zenodoSearchUtils: SearchUtilsClass = new SearchUtilsClass();
|
zenodoSearchUtils: SearchUtilsClass = new SearchUtilsClass();
|
||||||
public errorCodes: ErrorCodes = new ErrorCodes();
|
public errorCodes: ErrorCodes = new ErrorCodes();
|
||||||
subscriptions = [];
|
subscriptions = [];
|
||||||
@ViewChild('fsModal', { static: true }) fullscreen: FullScreenModalComponent;
|
@ViewChild('fsModal', {static: true}) fullscreen: FullScreenModalComponent;
|
||||||
@ViewChild(ManageZenodoCommunitiesComponent) manage: ManageZenodoCommunitiesComponent;
|
@ViewChild(ManageZenodoCommunitiesComponent) manage: ManageZenodoCommunitiesComponent;
|
||||||
public showLoadingInRemove: boolean = true;
|
public showLoadingInRemove: boolean = true;
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
|
||||||
private _zenodoCommunitieService: ZenodoCommunitiesService, private title: Title,
|
private _zenodoCommunitieService: ZenodoCommunitiesService, private title: Title,
|
||||||
private _communityService: CommunityService) {
|
private _communityService: CommunityService) {
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.zenodoSearchUtils.status = this.errorCodes.LOADING;
|
this.zenodoSearchUtils.status = this.errorCodes.LOADING;
|
||||||
this.properties = properties;
|
this.properties = properties;
|
||||||
|
@ -60,41 +60,23 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
|
||||||
this.community = community;
|
this.community = community;
|
||||||
this.title.setTitle(this.community.shortTitle.toUpperCase() + ' | Zenodo Communities');
|
this.title.setTitle(this.community.shortTitle.toUpperCase() + ' | Zenodo Communities');
|
||||||
this.masterZenodoCommunityId = this.community.zenodoCommunity;
|
this.masterZenodoCommunityId = this.community.zenodoCommunity;
|
||||||
if (this.masterZenodoCommunityId) {
|
this.selectedCommunities = [];
|
||||||
this.subscriptions.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties,
|
|
||||||
this.masterZenodoCommunityId).subscribe(
|
this.zenodoSearchUtils.status = this.errorCodes.LOADING;
|
||||||
result => {
|
|
||||||
this.masterZenodoCommunity = result;
|
this.selectedCommunityIds = this.community.otherZenodoCommunities;
|
||||||
this.selectedCommunities.unshift(this.masterZenodoCommunity);
|
if(this.masterZenodoCommunityId){
|
||||||
},
|
this.selectedCommunityIds.unshift(this.masterZenodoCommunityId)
|
||||||
error => {
|
}
|
||||||
const emptyCommunity: ZenodoCommunityInfo = new ZenodoCommunityInfo();
|
this.zenodoSearchUtils.totalResults = this.selectedCommunityIds.length;
|
||||||
emptyCommunity.id = this.masterZenodoCommunityId;
|
if (this.selectedCommunityIds.length === 0) {
|
||||||
emptyCommunity.title = this.masterZenodoCommunityId;
|
this.zenodoSearchUtils.status = this.errorCodes.NONE;
|
||||||
this.masterZenodoCommunity = emptyCommunity;
|
}
|
||||||
}
|
for (let i = 0; i < this.selectedCommunityIds.length; i++) {
|
||||||
));
|
this.getZenodoCommunityById(
|
||||||
}
|
this.selectedCommunityIds[i]);
|
||||||
this.zenodoSearchUtils.status = this.errorCodes.LOADING;
|
}
|
||||||
this.zenodoSearchUtils.status = this.errorCodes.LOADING;
|
|
||||||
// this._searchZenodoCommunitiesService.searchZCommunities(this.properties, this.community.communityId).subscribe(
|
|
||||||
// result => {
|
|
||||||
this.selectedCommunityIds = this.community.otherZenodoCommunities;
|
|
||||||
this.zenodoSearchUtils.totalResults = this.selectedCommunityIds.length;
|
|
||||||
if (this.selectedCommunityIds.length === 0) {
|
|
||||||
this.zenodoSearchUtils.status = this.errorCodes.NONE;
|
|
||||||
}
|
|
||||||
for (let i = 0; i < this.selectedCommunityIds.length; i++) {
|
|
||||||
this.getZenodoCommunityById(
|
|
||||||
this.selectedCommunityIds[i]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// },
|
|
||||||
// error => {
|
|
||||||
// console.log('list of zenodo communities couldn\'t be loaded');
|
|
||||||
// this.zenodoSearchUtils.status = this.errorCodes.DONE;
|
|
||||||
// }
|
|
||||||
// );
|
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -102,7 +84,7 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
|
||||||
this.fullscreen.okButtonText = "Done";
|
this.fullscreen.okButtonText = "Done";
|
||||||
this.fullscreen.okButton = true;
|
this.fullscreen.okButton = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy() {
|
ngOnDestroy() {
|
||||||
this.subscriptions.forEach(subscription => {
|
this.subscriptions.forEach(subscription => {
|
||||||
if (subscription instanceof Subscription) {
|
if (subscription instanceof Subscription) {
|
||||||
|
@ -110,18 +92,23 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
getZenodoCommunityById(zenodoid) {
|
getZenodoCommunityById(zenodoid) {
|
||||||
this.subscriptions.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties,
|
this.subscriptions.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties,
|
||||||
zenodoid).subscribe(
|
zenodoid).subscribe(
|
||||||
result => {
|
result => {
|
||||||
this.selectedCommunities.push(result);
|
if(zenodoid == this.masterZenodoCommunityId){
|
||||||
|
this.masterZenodoCommunity = result;
|
||||||
|
result.master = true;
|
||||||
|
this.selectedCommunities.unshift(result);
|
||||||
|
}else {
|
||||||
|
this.selectedCommunities.push(result);
|
||||||
|
}
|
||||||
this.zenodocommunitiesloadedCount++;
|
this.zenodocommunitiesloadedCount++;
|
||||||
if (this.zenodocommunitiesloadedCount >= this.selectedCommunityIds.length) {
|
if (this.zenodocommunitiesloadedCount >= this.selectedCommunityIds.length) {
|
||||||
this.zenodoSearchUtils.status = this.errorCodes.DONE;
|
this.zenodoSearchUtils.status = this.errorCodes.DONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
const emptyCommunity: ZenodoCommunityInfo = new ZenodoCommunityInfo();
|
const emptyCommunity: ZenodoCommunityInfo = new ZenodoCommunityInfo();
|
||||||
|
|
|
@ -11,27 +11,29 @@ export class ManageCommunityContentProvidersService {
|
||||||
|
|
||||||
removeContentProvider(properties: EnvProperties, pid: string, id: string): any {
|
removeContentProvider(properties: EnvProperties, pid: string, id: string): any {
|
||||||
let headers = new HttpHeaders({'Content-Type': 'application/json', 'accept': 'application/json'});
|
let headers = new HttpHeaders({'Content-Type': 'application/json', 'accept': 'application/json'});
|
||||||
let url = properties.communityAPI + pid + '/contentproviders?contentproviderId=' +id;
|
let url = properties.communityAPI + pid + '/datasources?dsId=' +id;
|
||||||
return this.http.request('delete', url, {body: id, headers: headers});
|
return this.http.request('delete', url, {body: id, headers: headers});
|
||||||
}
|
}
|
||||||
|
|
||||||
addContentProvider(properties: EnvProperties, pid: string, contentProvider: any): Observable<ContentProvider> {
|
addContentProvider(properties: EnvProperties, pid: string, contentProvider: any, content:boolean, deposit:boolean): Observable<ContentProvider> {
|
||||||
let url = properties.communityAPI + pid + '/contentproviders';
|
let url = properties.communityAPI + pid + '/datasources';
|
||||||
let communityContentProvider = this.convertSearchContentProviderToCommunityContentProvider(contentProvider, pid);
|
let communityContentProvider = this.convertSearchContentProviderToCommunityContentProvider(contentProvider, pid, content, deposit);
|
||||||
return this.http.post<ContentProvider>(url, communityContentProvider);
|
return this.http.post<ContentProvider>(url, communityContentProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
saveContentProvider(properties: EnvProperties, contentProvider: ContentProvider): Observable<ContentProvider> {
|
saveContentProvider(properties: EnvProperties, contentProvider: ContentProvider): Observable<ContentProvider> {
|
||||||
let url = properties.communityAPI + contentProvider.communityId + '/contentproviders';
|
let url = properties.communityAPI + contentProvider.communityId + '/datasources';
|
||||||
return this.http.post<ContentProvider>(url, contentProvider);
|
return this.http.post<ContentProvider>(url, contentProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
convertSearchContentProviderToCommunityContentProvider(contentProvider: any, community: string): ContentProvider {
|
convertSearchContentProviderToCommunityContentProvider(contentProvider: any, community: string, content:boolean, deposit:boolean): ContentProvider {
|
||||||
let communityContentProvider: ContentProvider = new ContentProvider();
|
let communityContentProvider: ContentProvider = new ContentProvider();
|
||||||
communityContentProvider.communityId = community;
|
communityContentProvider.communityId = community;
|
||||||
communityContentProvider.officialname = contentProvider.title.name;
|
communityContentProvider.officialname = contentProvider.title.name;
|
||||||
communityContentProvider.name = contentProvider.englishname;
|
communityContentProvider.name = contentProvider.englishname;
|
||||||
communityContentProvider.openaireId = contentProvider.id;
|
communityContentProvider.openaireId = contentProvider.id;
|
||||||
|
communityContentProvider.enabled = content;
|
||||||
|
communityContentProvider.deposit = deposit;
|
||||||
|
|
||||||
return communityContentProvider;
|
return communityContentProvider;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 6bb1e61b059bef1bff3bfb0611b0df46f7840426
|
Subproject commit ee22e97b114be823b7ab4e6c41a9cbff93b24e3a
|
|
@ -1 +1 @@
|
||||||
Subproject commit 5e8c1addb1ebfa508aac8cb9540a755940c95b79
|
Subproject commit 52eca9abe84c941a7e78a5690f273d8c8e3194f9
|
|
@ -5,8 +5,8 @@ let props: EnvProperties = {
|
||||||
isDashboard: true,
|
isDashboard: true,
|
||||||
enablePiwikTrack: false,
|
enablePiwikTrack: false,
|
||||||
useCache: false,
|
useCache: false,
|
||||||
domain:'https://beta.admin.connect.openaire.eu'
|
domain:'https://beta.admin.connect.openaire.eu',
|
||||||
|
monitorStatsFrameUrl:"https://beta.services.openaire.eu/stats-tool/"
|
||||||
};
|
};
|
||||||
|
|
||||||
export let properties: EnvProperties = {
|
export let properties: EnvProperties = {
|
||||||
|
|
|
@ -7,6 +7,7 @@ let props: EnvProperties = {
|
||||||
enablePiwikTrack: false,
|
enablePiwikTrack: false,
|
||||||
useCache: false,
|
useCache: false,
|
||||||
domain:'https://admin.connect.openaire.eu',
|
domain:'https://admin.connect.openaire.eu',
|
||||||
|
monitorStatsFrameUrl:"https://services.openaire.eu/stats-tool/"
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,11 @@ let props: EnvProperties = {
|
||||||
useCache: false,
|
useCache: false,
|
||||||
connectPortalUrl: 'http://scoobydoo.di.uoa.gr:4200',
|
connectPortalUrl: 'http://scoobydoo.di.uoa.gr:4200',
|
||||||
domain:'https://beta.admin.connect.openaire.eu',
|
domain:'https://beta.admin.connect.openaire.eu',
|
||||||
|
adminToolsAPIURL: 'http://scoobydoo.di.uoa.gr:8880/uoa-admin-tools/',
|
||||||
|
utilsService: "http://scoobydoo.di.uoa.gr:8000",
|
||||||
|
|
||||||
|
monitorStatsFrameUrl:"https://stats.madgik.di.uoa.gr/stats-api/",
|
||||||
|
// disableFrameLoad : true
|
||||||
};
|
};
|
||||||
|
|
||||||
export let properties: EnvProperties = {
|
export let properties: EnvProperties = {
|
||||||
|
|
Loading…
Reference in New Issue