Compare commits

...

65 Commits

Author SHA1 Message Date
argirok a3d67696ad commit libraries 2 months ago
argirok d2384ea07f Merge branch 'develop' 2 months ago
argirok c1e306cff0 [develop | DONE | ADDED ] add again publicationyear in criteria fields, add different list of verbs for numeric values 2 months ago
argirok f2e2edd1f2 [develop | DONE | FIXED ] community status checks 2 months ago
argirok 1003382304 [develop | DONE | REMOVED] : criteria-utils: comment out publicationyear option until integer value operators are available 3 months ago
argirok 4147ffca98 Merge remote-tracking branch 'origin/develop' into develop 5 months ago
argirok f23f75e2d8 [develop | DONE | UPDATED] Community form: remove old visibility statuses 5 months ago
argirok b5c60f85e9 Merge branch 'develop' 6 months ago
argirok a767a1d890 commit libraries 6 months ago
Alex Martzios 7827d23088 [develop | DONE | ADDED] add two new fields in datasources selection criteria & advanced criteria 6 months ago
Konstantinos Triantafyllou b4f01d1fd0 [develop | DONE]: Remove overflow auto from menu_section in customization 6 months ago
Konstantinos Triantafyllou bc201a1ae8 [develop | DONE | FIXED]: Fix sidebar in customization page. 6 months ago
argirok 66a0b038b6 Merge remote-tracking branch 'origin/develop' into develop
# Conflicts:
#	src/environments/environment.beta.ts
#	src/environments/environment.prod.ts
#	src/environments/environment.ts
6 months ago
argirok 2d6b144441 [develop | DONE | UPDATED] properties: use library properties 6 months ago
argirok a02dbded6e [develop | WIP] : properties: add comments what to check 6 months ago
argirok 1b23a25e24 [develop | DONE | UPDATED] :users-managers component add missing attribute to composer function 6 months ago
Konstantinos Triantafyllou e6a5dbc2b4 Merge pull request 'angular-16' (#6) from angular-16 into develop
Reviewed-on: #6
6 months ago
Konstantinos Triantafyllou 24ed9f0690 [angular-16 | FIXED]: Fix width of main content 6 months ago
Konstantinos Triantafyllou 47567e484b Merge pull request '[angular-16-community-projects-availableSince | DONE | UPDATE] : show project link only when it is available before the db update date' (#5) from angular-16-community-projects-availableSince into angular-16
Reviewed-on: #5
6 months ago
Konstantinos Triantafyllou 8f03223bcc Merge pull request '[angular-16-update-zenodo-api | DONE | UPDATE] : update zenodo community API - update method signatures' (#4) from angular-16-update-zenodo-api into angular-16
Reviewed-on: #4
6 months ago
argirok 1c8e46df21 [angular-16-community-projects-availableSince | DONE | UPDATE] : show project link only when it is available before the db update date 6 months ago
Konstantinos Triantafyllou 4ce3080146 [angular-16 | DONE | CHANGED]: Make dashboard-sidebar sticky instead of fixed. 6 months ago
argirok ba9f7db240 [angular-16-update-zenodo-api | DONE | UPDATE] : update zenodo community API - update method signatures 6 months ago
argirok 1907f6f723 beta properties: use new claims service 6 months ago
Konstantinos Triantafyllou 6546fd40a1 Merge from develop 7 months ago
Konstantinos Triantafyllou e2122bd14e Update libraries 7 months ago
Konstantinos Triantafyllou 8e27e29605 Enable membership and add condition in users->members 7 months ago
Konstantinos Triantafyllou e5a4472c6d Edit community fix margin in logo section 7 months ago
Konstantinos Triantafyllou 0ffc63ba95 Merge develop into angular-16 7 months ago
argirok 3c46fb9459 Merge branch 'master' of code-repo.d4science.org:MaDgIK/connect-admin 7 months ago
argirok 63521a83aa commit libraries 7 months ago
argirok 2f9b12c478 Merge branch 'new-community-api' into develop 7 months ago
argirok 0ef15e01cf commit libraries 7 months ago
Konstantina Galouni 5a4e76b0c2 Connect | develop: environments/: Added property swhURL 7 months ago
Konstantinos Triantafyllou 4076f96fb1 Update libraries 7 months ago
argirok 0b703bceec Community projects: add filtering and sorting 7 months ago
argirok b54fa1eaf9 update labels for claimOptions field 7 months ago
argirok 205db8bf10 limit the requests for add projetcs 7 months ago
argirok 78dcc5a208 Merge branch 'develop' into new-community-api 7 months ago
argirok ab85ca7e3c Commit library changes 7 months ago
argirok 7bcab90231 update manage projects page to use paging and search through new communities API 7 months ago
Konstantinos Triantafyllou ef19492aad Remove types/node from package.json 8 months ago
argirok 4dbf21ba48 update remove method on the screen you search and add projects and communities 8 months ago
argirok 7568c668b7 hide membership in edit form until the functionality is ready 8 months ago
Konstantinos Triantafyllou 4365aab4bb Merge from Develop. Resolve (Connect Admin release 30th August 2023 #3) 8 months ago
Konstantinos Triantafyllou 09c04d02b1 Merge from develop 8 months ago
Konstantinos Triantafyllou 93efde0b07 Fix criteria disabled condition because of null in selectionCriteria. 8 months ago
Konstantinos Triantafyllou df4b9be6fc Update uikit to version 3.16.24 8 months ago
Konstantinos Triantafyllou f8a7d0619e Update color picker and fix css of mining 9 months ago
Konstantinos Triantafyllou 2791c7c26b Add mining and update to angular-16 9 months ago
Konstantinos Triantafyllou 2943b496ee Update material to angular 16. 9 months ago
Konstantinos Triantafyllou 247452b860 Update angular to angular 16. 9 months ago
Konstantinos Triantafyllou f11b014248 Update Zone to 0.13.1 9 months ago
Konstantinos Triantafyllou 0dd4fc6717 Update material to angular 15. 9 months ago
Konstantinos Triantafyllou a97bac9e69 Migrate angular core and cli to version 15 and update dependencies to be compatible with the newer version. 9 months ago
Konstantinos Triantafyllou 353fe17126 Update typescript to version 4.9.5 and remove mining until migration ends 9 months ago
Konstantinos Triantafyllou fb6f423273 Update libraries 9 months ago
argirok f63cd1ec60 add fields claim and membership in edit form 9 months ago
argirok d9b0365a1d clean up imports for deleted SearchZenodoCommunitiesService 10 months ago
argirok 3a4203aef8 Merge branch 'develop' into new-community-api 10 months ago
Konstantinos Triantafyllou a79fd13a17 Update piwik with the new methods 10 months ago
argirok 662b514ab5 apply initial changes base odn new community API 10 months ago
Konstantinos Triantafyllou 500dd61f9b Update library. Fix an expression error in advanced-criteria. Add message if there are no subjects in each category. 10 months ago
Konstantinos Triantafyllou 94fc9bda53 Update libraries 10 months ago
Konstantina Galouni fa6f55e772 Updating openaireLibrary and openaire-theme before beta & prod release 10 months ago

@ -1,7 +1,7 @@
rm -f interactiveminingv3.tgz
git clone https://code-repo.d4science.org/MaDgIK/interactive-mining.git
cd interactive-mining/
git checkout angular-14
git checkout angular-16
cd interactive-mining-angular-frontend/
npm install
npm run packagr

@ -17,41 +17,40 @@
},
"private": true,
"dependencies": {
"@angular/animations": "^14.2.3",
"@angular/cdk": "^14.2.2",
"@angular/common": "^14.2.3",
"@angular/compiler": "^14.2.3",
"@angular/core": "^14.2.3",
"@angular/forms": "^14.2.3",
"@angular/localize": "^14.2.3",
"@angular/material": "^14.2.2",
"@angular/platform-browser": "^14.2.3",
"@angular/platform-browser-dynamic": "^14.2.3",
"@angular/router": "^14.2.3",
"@angular/animations": "^16.1.8",
"@angular/cdk": "^16.1.7",
"@angular/common": "^16.1.8",
"@angular/compiler": "^16.1.8",
"@angular/core": "^16.1.8",
"@angular/forms": "^16.1.8",
"@angular/localize": "^16.1.8",
"@angular/material": "^16.1.7",
"@angular/platform-browser": "^16.1.8",
"@angular/platform-browser-dynamic": "^16.1.8",
"@angular/router": "^16.1.8",
"clipboard": "^1.5.16",
"core-js": "^2.5.4",
"express": "^4.15.2",
"jquery": "^3.4.1",
"ng-recaptcha": "^10.0.0",
"ng-recaptcha": "^12.0.2",
"ng2-ckeditor": "1.3.7",
"ngx-color-picker": "^8.1.0",
"ngx-color-picker": "^14.0.0",
"rxjs": "^6.5.1",
"sass-loader": "7.3.1",
"ts-md5": "^1.2.0",
"tslib": "^2.0.0",
"uikit": "3.13.10",
"zone.js": "~0.11.4"
"uikit": "3.16.24",
"zone.js": "~0.13.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "^14.2.3",
"@angular/cli": "^14.2.3",
"@angular/compiler-cli": "^14.2.3",
"@angular/language-service": "^14.2.3",
"@angular-devkit/build-angular": "^16.1.7",
"@angular/cli": "^16.1.7",
"@angular/compiler-cli": "^16.1.8",
"@angular/language-service": "^16.1.8",
"@types/ckeditor": "^4.9.10",
"@types/express": "^4.17.0",
"@types/jasmine": "~3.6.0",
"@types/jasminewd2": "~2.0.3",
"@types/node": "^12.11.1",
"@types/ckeditor": "^4.9.10",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.8.0",
"jasmine-spec-reporter": "~5.0.0",
@ -62,6 +61,6 @@
"karma-jasmine-html-reporter": "^1.6.0",
"protractor": "~7.0.0",
"ts-node": "~7.0.0",
"typescript": "~4.6.4"
"typescript": "~4.9.5"
}
}

@ -2,17 +2,15 @@
<loading [full]="true"></loading>
</div>
<div *ngIf="loading == false">
<div class="sidebar_main_swipe" [class.sidebar_main_active]="open && hasSidebar" [class.sidebar_mini]="!open && hasSidebar"
<div id="modal-container"></div>
<navbar *ngIf="hasHeader" portal="connect-admin" [header]="menuHeader" [communityId]="community ? community.communityId : null"
[userMenuItems]=userMenuItems [menuItems]="menuItems" [user]="user"></navbar>
<div class="sidebar_main_swipe uk-flex" [class.sidebar_main_active]="open && (hasSidebar || hasInternalSidebar)" [class.sidebar_mini]="!open && (hasSidebar || hasInternalSidebar)"
[class.sidebar_hover]="hover">
<div id="modal-container"></div>
<navbar *ngIf="hasHeader" portal="connect-admin" [header]="menuHeader" [communityId]="community ? community.communityId : null"
[userMenuItems]=userMenuItems [menuItems]="menuItems" [user]="user"></navbar>
<div>
<dashboard-sidebar *ngIf="hasSidebar" [items]="sideBarItems" [backItem]="backItem"></dashboard-sidebar>
<main>
<dashboard-sidebar *ngIf="hasSidebar && !hasInternalSidebar" [items]="sideBarItems" [backItem]="backItem"></dashboard-sidebar>
<main class="uk-width-1-1">
<router-outlet></router-outlet>
</main>
</div>
</div>
</div>

@ -28,6 +28,7 @@ export class AppComponent implements OnInit {
params: BehaviorSubject<Params> = new BehaviorSubject<Params>(null);
data: BehaviorSubject<Data> = new BehaviorSubject<Data>(null);
hasSidebar: boolean = false;
hasInternalSidebar: boolean = false;
hasHeader: boolean = true;
hasAdminMenu: boolean = false;
isFrontPage: boolean = false;
@ -81,6 +82,10 @@ export class AppComponent implements OnInit {
this.hasSidebar = hasSidebar;
this.cdr.detectChanges();
}));
this.subscriptions.push(this.layoutService.hasInternalSidebar.subscribe(hasInternalSidebar => {
this.hasInternalSidebar = hasInternalSidebar;
this.cdr.detectChanges();
}));
this.subscriptions.push(this.layoutService.hasHeader.subscribe(hasHeader => {
this.hasHeader = hasHeader;
this.cdr.detectChanges();
@ -126,7 +131,7 @@ export class AppComponent implements OnInit {
this.subscriptions.push(this.data.subscribe(data => {
if(data && data.portal) {
this.setProperties(data.portal);
this.configurationService.initCommunityInformation(this.properties, this.properties.adminToolsCommunity);
this.configurationService.initPortal(this.properties, this.properties.adminToolsCommunity);
}
}));
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
@ -172,7 +177,7 @@ export class AppComponent implements OnInit {
} else {
ConnectHelper.setPortalTypeFromPid(id);
}
this.configurationService.initCommunityInformation(this.properties, this.properties.adminToolsCommunity);
this.configurationService.initPortal(this.properties, this.properties.adminToolsCommunity);
}
public get open() {

@ -1 +1 @@
Subproject commit 56428d0daed8726c9c70c8b7dad8f11b4ed604b8
Subproject commit e30672043b03c607fb6c6c1c490d4fa34a772d3d

@ -48,7 +48,7 @@ import {CommunityInfo} from "../../openaireLibrary/connect/community/communityIn
</div>
</div>
<fs-modal #filtersModal (okEmitter)="saveCriteria()" (cancelEmitter)="criteria.reset()"
[okButtonDisabled]="criteria && criteria.disabled">
[okButtonDisabled]="!criteria || criteria.disabled">
<div *ngIf="selectionCriteria" class="uk-container uk-container-large">
<criteria #criteria [height]="filtersModal.bodyHeight" [entityType]="'criterion'"
[entityTypePlural]="'criteria'" [selectionCriteria]="selectionCriteria">

@ -113,6 +113,7 @@ export class AffiliationsComponent implements OnInit, OnDestroy {
deleteAffiliationOpen(index: number) {
this.index = index;
let affiliation: Affiliation = this.affiliations[index];
console.log(index, affiliation)
this.removeAffiliationModal.alertTitle = 'Delete Organization';
this.removeAffiliationModal.message = 'Do you want to remove <b>' +
affiliation.name + '</b> from Organizations?';
@ -164,7 +165,8 @@ export class AffiliationsComponent implements OnInit, OnDestroy {
removeAffiliation() {
this.loading = true;
this.affiliationService.deleteAffiliation(this.properties.communityAPI + this.community.communityId + '/organizations',
console.log(this.index, this.affiliations[this.index].id)
this.affiliationService.deleteAffiliation(this.properties.communityAPI + this.community.communityId + '/organizations?organizationName='+this.affiliations[this.index].name,
this.affiliations[this.index].id).subscribe((deleteOK) => {
this.affiliations.splice(this.index, 1);
if (this.currentPage.length === 0) {

@ -42,7 +42,7 @@ import {ClearCacheService} from "../../../../openaireLibrary/services/clear-cach
<div class="uk-width-1-1">
<input #file id="photo" type="file" class="uk-hidden" (change)="fileChangeEvent($event)"/>
<div *ngIf="!communityFb.get('isUpload').value" class="uk-grid uk-grid-column-large" uk-grid>
<div class="uk-margin-top uk-width-auto@l uk-width-1-1">
<div class="uk-margin-xsmall-top uk-width-auto@l uk-width-1-1">
<div class="uk-grid uk-grid-column-large uk-flex-middle" uk-grid>
<div class="uk-width-auto@l uk-width-1-1 uk-flex uk-flex-center">
<button class="uk-button uk-button-primary uk-flex uk-flex-middle uk-flex-wrap"
@ -77,11 +77,21 @@ import {ClearCacheService} from "../../../../openaireLibrary/services/clear-cach
<!-- Full width error message -->
<div *ngIf="uploadError" class="uk-text-danger uk-margin-small-top uk-width-1-1">{{uploadError}}</div>
</div>
<div class="uk-width-1-2@m">
<div class="uk-width-1-3@m">
<div input [formInput]="communityFb.get('status')"
placeholder="Visibility status for your community's profile."
[options]="statuses" type="select"></div>
</div>
<div class="uk-width-1-3@m">
<div input [formInput]="communityFb.get('claim')"
placeholder="Who can create links for your community"
[options]="claimOptions" type="select"></div>
</div>
<div class="uk-width-1-3@m">
<div input [formInput]="communityFb.get('membership')"
placeholder="Who can join"
[options]="membershipOptions" type="select"></div>
</div>
</div>
</form>
`,
@ -90,10 +100,22 @@ import {ClearCacheService} from "../../../../openaireLibrary/services/clear-cach
export class EditCommunityComponent {
public communityFb: UntypedFormGroup;
public statuses: Option[] = [
{label: 'Visible', value: 'all'},
{label: 'Visible to managers', value: 'manager'},
// {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[] = [
{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'},
{label: 'By invitation', value: 'byInvitation'}
]
public community: CommunityInfo;
public isNew: boolean;
public properties: EnvProperties = properties
@ -133,6 +155,8 @@ export class EditCommunityComponent {
shortName: this.fb.control(this.community.shortTitle, Validators.required),
description: this.fb.control(this.community.description),
status: this.fb.control(this.community.status),
claim: this.fb.control(this.community.claim),
membership: this.fb.control(this.community.membership),
managers: this.fb.control(this.community.managers),
isUpload: this.fb.control(this.community.isUpload),
logoUrl: this.fb.control(this.community.logoUrl)

@ -31,7 +31,7 @@ import {ConnectRIGuard} from "../openaireLibrary/connect/communityGuard/connectR
{
path: 'customize-layout',
loadChildren: () => import('./customization/customization.module').then(m => m.CustomizationModule),
data: {hasSidebar: true, hasHeader: false}
data: {hasInternalSidebar: true, hasHeader: false}
},
{
path: 'user-info',

@ -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(" <b>and</b> "));

@ -40,13 +40,17 @@
</button>
</div>
<div class="uk-width-1-1" input type="select" inputClass="border-bottom" [placeholder]="{static: true, label: 'Choose a field'}"
[options]="criteriaUtils.fields" [formInput]="constraint.get('field')">
[options]="criteriaUtils.fields" [formInput]="constraint.get('field')" (valueChange)="resetFieldWhenValueChange(constraint)">
<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"
<div *ngIf="criteriaUtils.numericFields.indexOf(constraint.get('field').value) == -1" class="uk-width-1-1" input type="select" inputClass="border-bottom"
[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 *ngIf="criteriaUtils.numericFields.indexOf(constraint.get('field').value) != -1" class="uk-width-1-1" input type="select" inputClass="border-bottom"
[options]="criteriaUtils.verbsForNumbers" [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'}"
[formInput]="constraint.get('value')">
<label class="uk-text-uppercase uk-text-bold uk-width-1-3 uk-text-truncate">Term:</label>
@ -69,8 +73,10 @@
<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]="criteriaUtils.fields" [formInput]="constraint.get('field')"></div>
<div class="uk-width-1-4" input type="select" inputClass="border-bottom"
<div *ngIf="criteriaUtils.numericFields.indexOf(constraint.get('field').value) == -1" class="uk-width-1-4" input type="select" inputClass="border-bottom"
[options]="criteriaUtils.verbs" [formInput]="constraint.get('verb')"></div>
<div *ngIf="criteriaUtils.numericFields.indexOf(constraint.get('field').value) != -1" class="uk-width-1-4" input type="select" inputClass="border-bottom"
[options]="criteriaUtils.verbsForNumbers" [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'}"

@ -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;
@ -225,4 +225,14 @@ export class CriteriaComponent implements OnInit, OnChanges, AfterViewInit, OnDe
})
return selectionCriteria;
}
resetFieldWhenValueChange(constraint){
// if field not numeric, but verb is numeric clear the verb
if(this.criteriaUtils.numericFields.indexOf(constraint.get('field').value) == -1 && this.criteriaUtils.verbs.indexOf(constraint.get('verb').value)){
constraint.get('verb').setValue(this.criteriaUtils.verbs[0].value);
}
if(this.criteriaUtils.numericFields.indexOf(constraint.get('field').value) != -1 && this.criteriaUtils.numericFields.indexOf(constraint.get('verb').value)){
constraint.get('verb').setValue(this.criteriaUtils.verbsForNumbers[0].value);
}
}
}

@ -81,7 +81,8 @@ export class RemoveContentProvidersComponent implements OnInit {
}
public confirmedDeleteContentProvider() {
this.subscriptions.push(this._manageCommunityContentProvidersService.removeContentProvider(this.properties, this.community.communityId, this.selectedCommunityContentProvider.id).subscribe(
console.log(this.selectedCommunityContentProvider)
this.subscriptions.push(this._manageCommunityContentProvidersService.removeContentProvider(this.properties, this.community.communityId, this.selectedCommunityContentProvider.openaireId).subscribe(
() => {
let index = this.communityContentProviders.indexOf(this.selectedCommunityContentProvider);
this.communityContentProviders.splice(index, 1);

@ -21,14 +21,14 @@ import {CustomizationOptions} from '../../openaireLibrary/connect/community/Cust
`,
styles:[
`
.color-input{
width:24px;
height:14px;
border-radius:3px;
border:0.1px solid #707070;
cursor: pointer;
}`
.color-input{
width:24px;
height:14px;
border-radius:3px;
border:0.1px solid #707070;
cursor: pointer;
}`
]
})

@ -1,134 +1,135 @@
<aside *ngIf="draftCustomizationOptions" id="sidebar_main">
<div id="sidebar_content">
<div class="back">
<a (click)="close()" class="uk-flex uk-flex-middle uk-flex-center">
<div class="uk-width-auto">
<icon *ngIf="menuSelected.id != 'home'" name="west" ratio="1.3"
[flex]="true"></icon>
<icon *ngIf="menuSelected.id == 'home'" name="close" ratio="1.3"
[flex]="true"></icon>
</div>
<span class="uk-width-expand uk-text-truncate uk-margin-left hide-on-close">{{menuSelected.name}}</span>
</a>
</div>
<div class="menu_section uk-margin-large-top uk-overflow-auto" style="max-height: 75vh">
<ul *ngIf="menuSelected.id == 'home'" class="uk-list uk-nav uk-nav-default" uk-nav>
<ng-template ngFor [ngForOf]="sidebarItems" let-item let-i="index">
<li class="uk-visible-toggle" [class.uk-active]="menuSelected.id == item.id">
<a (click)="changeMenu(item)"
[title]="item.name">
<div class="uk-flex uk-flex-middle uk-flex-center">
<div *ngIf="item.icon" class="uk-width-auto">
<icon class="menu-icon" [name]="item.icon" [flex]="true"></icon>
</div>
<span class="uk-width-expand uk-text-truncate uk-margin-small-left hide-on-close">
<div *ngIf="draftCustomizationOptions" class="uk-flex">
<aside id="sidebar_main" class="uk-sticky" uk-sticky="start: 0; end: .sidebar_main_swipe">
<div sidebar-content>
<div class="back">
<a (click)="close()" class="uk-flex uk-flex-middle uk-flex-center">
<div class="uk-width-auto">
<icon *ngIf="menuSelected.id != 'home'" name="west" ratio="1.3"
[flex]="true"></icon>
<icon *ngIf="menuSelected.id == 'home'" name="close" ratio="1.3"
[flex]="true"></icon>
</div>
<span class="uk-width-expand uk-text-truncate uk-margin-left hide-on-close">{{menuSelected.name}}</span>
</a>
</div>
<div class="menu_section uk-margin-large-top">
<ul *ngIf="menuSelected.id == 'home'" class="uk-list uk-nav uk-nav-default" uk-nav>
<ng-template ngFor [ngForOf]="sidebarItems" let-item let-i="index">
<li class="uk-visible-toggle" [class.uk-active]="menuSelected.id == item.id">
<a (click)="changeMenu(item)"
[title]="item.name">
<div class="uk-flex uk-flex-middle uk-flex-center">
<div *ngIf="item.icon" class="uk-width-auto">
<icon class="menu-icon" [name]="item.icon" [flex]="true"></icon>
</div>
<span class="uk-width-expand uk-text-truncate uk-margin-small-left hide-on-close">
{{item.name}}
</span>
<span uk-icon="triangle-right"></span>
</div>
</a>
</li>
</ng-template>
</ul>
<ng-container *ngIf="menuSelected.id == 'identity'">
<ng-container
*ngTemplateOutlet="identityOptions ; context: { }"></ng-container>
</ng-container>
<ng-container *ngIf="menuSelected.id == 'backgrounds'">
<ng-container
*ngTemplateOutlet="backgroundOptions ; context: { }"></ng-container>
</ng-container>
<ng-container *ngIf="menuSelected.id == 'buttons'">
<ng-container
*ngTemplateOutlet="buttonOptions ; context: { }"></ng-container>
</ng-container>
<span uk-icon="triangle-right"></span>
</div>
</a>
</li>
</ng-template>
</ul>
<ng-container *ngIf="menuSelected.id == 'identity'">
<ng-container
*ngTemplateOutlet="identityOptions ; context: { }"></ng-container>
</ng-container>
<ng-container *ngIf="menuSelected.id == 'backgrounds'">
<ng-container
*ngTemplateOutlet="backgroundOptions ; context: { }"></ng-container>
</ng-container>
<ng-container *ngIf="menuSelected.id == 'buttons'">
<ng-container
*ngTemplateOutlet="buttonOptions ; context: { }"></ng-container>
</ng-container>
</div>
</div>
</div>
</aside>
<div *ngIf="draftCustomizationOptions" page-content>
<div actions>
<div class="uk-section-small">
<ng-container *ngTemplateOutlet="applyResetButtons;"></ng-container>
</aside>
<div page-content class="uk-width-1-1">
<div actions>
<div class="uk-section-small">
<ng-container *ngTemplateOutlet="applyResetButtons;"></ng-container>
</div>
</div>
</div>
<div inner>
<div class="uk-section-small">
<div *ngIf="menuSelected.id == 'backgrounds'" class=" uk-padding-small ">
<div class="customizationMenuItems uk-margin-small">
<div class="uk-h4">Backgrounds</div>
<div>Note: Custom background style settings will override any identity settings that effect the
visualisation of a background.
</div>
<div inner>
<div class="uk-section-small">
<div *ngIf="menuSelected.id == 'backgrounds'" class=" uk-padding-small ">
<div class="customizationMenuItems uk-margin-small">
<div class="uk-h4">Backgrounds</div>
<div>Note: Custom background style settings will override any identity settings that effect the
visualisation of a background.
</div>
<div class="uk-margin-large-top uk-margin-small-bottom uk-h5"> Quick look
<div class="uk-margin-large-top uk-margin-small-bottom uk-h5"> Quick look
</div>
<quick-look-backgrounds [darkBackgroundColor]="draftCustomizationOptions.backgrounds.dark.color "
[lightBackgroundColor]="draftCustomizationOptions.backgrounds.light.color "
[formBackgroundColor]="draftCustomizationOptions.backgrounds.form.color"
[primaryColor]="draftCustomizationOptions.identity.mainColor"
[secondaryColor]="draftCustomizationOptions.identity.secondaryColor"
[buttonsOnDark]="draftCustomizationOptions.buttons.darkBackground"
[buttonsOnLight]="draftCustomizationOptions.buttons.lightBackground"
></quick-look-backgrounds>
</div>
<quick-look-backgrounds [darkBackgroundColor]="draftCustomizationOptions.backgrounds.dark.color "
[lightBackgroundColor]="draftCustomizationOptions.backgrounds.light.color "
[formBackgroundColor]="draftCustomizationOptions.backgrounds.form.color"
[primaryColor]="draftCustomizationOptions.identity.mainColor"
[secondaryColor]="draftCustomizationOptions.identity.secondaryColor"
[buttonsOnDark]="draftCustomizationOptions.buttons.darkBackground"
[buttonsOnLight]="draftCustomizationOptions.buttons.lightBackground"
></quick-look-backgrounds>
</div>
</div>
<div *ngIf="menuSelected.id == 'buttons'" class=" uk-padding-small ">
<div class="customizationMenuItems uk-margin-small">
<div class="uk-h4">Buttons</div>
<div>Note: Custom background style settings will override any identity settings that effect the
visualisation of a background.
</div>
</div>
<div *ngIf="menuSelected.id == 'buttons'" class=" uk-padding-small ">
<div class="customizationMenuItems uk-margin-small">
<div class="uk-h4">Buttons</div>
<div>Note: Custom background style settings will override any identity settings that effect the
visualisation of a background.
</div>
<div class="uk-margin-large-top uk-margin-small-bottom uk-h5"> Quick look
<div class="uk-margin-large-top uk-margin-small-bottom uk-h5"> Quick look
</div>
<quick-look-backgrounds [darkBackgroundColor]="draftCustomizationOptions.backgrounds.dark.color "
[lightBackgroundColor]="draftCustomizationOptions.backgrounds.light.color "
[formBackgroundColor]="draftCustomizationOptions.backgrounds.form.color"
[primaryColor]="draftCustomizationOptions.identity.mainColor"
[secondaryColor]="draftCustomizationOptions.identity.secondaryColor"
[buttonsOnDark]="draftCustomizationOptions.buttons.darkBackground"
[buttonsOnLight]="draftCustomizationOptions.buttons.lightBackground"
[buttonView]="true"
></quick-look-backgrounds>
</div>
<quick-look-backgrounds [darkBackgroundColor]="draftCustomizationOptions.backgrounds.dark.color "
[lightBackgroundColor]="draftCustomizationOptions.backgrounds.light.color "
[formBackgroundColor]="draftCustomizationOptions.backgrounds.form.color"
[primaryColor]="draftCustomizationOptions.identity.mainColor"
[secondaryColor]="draftCustomizationOptions.identity.secondaryColor"
[buttonsOnDark]="draftCustomizationOptions.buttons.darkBackground"
[buttonsOnLight]="draftCustomizationOptions.buttons.lightBackground"
[buttonView]="true"
></quick-look-backgrounds>
</div>
<div *ngIf="menuSelected.id == 'identity'" class=" uk-padding-small ">
<div class=" customizationMenuItems uk-margin-small">
</div>
<div *ngIf="menuSelected.id == 'identity'" class=" uk-padding-small ">
<div class=" customizationMenuItems uk-margin-small">
<div class="uk-h4">Identity</div>
<div>Note: Custom identity style settings will effect the visualisation of the whole gateway. That
includes <span class="uk-text-bold">buttons, links, tabs, backgrounds, etc.</span></div>
<div class="uk-h4">Identity</div>
<div>Note: Custom identity style settings will effect the visualisation of the whole gateway. That
includes <span class="uk-text-bold">buttons, links, tabs, backgrounds, etc.</span></div>
</div>
</div>
</div>
<div class="uk-padding-small">
<div class="uk-margin-top uk-margin-small-bottom uk-h5">See a preview</div>
<div id="container" class=" uk-flex uk-flex-center uk-flex-middle">
<div id="iframecontainer" class="">
<div class="uk-height-1-1">
<div *ngIf="hasChanges(draftCustomizationOptions, appliedCustomizationOptions)"
class=" uk-width-1-1 refresh-indicator">
<div class="uk-position-relative uk-height-1-1">
<div class="uk-position-center uk-text-center clickable uk-h3" style="color:white"
(click)="applyLayout()">
<div>
<icon name="refresh" ratio="2.5"></icon>
<div class="uk-padding-small">
<div class="uk-margin-top uk-margin-small-bottom uk-h5">See a preview</div>
<div id="container" class=" uk-flex uk-flex-center uk-flex-middle">
<div id="iframecontainer" class="">
<div class="uk-height-1-1">
<div *ngIf="hasChanges(draftCustomizationOptions, appliedCustomizationOptions)"
class=" uk-width-1-1 refresh-indicator">
<div class="uk-position-relative uk-height-1-1">
<div class="uk-position-center uk-text-center clickable uk-h3" style="color:white"
(click)="applyLayout()">
<div>
<icon name="refresh" ratio="2.5"></icon>
</div>
<div class="uk-margin-medium-top">Style has been changed.</div>
<div class="uk-margin-top"> Click to refresh the view.</div>
</div>
<div class="uk-margin-medium-top">Style has been changed.</div>
<div class="uk-margin-top"> Click to refresh the view.</div>
</div>
</div>
</div>
<iframe *ngIf="previewUrl" [src]="previewUrl" class="uk-width-1-1 "
style=" border-radius: 10px;"
></iframe>
<iframe *ngIf="previewUrl" [src]="previewUrl" class="uk-width-1-1 "
style=" border-radius: 10px;"
></iframe>
</div>
</div>
</div>
</div>
@ -136,6 +137,7 @@
</div>
</div>
</div>
<ng-template #identityOptions>
<div class="functionalities-container uk-text-small">
<div class="uk-margin-top">

@ -83,7 +83,7 @@ type Tab = 'all' | 'communities' | 'ris';
<div class="uk-card uk-card-default uk-card-body uk-position-relative">
<div class="uk-position-top-right uk-margin-small-right uk-margin-small-top">
<div class="uk-flex uk-flex-middle">
<icon [flex]="true" [name]="community.status == 'all'?'earth':(community.status == 'manager'?'restricted':'incognito')" ratio="0.6"></icon>
<icon [flex]="true" [name]="community.isPublic()?'earth':(community.isRestricted()?'restricted':'incognito')" ratio="0.6"></icon>
</div>
</div>
<a class="uk-display-block uk-text-center uk-link-reset" [routerLink]="community.communityId">

@ -94,12 +94,12 @@
<div class="uk-card-body">
<result-preview [properties]="properties" [showOrganizations]="true"
[showSubjects]="true" [result]="getResultPreview(result)"
[externalUrl]="projectUrl">
[externalUrl]="projectUrl" [hasLink]="false">
</result-preview>
</div>
<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 *ngIf="!getCommunityProject(result)">
<div *ngIf="!result['isPart']">
<div class="uk-padding-small uk-padding-remove-horizontal">
<a (click)="addProject(result)" class="uk-button uk-button-link uk-flex uk-flex-middle">
<icon name="add" [flex]="true"></icon>
@ -109,7 +109,7 @@
</a>
</div>
</div>
<div *ngIf="getCommunityProject(result)">
<div *ngIf="result['isPart']">
<div class="uk-padding-small uk-padding-remove-horizontal">
<a (click)="removeProject(result)"
class="uk-button uk-button-link uk-flex uk-flex-middle">

@ -19,6 +19,7 @@ import {CommunityInfo} from "../../openaireLibrary/connect/community/communityIn
import {OpenaireEntities} from "../../openaireLibrary/utils/properties/searchFields";
import {Filter, Value} from "../../openaireLibrary/searchPages/searchUtils/searchHelperClasses.class";
import {ClearCacheService} from "../../openaireLibrary/services/clear-cache.service";
import {SearchCommunityProjectsService} from "../../openaireLibrary/connect/projects/searchProjects.service";
declare var UIkit;
@ -38,7 +39,7 @@ export class AddProjectsComponent implements OnInit {
public errorCodes: ErrorCodes;
public openaireSearchUtils: SearchUtilsClass = new SearchUtilsClass();
@Output() communityProjectsChanged = new EventEmitter();
@Input() communityProjects = [];
// @Input() communityProjects = [];
public openaireProjects = [];
public queryParameters: string = "";
@ -58,7 +59,7 @@ export class AddProjectsComponent implements OnInit {
constructor(private route: ActivatedRoute, private _router: Router, private _searchProjectsService: SearchProjectsService,
private _manageCommunityProjectsService: ManageCommunityProjectsService,
private _clearCacheService: ClearCacheService,
private _clearCacheService: ClearCacheService, private _searchCommunityProjectsService: SearchCommunityProjectsService,
private _fb: UntypedFormBuilder) {
this.errorCodes = new ErrorCodes();
this.openaireSearchUtils.status = this.errorCodes.LOADING;
@ -121,15 +122,17 @@ export class AddProjectsComponent implements OnInit {
public addProject(project: SearchResult) {
this.subscriptions.push(this._manageCommunityProjectsService.addProject(this.properties, this.community.communityId, project).subscribe(
data => {
this.communityProjects.push(data);
// this.communityProjects.push(data);
this._clearCacheService.purgeBrowserCache(this.openaireEntities.PROJECT+" added", this.community.communityId);
UIkit.notification(this.openaireEntities.PROJECT+' successfully added!', {
status: 'success',
timeout: 6000,
pos: 'bottom-right'
});
project["isPart"] = true;
this.communityProjectsChanged.emit({
value: this.communityProjects,
value: project,
});
},
err => {
@ -140,20 +143,20 @@ export class AddProjectsComponent implements OnInit {
}
public removeProject(project: any) {
let communityProject = this.getCommunityProject(project);
let projectId: string = communityProject['id'];
this.subscriptions.push(this._manageCommunityProjectsService.removeProject(this.properties, this.community.communityId, projectId).subscribe(
// let communityProject = this.getCommunityProject(project);
this.subscriptions.push(this._manageCommunityProjectsService.removeProject(this.properties, this.community.communityId, project['id']).subscribe(
data => {
let index = this.communityProjects.indexOf(communityProject);
this.communityProjects.splice(index, 1);
// let index = this.communityProjects.indexOf(communityProject);
// this.communityProjects.splice(index, 1);
this._clearCacheService.purgeBrowserCache(this.openaireEntities.PROJECT+" removed", this.community.communityId);
UIkit.notification(this.openaireEntities.PROJECT+' successfully removed!', {
status: 'success',
timeout: 6000,
pos: 'bottom-right'
});
project["isPart"] = false;
this.communityProjectsChanged.emit({
value: this.communityProjects,
value: project,
});
},
err => {
@ -163,16 +166,19 @@ export class AddProjectsComponent implements OnInit {
));
}
public getCommunityProject(project: any): string {
let index: number = 0;
for (let communityProject of this.communityProjects) {
if (communityProject.openaireId == project.id ||
(project.code == communityProject.grantId && project.funderShortname == communityProject.funder)) {
return communityProject;
public getCommunityProject(project: any) {
this.subscriptions.push(this._searchCommunityProjectsService.searchProjectsWithPaging(this.properties, this.community.communityId, 1, this.resultsPerPage, project.id, null).subscribe(
data => {
if(data.totalElements > 0){
project["isPart"] = true;
}
},
err => {
console.error(err);
//TODO check erros (service not available, bad request)
}
index++;
}
return "";
));
}
getFunders() {
@ -217,7 +223,9 @@ export class AddProjectsComponent implements OnInit {
data => {
this.openaireSearchUtils.totalResults = data[0];
this.openaireProjects = data[1];
for(let project of this.openaireProjects){
this.getCommunityProject(project);
}
this.openaireSearchUtils.status = this.errorCodes.DONE;
if (this.openaireSearchUtils.totalResults == 0) {
this.openaireSearchUtils.status = this.errorCodes.NONE;

@ -16,12 +16,11 @@ import {CommunityService} from "../../openaireLibrary/connect/community/communit
@Component({
selector: 'manage-projects',
template: `
<remove-projects #removeProjectsComponent (addProjects)="openAddProjects()" [communityProjects]="communityProjects"
[loading]="showLoadingInRemove" [community]="community"
(communityProjectsChanged)="communityProjectsChanged($event)">
<remove-projects #removeProjectsComponent (addProjects)="openAddProjects()"
[loading]="showLoadingInRemove" [community]="community">
</remove-projects>
<fs-modal #fsModalProjects>
<add-projects #addProjects [communityProjects]="communityProjects" [community]="community"
<add-projects *ngIf="modalIsOpen" #addProjects [community]="community"
(communityProjectsChanged)="communityProjectsChanged($event)"></add-projects>
</fs-modal>
`
@ -36,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,
@ -68,15 +68,17 @@ export class ManageProjectsComponent implements OnInit {
this.fullscreen.back = true;
this.fullscreen.okButton = true;
this.fullscreen.open();
this.modalIsOpen = true;
}
public communityProjectsChanged($event) {
this.communityProjects = $event.value;
/* this.communityProjects = $event.value;
this.showLoadingInRemove = false;
if (this.fullscreen.isOpen) {
this.removeProjectsComponent.applyFilters();
this.removeProjectsComponent.createFunderFilter();
}
}*/
this.removeProjectsComponent.getCommunityProjects();
}
}

@ -24,20 +24,21 @@
</div>
<div inner>
<div class="uk-margin-top">
<results-and-pages [type]="openaireEntiites.PROJECTS | lowercase" [page]="page" [pageSize]="resultsPerPage"
[totalResults]="previewCommunityProjects.length"></results-and-pages>
<results-and-pages [type]="openaireEntiites.PROJECTS | lowercase" [page]="communitySearchUtils.page" [pageSize]="resultsPerPage"
[totalResults]="communitySearchUtils.totalResults"></results-and-pages>
</div>
<div class="uk-grid uk-flex-middle uk-margin-medium-top" uk-grid>
<div *ngIf="allOptions.length > 0">
<div *ngIf="allFunderOptions.length > 0">
<dropdown-filter #dropdownFilter dropdownClass="uk-width-medium uk-padding-small"
name="Filter by Funder" [count]="filterForm.get('funder').value.length">
name="Filter by Funder" [count]="filterForm.get('funder').value?1:null">
<h6 class="uk-margin-remove-bottom" title="Filter by Funder">Funder</h6>
<ul class="uk-list uk-margin-remove-bottom">
<li *ngFor="let option of allOptions">
<a class="uk-link-text">
<label (click)="select(option.value, $event, dropdownFilter)" class="uk-flex uk-flex-middle">
<li *ngFor="let option of previewFunderOptions">
<a class="uk-link-text" >
<label (click)="select(option, $event, dropdownFilter)" class="uk-flex uk-flex-middle">
<input class="uk-checkbox"
type="checkbox" [checked]="isSelected(option.value)">
type="checkbox" [checked]="isSelected(option.value.id)">
<span class="uk-margin-small-left">{{option.label}}</span>
</label>
</a>
@ -55,9 +56,9 @@
</div>
<!-- </div>-->
<div class="uk-width-expand@l uk-width-1-1 uk-flex uk-flex-right@m uk-flex-center">
<paging-no-load *ngIf="previewCommunityProjects.length > 0"
<paging-no-load *ngIf="communitySearchUtils.totalResults> 0" [currentPage]="communitySearchUtils.page"
(pageChange)="updatePage($event)" [size]="resultsPerPage"
[totalResults]="previewCommunityProjects.length" customClasses="uk-flex-right">
[totalResults]="communitySearchUtils.totalResults" customClasses="uk-flex-right">
</paging-no-load>
</div>
</div>
@ -67,29 +68,28 @@
<loading></loading>
</div>
<div *ngIf="!loading">
<div class="uk-margin-medium-bottom">
<div *ngIf="previewCommunityProjects.length == 0"
class="uk-card uk-card-default uk-padding-large uk-text-center uk-margin-bottom uk-text-bold">
<div>No {{openaireEntiites.PROJECTS | lowercase}}
<span *ngIf="communityProjects.length == 0; else: notFound">for {{community.shortTitle}}</span>
<span *ngIf="communitySearchUtils.totalResults == 0; else: notFound">for {{community.shortTitle}}</span>
<ng-template #notFound>found</ng-template>
</div>
</div>
<div *ngIf="previewCommunityProjects.length > 0"
class="uk-grid uk-grid-large uk-child-width-1-1 uk-child-width-1-2@m uk-margin-bottom" uk-grid uk-height-match="target: .uk-card-body">
<div *ngFor="let item of previewCommunityProjects.slice((page - 1)*resultsPerPage, page*resultsPerPage); let i=index">
<div *ngFor="let item of previewCommunityProjects; let i=index">
<div class="uk-card uk-card-default">
<div class="uk-card-body">
<h6 class="uk-margin-bottom">
<a *ngIf="item.openaireId || (item.grantId && item.funder)"
<a *ngIf="(item.openaireId || (item.grantId && item.funder)) && (!item['availableSince'] || !lastDBLoadDate || item['availableSince']<lastDBLoadDate)"
target="_blank" class="custom-external uk-link-text"
[href]="projectUrl+'?' + ((item.openaireId) ? 'projectId='+item.openaireId : 'grantId='+item.grantId+'&funder='+item.funder)">
<span *ngIf="item.name">{{item.name}}</span>
<span *ngIf="item.name && item.acronym"> (</span><span *ngIf="item.acronym">{{item.acronym}}</span><span *ngIf="item.name && item.acronym">)</span>
<span *ngIf="!item.name && !item.acronym">[no title available]</span>
</a>
<span *ngIf="!item.openaireId && !(item.grantId && item.funder)">
<span *ngIf="(!item.openaireId && !(item.grantId && item.funder) || (item['availableSince'] && lastDBLoadDate && item['availableSince'] >= lastDBLoadDate))">
<span *ngIf="item.name">{{item.name}}</span>
<span *ngIf="item.name && item.acronym"> (</span><span *ngIf="item.acronym">{{item.acronym}}</span><span *ngIf="item.name && item.acronym">)</span>
<span *ngIf="!item.name && !item.acronym">[no title available]</span>
@ -124,7 +124,7 @@
</div>
<div class="uk-margin-small-top">
<paging-no-load [currentPage]="page"
[totalResults]="previewCommunityProjects.length" [size]="resultsPerPage"
[totalResults]="communitySearchUtils.totalResults" [size]="resultsPerPage"
(pageChange)="updatePage($event)" customClasses="uk-flex-right@m uk-flex-center">
</paging-no-load>
</div>

@ -19,6 +19,8 @@ import {CommunityInfo} from "../../openaireLibrary/connect/community/communityIn
import {HelperFunctions} from "../../openaireLibrary/utils/HelperFunctions.class";
import {NotificationHandler} from "../../openaireLibrary/utils/notification-handler";
import {ClearCacheService} from "../../openaireLibrary/services/clear-cache.service";
import {debounceTime, distinctUntilChanged} from "rxjs/operators";
import {IndexInfoService} from "../../openaireLibrary/utils/indexInfo.service";
@Component({
selector: 'remove-projects',
@ -35,7 +37,7 @@ export class RemoveProjectsComponent implements OnInit {
public projectUrl = "https://" + ((properties.environment == "beta" || properties.environment == "development") ? "beta." : "") + "explore.openaire.eu" + properties.searchLinkToProject.split("?")[0];
@Output() communityProjectsChanged = new EventEmitter();
@Input() public communityProjects = [];
// @Input() public communityProjects = [];
public previewCommunityProjects = [];
public communitySearchUtils: SearchUtilsClass = new SearchUtilsClass();
public errorCodes: ErrorCodes;
@ -51,56 +53,49 @@ 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}}
];
public openaireEntiites = OpenaireEntities;
lastDBLoadDate = null;
constructor(private route: ActivatedRoute, private _router: Router,
private _fb: UntypedFormBuilder,
private communityService: CommunityService,
private _manageCommunityProjectsService: ManageCommunityProjectsService,
private _searchCommunityProjectsService: SearchCommunityProjectsService,
private _clearCacheService: ClearCacheService) {
private _clearCacheService: ClearCacheService, private indexInfoService: IndexInfoService) {
this.errorCodes = new ErrorCodes();
this.communitySearchUtils.status = this.errorCodes.LOADING;
}
ngOnInit() {
this.subscriptions.push(this.indexInfoService.getDBLoadLastDate(this.properties).subscribe(res => {
this.lastDBLoadDate = res;
}));
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.subscribe(value => {
this.searchText = new RegExp(value, 'i');
this.subscriptions.push(this.filterForm.get('keyword').valueChanges.pipe(debounceTime(500), distinctUntilChanged()).subscribe(value => {
this.page = 1;
this.applyFilters();
}));
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.applyFilters();
}));
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 => {
@ -111,7 +106,8 @@ export class RemoveProjectsComponent implements OnInit {
+ this.community.communityId + ".openaire.eu" + this.properties.searchLinkToProject.split("?")[0];
this.keyword = '';
this._getCommunityProjects();
this._getCommunityFunders();
this._getCommunityProjects(1,this.keyword, null);
}
}));
}
@ -133,18 +129,13 @@ export class RemoveProjectsComponent implements OnInit {
}
public confirmedDeleteProject(data: any) {
this.subscriptions.push(this._manageCommunityProjectsService.removeProject(this.properties, this.community.communityId, this.selectedCommunityProject.id).subscribe(
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);
},
err => {
this.handleError('An error has been occurred. Try again later!');
@ -179,29 +170,21 @@ export class RemoveProjectsComponent implements OnInit {
this.alertModalDeleteCommunity.okButtonText = "Yes";
this.alertModalDeleteCommunity.open();
}
public _getCommunityProjects() {
public getCommunityProjects() {
this._getCommunityProjects(this.communitySearchUtils.page, this.keyword,null );
}
public _getCommunityProjects(page, keyword, funder, orderBy = "name" ) {
this.communitySearchUtils.status = this.errorCodes.LOADING;
this.communityProjects = [];
this.communitySearchUtils.totalResults = 0;
this.communitySearchUtils.page = 1;
this.communitySearchUtils.keyword = "";
this.subscriptions.push(this._searchCommunityProjectsService.searchProjects(this.properties, this.community.communityId).subscribe(
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, orderBy).subscribe(
data => {
this.communityProjects = data;
this.previewCommunityProjects = this.communityProjects;
this.sort();
this.communitySearchUtils.totalResults = data.length;
this.previewCommunityProjects = data.content;
this.communitySearchUtils.totalResults = data.totalElements;
this.communitySearchUtils.status = this.errorCodes.DONE;
this.communityProjectsChanged.emit({
value: this.communityProjects,
value: this.communitySearchUtils.totalResults
});
this.createFunderFilter();
this.loading = false;
},
err => {
@ -215,90 +198,33 @@ export class RemoveProjectsComponent implements OnInit {
} else {
this.communitySearchUtils.status = this.errorCodes.NOT_AVAILABLE;
}
this.loading = false;
}
));
}
public createFunderFilter(): void {
let funders: Set<string> = new Set<string>();
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) {
HelperFunctions.scroll();
this.page = $event.value;
this._getCommunityProjects(this.page, this.filterForm.get('keyword').value, null);
}
addNew() {
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();
}
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;
@ -313,23 +239,25 @@ 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;
}
}

@ -133,7 +133,7 @@ export class StatsComponent implements OnInit {
this._router.navigate(['/user-info'], { queryParams: { "errorCode": LoginErrorCodes.NOT_VALID, "redirectUrl": this._router.url} });
} else {
//console.log(`calling ${this.properties.adminToolsAPIURL}/communityFull/${this.communityId}`);
this.configService.communityInformationState.subscribe(
this.configService.portalAsObservable.subscribe(
res => {
console.debug(res);
if(res) {

@ -31,19 +31,19 @@
<li class="uk-active" *ngIf="displayedAllSubjects?.length" (click)="groupSubjects(displayedAllSubjects, 'all')">
<a>All ({{displayedAllSubjects.length}})</a>
</li>
<li *ngIf="displayedSubjects?.length" (click)="groupSubjects(displayedSubjects, 'freeText')">
<li (click)="groupSubjects(displayedSubjects, 'freeText')">
<a>Free Text ({{displayedSubjects.length}})</a>
</li>
<li *ngIf="displayedSdg?.length" (click)="groupSubjects(displayedSdg, 'sdg')">
<li (click)="groupSubjects(displayedSdg, 'sdg')">
<a>SDGs ({{displayedSdg.length}})</a>
</li>
<li *ngIf="displayedFos?.length" (click)="groupSubjects(displayedFos, 'fos')">
<li (click)="groupSubjects(displayedFos, 'fos')">
<a>Fields of Science ({{displayedFos.length}})</a>
</li>
</ul>
<ul class="uk-switcher">
<li *ngIf="displayedAllSubjects?.length">
<ng-container *ngIf="groupedAllSubjects?.length">
<li>
<ng-container *ngIf="displayedAllSubjects?.length">
<div>
<ul class="uk-nav uk-nav-default uk-flex uk-flex-wrap">
<li *ngFor="let item of groupedAllSubjects; let i = index;" class="uk-margin-right" [class.uk-margin-left]="i != 0"
@ -97,9 +97,14 @@
</div>
</div>
</ng-container>
<ng-container *ngIf="displayedAllSubjects?.length === 0">
<div class="uk-position-relative uk-height-medium">
<h6 class="uk-position-center uk-margin-remove">There are no subjects yet</h6>
</div>
</ng-container>
</li>
<li *ngIf="displayedSubjects?.length">
<ng-container *ngIf="groupedSubjects?.length">
<li>
<ng-container *ngIf="displayedSubjects?.length">
<div>
<ul class="uk-nav uk-nav-default uk-flex uk-flex-wrap">
<li *ngFor="let item of groupedSubjects; let i = index;" class="uk-margin-right" [class.uk-margin-left]="i != 0"
@ -153,9 +158,14 @@
</div>
</div>
</ng-container>
<ng-container *ngIf="displayedSubjects?.length === 0">
<div class="uk-position-relative uk-height-medium">
<h6 class="uk-position-center uk-margin-remove">There are no subjects yet</h6>
</div>
</ng-container>
</li>
<li *ngIf="displayedSdg?.length">
<ng-container *ngIf="groupedSdg?.length">
<li>
<ng-container *ngIf="displayedSdg?.length">
<div>
<ul class="uk-nav uk-nav-default uk-flex uk-flex-wrap">
<li *ngFor="let item of groupedSdg; let i = index;" class="uk-margin-right" [class.uk-margin-left]="i != 0"
@ -209,9 +219,14 @@
</div>
</div>
</ng-container>
<ng-container *ngIf="displayedSdg?.length === 0">
<div class="uk-position-relative uk-height-medium">
<h6 class="uk-position-center uk-margin-remove">There are no subjects yet</h6>
</div>
</ng-container>
</li>
<li *ngIf="displayedFos?.length">
<ng-container *ngIf="groupedFos?.length">
<li>
<ng-container *ngIf="displayedFos?.length">
<div>
<ul class="uk-nav uk-nav-default uk-flex uk-flex-wrap">
<li *ngFor="let item of groupedFos; let i = index;" class="uk-margin-right" [class.uk-margin-left]="i != 0"
@ -265,7 +280,13 @@
</div>
</div>
</ng-container>
<ng-container *ngIf="displayedFos?.length === 0">
<div class="uk-position-relative uk-height-medium">
<h6 class="uk-position-center uk-margin-remove">There are no subjects yet</h6>
</div>
</ng-container>
</li>
</ul>
</div>
</div>

@ -10,7 +10,9 @@ import {AlertModal} from '../../../openaireLibrary/utils/modal/alert';
import {SearchInputComponent} from '../../../openaireLibrary/sharedComponents/search-input/search-input.component';
import {forkJoin, Subscription} from 'rxjs';
import {CommunityInfo} from '../../../openaireLibrary/connect/community/communityInfo';
import {FullScreenModalComponent} from 'src/app/openaireLibrary/utils/modal/full-screen-modal/full-screen-modal.component';
import {
FullScreenModalComponent
} from 'src/app/openaireLibrary/utils/modal/full-screen-modal/full-screen-modal.component';
import {HelperFunctions} from 'src/app/openaireLibrary/utils/HelperFunctions.class';
import {NotificationHandler} from "../../../openaireLibrary/utils/notification-handler";
import {ClearCacheService} from "../../../openaireLibrary/services/clear-cache.service";
@ -21,361 +23,361 @@ import {InputComponent} from "../../../openaireLibrary/sharedComponents/input/in
declare var UIkit: any;
@Component({
selector: 'subjects-edit-form',
templateUrl: './subjects-edit-form.component.html',
selector: 'subjects-edit-form',
templateUrl: './subjects-edit-form.component.html',
})
export class SubjectsEditFormComponent implements OnInit {
properties: EnvProperties = properties;
communityId: string = null;
community: CommunityInfo = null;
loading = true;
params: any;
private subscriptions: any[] = [];
properties: EnvProperties = properties;
communityId: string = null;
community: CommunityInfo = null;
loading = true;
params: any;
private subscriptions: any[] = [];
filterForm: UntypedFormControl;
subjectsForm = new UntypedFormArray([]);
hasChanges: boolean = false;
originalAllSubjects = [];
originalSubjects = [];
originalSdg = [];
originalFos = [];
displayedAllSubjects = [];
displayedSubjects = [];
displayedSdg = [];
displayedFos = [];
groupedAllSubjects = [];
groupedSubjects = [];
groupedSdg = [];
groupedFos = [];
subjectsColumns = [];
subjectsLimit: number = 6;
maxCharacters: number = 25;
activeTab: 'all' | 'freeText' | 'sdg' | 'fos' = 'all';
indexAll: number = 0;
indexSubjects: number = 0;
indexSdg: number = 0;
indexFos: number = 0;
filterForm: UntypedFormControl;
subjectsForm = new UntypedFormArray([]);
hasChanges: boolean = false;
originalAllSubjects = [];
originalSubjects = [];
originalSdg = [];
originalFos = [];
displayedAllSubjects = [];
displayedSubjects = [];
displayedSdg = [];
displayedFos = [];
groupedAllSubjects = [];
groupedSubjects = [];
groupedSdg = [];
groupedFos = [];
subjectsColumns = [];
subjectsLimit: number = 6;
maxCharacters: number = 25;
activeTab: 'all' | 'freeText' | 'sdg' | 'fos' = 'all';
indexAll: number = 0;
indexSubjects: number = 0;
indexSdg: number = 0;
indexFos: number = 0;
@ViewChild('addSubjectsInput') addSubjectsInput: InputComponent;
@ViewChild('editModal') editModal: AlertModal;
@ViewChild('deleteModal') deleteModal: AlertModal;
@ViewChild('fsModal', {static: true}) fullscreen: FullScreenModalComponent;
@ViewChild('modalTabs') modalTabs: ElementRef;
@ViewChild('sdgSelection') sdgSelection: SdgSelectionComponent;
@ViewChild('fosSelection') fosSelection: FosSelectionComponent;
@ViewChild('addSubjectsInput') addSubjectsInput: InputComponent;
@ViewChild('editModal') editModal: AlertModal;
@ViewChild('deleteModal') deleteModal: AlertModal;
@ViewChild('fsModal', {static: true}) fullscreen: FullScreenModalComponent;
@ViewChild('modalTabs') modalTabs: ElementRef;
@ViewChild('sdgSelection') sdgSelection: SdgSelectionComponent;
@ViewChild('fosSelection') fosSelection: FosSelectionComponent;
onEnter: () => void = () => {
this.addSubjectsIntoList();
}
constructor(private route: ActivatedRoute,
public _fb: UntypedFormBuilder,
private title: Title,
private _communityService: CommunityService,
private _subjectsService: SubjectsService,
private _clearCacheService: ClearCacheService) {
}
ngOnInit() {
this.filterForm = this._fb.control('');
this.subscriptions.push(this.filterForm.valueChanges.subscribe(value => {
this.displayedAllSubjects = this.originalAllSubjects.filter(subject => {
return !value || subject.toLowerCase().indexOf(value.toLowerCase()) != -1
});
this.displayedSubjects = this.originalSubjects.filter(subject => {
return !value || subject.toLowerCase().indexOf(value.toLowerCase()) != -1
});
this.displayedSdg = this.originalSdg.filter(subject => {
return !value || subject.toLowerCase().indexOf(value.toLowerCase()) != -1
});
this.displayedFos = this.originalFos.filter(subject => {
return !value || subject.toLowerCase().indexOf(value.toLowerCase()) != -1
});
if(this.activeTab === 'all') {
this.groupSubjects(this.displayedAllSubjects, 'all');
} else if(this.activeTab === 'freeText') {
this.groupSubjects(this.displayedSubjects, 'freeText');
} else if(this.activeTab === 'sdg') {
this.groupSubjects(this.displayedSdg, 'sdg');
} else if(this.activeTab === 'fos') {
this.groupSubjects(this.displayedFos, 'fos');
}
}));
this.subscriptions.push(this.route.params.subscribe(
params => {
this.communityId = params['community'];
this.title.setTitle(this.communityId.toUpperCase() + ' | Subjects');
this.loading = true;
this.subscriptions.push(this._communityService.getCommunityAsObservable().subscribe(
community => {
this.community = community;
this.params = {
community: encodeURIComponent(
'"' + community.queryId + '"')
};
this.community.subjects.sort((n1,n2)=> {
if (n1.toLowerCase() > n2.toLowerCase()) {
return 1;
}
if (n1.toLowerCase() < n2.toLowerCase()) {
return -1;
}
return 0;
onEnter: () => void = () => {
this.addSubjectsIntoList();
}
constructor(private route: ActivatedRoute,
public _fb: UntypedFormBuilder,
private title: Title,
private _communityService: CommunityService,
private _subjectsService: SubjectsService,
private _clearCacheService: ClearCacheService) {
}
ngOnInit() {
this.filterForm = this._fb.control('');
this.subscriptions.push(this.filterForm.valueChanges.subscribe(value => {
this.displayedAllSubjects = this.originalAllSubjects.filter(subject => {
return !value || subject.toLowerCase().indexOf(value.toLowerCase()) != -1
});
this.displayedSubjects = this.originalSubjects.filter(subject => {
return !value || subject.toLowerCase().indexOf(value.toLowerCase()) != -1
});
this.displayedSdg = this.originalSdg.filter(subject => {
return !value || subject.toLowerCase().indexOf(value.toLowerCase()) != -1
});
this.displayedFos = this.originalFos.filter(subject => {
return !value || subject.toLowerCase().indexOf(value.toLowerCase()) != -1
});
this.displayedSubjects = HelperFunctions.copy(this.community.subjects);
this.displayedSdg = this.community.sdg;
this.displayedFos = this.community.fos;
this.displayedAllSubjects = [...this.displayedSubjects, ...this.displayedSdg, ...this.displayedFos];
this.groupSubjects(this.displayedAllSubjects, 'all');
this.originalAllSubjects = HelperFunctions.copy(this.displayedAllSubjects);
this.originalSubjects = HelperFunctions.copy(this.displayedSubjects);
this.originalSdg = HelperFunctions.copy(this.displayedSdg);
this.originalFos = HelperFunctions.copy(this.displayedFos);
this.loading = false;
},
error => this.handleUpdateError('System error retrieving community profile', error)
));
}));
}
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscription) {
subscription.unsubscribe();
}
});
}
if (this.activeTab === 'all') {
this.groupSubjects(this.displayedAllSubjects, 'all');
} else if (this.activeTab === 'freeText') {
this.groupSubjects(this.displayedSubjects, 'freeText');
} else if (this.activeTab === 'sdg') {
this.groupSubjects(this.displayedSdg, 'sdg');
} else if (this.activeTab === 'fos') {
this.groupSubjects(this.displayedFos, 'fos');
}
}));
this.subscriptions.push(this.route.params.subscribe(
params => {
this.communityId = params['community'];
this.title.setTitle(this.communityId.toUpperCase() + ' | Subjects');
this.loading = true;
this.subscriptions.push(this._communityService.getCommunityAsObservable().subscribe(
community => {
this.community = community;
this.params = {
community: encodeURIComponent(
'"' + community.queryId + '"')
};
this.community.subjects.sort((n1, n2) => {
if (n1.toLowerCase() > n2.toLowerCase()) {
return 1;
}
if (n1.toLowerCase() < n2.toLowerCase()) {
return -1;
}
return 0;
});
this.displayedSubjects = HelperFunctions.copy(this.community.subjects);
this.displayedSdg = this.community.sdg;
this.displayedFos = this.community.fos;
this.displayedAllSubjects = [...this.displayedSubjects, ...this.displayedSdg, ...this.displayedFos];
this.groupSubjects(this.displayedAllSubjects, 'all');
this.originalAllSubjects = HelperFunctions.copy(this.displayedAllSubjects);
this.originalSubjects = HelperFunctions.copy(this.displayedSubjects);
this.originalSdg = HelperFunctions.copy(this.displayedSdg);
this.originalFos = HelperFunctions.copy(this.displayedFos);
this.loading = false;
},
error => this.handleUpdateError('System error retrieving community profile', error)
));
}));
}
ngOnDestroy() {
this.subscriptions.forEach(subscription => {
if (subscription instanceof Subscription) {
subscription.unsubscribe();
}
});
}
public groupSubjects(subjects: string[], type: string) {
if (subjects.length === 0) {
return [];
}
subjects.sort((a, b) => a.localeCompare(b));
if (type === 'all') {
this.indexAll = 0;
this.activeTab = 'all';
this.groupedAllSubjects = Object.values(
subjects.reduce((acc, subject) => {
let firstLetter = subject[0].toLocaleUpperCase();
if (!acc[firstLetter]) {
acc[firstLetter] = {group: firstLetter, data: [subject]};
} else {
acc[firstLetter].data.push(subject);
}
return acc;
}, {})
)
if (subjects.length > 1) {
this.groupedAllSubjects.unshift({group: 'All', data: subjects});
}
}
if (type === 'freeText') {
this.indexSubjects = 0;
this.activeTab = 'freeText';
this.groupedSubjects = Object.values(
subjects.reduce((acc, subject) => {
let firstLetter = subject[0].toLocaleUpperCase();
if (!acc[firstLetter]) {
acc[firstLetter] = {group: firstLetter, data: [subject]};
} else {
acc[firstLetter].data.push(subject);
}
return acc;
}, {})
)
if (subjects.length > 1) {
this.groupedSubjects.unshift({group: 'All', data: subjects});
}
}
if (type === 'sdg') {
this.indexSdg = 0;
this.activeTab = 'sdg';
this.groupedSdg = Object.values(
subjects.reduce((acc, subject) => {
let firstLetter = subject[0].toLocaleUpperCase();
if (!acc[firstLetter]) {
acc[firstLetter] = {group: firstLetter, data: [subject]};
} else {
acc[firstLetter].data.push(subject);
}
return acc;
}, {})
)
if (subjects.length > 1) {
this.groupedSdg.unshift({group: 'All', data: subjects});
}
}
if (type === 'fos') {
this.indexFos = 0;
this.activeTab = 'fos';
this.groupedFos = Object.values(
subjects.reduce((acc, subject) => {
let key = subject.substring(0, 2).toLocaleUpperCase();
if (!acc[key]) {
acc[key] = {group: key, data: [subject]};
} else {
acc[key].data.push(subject);
}
return acc;
}, {})
)
if (subjects.length > 1) {
this.groupedFos.unshift({group: 'All', data: subjects});
}
}
}
public changeDisplayedSubjects(i, group) {
this.subjectsColumns = [];
if (this.activeTab === 'all') {
this.indexAll = i;
} else if (this.activeTab === 'freeText') {
this.indexSubjects = i;
} else if (this.activeTab === 'sdg') {
this.indexSdg = i;
} else if (this.activeTab === 'fos') {
this.indexFos = i;
}
if (group.data.length > this.subjectsLimit && group.group != 'All') {
this.divideSubjects(group);
}
}
public divideSubjects(group) {
let columns = [];
for (let i = 0; i < (group.data.length / this.subjectsLimit); i++) {
columns.push(group.data.slice(i * this.subjectsLimit, ((i + 1) * this.subjectsLimit)));
}
this.subjectsColumns = columns;
}
public groupSubjects(subjects: string[], type: string) {
if(subjects.length === 0) {
return [];
}
subjects.sort((a, b) => a.localeCompare(b));
if(type === 'all') {
this.indexAll = 0;
this.activeTab = 'all';
this.groupedAllSubjects = Object.values(
subjects.reduce((acc, subject) => {
let firstLetter = subject[0].toLocaleUpperCase();
if(!acc[firstLetter]) {
acc[firstLetter] = {group: firstLetter, data: [subject]};
} else {
acc[firstLetter].data.push(subject);
}
return acc;
},{})
)
if(subjects.length > 1) {
this.groupedAllSubjects.unshift({group: 'All', data: subjects});
}
}
if(type === 'freeText') {
this.indexSubjects = 0;
this.activeTab = 'freeText';
this.groupedSubjects = Object.values(
subjects.reduce((acc, subject) => {
let firstLetter = subject[0].toLocaleUpperCase();
if(!acc[firstLetter]) {
acc[firstLetter] = {group: firstLetter, data: [subject]};
} else {
acc[firstLetter].data.push(subject);
}
return acc;
},{})
)
if(subjects.length > 1) {
this.groupedSubjects.unshift({group: 'All', data: subjects});
}
}
if(type === 'sdg') {
this.indexSdg = 0;
this.activeTab = 'sdg';
this.groupedSdg = Object.values(
subjects.reduce((acc, subject) => {
let firstLetter = subject[0].toLocaleUpperCase();
if(!acc[firstLetter]) {
acc[firstLetter] = {group: firstLetter, data: [subject]};
} else {
acc[firstLetter].data.push(subject);
}
return acc;
},{})
)
if(subjects.length > 1) {
this.groupedSdg.unshift({group: 'All', data: subjects});
}
}
if(type === 'fos') {
this.indexFos = 0;
this.activeTab = 'fos';
this.groupedFos = Object.values(
subjects.reduce((acc, subject) => {
let key = subject.substring(0,2).toLocaleUpperCase();
if(!acc[key]) {
acc[key] = {group: key, data: [subject]};
} else {
acc[key].data.push(subject);
}
return acc;
},{})
)
if(subjects.length > 1) {
this.groupedFos.unshift({group: 'All', data: subjects});
}
}
}
public getSubjectsExistOnlyInFirst(firstArray: string[], secondArray: string[]): string[] {
const difference = [];
for (let i = 0; i < firstArray.length; i++) {
if (secondArray.indexOf(firstArray[i]) === -1) {
difference.push(firstArray[i]);
}
}
return difference;
}
public changeDisplayedSubjects(i, group) {
this.subjectsColumns = [];
if(this.activeTab === 'all') {
this.indexAll = i;
} else if(this.activeTab === 'freeText') {
this.indexSubjects = i;
} else if(this.activeTab === 'sdg') {
this.indexSdg = i;
} else if(this.activeTab === 'fos') {
this.indexFos = i;
public editAllSubjects() {
UIkit.tab(this.modalTabs.nativeElement).show(0);
this.displayedSubjects = HelperFunctions.copy(this.community.subjects);
this.sdgSelection.reset();
this.sdgSelection.sdgs.markAsPristine();
this.fosSelection.reset();
this.fosSelection.fosOptions.markAsPristine();
this.fullscreen.title = "Add/Edit Subjects";
this.fullscreen.okButtonText = "Save";
this.fullscreen.back = true;
this.fullscreen.okButton = true;
this.fullscreen.open();
}
if(group.data.length > this.subjectsLimit && group.group != 'All') {
this.divideSubjects(group);
}
}
public divideSubjects(group) {
let columns = [];
for(let i = 0; i < (group.data.length / this.subjectsLimit); i++) {
columns.push(group.data.slice(i * this.subjectsLimit, ((i + 1) * this.subjectsLimit)));
}
this.subjectsColumns = columns;
}
public getSubjectsExistOnlyInFirst(firstArray: string[], secondArray: string[]): string[] {
const difference = [];
for (let i = 0; i < firstArray.length; i++) {
if (secondArray.indexOf(firstArray[i]) === -1) {
difference.push(firstArray[i]);
}
public addSubjectsIntoList() {
if (this.addSubjectsInput.searchControl.getRawValue()) {
this.addSubjectsInput.add(null, true);
}
this.subjectsForm.getRawValue().forEach(element => {
this.displayedSubjects.unshift(element);
});
this.subjectsForm.clear();
this.hasChanges = true;
}
return difference;
}
public editAllSubjects() {
UIkit.tab(this.modalTabs.nativeElement).show(0);
this.displayedSubjects = HelperFunctions.copy(this.community.subjects);
this.sdgSelection.reset();
this.sdgSelection.sdgs.markAsPristine();
this.fosSelection.reset();
this.fosSelection.fosOptions.markAsPristine();
this.fullscreen.title = "Add/Edit Subjects";
this.fullscreen.okButtonText = "Save";
this.fullscreen.back = true;
this.fullscreen.okButton = true;
this.fullscreen.open();
}
public removeSubjectFromList(i) {
this.displayedSubjects.splice(i, 1);
this.hasChanges = true;
}
public saveAllSubjects() {
let selectedSdg = this.sdgSelection.getSelectedSubjects().map(a => a.id);
let selectedFos = this.fosSelection.getSelectedSubjects().map(a => a.id);
let requests = [
...this.saveSubjects(this.community.subjects, this.displayedSubjects, 'subjects'),
...this.saveSubjects(this.community.sdg, selectedSdg, 'sdg'),
...this.saveSubjects(this.community.fos, selectedFos, 'fos')
];
this.subscriptions.push(forkJoin(requests).subscribe(res => {
this.afterUpdateActions(res, "updated");
}));
}
public addSubjectsIntoList() {
if(this.addSubjectsInput.searchControl.getRawValue()) {
this.addSubjectsInput.add(null, true);
}
this.subjectsForm.getRawValue().forEach(element => {
this.displayedSubjects.unshift(element);
});
this.subjectsForm.clear();
this.hasChanges = true;
}
public saveSubjects(subjects, displayedSubjects, type: string) {
if (this.communityId != null && this.communityId !== '') {
this.loading = true;
const subjectsToDeleteAr = this.getSubjectsExistOnlyInFirst(subjects, displayedSubjects);
const subjectsToAddAr = this.getSubjectsExistOnlyInFirst(displayedSubjects, subjects);
const subjectsToDelete = this.getNonEmptyItems(subjectsToDeleteAr);
const subjectsToAdd = this.getNonEmptyItems(subjectsToAddAr);
let requests = [];
if (subjectsToDelete.length > 0) {
requests.push(this._subjectsService.removeSubjects(
this.properties.communityAPI + this.communityId + '/' + type, subjectsToDelete))
}
if (subjectsToAdd.length > 0) {
requests.push(this._subjectsService.addSubjects(
this.properties.communityAPI + this.communityId + '/' + type, subjectsToAdd))
}
return requests;
}
}
public removeSubjectFromList(i) {
this.displayedSubjects.splice(i, 1);
this.hasChanges = true;
}
handleUpdateError(message: string, error = null) {
if (error) {
console.error(error)
}
NotificationHandler.rise(message, 'danger');
this.loading = false;
}
public saveAllSubjects() {
let selectedSdg = this.sdgSelection.getSelectedSubjects().map(a => a.id);
let selectedFos = this.fosSelection.getSelectedSubjects().map(a => a.id);
let requests = [
...this.saveSubjects(this.community.subjects, this.displayedSubjects, 'subjects'),
...this.saveSubjects(this.community.sdg, selectedSdg, 'sdg'),
...this.saveSubjects(this.community.fos, selectedFos, 'fos')
];
this.subscriptions.push(forkJoin(requests).subscribe(res => {
this.afterUpdateActions(res, "updated");
}));
}
public saveSubjects(subjects, displayedSubjects, type: string) {
if (this.communityId != null && this.communityId !== '') {
this.loading = true;
const subjectsToDeleteAr = this.getSubjectsExistOnlyInFirst(subjects, displayedSubjects);
const subjectsToAddAr = this.getSubjectsExistOnlyInFirst(displayedSubjects, subjects);
const subjectsToDelete = this.getNonEmptyItems(subjectsToDeleteAr);
const subjectsToAdd = this.getNonEmptyItems(subjectsToAddAr);
let requests = [];
if (subjectsToDelete.length > 0) {
requests.push(this._subjectsService.removeSubjects(
this.properties.communityAPI + this.communityId + '/' + type, subjectsToDelete))
}
if (subjectsToAdd.length > 0) {
requests.push(this._subjectsService.addSubjects(
this.properties.communityAPI + this.communityId + '/' + type, subjectsToAdd))
}
return requests;
}
}
handleUpdateError(message: string, error = null) {
if(error) {
console.error(error)
afterUpdateActions(response, message: string) {
response.forEach(res => {
if (res.subjects) {
this.community.subjects = res.subjects;
} else if (res.sdg) {
this.community.sdg = res.sdg;
} else if (res.fos) {
this.community.fos = res.fos;
}
});
this._communityService.updateSubjects(this.community.subjects, this.community.fos, this.community.sdg);
this._clearCacheService.purgeBrowserCache("Subjects " + message, this.communityId);
NotificationHandler.rise('Subjects successfully ' + message + '!')
this.loading = false;
}
NotificationHandler.rise(message, 'danger');
this.loading = false;
}
afterUpdateActions(response, message: string) {
response.forEach(res => {
if (res.subjects) {
this.community.subjects = res.subjects;
} else if (res.sdg) {
this.community.sdg = res.sdg;
} else if (res.fos) {
this.community.fos = res.fos;
}
});
this._communityService.updateSubjects(this.community.subjects, this.community.fos, this.community.sdg);
this._clearCacheService.purgeBrowserCache("Subjects "+message, this.communityId);
NotificationHandler.rise('Subjects successfully ' + message + '!')
this.loading = false;
}
private getNonEmptyItems(data: string[]): string[] {
const length = data.length;
const arrayNonEmpty = new Array<string>();
let j = 0;
for (let i = 0; i < length; i++) {
if (this.isEmpty(data[i])) {
} else if (this.isNonEmpty(data[i])) {
arrayNonEmpty[j] = data[i];
j++;
}
private getNonEmptyItems(data: string[]): string[] {
const length = data.length;
const arrayNonEmpty = new Array<string>();
let j = 0;
for (let i = 0; i < length; i++) {
if (this.isEmpty(data[i])) {
} else if (this.isNonEmpty(data[i])) {
arrayNonEmpty[j] = data[i];
j++;
}
}
return arrayNonEmpty;
}
return arrayNonEmpty;
}
private isEmpty(data: string): boolean {
if (data !== undefined && !data.replace(/\s/g, '').length) {
return true;
} else {
return false;
private isEmpty(data: string): boolean {
if (data !== undefined && !data.replace(/\s/g, '').length) {
return true;
} else {
return false;
}
}
}
private isNonEmpty(data: string): boolean {
if (data !== undefined && data != null) {
return true;
} else {
return false;
private isNonEmpty(data: string): boolean {
if (data !== undefined && data != null) {
return true;
} else {
return false;
}
}
}
}

@ -25,12 +25,11 @@ export class UsersManagersComponent implements OnInit {
public message: string;
public inviteDisableMessage: string;
public emailComposer: Function = (name, recipient, role):Email => {
return Composer.composeEmailForCommunityDashboard(name, recipient);
return Composer.composeEmailForCommunityDashboard(name, role, recipient);
}
private subscriptions: any[] = [];
constructor(private communityService: CommunityService,
private route: ActivatedRoute,
private title: Title) {
}
@ -43,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;

@ -4,24 +4,36 @@ import {ActivatedRoute} from "@angular/router";
import {CommunityService} from "../../../openaireLibrary/connect/community/community.service";
import {Subscriber} from "rxjs";
import {CommunityInfo} from "../../../openaireLibrary/connect/community/communityInfo";
import {Email} from "../../../openaireLibrary/utils/email/email";
import {Composer} from "../../../openaireLibrary/utils/email/composer";
import {properties} from "../../../../environments/environment";
@Component({
selector: 'users-subscribers',
template: `
<subscribers [id]="community.communityId" [type]="'community'" [name]="community.shortTitle"
<subscribers *ngIf="community.isOpen()" [id]="community.communityId" [type]="'community'" [name]="community.shortTitle"
[inviteDisableMessage]="inviteDisableMessage">
<users-tabs tab="member"></users-tabs>
</subscribers>
<role-users *ngIf="!community.isOpen()" [id]="community.communityId" [type]="community.type" [name]="community.shortTitle" [inviteDisableMessage]="inviteDisableMessage"
[link]="link" [role]="'member'"
[message]="message" [emailComposer]="emailComposer">
<users-tabs tab="member"></users-tabs>
</role-users>
`
})
export class UsersSubscribersComponent implements OnInit {
public community: CommunityInfo;
public link: string;
public loading: boolean;
public message: string;
public inviteDisableMessage: string;
public emailComposer: Function = (name, recipient, role):Email => {
return Composer.composeEmailForCommunityDashboard(name, role, recipient);
}
private subscriptions: any[] = [];
constructor(private communityService: CommunityService,
private route: ActivatedRoute,
private title: Title) {
}
@ -30,9 +42,12 @@ export class UsersSubscribersComponent implements OnInit {
this.subscriptions.push(this.communityService.getCommunityAsObservable().subscribe(community => {
if(community) {
this.community = community;
this.title.setTitle(this.community.shortTitle.toUpperCase() + " | Subscribers");
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."
this.title.setTitle(this.community.shortTitle.toUpperCase() + " | Members");
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.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;
}
@ -46,4 +61,8 @@ export class UsersSubscribersComponent implements OnInit {
}
});
}
private getURL(id: string): string {
return 'https://' + (properties.environment !== "production"?'beta.':'') + id + ".openaire.eu?verify=";
}
}

@ -5,11 +5,12 @@ import {LoadingModule} from "../../../openaireLibrary/utils/loading/loading.modu
import {RouterModule} from "@angular/router";
import {SubscribersModule} from "../../../openaireLibrary/dashboard/users/subscribers/subscribers.module";
import {UsersTabsModule} from '../users-tabs.module';
import {RoleUsersModule} from "../../../openaireLibrary/dashboard/users/role-users/role-users.module";
@NgModule({
imports: [CommonModule, LoadingModule, RouterModule.forChild([
{path: '', component: UsersSubscribersComponent}
]), SubscribersModule, UsersTabsModule],
]), SubscribersModule, UsersTabsModule, RoleUsersModule],
declarations: [UsersSubscribersComponent],
exports: [UsersSubscribersComponent]
})

@ -194,7 +194,7 @@ export class AddZenodoCommunitiesComponent implements OnInit {
public getOpenaireId(community: any): string {
for (let com of this.selectedCommunities) {
if (com.id == community.id) {
return com.openaireId;
return com.id;
}
}
return null;

@ -88,7 +88,7 @@ export class ManageZenodoCommunitiesComponent implements OnInit, OnDestroy {
}
public confirmedDeleteCommunity(data: any) {
this.subscriptions.push(this._manageZenodoCommunitiesService.removeZCommunity(this.properties, this.community.communityId, this.selectedToDelete.openaireId).subscribe(
this.subscriptions.push(this._manageZenodoCommunitiesService.removeZCommunity(this.properties, this.community.communityId, this.selectedToDelete.id).subscribe(
data => {
var pos = -1;
for (var i = 0; i < this.selectedCommunities.length; i++) {

@ -3,8 +3,6 @@ import {ActivatedRoute, Router} from '@angular/router';
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
import {ZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
import {SearchZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service';
import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
import {CommunityInfo} from '../../openaireLibrary/connect/community/communityInfo';
import {ZenodoCommunityInfo} from '../../openaireLibrary/connect/zenodoCommunities/zenodoCommunityInfo';
@ -50,8 +48,7 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
constructor(private element: ElementRef, private route: ActivatedRoute, private _router: Router,
private _zenodoCommunitieService: ZenodoCommunitiesService, private title: Title,
private _communityService: CommunityService,
private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService) {
private _communityService: CommunityService) {
}
ngOnInit() {
@ -65,8 +62,7 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
this.masterZenodoCommunityId = this.community.zenodoCommunity;
if (this.masterZenodoCommunityId) {
this.subscriptions.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties,
this.properties.zenodoCommunities + this.masterZenodoCommunityId,
null).subscribe(
this.masterZenodoCommunityId).subscribe(
result => {
this.masterZenodoCommunity = result;
this.selectedCommunities.unshift(this.masterZenodoCommunity);
@ -81,25 +77,24 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
}
this.zenodoSearchUtils.status = this.errorCodes.LOADING;
this.zenodoSearchUtils.status = this.errorCodes.LOADING;
this._searchZenodoCommunitiesService.searchZCommunities(this.properties, this.community.communityId).subscribe(
result => {
this.selectedCommunityIds = result;
// 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]['zenodoid'],
this.selectedCommunityIds[i]['id']);
this.selectedCommunityIds[i]);
}
},
error => {
console.log('list of zenodo communities couldn\'t be loaded');
this.zenodoSearchUtils.status = this.errorCodes.DONE;
}
);
// },
// error => {
// console.log('list of zenodo communities couldn\'t be loaded');
// this.zenodoSearchUtils.status = this.errorCodes.DONE;
// }
// );
})
);
@ -116,9 +111,9 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
});
}
getZenodoCommunityById(zenodoid, openaireId) {
getZenodoCommunityById(zenodoid) {
this.subscriptions.push(this._zenodoCommunitieService.getZenodoCommunityById(this.properties,
this.properties.zenodoCommunities + zenodoid, openaireId).subscribe(
zenodoid).subscribe(
result => {
this.selectedCommunities.push(result);
this.zenodocommunitiesloadedCount++;
@ -131,7 +126,6 @@ export class ZenodoCommunitiesComponent implements OnInit, OnDestroy {
error => {
const emptyCommunity: ZenodoCommunityInfo = new ZenodoCommunityInfo();
emptyCommunity.id = zenodoid;
emptyCommunity.openaireId = openaireId;
emptyCommunity.title = zenodoid;
this.selectedCommunities.push(emptyCommunity);
this.zenodocommunitiesloadedCount++;

@ -5,7 +5,6 @@ import {RouterModule} from '@angular/router';
import {ManageZenodoCommunitiesComponent} from './manage-zenodo-communities.component';
import {AddZenodoCommunitiesComponent} from './add-zenodo-communities.component';
import {ZenodoCommunitiesComponent} from './zenodo-communities.component';
import {SearchZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunitiesService.module';
import {ManageZenodoCommunitiesService} from '../../services/manageZenodoCommunities.service';
import {ZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communitiesService.module';
import {AlertModalModule} from '../../openaireLibrary/utils/modal/alertModal.module';
@ -22,7 +21,7 @@ import {PagingModule} from "../../openaireLibrary/utils/paging.module";
@NgModule({
imports: [
CommonModule, FormsModule, RouterModule, SearchZenodoCommunitiesServiceModule, ZenodoCommunitiesServiceModule,
CommonModule, FormsModule, RouterModule, ZenodoCommunitiesServiceModule,
AlertModalModule, ZenodoCommunitiesRoutingModule, PageContentModule, SearchInputModule, IconsModule, NoLoadPaging, LoadingModule, FullScreenModalModule, HTMLToStringPipeModule, PagingModule
],
declarations: [

@ -11,7 +11,7 @@ export class ManageCommunityContentProvidersService {
removeContentProvider(properties: EnvProperties, pid: string, id: string): any {
let headers = new HttpHeaders({'Content-Type': 'application/json', 'accept': 'application/json'});
let url = properties.communityAPI + pid + '/contentproviders';
let url = properties.communityAPI + pid + '/contentproviders?contentproviderId=' +id;
return this.http.request('delete', url, {body: id, headers: headers});
}

@ -12,9 +12,9 @@ export class ManageCommunityProjectsService {
let headers = new HttpHeaders({'Content-Type': 'application/json', 'accept': 'application/json'});
let url = properties.communityAPI+pid+"/projects";
let url = properties.communityAPI+pid+"/projects?projectId="+id;
//return this.http.delete(url, options)
return this.http.request('delete', url, { body: id, headers: headers})
return this.http.request('delete', url, { headers: headers})
}
addProject(properties:EnvProperties, pid: string, project: any) {

@ -11,10 +11,10 @@ export class ManageZenodoCommunitiesService {
//let options = new RequestOptions({headers: headers, body: id});
let headers = new HttpHeaders({'Content-Type': 'application/json', 'accept': 'application/json'});
let url = properties.communityAPI + pid + "/zenodocommunities";
let url = properties.communityAPI + pid + "/zenodocommunities?zenodocommunity="+id;
//return this.http.delete(url, options);
return this.http.request('delete', url, { body: id, headers: headers})
return this.http.request('delete', url, { headers: headers})
}
addZCommunity(properties:EnvProperties, pid: string,zenodoid: string) {
@ -23,13 +23,9 @@ export class ManageZenodoCommunitiesService {
let headers = new HttpHeaders({'Content-Type': 'application/json'});
let url = properties.communityAPI+pid+"/zenodocommunities";
var zCommunity: any = {
"communityId": pid,
let url = properties.communityAPI+pid+"/zenodocommunities?zenodocommunity="+zenodoid;
"zenodoid": zenodoid
};
return this.http.post<any>(url, JSON.stringify(zCommunity), {headers: headers});
return this.http.post<any>(url, headers);
//.map(res => <any> res.json())
}

@ -1 +1 @@
Subproject commit d8e7e5439fbd606301b51fdd5ed5115d9ad75c22
Subproject commit 3b437aafda7a716a0a89785a106456cbe520dce3

@ -1 +1 @@
Subproject commit 64c5ed3d459df4947b0ab93917960c7fb8d1e507
Subproject commit 99ab54cdd7b973a2ba047f0a6b37667270b58439

@ -1,91 +1,14 @@
import {EnvProperties} from '../app/openaireLibrary/utils/properties/env-properties';
import {common, commonBeta, commonProd} from "../app/openaireLibrary/utils/properties/environments/environment";
export let properties: EnvProperties = {
environment: "beta",
dashboard: 'connect',
let props: EnvProperties = {
isDashboard: true,
adminToolsPortalType: "community",
enablePiwikTrack: false,
useCache: false,
framesAPIURL: "https://beta.openaire.eu/stats3/",
claimsAPIURL: "https://beta.services.openaire.eu/claims/rest/claimsService/",
statisticsAPIURL: "https://beta.services.openaire.eu/stats-api/",
statisticsFrameAPIURL: "https://beta.openaire.eu/stats/",
statisticsFrameNewAPIURL: "https://stats.madgik.di.uoa.gr/stats-api/",
useNewStatistisTool: true,
searchAPIURLLAst: "https://beta.services.openaire.eu/search/v2/api/",
searchResourcesAPIURL: "https://beta.services.openaire.eu/search/v2/api/resources",
openCitationsAPIURL: "https://services.openaire.eu/opencitations/getCitations?id=",
csvAPIURL: "https://beta.services.openaire.eu/search/v2/api/reports",
searchCrossrefAPIURL: "https://api.crossref.org/works",
searchDataciteAPIURL: "https://api.datacite.org/works",
searchOrcidURL: "https://pub.orcid.org/",
orcidURL: "https://orcid.org/",
doiURL: "https://dx.doi.org/",
cordisURL: "http://cordis.europa.eu/projects/",
openDoarURL: "http://v2.sherpa.ac.uk/id/repository/",
r3DataURL: "http://service.re3data.org/repository/",
sherpaURL: "http://www.sherpa.ac.uk/romeo/search.php?issn=",
zenodo: "https://zenodo.org/",
zenodoCommunities: "https://zenodo.org/api/communities/",
openAccess: "https://www.openaire.eu/support/faq#article-id-234",
openAccessRepo: "https://www.openaire.eu/support/faq#article-id-310",
fp7Guidlines: "https://www.openaire.eu/open-access-in-fp7-seventh-research-framework-programme",
h2020Guidlines: "https://www.openaire.eu/oa-publications/h2020/open-access-in-horizon-2020",
ercGuidlines: "http://erc.europa.eu/sites/default/files/document/file/ERC_Open_Access_Guidelines-revised_2014.pdf",
helpdesk: "https://www.openaire.eu/support/helpdesk",
helpdeskEmail: "helpdesk@openaire.eu",
utilsService: "https://demo.openaire.eu/utils-service",
vocabulariesAPI: "https://beta.services.openaire.eu/provision/mvc/vocabularies/",
piwikBaseUrl: " https://analytics.openaire.eu/piwik.php?idsite=6",
registryUrl: 'https://beta.services.openaire.eu/uoa-user-management/api/registry/',
loginUrl: "https://beta.services.openaire.eu/login-service/openid_connect_login",
userInfoUrl: "https://beta.services.openaire.eu/login-service/userInfo",
logoutUrl: "https://beta.services.openaire.eu/login-service/openid_logout",
cookieDomain: ".openaire.eu",
feedbackmail: "feedback@openaire.eu",
feedbackmailForMissingEntities: "feedback@openaire.eu",
cacheUrl: "https://demo.openaire.eu/cache/get?url=",
deleteCacheUrl: 'https://demo.openaire.eu/cache/clear',
deleteBrowserCacheUrl: 'https://beta.services.openaire.eu/uoa-admin-tools/cache',
adminToolsAPIURL: "https://beta.services.openaire.eu/uoa-admin-tools/",
adminToolsCommunity: "openaire",
communityAPI: "https://beta.services.openaire.eu/openaire/community/",
miningBackendURL: "https://beta.services.openaire.eu/interactive-mining",
csvLimit: 2000,
pagingLimit: 20,
resultsPerPage: 10,
baseLink: "",
domain: "https://beta.admin.connect.openaire.eu/",
baseOpenaireLink: "https://beta.explore.openaire.eu",
searchLinkToPublication: "/search/publication?articleId=",
searchLinkToProject: "/search/project?projectId=",
searchLinkToDataProvider: "/search/dataprovider?datasourceId=",
searchLinkToDataset: "/search/dataset?datasetId=",
searchLinkToOrganization: "/search/organization?organizationId=",
searchLinkToPublications: "/search/find/publications",
searchLinkToDataProviders: "/search/find/dataproviders",
searchLinkToProjects: "/search/find/projects",
searchLinkToDatasets: "/search/find/datasets",
searchLinkToSoftware: "/search/find/software",
searchLinkToOrganizations: "/search/find/organizations",
searchLinkToCompatibleDataProviders: "/search/content-providers",
searchLinkToEntityRegistriesDataProviders: "/search/entity-registries",
searchLinkToJournals: "/search/journals",
searchLinkToAdvancedPublications: "/search/advanced/publications",
searchLinkToAdvancedProjects: "/search/advanced/projects",
searchLinkToAdvancedDatasets: "/search/advanced/datasets",
searchLinkToAdvancedSoftware: "/search/advanced/software",
searchLinkToAdvancedDataProviders: "/search/advanced/dataproviders",
searchLinkToAdvancedOrganizations: "/search/advanced/organizations",
lastIndexInformationLink: "https://beta.openaire.eu/aggregation-and-content-provision-workflows",
showLastIndexInformationLink: false,
widgetLink: "https://beta.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=",
claimsInformationLink: "https://beta.openaire.eu/linking",
lastIndexUpdate: "2020-05-06",
indexInfoAPI: "https://beta.services.openaire.eu/openaire/info/",
admins: ["rcd@openaire.eu"],
adminPortalURL: "https://beta.admin.connect.openaire.eu",
errorLink: '/error',
connectPortalUrl: 'https://beta.connect.openaire.eu'
domain:'https://beta.admin.connect.openaire.eu'
};
export let properties: EnvProperties = {
...common, ...commonBeta, ...props
}

@ -1,91 +1,15 @@
import {EnvProperties} from '../app/openaireLibrary/utils/properties/env-properties';
import {common, commonProd} from "../app/openaireLibrary/utils/properties/environments/environment";
let props: EnvProperties = {
export let properties: EnvProperties = {
environment:"production",
dashboard: 'connect',
isDashboard: true,
adminToolsPortalType: "community",
enablePiwikTrack: false,
useCache: false,
framesAPIURL: "https://www.openaire.eu/stats3/",
claimsAPIURL: "https://services.openaire.eu/claims/rest/claimsService/",
statisticsAPIURL: "https://beta.services.openaire.eu/stats-api/",
statisticsFrameAPIURL:"https://www.openaire.eu/stats/",
statisticsFrameNewAPIURL: "http://marilyn.athenarc.gr:8080/stats-api/",
useNewStatistisTool:false,
searchAPIURLLAst: "https://services.openaire.eu/search/v2/api/",
searchResourcesAPIURL: "https://services.openaire.eu/search/v2/api/resources",
openCitationsAPIURL: "https://services.openaire.eu/opencitations/getCitations?id=",
csvAPIURL: "https://services.openaire.eu/search/v2/api/reports",
searchCrossrefAPIURL: "https://api.crossref.org/works",
searchDataciteAPIURL: "https://api.datacite.org/works",
searchOrcidURL: "https://pub.orcid.org/",
orcidURL: "https://orcid.org/",
doiURL: "https://dx.doi.org/",
cordisURL: "http://cordis.europa.eu/projects/",
openDoarURL: "http://v2.sherpa.ac.uk/id/repository/",
r3DataURL: "http://service.re3data.org/repository/",
sherpaURL: "http://www.sherpa.ac.uk/romeo/search.php?issn=",
zenodo: "https://zenodo.org/",
zenodoCommunities: "https://zenodo.org/api/communities/",
openAccess: "https://www.openaire.eu/support/faq#article-id-234",
openAccessRepo: "https://www.openaire.eu/support/faq#article-id-310",
fp7Guidlines: "https://www.openaire.eu/open-access-in-fp7-seventh-research-framework-programme",
h2020Guidlines: "https://www.openaire.eu/oa-publications/h2020/open-access-in-horizon-2020",
ercGuidlines: "http://erc.europa.eu/sites/default/files/document/file/ERC_Open_Access_Guidelines-revised_2014.pdf",
helpdesk: "https://www.openaire.eu/support/helpdesk",
helpdeskEmail: "helpdesk@openaire.eu",
utilsService: "https://explore.openaire.eu/utils-service",
vocabulariesAPI:"https://services.openaire.eu/provision/mvc/vocabularies/",
piwikBaseUrl:" https://analytics.openaire.eu/piwik.php?idsite=6",
loginUrl: "https://services.openaire.eu/login-service/openid_connect_login",
registryUrl: 'https://services.openaire.eu/uoa-user-management/api/registry/',
userInfoUrl: "https://services.openaire.eu/login-service/userInfo",
logoutUrl: "https://services.openaire.eu/login-service/openid_logout",
cookieDomain:".openaire.eu",
feedbackmail:"openaire.test@gmail.com",
feedbackmailForMissingEntities: "feedback@openaire.eu",
cacheUrl:"https://explore.openaire.eu/cache/get?url=",
deleteCacheUrl: 'https://explore.openaire.eu/cache/clear',
deleteBrowserCacheUrl: 'https://services.openaire.eu/uoa-admin-tools/cache',
adminToolsAPIURL:"https://services.openaire.eu/uoa-admin-tools/",
adminToolsCommunity:"openaire",
communityAPI: "https://services.openaire.eu/openaire/community/",
miningBackendURL: "https://beta.services.openaire.eu/interactive-mining",
csvLimit: 2000,
pagingLimit: 20,
resultsPerPage: 10,
baseLink: "",
domain: "https://admin.explore.openaire.eu/",
baseOpenaireLink: "https://explore.openaire.eu",
searchLinkToPublication: "/search/publication?articleId=",
searchLinkToProject: "/search/project?projectId=",
searchLinkToDataProvider: "/search/dataprovider?datasourceId=",
searchLinkToDataset: "/search/dataset?datasetId=",
searchLinkToOrganization: "/search/organization?organizationId=",
searchLinkToPublications: "/search/find/publications",
searchLinkToDataProviders: "/search/find/dataproviders",
searchLinkToProjects: "/search/find/projects",
searchLinkToDatasets: "/search/find/datasets",
searchLinkToSoftware: "/search/find/software",
searchLinkToOrganizations: "/search/find/organizations",
searchLinkToCompatibleDataProviders: "/search/content-providers",
searchLinkToEntityRegistriesDataProviders: "/search/entity-registries",
searchLinkToJournals: "/search/journals",
searchLinkToAdvancedPublications: "/search/advanced/publications",
searchLinkToAdvancedProjects: "/search/advanced/projects",
searchLinkToAdvancedDatasets: "/search/advanced/datasets",
searchLinkToAdvancedSoftware: "/search/advanced/software",
searchLinkToAdvancedDataProviders: "/search/advanced/dataproviders",
searchLinkToAdvancedOrganizations: "/search/advanced/organizations",
lastIndexInformationLink: "https://www.openaire.eu/aggregation-and-content-provision-workflows",
showLastIndexInformationLink: false,
widgetLink: "https://www.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=",
claimsInformationLink: "https://www.openaire.eu/linking",
lastIndexUpdate: "2020-12-17",
indexInfoAPI: "https://services.openaire.eu/openaire/info/",
admins: ["rcd@openaire.eu"],
adminPortalURL: "https://admin.connect.openaire.eu",
errorLink: '/error',
connectPortalUrl: 'https://connect.openaire.eu'
domain:'https://admin.connect.openaire.eu',
};
export let properties: EnvProperties = {
...common, ...commonProd, ...props
}

@ -4,93 +4,19 @@
// The list of which env maps to which file can be found in `.angular-cli.json`.
import {EnvProperties} from '../app/openaireLibrary/utils/properties/env-properties';
import {common, commonDev, commonProd} from "../app/openaireLibrary/utils/properties/environments/environment";
let props: EnvProperties = {
export let properties: EnvProperties = {
environment: 'development',
dashboard: 'connect',
isDashboard: true,
adminToolsPortalType: "community",
enablePiwikTrack: false,
useCache: false,
framesAPIURL: 'https://beta.openaire.eu/stats3/',
claimsAPIURL: 'http://scoobydoo.di.uoa.gr:8080/dnet-claims-service-2.0.0-SNAPSHOT/rest/claimsService/',
statisticsAPIURL: 'https://beta.services.openaire.eu/stats-api/',
statisticsFrameAPIURL: 'https://beta.openaire.eu/stats/',
statisticsFrameNewAPIURL: "https://stats.madgik.di.uoa.gr/stats-api/",
useNewStatistisTool: true,
searchAPIURLLAst: 'https://beta.services.openaire.eu/search/v2/api/',
searchResourcesAPIURL: 'https://beta.services.openaire.eu/search/v2/api/resources',
openCitationsAPIURL: 'https://services.openaire.eu/opencitations/getCitations?id=',
csvAPIURL: 'http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/reports',
searchCrossrefAPIURL: 'https://api.crossref.org/works',
searchDataciteAPIURL: 'https://api.datacite.org/works',
searchOrcidURL: 'https://pub.orcid.org/',
orcidURL: 'https://orcid.org/',
doiURL: 'https://dx.doi.org/',
cordisURL: 'http://cordis.europa.eu/projects/',
openDoarURL: 'http://v2.sherpa.ac.uk/id/repository/',
r3DataURL: 'http://service.re3data.org/repository/',
sherpaURL: 'http://www.sherpa.ac.uk/romeo/search.php?issn=',
zenodo: 'https://zenodo.org/',
zenodoCommunities: 'https://zenodo.org/api/communities/',
openAccess: 'https://www.openaire.eu/support/faq#article-id-234',
openAccessRepo: 'https://www.openaire.eu/support/faq#article-id-310',
fp7Guidlines: 'https://www.openaire.eu/open-access-in-fp7-seventh-research-framework-programme',
h2020Guidlines: 'https://www.openaire.eu/oa-publications/h2020/open-access-in-horizon-2020',
ercGuidlines: 'http://erc.europa.eu/sites/default/files/document/file/ERC_Open_Access_Guidelines-revised_2014.pdf',
helpdesk: 'https://www.openaire.eu/support/helpdesk',
helpdeskEmail: 'helpdesk@openaire.eu',
utilsService: 'http://mpagasas.di.uoa.gr:8000',
vocabulariesAPI: 'https://beta.services.openaire.eu/provision/mvc/vocabularies/',
piwikBaseUrl: ' https://analytics.openaire.eu/piwik.php?idsite=6',
registryUrl: 'http://mpagasas.di.uoa.gr:8080/dnet-openaire-users-1.0.0-SNAPSHOT/api/registry/',
loginUrl: "http://mpagasas.di.uoa.gr:19080/login-service/openid_connect_login",
userInfoUrl: "http://mpagasas.di.uoa.gr:19080/login-service/userInfo",
logoutUrl: "http://mpagasas.di.uoa.gr:19080/login-service/openid_logout",
cookieDomain: '.di.uoa.gr',
feedbackmail: 'openaire.test@gmail.com',
feedbackmailForMissingEntities: 'feedback@openaire.eu',
cacheUrl: 'http://scoobydoo.di.uoa.gr:3000/get?url=',
// deleteCacheUrl: 'http://duffy.di.uoa.gr:3000/clear',
// deleteBrowserCacheUrl: 'http://duffy.di.uoa.gr:19280/uoa-admin-tools/cache',
adminToolsAPIURL: 'http://duffy.di.uoa.gr:19280/uoa-admin-tools/',
adminToolsCommunity: 'openaire',
communityAPI: 'https://dev-openaire.d4science.org/openaire/community/',
miningBackendURL: 'https://beta.services.openaire.eu/interactive-mining',
csvLimit: 2000,
pagingLimit: 20,
resultsPerPage: 10,
baseLink: "",
connectPortalUrl: 'http://scoobydoo.di.uoa.gr:4200',
domain:'https://beta.admin.connect.openaire.eu',
baseOpenaireLink: 'https://beta.explore.openaire.eu',
searchLinkToPublication: '/search/publication?articleId=',
searchLinkToProject: '/search/project?projectId=',
searchLinkToDataProvider: '/search/dataprovider?datasourceId=',
searchLinkToDataset: '/search/dataset?datasetId=',
searchLinkToOrganization: '/search/organization?organizationId=',
searchLinkToPublications: '/search/find/publications',
searchLinkToDataProviders: '/search/find/dataproviders',
searchLinkToProjects: '/search/find/projects',
searchLinkToDatasets: '/search/find/datasets',
searchLinkToSoftware: '/search/find/software',
searchLinkToOrganizations: '/search/find/organizations',
searchLinkToCompatibleDataProviders: '/search/content-providers',
searchLinkToEntityRegistriesDataProviders: '/search/entity-registries',
searchLinkToJournals: '/search/journals',
searchLinkToAdvancedPublications: '/search/advanced/publications',
searchLinkToAdvancedProjects: '/search/advanced/projects',
searchLinkToAdvancedDatasets: '/search/advanced/datasets',
searchLinkToAdvancedSoftware: '/search/advanced/software',
searchLinkToAdvancedDataProviders: '/search/advanced/dataproviders',
searchLinkToAdvancedOrganizations: '/search/advanced/organizations',
lastIndexInformationLink: 'https://www.openaire.eu/aggregation-and-content-provision-workflows',
showLastIndexInformationLink: false,
widgetLink: 'https://beta.openaire.eu/index.php?option=com_openaire&view=widget&format=raw&projectId=',
claimsInformationLink: 'https://www.openaire.eu/linking-beta',
lastIndexUpdate: '2019-05-16',
indexInfoAPI: 'http://beta.services.openaire.eu/openaire/info/',
admins: ['kostis30fylloy@gmail.com'],
adminPortalURL: 'https://beta.admin.connect.openaire.eu',
errorLink: '/error',
connectPortalUrl: 'http://scoobydoo.di.uoa.gr:4200'
};
export let properties: EnvProperties = {
...common, ...commonDev, ...props
}

@ -1,5 +1,5 @@
@use "sass:meta";
@import "~interactiveminingv3/assets/css/variables.css";
@import "node_modules/interactiveminingv3/assets/css/variables.css";
.mining {

@ -7,8 +7,6 @@ import {
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: any;
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
@ -16,7 +14,3 @@ getTestBed().initTestEnvironment(
teardown: { destroyAfterEach: false }
}
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

@ -10,13 +10,14 @@
"moduleResolution": "node",
"experimentalDecorators": true,
"importHelpers": true,
"target": "es2020",
"target": "ES2022",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2018",
"dom"
]
],
"useDefineForClassFields": false
}
}

Loading…
Cancel
Save