diff --git a/src/app/pages/community-info/profile/edit-community/edit-community.component.ts b/src/app/pages/community-info/profile/edit-community/edit-community.component.ts index 0134f16..89c1116 100644 --- a/src/app/pages/community-info/profile/edit-community/edit-community.component.ts +++ b/src/app/pages/community-info/profile/edit-community/edit-community.component.ts @@ -100,13 +100,10 @@ import {ClearCacheService} from "../../../../openaireLibrary/services/clear-cach export class EditCommunityComponent { public communityFb: UntypedFormGroup; public statuses: Option[] = [ - {label: 'Visible', value: 'all'}, - {label: 'Visible [Public*]', value: 'PUBLIC'}, - {label: 'Visible to managers', value: 'manager'}, - {label: 'Visible to managers [Restricted*]', value: 'RESTRICTED'}, -/* - {label: 'Hidden [Private*]', value: 'PRIVATE'}, -*/ + // {label: 'Visible', value: 'all'}, + {label: 'Visible', value: 'PUBLIC'}, + // {label: 'Visible to managers', value: 'manager'}, + {label: 'Visible to managers', value: 'RESTRICTED'}, {label: 'Hidden', value: 'hidden'} ] public claimOptions: Option[] = [ diff --git a/src/app/pages/content-providers/criteria-utils.ts b/src/app/pages/content-providers/criteria-utils.ts index 2e6a3b4..c8eee7d 100644 --- a/src/app/pages/content-providers/criteria-utils.ts +++ b/src/app/pages/content-providers/criteria-utils.ts @@ -10,9 +10,11 @@ export class CriteriaUtils { {value: 'description', label: 'Description'}, {value: 'subject', label: 'Subject'}, {value: 'fos', label: 'Field of Science'}, - {value: 'sdg', label: 'SDG'} + {value: 'sdg', label: 'SDG'}, + {value: 'publisher', label: 'Publisher'}, + {value: 'publicationyear', label: 'Publication Year'} ] - + public readonly numericFields: string[] = ['publicationyear']; public readonly verbs: Option[] = [ {value: 'contains', label: 'contains'}, {value: 'equals', label: 'equals'}, @@ -20,6 +22,11 @@ export class CriteriaUtils { {value: 'not_equals', label: 'not equals'}, {value: 'starts_with', label: 'starts with'} ] + public readonly verbsForNumbers: Option[] = [ + {value: 'equals', label: 'equals'}, + {value: 'lesser_than', label: 'lesser than'}, + {value: 'greater_than', label: 'greater than'} + ] public getFiltersAsText(criteria: Criteria[]): string { let text = criteria.slice(0, 3).map((criterion, index) => (index + 1) + ". " + criterion.constraint.map(constraint => { @@ -28,7 +35,7 @@ export class CriteriaUtils { if (!constraint.verb.includes('_caseinsensitive')) { matchCase = true; } - let verb = this.verbs.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)" : ""); return field + " " + verb + " " + value; }).join(" and ")); diff --git a/src/app/pages/content-providers/criteria/criteria.component.html b/src/app/pages/content-providers/criteria/criteria.component.html index 8b84635..74469a3 100644 --- a/src/app/pages/content-providers/criteria/criteria.component.html +++ b/src/app/pages/content-providers/criteria/criteria.component.html @@ -40,13 +40,17 @@
+ [options]="criteriaUtils.fields" [formInput]="constraint.get('field')" (valueChange)="resetFieldWhenValueChange(constraint)">
-
+
+ +
@@ -69,8 +73,10 @@
-
+
- +
diff --git a/src/app/pages/users/users-managers/users-managers.component.ts b/src/app/pages/users/users-managers/users-managers.component.ts index ecb8256..1beddb8 100644 --- a/src/app/pages/users/users-managers/users-managers.component.ts +++ b/src/app/pages/users/users-managers/users-managers.component.ts @@ -42,7 +42,7 @@ export class UsersManagersComponent implements OnInit { this.link = this.getURL(this.community.communityId); this.message = 'A manager has the right to access the administration part of Research Community Dashboard, ' + 'where he is able to customize and manage the content, invite other users as managers or members.'; - if(community.status === "hidden") { + if(community.isPrivate()) { this.inviteDisableMessage = "Community's status is Hidden and invitation to manage the Research community dashboard is disabled. Update the community status to enable invitations." } this.loading = false; diff --git a/src/app/pages/users/users-subscribers/users-subscribers.component.ts b/src/app/pages/users/users-subscribers/users-subscribers.component.ts index 02063ec..7e06b9d 100644 --- a/src/app/pages/users/users-subscribers/users-subscribers.component.ts +++ b/src/app/pages/users/users-subscribers/users-subscribers.component.ts @@ -46,8 +46,8 @@ export class UsersSubscribersComponent implements OnInit { this.link = this.getURL(this.community.communityId); this.message = 'A member can access the community dashboard and link research results with projects, ' + 'communities and other research projects.'; - if(community.status !== "all") { - this.inviteDisableMessage = "Community's status is " + (community.status === 'manager'?'Visible to managers':'Hidden') + " and invitation to join the Research community dashboard is disabled. Update the community status to enable invitations." + if(!community.isPublic()) { + this.inviteDisableMessage = "Community's status is " + (community.isRestricted()?'Visible to managers':'Hidden') + " and invitation to join the Research community dashboard is disabled. Update the community status to enable invitations." } this.loading = false; }