Delete header from all pages of communityInfo and users. Add advanced criteria page.
This commit is contained in:
parent
a83852cffd
commit
f2bbf0fb85
|
@ -221,9 +221,12 @@ export class AppComponent implements OnInit {
|
|||
new MenuItem("organizations", "Organizations", "", "/" + this.community.communityId + "/info/organizations", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/info/organizations"),
|
||||
new MenuItem("projects", OpenaireEntities.PROJECTS, "", "/" + this.community.communityId + "/info/projects", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/info/projects"),
|
||||
new MenuItem("content-providers", OpenaireEntities.DATASOURCES, "", "/" + this.community.communityId + "/info/content-providers", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/info/content-providers"),
|
||||
new MenuItem("subjects", "Subjects", "", "/" + this.community.communityId + "/info/subjects", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/info/subjects"),
|
||||
new MenuItem("zenodo-communities", "Zenodo Communities ", "", "/" + this.community.communityId + "/info/zenodo-communities", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/info/zenodo-communities"),
|
||||
new MenuItem("advanced-criteria", "Advanced Criteria", "", "/" + this.community.communityId + "/info/advanced-criteria", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/info/advanced-criteria")
|
||||
]
|
||||
if(this.community.type === 'community') {
|
||||
communityInfo.items.splice(4, 0, new MenuItem("subjects", "Subjects", "", "/" + this.community.communityId + "/info/subjects", false, [], [], {}, null, null, null, "/" + this.community.communityId + "/info/subjects"))
|
||||
}
|
||||
this.sideBarItems.push(communityInfo);
|
||||
this.sideBarItems.push(new MenuItem("users", "Users", "", "/" + this.community.communityId + "/users", false, [], [], {}, {name: 'group'}, null, null, "/" + this.community.communityId + "/users"));
|
||||
this.sideBarItems.push(new MenuItem("admin-tools", "Pages & Menus", "", "/" + this.community.communityId + "/admin-tools/pages", false, [], [], {}, {name: 'description'}, null, null, "/" + this.community.communityId + "/admin-tools"));
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit efc2d6c47b1c8e81150274589550b26c25b6eb8f
|
||||
Subproject commit cdd59b68abb368dc178e898ce3b336606cd499d1
|
|
@ -0,0 +1,121 @@
|
|||
import {ChangeDetectorRef, Component, OnDestroy, OnInit, ViewChild} from "@angular/core";
|
||||
import {CommunityService} from "../../openaireLibrary/connect/community/community.service";
|
||||
import {AdvancedCriteriaService} from "./advanced-criteria.service";
|
||||
import {Subscription} from "rxjs";
|
||||
import {ContentProvider, SelectionCriteria} from "../../openaireLibrary/utils/entities/contentProvider";
|
||||
import {
|
||||
FullScreenModalComponent
|
||||
} from "../../openaireLibrary/utils/modal/full-screen-modal/full-screen-modal.component";
|
||||
import {NotificationHandler} from "../../openaireLibrary/utils/notification-handler";
|
||||
import {CriteriaComponent} from "../content-providers/criteria/criteria.component";
|
||||
import {CriteriaUtils} from "../content-providers/criteria-utils";
|
||||
import {OpenaireEntities} from "../../openaireLibrary/utils/properties/searchFields";
|
||||
import {CommunityInfo} from "../../openaireLibrary/connect/community/communityInfo";
|
||||
|
||||
@Component({
|
||||
selector: 'advanced-criteria',
|
||||
template: `
|
||||
<div page-content>
|
||||
<div *ngIf="selectionCriteria" actions>
|
||||
<div class="uk-section-xsmall uk-margin-top">
|
||||
<div class="uk-flex uk-flex-right@m uk-flex-center">
|
||||
<button *ngIf="selectionCriteria.criteria.length === 0" (click)="openCriteria()" class="uk-button uk-button-default uk-flex uk-flex-middle">
|
||||
<icon name="add" [flex]="true"></icon>
|
||||
<span class="uk-margin-small-left">Add Criteria</span>
|
||||
</button>
|
||||
<button *ngIf="selectionCriteria.criteria.length > 0" (click)="openCriteria()" class="uk-button uk-button-default uk-flex uk-flex-middle">
|
||||
<icon name="edit" [flex]="true"></icon>
|
||||
<span class="uk-margin-small-left">Edit Criteria</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div inner>
|
||||
<div *ngIf="loading" class="uk-position-center">
|
||||
<loading></loading>
|
||||
</div>
|
||||
<div *ngIf="!loading">
|
||||
<div *ngIf="selectionCriteria?.criteria?.length > 0" class="uk-margin-small-bottom">
|
||||
<div class="uk-text-meta uk-margin-small-bottom">Criteria</div>
|
||||
<div [innerHTML]="criteriaUtils.getFiltersAsText(selectionCriteria.criteria)"></div>
|
||||
</div>
|
||||
<div *ngIf="selectionCriteria?.criteria?.length === 0" class="message">
|
||||
<h5 class="uk-margin-small-bottom">No criteria yet</h5>
|
||||
<i class="uk-display-block">
|
||||
Add multiple constraints in AND to define a criterion: results that satisfy at least one of the criteria will be included in your community.
|
||||
</i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<fs-modal #filtersModal (okEmitter)="saveCriteria()" (cancelEmitter)="criteria.reset()"
|
||||
[okButtonDisabled]="criteria && criteria.disabled">
|
||||
<div *ngIf="selectionCriteria" class="uk-container uk-container-large">
|
||||
<criteria #criteria [height]="filtersModal.bodyHeight" [entityType]="'criterion'"
|
||||
[entityTypePlural]="'criteria'" [selectionCriteria]="selectionCriteria">
|
||||
<div no-criteria>
|
||||
<h5 class="uk-margin-small-bottom">No Criteria yet</h5>
|
||||
<i class="uk-display-block">
|
||||
Add multiple constraints in AND to define a criterion: results that satisfy at least one of the criteria will be included in your community.
|
||||
</i>
|
||||
</div>
|
||||
</criteria>
|
||||
</div>
|
||||
</fs-modal>
|
||||
`
|
||||
})
|
||||
export class AdvancedCriteriaComponent implements OnInit, OnDestroy {
|
||||
public loading = true;
|
||||
public selectionCriteria: SelectionCriteria;
|
||||
public community: CommunityInfo;
|
||||
public criteriaUtils: CriteriaUtils = new CriteriaUtils();
|
||||
private subscriptions: any[] = [];
|
||||
@ViewChild('criteria') criteria: CriteriaComponent;
|
||||
@ViewChild('filtersModal', { static: true }) filtersModal: FullScreenModalComponent;
|
||||
|
||||
constructor(private communityService: CommunityService,
|
||||
private cdr: ChangeDetectorRef,
|
||||
private advancedCriteriaService: AdvancedCriteriaService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.loading = true;
|
||||
this.subscriptions.push(this.communityService.getCommunityAsObservable().subscribe(community => {
|
||||
this.community = community;
|
||||
this.selectionCriteria = community.selectionCriteria;
|
||||
this.loading = false;
|
||||
}));
|
||||
}
|
||||
|
||||
saveCriteria() {
|
||||
let callback = (selectionCriteria): void => {
|
||||
this.advancedCriteriaService.saveAdvancedCriteria(this.community.communityId, selectionCriteria).subscribe(() => {
|
||||
this.criteria.reset();
|
||||
this.criteria.loading = false;
|
||||
NotificationHandler.rise('Filters have been <b>successfully updated</b>');
|
||||
}, error => {
|
||||
this.criteria.loading = false;
|
||||
this.criteria.handeError('An error has been occurred. Try again later!', error);
|
||||
});
|
||||
}
|
||||
this.loading = true;
|
||||
this.criteria.save(callback);
|
||||
}
|
||||
|
||||
public openCriteria() {
|
||||
this.criteria.reset();
|
||||
this.filtersModal.title = 'Criteria';
|
||||
this.filtersModal.okButtonText = "Save";
|
||||
this.filtersModal.back = true;
|
||||
this.filtersModal.okButton = true;
|
||||
this.filtersModal.open();
|
||||
this.cdr.detectChanges();
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.subscriptions.forEach(subscription => {
|
||||
if(subscription instanceof Subscription) {
|
||||
subscription.unsubscribe();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
|
@ -0,0 +1,18 @@
|
|||
import {NgModule} from "@angular/core";
|
||||
import {CommonModule} from "@angular/common";
|
||||
import {RouterModule} from "@angular/router";
|
||||
import {AdvancedCriteriaComponent} from "./advanced-criteria.component";
|
||||
import {PageContentModule} from "../../openaireLibrary/dashboard/sharedComponents/page-content/page-content.module";
|
||||
import {FullScreenModalModule} from "../../openaireLibrary/utils/modal/full-screen-modal/full-screen-modal.module";
|
||||
import {CriteriaModule} from "../content-providers/criteria/criteria.module";
|
||||
import {IconsModule} from "../../openaireLibrary/utils/icons/icons.module";
|
||||
import {LoadingModule} from "../../openaireLibrary/utils/loading/loading.module";
|
||||
|
||||
@NgModule({
|
||||
imports: [CommonModule, RouterModule.forChild([
|
||||
{path: '', component: AdvancedCriteriaComponent,}
|
||||
]), PageContentModule, FullScreenModalModule, CriteriaModule, IconsModule, LoadingModule],
|
||||
declarations: [AdvancedCriteriaComponent],
|
||||
exports: [AdvancedCriteriaComponent]
|
||||
})
|
||||
export class AdvancedCriteriaModule {}
|
|
@ -0,0 +1,25 @@
|
|||
import {Injectable} from "@angular/core";
|
||||
import {SelectionCriteria} from "../../openaireLibrary/utils/entities/contentProvider";
|
||||
import {Observable} from "rxjs";
|
||||
import {CommunityInfo} from "../../openaireLibrary/connect/community/communityInfo";
|
||||
import {HttpClient} from "@angular/common/http";
|
||||
import {properties} from "../../../environments/environment";
|
||||
import {map} from "rxjs/operators";
|
||||
import {CommunityService} from "../../openaireLibrary/connect/community/community.service";
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AdvancedCriteriaService {
|
||||
|
||||
constructor(private httpClient: HttpClient,
|
||||
private communityService: CommunityService) {
|
||||
}
|
||||
|
||||
public saveAdvancedCriteria(communityId, selectionCriteria: SelectionCriteria): Observable<void> {
|
||||
return this.httpClient.post(properties.communityAPI + communityId + '/advancedConstraint', selectionCriteria).pipe(map(community => {
|
||||
this.communityService.updateAdvancedCriteria(this.communityService.parseCommunity(community).selectionCriteria);
|
||||
}));
|
||||
}
|
||||
|
||||
}
|
|
@ -1,15 +1,6 @@
|
|||
<div page-content>
|
||||
<div header>
|
||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
||||
<div>
|
||||
<div class="uk-text-background uk-text-bold uk-text-small">Admin Dashboard - Manage Organizations
|
||||
</div>
|
||||
<h1 class="uk-h6 uk-margin-remove">{{community.shortTitle}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div actions>
|
||||
<div class="uk-section-xsmall">
|
||||
<div class="uk-section-xsmall uk-margin-top">
|
||||
<div class="uk-flex uk-flex-center uk-flex-right@m">
|
||||
<button *ngIf="!organizationsEnabled" class="uk-button uk-button-default uk-margin-right" [class.uk-disabled]="loading"
|
||||
[disabled]="loading"
|
||||
|
|
|
@ -11,13 +11,6 @@ import {CommunityService} from "../../openaireLibrary/connect/community/communit
|
|||
template: `
|
||||
<div page-content>
|
||||
<div header>
|
||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
||||
<div>
|
||||
<div class="uk-text-background uk-text-bold uk-text-small">Admin Dashboard - Manage Links
|
||||
</div>
|
||||
<h1 class="uk-h6 uk-margin-remove">{{community.shortTitle}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<users-tabs tab="claims"></users-tabs>
|
||||
</div>
|
||||
<div inner>
|
||||
|
|
|
@ -11,6 +11,7 @@ import {ConnectCommunityGuard} from "../../openaireLibrary/connect/communityGuar
|
|||
{path: 'projects', loadChildren: () => import('../projects/communityProjects.module').then(m => m.CommunityProjectsModule)},
|
||||
{path: 'content-providers', loadChildren: () => import('../content-providers/communityContentProviders.module').then(m => m.CommunityContentProvidersModule)},
|
||||
{path: 'zenodo-communities', loadChildren: () => import('../zenodo-communities/zenodo-communities.module').then(m => m.ZenodoCommunitiesModule)},
|
||||
{path: 'advanced-criteria', loadChildren: () => import('../advanced-criteria/advanced-criteria.module').then(m => m.AdvancedCriteriaModule)},
|
||||
{path: 'subjects', canActivateChild: [ConnectCommunityGuard], loadChildren: () => import('../subjects/subjects-edit-form/subjects-edit-form.module').then(m => m.SubjectsEditFormModule)},
|
||||
])
|
||||
],
|
||||
|
|
|
@ -11,18 +11,8 @@ import {Subscription} from "rxjs";
|
|||
selector: 'community-profile',
|
||||
template: `
|
||||
<div page-content>
|
||||
<div header>
|
||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
||||
<div>
|
||||
<div class="uk-text-background uk-text-bold uk-text-small">Admin Dashboard - Manage Community
|
||||
Profile
|
||||
</div>
|
||||
<h1 class="uk-h6 uk-margin-remove">{{community.shortTitle}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div actions>
|
||||
<div class="uk-container uk-section-xsmall">
|
||||
<div actions class="uk-section-xsmall uk-margin-top">
|
||||
<div class="uk-container">
|
||||
<div class="uk-flex uk-flex-center uk-flex-right@m">
|
||||
<button class="uk-button uk-button-default uk-margin-right"
|
||||
(click)="reset()" [class.uk-disabled]="loading || !editCommunityComponent.dirty"
|
||||
|
|
|
@ -13,17 +13,8 @@ declare var UIkit;
|
|||
template: `
|
||||
<div page-content>
|
||||
<div header>
|
||||
<div class="uk-flex uk-flex-middle uk-margin-top info">
|
||||
<img src="assets/common-assets/placeholder.png" class="uk-margin-right">
|
||||
<div>
|
||||
<div class="uk-margin-remove uk-text-background uk-text-bold uk-h6">Admin Dashboard - Manage Options</div>
|
||||
<h1 class="uk-h4 uk-margin-remove">Super Admin</h1>
|
||||
</div>
|
||||
</div>
|
||||
<admin-tabs tab="customization" portal="connect"></admin-tabs>
|
||||
|
||||
</div>
|
||||
|
||||
<div inner>
|
||||
<div class="uk-alert uk-alert-warning uk-margin-top ">
|
||||
<div class="uk-text-large">Use only after connect deployment. And only if there are css updates!</div>
|
||||
|
|
|
@ -1,20 +1,37 @@
|
|||
import {Option} from "../../openaireLibrary/sharedComponents/input/input.component";
|
||||
import {Criteria} from "../../openaireLibrary/utils/entities/contentProvider";
|
||||
|
||||
export class CriteriaUtils {
|
||||
public static readonly fields: Option[] = [
|
||||
public readonly fields: Option[] = [
|
||||
{value: 'author', label: 'Author\'s name'},
|
||||
{value: 'title', label: 'Title'},
|
||||
{value: 'orcid', label: 'Author\'s ORCID'},
|
||||
{value: 'contributor', label: 'Contributor'},
|
||||
{value: 'description', label: 'Description'},
|
||||
{value: 'subject', label: 'Subject'},
|
||||
{value: 'fos', label: 'Field of Science'}
|
||||
{value: 'fos', label: 'Field of Science'},
|
||||
{value: 'sdg', label: 'SDG'}
|
||||
]
|
||||
|
||||
public static readonly verbs: Option[] = [
|
||||
public readonly verbs: Option[] = [
|
||||
{value: 'contains', label: 'contains'},
|
||||
{value: 'equals', label: 'equals'},
|
||||
{value: 'not_contains', label: 'not contains'},
|
||||
{value: 'not_equals', label: 'not equals'}
|
||||
{value: 'not_equals', label: 'not equals'},
|
||||
{value: 'starts_with', label: 'starts with'}
|
||||
]
|
||||
|
||||
public getFiltersAsText(criteria: Criteria[]): string {
|
||||
let text = criteria.slice(0, 3).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')) {
|
||||
matchCase = true;
|
||||
}
|
||||
let verb = this.verbs.find(verb => verb.value === constraint.verb.replace("_caseinsensitive", "")).label;
|
||||
let value = '"' + constraint.value + '"' + (matchCase ? " (Match case)" : "");
|
||||
return field + " " + verb + " " + value;
|
||||
}).join(" <b>and</b> "));
|
||||
return text.join("<br>");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
<div class="uk-section uk-position-relative" style="min-height: 60vh">
|
||||
<div class="uk-position-relative" style="min-height: 60vh">
|
||||
<div *ngIf="loading" class="uk-position-center">
|
||||
<loading></loading>
|
||||
</div>
|
||||
<ng-container *ngIf="!loading">
|
||||
<div class="criteria uk-overflow-auto" [ngStyle]="{'max-height.px': maxHeight?maxHeight:null}">
|
||||
<div *ngIf="criteria.length == 0" class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-medium-bottom uk-text-bold">
|
||||
<div>No filters <span *ngIf="dataProvider">for {{dataProvider}}.</span></div>
|
||||
<div *ngIf="dataProvider">If no filters are specified, all {{openaireEntities.RESULTS | lowercase}} of this {{openaireEntities.DATASOURCE | lowercase}} will be included in your
|
||||
{{openaireEntities.COMMUNITY | lowercase}}.
|
||||
</div>
|
||||
<div class="criteria uk-overflow-auto uk-position-relative" [ngStyle]="{'height.px': criteriaHeight?criteriaHeight:null}">
|
||||
<div *ngIf="criteria.length == 0" class="uk-text-center uk-position-center">
|
||||
<ng-content select="[no-criteria]"></ng-content>
|
||||
</div>
|
||||
<form *ngIf="criteria.length > 0" [formGroup]="selectionCriteriaForm">
|
||||
<div formArrayName="criteria" class="uk-margin-bottom">
|
||||
|
@ -18,7 +15,7 @@
|
|||
<h3 class="uk-padding uk-margin-remove-bottom uk-margin-top">
|
||||
{{i + 1}}
|
||||
</h3>
|
||||
<div class="uk-width-expand uk-padding-small criterion uk-border uk-border-rounded uk-overflow-auto" formArrayName="constraint">
|
||||
<div class="uk-width-expand uk-padding-small uk-border uk-border-rounded" formArrayName="constraint">
|
||||
<div class="uk-flex-middle uk-grid uk-margin-small-bottom uk-visible@l" uk-grid>
|
||||
<div class="uk-width-1-4">
|
||||
<label class="uk-text-uppercase uk-text-bold">Field</label>
|
||||
|
@ -39,15 +36,15 @@
|
|||
<div class="uk-flex uk-flex-right uk-width-1-1">
|
||||
<button class="uk-close uk-icon" (click)="removeConstraint(i, j)">
|
||||
<icon name="close" ratio="1.5" [flex]="true"
|
||||
[attr.uk-tooltip]="(getConstraint(i).length === 1?'By removing this constraint, the filter will be removed too':null)"></icon>
|
||||
[attr.uk-tooltip]="(getConstraint(i).length === 1?'By removing this constraint, the ' + entityType + ' will be removed too':null)"></icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="uk-width-1-1" input type="select" inputClass="border-bottom" [placeholder]="{static: true, label: 'Choose a field'}"
|
||||
[options]="fields" [formInput]="constraint.get('field')">
|
||||
[options]="criteriaUtils.fields" [formInput]="constraint.get('field')">
|
||||
<label class="uk-text-uppercase uk-text-bold uk-width-1-3 uk-text-truncate">Field:</label>
|
||||
</div>
|
||||
<div class="uk-width-1-1" input type="select" inputClass="border-bottom"
|
||||
[options]="verbs" [formInput]="constraint.get('verb')">
|
||||
[options]="criteriaUtils.verbs" [formInput]="constraint.get('verb')">
|
||||
<label class="uk-text-uppercase uk-text-bold uk-width-1-3 uk-text-truncate">Operator:</label>
|
||||
</div>
|
||||
<div class="uk-width-1-1" input [placeholder]="{static: true, label: 'Type a keyword'}"
|
||||
|
@ -71,13 +68,15 @@
|
|||
[formGroupName]="j.toString()" class="uk-margin-bottom uk-visible@l">
|
||||
<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'}"
|
||||
[options]="fields" [formInput]="constraint.get('field')"></div>
|
||||
[options]="criteriaUtils.fields" [formInput]="constraint.get('field')"></div>
|
||||
<div class="uk-width-1-4" input type="select" inputClass="border-bottom"
|
||||
[options]="verbs" [formInput]="constraint.get('verb')"></div>
|
||||
<div *ngIf="constraint.get('field').value !== 'fos'" class="uk-width-1-4" inputClass="flat small" input [placeholder]="{static: true, label: 'Type a keyword'}"
|
||||
[options]="criteriaUtils.verbs" [formInput]="constraint.get('verb')"></div>
|
||||
<div *ngIf="constraint.get('field').value !== 'fos' && constraint.get('field').value !== 'sdg'" class="uk-width-1-4" inputClass="flat small" input [placeholder]="{static: true, label: 'Type a keyword'}"
|
||||
[formInput]="constraint.get('value')"></div>
|
||||
<div *ngIf="constraint.get('field').value === 'fos'" class="uk-width-1-4" inputClass="flat small" input [placeholder]="{static: true, label: 'Choose a FoS'}"
|
||||
[formInput]="constraint.get('value')" type="select" [options]="fos"></div>
|
||||
<div *ngIf="constraint.get('field').value === 'sdg'" class="uk-width-1-4" inputClass="flat small" input [placeholder]="{static: true, label: 'Choose a FoS'}"
|
||||
[formInput]="constraint.get('value')" type="select" [options]="sdg"></div>
|
||||
<div class="uk-width-expand">
|
||||
<mat-slide-toggle [checked]="constraint.get('verb_suffix').value === ''" class="uk-margin-left"
|
||||
[attr.uk-tooltip]="(constraint.get('verb_suffix').value === ''?('Only \'\'' + constraint.get('value').value + '\'\' matches'):
|
||||
|
@ -87,7 +86,7 @@
|
|||
<div class="uk-flex uk-flex-center">
|
||||
<button class="uk-close uk-icon" (click)="removeConstraint(i, j)">
|
||||
<icon name="close" ratio="1.5" [flex]="true"
|
||||
[attr.uk-tooltip]="(getConstraint(i).length === 1?'By removing this constraint, the filter will be removed too':null)"></icon>
|
||||
[attr.uk-tooltip]="(getConstraint(i).length === 1?'By removing this constraint, the ' + entityType + ' will be removed too':null)"></icon>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -107,9 +106,9 @@
|
|||
</div>
|
||||
<div class="uk-flex uk-flex-center uk-margin-top">
|
||||
<a (click)="addCriteria()" class="uk-flex uk-flex-middle uk-button uk-button-primary"
|
||||
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>">
|
||||
[attr.uk-tooltip]="'<div>Add a ' + entityType + ' to limit research results.<br>Results which satisfy any of the selected ' + entityTypePlural + ' will be included in your ' + openaireEntities.COMMUNITY + '.</div>'">
|
||||
<icon name="add" [flex]="true"></icon>
|
||||
<span class="uk-margin-small-left">Add filter</span>
|
||||
<span class="uk-margin-small-left">Add {{entityType}}</span>
|
||||
</a>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
|
|
@ -1,7 +1,3 @@
|
|||
.criteria {
|
||||
padding-right: 20px;
|
||||
}
|
||||
|
||||
.criterion {
|
||||
max-height: 400px;
|
||||
}
|
||||
|
|
|
@ -12,7 +12,6 @@ import {EnvProperties} from '../../../openaireLibrary/utils/properties/env-prope
|
|||
import {Constraint, Criteria, SelectionCriteria} from '../../../openaireLibrary/utils/entities/contentProvider';
|
||||
import {AbstractControl, UntypedFormArray, UntypedFormBuilder, UntypedFormGroup, Validators} from '@angular/forms';
|
||||
import {properties} from "../../../../environments/environment";
|
||||
import {Option} from "../../../openaireLibrary/sharedComponents/input/input.component";
|
||||
import {MatSlideToggleChange} from "@angular/material/slide-toggle";
|
||||
import {HelperFunctions} from "../../../openaireLibrary/utils/HelperFunctions.class";
|
||||
import {CriteriaUtils} from "../criteria-utils";
|
||||
|
@ -28,17 +27,19 @@ import {Subscription} from "rxjs";
|
|||
})
|
||||
export class CriteriaComponent implements OnInit, OnChanges, AfterViewInit, OnDestroy {
|
||||
@Input()
|
||||
public dataProvider: string;
|
||||
public entityType: string = 'filter';
|
||||
@Input()
|
||||
public entityTypePlural: string = 'filters';
|
||||
@Input()
|
||||
public selectionCriteria: SelectionCriteria;
|
||||
@Input()
|
||||
public height: number = 0;
|
||||
public maxHeight: number = 0;
|
||||
public criteriaHeight: number = 0;
|
||||
public selectionCriteriaForm: UntypedFormGroup;
|
||||
public properties: EnvProperties = properties;
|
||||
public fields: Option[] = CriteriaUtils.fields;
|
||||
public verbs: Option[] = CriteriaUtils.verbs;
|
||||
public criteriaUtils: CriteriaUtils = new CriteriaUtils();
|
||||
public fos: string[] = [];
|
||||
public sdg: string[] = [];
|
||||
public loading = true;
|
||||
public openaireEntities = OpenaireEntities;
|
||||
private subscriptions: any[] = [];
|
||||
|
@ -53,6 +54,9 @@ export class CriteriaComponent implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||
this.subscriptions.push(this.vocabulariesService.getVocabularyByType('fos', null, properties).subscribe((fos: any[]) => {
|
||||
this.fos = fos.map(element => element.id);
|
||||
}));
|
||||
this.subscriptions.push(this.vocabulariesService.getVocabularyByType('sdg', null, properties).subscribe((sdg: any[]) => {
|
||||
this.sdg = sdg.map(element => element.id);
|
||||
}));
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
|
@ -74,8 +78,8 @@ export class CriteriaComponent implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||
calculateMaxHeight() {
|
||||
if(this.height) {
|
||||
if(this.height > 0) {
|
||||
/* Element height - section (70 + 70) - margins(20 + 20) - button height(42) */
|
||||
this.maxHeight = this.height - 140 - 40 - 42;
|
||||
/* Element height - margins(20 + 20) - button height(42) */
|
||||
this.criteriaHeight = this.height - 40 - 42;
|
||||
this.cdr.detectChanges();
|
||||
}
|
||||
}
|
||||
|
@ -154,7 +158,7 @@ export class CriteriaComponent implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||
}
|
||||
|
||||
get dirty() {
|
||||
if (!this.dataProvider || !this.criteria) {
|
||||
if (!this.selectionCriteria || !this.criteria) {
|
||||
return false;
|
||||
} else if (this.criteria.length !== this.criteriaArray.length) {
|
||||
return true;
|
||||
|
|
|
@ -34,8 +34,14 @@ import {ManageCommunityContentProvidersService} from "../../services/manageConte
|
|||
[okButtonDisabled]="criteria && criteria.disabled">
|
||||
<div class="uk-container uk-container-large">
|
||||
<criteria #criteria *ngIf="dataProvider" [height]="filtersModal.bodyHeight"
|
||||
[selectionCriteria]="dataProvider.selectioncriteria"
|
||||
[dataProvider]="dataProvider.officialname"></criteria>
|
||||
[selectionCriteria]="dataProvider.selectioncriteria">
|
||||
<div no-criteria>
|
||||
<h5 class="uk-margin-small-bottom">No Filters for {{dataProvider.officialname}} yet</h5>
|
||||
<i class="uk-display-block">If no Filters are specified, all {{openaireEntities.RESULTS | lowercase}} of this {{openaireEntities.DATASOURCE | lowercase}} will be included in your
|
||||
{{openaireEntities.COMMUNITY | lowercase}}.
|
||||
</i>
|
||||
</div>
|
||||
</criteria>
|
||||
</div>
|
||||
</fs-modal>
|
||||
`
|
||||
|
@ -51,6 +57,7 @@ export class ManageContentProvidersComponent implements OnInit {
|
|||
public showLoadingInRemove: boolean = true;
|
||||
public body: string = "Send from page";
|
||||
public properties: EnvProperties = properties;
|
||||
public openaireEntities = OpenaireEntities;
|
||||
public community: CommunityInfo;
|
||||
public dataProvider: ContentProvider;
|
||||
|
||||
|
|
|
@ -1,15 +1,6 @@
|
|||
<div page-content>
|
||||
<div header>
|
||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
||||
<div>
|
||||
<div class="uk-text-background uk-text-bold uk-text-small">Admin Dashboard - Manage <span class="uk-text-capitalize">{{openAIREEntities.DATASOURCES}}</span>
|
||||
</div>
|
||||
<h1 class="uk-h6 uk-margin-remove">{{community.shortTitle}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div actions>
|
||||
<div class="uk-section-xsmall">
|
||||
<div class="uk-section-xsmall uk-margin-top">
|
||||
<div class="uk-flex uk-flex-right@m uk-flex-center uk-flex-middle uk-grid" uk-grid>
|
||||
<div search-input [expandable]="true" [searchControl]="filterForm.get('keyword')" searchInputClass="outer"
|
||||
[placeholder]="'Search ' + openAIREEntities.DATASOURCES" [disabled]="loading"
|
||||
|
@ -65,7 +56,7 @@
|
|||
</h6>
|
||||
<div *ngIf="item.selectioncriteria?.criteria?.length > 0" class="uk-margin-small-bottom uk-text-small">
|
||||
<div class="uk-text-meta uk-margin-small-bottom">Filters</div>
|
||||
<div [innerHTML]="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">
|
||||
<a class="uk-link view-more-less-link" (click)="openCriteria(item)">View all {{item.selectioncriteria.criteria.length}} filters</a>
|
||||
</div>
|
||||
|
|
|
@ -38,8 +38,7 @@ export class RemoveContentProvidersComponent implements OnInit {
|
|||
private selectedCommunityContentProvider: any;
|
||||
@ViewChild('deleteModal') deleteModal: AlertModal;
|
||||
/** Criteria */
|
||||
private fields = CriteriaUtils.fields;
|
||||
private verbs = CriteriaUtils.verbs;
|
||||
public criteriaUtils: CriteriaUtils = new CriteriaUtils();
|
||||
/** Paging */
|
||||
page: number = 1;
|
||||
resultsPerPage: number = properties.resultsPerPage;
|
||||
|
@ -81,20 +80,6 @@ export class RemoveContentProvidersComponent implements OnInit {
|
|||
});
|
||||
}
|
||||
|
||||
getFiltersAsText(criteria: Criteria[]): string {
|
||||
let text = criteria.slice(0, 3).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')) {
|
||||
matchCase = true;
|
||||
}
|
||||
let verb = this.verbs.find(verb => verb.value === constraint.verb.replace("_caseinsensitive", "")).label;
|
||||
let value = '"' + constraint.value + '"' + (matchCase ? " (Match case)" : "");
|
||||
return field + " " + verb + " " + value;
|
||||
}).join(" <b>and</b> "));
|
||||
return text.join("<br>");
|
||||
}
|
||||
|
||||
public confirmedDeleteContentProvider() {
|
||||
this.subscriptions.push(this._manageCommunityContentProvidersService.removeContentProvider(this.properties, this.community.communityId, this.selectedCommunityContentProvider.id).subscribe(
|
||||
() => {
|
||||
|
|
|
@ -20,14 +20,6 @@ type Tab = 'all' | 'communities' | 'ris';
|
|||
template: `
|
||||
<div page-content [id]="tab">
|
||||
<div header>
|
||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
||||
<div>
|
||||
<div class="uk-text-background uk-text-bold uk-text-small">
|
||||
Admin Dashboard - Manage Communities
|
||||
</div>
|
||||
<h1 class="uk-h6 uk-margin-remove">Research Communities & Initiatives</h1>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="uk-tab uk-margin-medium-top" uk-tab>
|
||||
<li [class.uk-active]="tab === 'all'"><a (click)="tab = 'all'"><span class="title">All</span></a></li>
|
||||
<li [class.uk-active]="tab === 'communities'"><a (click)="tab = 'communities'"><span class="title">Research Communities</span></a>
|
||||
|
|
|
@ -1,15 +1,6 @@
|
|||
<div page-content>
|
||||
<div header>
|
||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
||||
<div>
|
||||
<div class="uk-text-background uk-text-bold uk-text-small">Admin Dashboard - Manage {{openaireEntiites.PROJECTS}}
|
||||
</div>
|
||||
<h1 class="uk-h6 uk-margin-remove">{{community.shortTitle}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div actions>
|
||||
<div class="uk-section-xsmall">
|
||||
<div class="uk-section-xsmall uk-margin-top">
|
||||
<div class="uk-flex uk-flex-middle">
|
||||
<div class="uk-width-expand@m uk-width-1-1 uk-grid uk-flex-middle uk-flex-right@m uk-flex-center uk-margin-remove-left" uk-grid>
|
||||
<div search-input [expandable]="true" [searchControl]="filterForm.get('keyword')" searchInputClass="outer"
|
||||
|
|
|
@ -1,11 +1,5 @@
|
|||
<div page-content>
|
||||
<div header>
|
||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
||||
<div>
|
||||
<div class="uk-text-background uk-text-bold uk-text-small">Admin Dashboard - Manage Notification Settings</div>
|
||||
<h1 class="uk-h6 uk-margin-remove">{{community.shortTitle}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<users-tabs tab="notifications"></users-tabs>
|
||||
</div>
|
||||
<div actions>
|
||||
|
|
|
@ -25,18 +25,10 @@ declare var UIkit;
|
|||
template: `
|
||||
<div page-content>
|
||||
<div header>
|
||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
||||
<div>
|
||||
<div class="uk-text-background uk-text-bold uk-text-small">Admin Dashboard - Manage Personal Info &
|
||||
Affiliations
|
||||
</div>
|
||||
<h1 class="uk-h6 uk-margin-remove">{{community.shortTitle}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<users-tabs tab="personal"></users-tabs>
|
||||
</div>
|
||||
<div actions>
|
||||
<div class="uk-container uk-section-xsmall">
|
||||
<div class="uk-container uk-section-xsmall uk-margin-top">
|
||||
<div class="uk-flex uk-flex-middle uk-flex-center uk-flex-right@m">
|
||||
<button class="uk-button uk-button-secondary" [class.uk-disabled]="!hasChanged || loading"
|
||||
[disabled]="!hasChanged || loading"
|
||||
|
|
|
@ -14,12 +14,6 @@ import {CommunityInfo} from "../../../openaireLibrary/connect/community/communit
|
|||
<role-users [id]="community.communityId" [type]="community.type" [name]="community.shortTitle" [inviteDisableMessage]="inviteDisableMessage"
|
||||
[link]="link" [role]="'manager'" [deleteAuthorizationLevel]="'manager'"
|
||||
[message]="message" [emailComposer]="emailComposer">
|
||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
||||
<div>
|
||||
<div class="uk-margin-remove uk-text-background uk-text-bold uk-text-small">Admin Dashboard - Manage Users</div>
|
||||
<h1 class="uk-h6 uk-margin-remove">{{community.shortTitle}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<users-tabs tab="manager"></users-tabs>
|
||||
</role-users>
|
||||
`
|
||||
|
|
|
@ -10,12 +10,6 @@ import {CommunityInfo} from "../../../openaireLibrary/connect/community/communit
|
|||
template: `
|
||||
<subscribers [id]="community.communityId" [type]="'community'" [name]="community.shortTitle"
|
||||
[inviteDisableMessage]="inviteDisableMessage">
|
||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
||||
<div>
|
||||
<div class="uk-text-background uk-text-bold uk-text-small">Admin Dashboard - Manage Users</div>
|
||||
<h1 class="uk-h6 uk-margin-remove">{{community.shortTitle}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
<users-tabs tab="member"></users-tabs>
|
||||
</subscribers>
|
||||
`
|
||||
|
|
|
@ -1,15 +1,6 @@
|
|||
<div page-content>
|
||||
<div header>
|
||||
<div class="uk-flex uk-flex-middle uk-margin-medium-top info">
|
||||
<div>
|
||||
<div class="uk-text-background uk-text-bold uk-text-small">Admin Dashboard - Manage Zenodo Communities
|
||||
</div>
|
||||
<h1 class="uk-h6 uk-margin-remove">{{community.shortTitle}}</h1>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div actions>
|
||||
<div class="uk-section-xsmall">
|
||||
<div class="uk-section-xsmall uk-margin-top">
|
||||
<div class="uk-flex uk-flex-right@m uk-flex-center uk-flex-middle uk-grid" uk-grid>
|
||||
<div search-input [expandable]="true" [searchControl]="filterForm" searchInputClass="outer"
|
||||
placeholder="Search Zenodo Community" [disabled]="searchUtils.status === errorCodes.LOADING"
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit e0c850adad45d61fe7e07f340eea2dc7870ff3c9
|
||||
Subproject commit 95c2b50a57696a80dd3dd376880f26cb21d65817
|
|
@ -1 +1 @@
|
|||
Subproject commit a72ea0d0c9d0b490de6c77a238d501ee75216960
|
||||
Subproject commit c4e2781acc42f281265a70d6cd75616cdd6fa762
|
Loading…
Reference in New Issue