diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary
index 3ee4129..5e4aaab 160000
--- a/src/app/openaireLibrary
+++ b/src/app/openaireLibrary
@@ -1 +1 @@
-Subproject commit 3ee4129c7e76cc7f4c8dcfcf27c135ce873f8f0d
+Subproject commit 5e4aaab04f89446f956d524469ef2a856f556de5
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 d44ae48..d418d0b 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
@@ -111,9 +111,10 @@ export class EditCommunityComponent {
{label: 'Hidden', value: 'hidden'}
]
public claimOptions: Option[] = [
- {label: 'Anyone can claim', value: 'all'},
- {label: 'Managers only', value: 'managersOnly'},
- {label: 'membersOnly', value: 'membersOnly'}
+ {label: 'Logged in users', value: 'all'},
+ {label: 'Members only', value: 'membersOnly'},
+ {label: 'Managers only', value: 'managersOnly'}
+
]
public membershipOptions: Option[] = [
{label: 'Anyone can join', value: 'open'},
diff --git a/src/app/pages/content-providers/criteria/criteria.component.ts b/src/app/pages/content-providers/criteria/criteria.component.ts
index db9fcea..0549ace 100644
--- a/src/app/pages/content-providers/criteria/criteria.component.ts
+++ b/src/app/pages/content-providers/criteria/criteria.component.ts
@@ -161,7 +161,7 @@ export class CriteriaComponent implements OnInit, OnChanges, AfterViewInit, OnDe
}
get dirty() {
- if (!this.selectionCriteria || !this.criteria) {
+ if (!this.selectionCriteria && !this.criteria) {
return false;
} else if (this.criteria.length !== this.criteriaArray.length) {
return true;
diff --git a/src/app/pages/projects/manage-projects.component.ts b/src/app/pages/projects/manage-projects.component.ts
index 1615f1b..8ed0d01 100644
--- a/src/app/pages/projects/manage-projects.component.ts
+++ b/src/app/pages/projects/manage-projects.component.ts
@@ -20,7 +20,7 @@ import {CommunityService} from "../../openaireLibrary/connect/community/communit
[loading]="showLoadingInRemove" [community]="community">
-
`
@@ -35,6 +35,7 @@ export class ManageProjectsComponent implements OnInit {
public body: string = "Send from page";
public properties: EnvProperties = properties;
public community: CommunityInfo = null;
+ modalIsOpen = false;
constructor(private element: ElementRef,
private title: Title,
@@ -67,6 +68,7 @@ export class ManageProjectsComponent implements OnInit {
this.fullscreen.back = true;
this.fullscreen.okButton = true;
this.fullscreen.open();
+ this.modalIsOpen = true;
}
public communityProjectsChanged($event) {
diff --git a/src/app/pages/projects/remove-projects.component.html b/src/app/pages/projects/remove-projects.component.html
index fc4a4b8..59af0c5 100644
--- a/src/app/pages/projects/remove-projects.component.html
+++ b/src/app/pages/projects/remove-projects.component.html
@@ -28,31 +28,32 @@
[totalResults]="communitySearchUtils.totalResults">
-
-
+
0" [currentPage]="communitySearchUtils.page"
diff --git a/src/app/pages/projects/remove-projects.component.ts b/src/app/pages/projects/remove-projects.component.ts
index 90d7536..d5bc5fb 100644
--- a/src/app/pages/projects/remove-projects.component.ts
+++ b/src/app/pages/projects/remove-projects.component.ts
@@ -52,17 +52,13 @@ export class RemoveProjectsComponent implements OnInit {
/* Search */
@ViewChild('searchInputComponent') searchInputComponent: SearchInputComponent;
filterForm: UntypedFormGroup;
- public fundersCtrl: UntypedFormArray;
private searchText: RegExp = new RegExp('');
public keyword: string = '';
- selectedFunders: string[] = [];
- allOptions: Option[] = [];
+ allFunderOptions: Option[] = [];
+ previewFunderOptions: Option[] = [];
sortOptions: Option[] = [
- //{label:"Title (desc) ", value:{ sort: "title",descending: true }},
- {label: "Title ", value: {sort: "title", descending: false}},
- //{label:"Grant ID (desc) ", value:{ sort: "grant",descending: true }},
- {label: "Grant ID ", value: {sort: "grant", descending: false}},
- //{label:"Funder (desc) ", value:{ sort: "funder",descending: true }},
+ {label: "Title ", value: {sort: "name", descending: false}},
+ {label: "Grant ID ", value: {sort: "grantId", descending: false}},
{label: "Funder ", value: {sort: "funder", descending: false}}
];
@@ -81,31 +77,22 @@ export class RemoveProjectsComponent implements OnInit {
ngOnInit() {
this.communitySearchUtils.keyword = "";
- this.fundersCtrl = this._fb.array([]);
this.filterForm = this._fb.group({
keyword: [''],
- funder: this.fundersCtrl,
+ funder: this._fb.control(null),
sort: this._fb.control(this.sortOptions[0].value)
});
this.subscriptions.push(this.filterForm.get('keyword').valueChanges.pipe(debounceTime(500), distinctUntilChanged()).subscribe(value => {
this.page = 1;
- this._getCommunityProjects(this.page, this.filterForm.get('keyword').value,null );
+ this._getCommunityProjects(this.page, this.filterForm.get('keyword').value,(this.filterForm.get("funder").value? this.filterForm.get("funder").value.id:null),
+ this.filterForm.get("sort").value.sort );
}));
-/*
- this.subscriptions.push(this.filterForm.get('funder').valueChanges.subscribe(value => {
- this.page = 1;
- this._getCommunityProjects(1, this.searchText.toString(),this.fundersCtrl.getRawValue() );
-
- }));*/
-/*
-
this.subscriptions.push(this.filterForm.get('sort').valueChanges.subscribe(value => {
this.page = 1;
- this.sort();
+ this._getCommunityProjects(this.page, this.filterForm.get('keyword').value, this.filterForm.get("funder").value? this.filterForm.get("funder").value.id:null, this.filterForm.get("sort").value.sort );
}));
-*/
this.subscriptions.push(this.communityService.getCommunityAsObservable().subscribe(community => {
if (community) {
@@ -115,6 +102,7 @@ export class RemoveProjectsComponent implements OnInit {
+ this.community.communityId + ".openaire.eu" + this.properties.searchLinkToProject.split("?")[0];
this.keyword = '';
+ this._getCommunityFunders();
this._getCommunityProjects(1,this.keyword, null);
}
}));
@@ -139,16 +127,9 @@ export class RemoveProjectsComponent implements OnInit {
public confirmedDeleteProject(data: any) {
this.subscriptions.push(this._manageCommunityProjectsService.removeProject(this.properties, this.community.communityId, this.selectedCommunityProject.openaireId).subscribe(
data => {
- // let index = this.communityProjects.indexOf(this.selectedCommunityProject);
- // this.communityProjects.splice(index, 1);
- // this.applyFilters();
+
this._clearCacheService.purgeBrowserCache(this.openaireEntiites.PROJECT+" removed", this.community.communityId);
NotificationHandler.rise(OpenaireEntities.PROJECT+' successfully removed!');
- // this.communityProjectsChanged.emit({
- // value: this.communityProjects,
- // });
- // this.communitySearchUtils.totalResults--;
- // this.communitySearchUtils.page = 1;
this._getCommunityProjects(this.communitySearchUtils.page, this.keyword,null);
},
@@ -188,11 +169,11 @@ export class RemoveProjectsComponent implements OnInit {
public getCommunityProjects() {
this._getCommunityProjects(this.communitySearchUtils.page, this.keyword,null );
}
- public _getCommunityProjects(page, keyword, funder) {
+ public _getCommunityProjects(page, keyword, funder, orderBy = "name" ) {
this.communitySearchUtils.status = this.errorCodes.LOADING;
this.communitySearchUtils.page = page;
this.communitySearchUtils.keyword = keyword;
- this.subscriptions.push(this._searchCommunityProjectsService.searchProjectsWithPaging(this.properties, this.community.communityId, this.communitySearchUtils.page, this.resultsPerPage, this.communitySearchUtils.keyword, funder).subscribe(
+ this.subscriptions.push(this._searchCommunityProjectsService.searchProjectsWithPaging(this.properties, this.community.communityId, this.communitySearchUtils.page, this.resultsPerPage, this.communitySearchUtils.keyword, funder, orderBy).subscribe(
data => {
this.previewCommunityProjects = data.content;
this.communitySearchUtils.totalResults = data.totalElements;
@@ -213,23 +194,21 @@ export class RemoveProjectsComponent implements OnInit {
} else {
this.communitySearchUtils.status = this.errorCodes.NOT_AVAILABLE;
}
-
this.loading = false;
}
));
}
-
- public createFunderFilter(): void {
- let funders: Set = new Set();
- this.allOptions = [];
- let i;
- /* for (i = 0; i < this.communityProjects.length; i++) {
- let funder = this.communityProjects[i].funder;
- if (funder && !funders.has(funder)) {
- funders.add(funder);
- this.allOptions.push({label: funder, value: {id: funder, label: funder}});
+ public _getCommunityFunders() {
+ this.subscriptions.push(this._searchCommunityProjectsService.getProjectFunders(this.properties, this.community.communityId).subscribe(
+ data => {
+ for (let funder of data) {
+ this.allFunderOptions.push({label: funder, value: {id: funder, label: funder}});
+ }
+ this.previewFunderOptions =[...this.allFunderOptions];
+ },
+ err => {
}
- }*/
+ ));
}
public updatePage($event) {
@@ -242,67 +221,6 @@ export class RemoveProjectsComponent implements OnInit {
this.addProjects.emit();
}
- public applyFilters() {
- /*this.previewCommunityProjects = this.communityProjects.filter(project => {
- return (this.filterCommunityProjectByKeyword(project) && this.filterCommunityProjectByFunder(project));
- });
- // check paging here!!!
- if (this.previewCommunityProjects.slice((this.page - 1) * this.resultsPerPage, this.page * this.resultsPerPage).length == 0) {
- this.page = 1;
- }
-
- this.sort();*/
- this._getCommunityProjects(1, this.searchText.toString(),this.fundersCtrl.getRawValue() );
- }
-/*
-
- public filterCommunityProjectByKeyword(project): boolean {
- return this.searchText.toString() === ''
- || ((project.name + " " + project.acronym + " " + project.grantId + " " + project.funder)).match(this.searchText) != null;
- }
-
- public filterCommunityProjectByFunder(project): boolean {
- if (this.fundersCtrl.getRawValue().length == 0) {
- return true;
- }
- for (let funder of this.fundersCtrl.getRawValue()) {
- if (project.funder.toLowerCase().indexOf(funder.label.toLowerCase()) != -1) {
- return true;
- }
- }
- return false;
- }
-*/
-
-/*
- private sort() {
- let sortOption: { sort: string, descending: boolean } = this.filterForm.get('sort').value;
-
- this.previewCommunityProjects.sort((left, right): number => {
- if (sortOption.sort == "title") {
- if ((left.name + left.acronym) > (right.name + right.acronym)) {
- return sortOption.descending ? -1 : 1;
- } else if ((left.name + left.acronym) < (right.name + right.acronym)) {
- return sortOption.descending ? 1 : -1;
- }
- } else if (sortOption.sort == "grant") {
- if (left.grantId > right.grantId) {
- return sortOption.descending ? -1 : 1;
- } else if (left.grantId < right.grantId) {
- return sortOption.descending ? 1 : -1;
- }
- } else if (sortOption.sort == "funder") {
- if (left.funder > right.funder) {
- return sortOption.descending ? -1 : 1;
- } else if (left.funder < right.funder) {
- return sortOption.descending ? 1 : -1;
- }
- }
-
- return 0;
- });
- }
-*/
public onSearchClose() {
this.communitySearchUtils.keyword = this.filterForm.get('keyword').value;
@@ -317,23 +235,23 @@ export class RemoveProjectsComponent implements OnInit {
NotificationHandler.rise(message, 'danger');
}
- select(value: string, event, dropdownFilter: DropdownFilterComponent) {
+ select(option, event, dropdownFilter: DropdownFilterComponent) {
+ console.log(option)
if(event.target instanceof HTMLInputElement) {
dropdownFilter.closeDropdown();
- if(event.target.checked && !this.selectedFunders.find(entity => value === entity)) {
- this.selectedFunders.push(value);
- this.fundersCtrl.setControl(this.fundersCtrl.value.length, this._fb.control(value));
+ if(event.target.checked) {
+ this.filterForm.get("funder").setValue(option.value);
+ this._getCommunityProjects(1, this.filterForm.get('keyword').value, this.filterForm.get('funder').value.id );
+ this.previewFunderOptions =[option];
} else if(!event.target.checked) {
- let index = this.selectedFunders.indexOf(value);
- if(index !== -1) {
- this.selectedFunders.splice(index, 1);
- this.fundersCtrl.removeAt(index);
- }
+ this.filterForm.get("funder").setValue(null);
+ this._getCommunityProjects(1, this.filterForm.get('keyword').value,null);
+ this.previewFunderOptions =[...this.allFunderOptions];
}
}
}
isSelected(value: string) {
- return this.filterForm && this.filterForm.get('funder').value.find(funder => funder === value)
+ return this.filterForm && this.filterForm.get('funder').value && this.filterForm.get('funder').value.id === value;
}
}
diff --git a/src/assets/common-assets b/src/assets/common-assets
index 2fd5784..d18e0a7 160000
--- a/src/assets/common-assets
+++ b/src/assets/common-assets
@@ -1 +1 @@
-Subproject commit 2fd57843f85125e54adfb95b35776755037ea359
+Subproject commit d18e0a7e43e5ab74649481ecbf352ba49893c66f
diff --git a/src/assets/openaire-theme b/src/assets/openaire-theme
index 2fffe0f..ac458b5 160000
--- a/src/assets/openaire-theme
+++ b/src/assets/openaire-theme
@@ -1 +1 @@
-Subproject commit 2fffe0fa672adcf5577461d10c30e34b00308c85
+Subproject commit ac458b5a6d156167d7b6c9005ef1f9cfac75d3ae
diff --git a/src/environments/environment.beta.ts b/src/environments/environment.beta.ts
index 137b521..a10968d 100644
--- a/src/environments/environment.beta.ts
+++ b/src/environments/environment.beta.ts
@@ -25,6 +25,7 @@ export let properties: EnvProperties = {
cordisURL: "http://cordis.europa.eu/projects/",
openDoarURL: "http://v2.sherpa.ac.uk/id/repository/",
r3DataURL: "http://service.re3data.org/repository/",
+ swhURL: "https://archive.softwareheritage.org/",
sherpaURL: "http://www.sherpa.ac.uk/romeo/search.php?issn=",
zenodo: "https://zenodo.org/",
zenodoCommunities: "https://zenodo.org/api/communities/",
diff --git a/src/environments/environment.prod.ts b/src/environments/environment.prod.ts
index d7f07da..d916388 100644
--- a/src/environments/environment.prod.ts
+++ b/src/environments/environment.prod.ts
@@ -25,6 +25,7 @@ export let properties: EnvProperties = {
cordisURL: "http://cordis.europa.eu/projects/",
openDoarURL: "http://v2.sherpa.ac.uk/id/repository/",
r3DataURL: "http://service.re3data.org/repository/",
+ swhURL: "https://archive.softwareheritage.org/",
sherpaURL: "http://www.sherpa.ac.uk/romeo/search.php?issn=",
zenodo: "https://zenodo.org/",
zenodoCommunities: "https://zenodo.org/api/communities/",
diff --git a/src/environments/environment.ts b/src/environments/environment.ts
index fb69099..fa9ff2e 100644
--- a/src/environments/environment.ts
+++ b/src/environments/environment.ts
@@ -30,6 +30,7 @@ export let properties: EnvProperties = {
cordisURL: 'http://cordis.europa.eu/projects/',
openDoarURL: 'http://v2.sherpa.ac.uk/id/repository/',
r3DataURL: 'http://service.re3data.org/repository/',
+ swhURL: "https://archive.softwareheritage.org/",
sherpaURL: 'http://www.sherpa.ac.uk/romeo/search.php?issn=',
zenodo: 'https://zenodo.org/',
zenodoCommunities: 'https://zenodo.org/api/communities/',