diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 7ebf4f7..936c870 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 7ebf4f7f9054c2119d5e3d1eb07d3cb0d52a8aeb +Subproject commit 936c870abcb48b632f3a1433130e8701c813fa65 diff --git a/src/app/pages/affiliations/affiliations.component.html b/src/app/pages/affiliations/affiliations.component.html index cae7adb..54b4486 100644 --- a/src/app/pages/affiliations/affiliations.component.html +++ b/src/app/pages/affiliations/affiliations.component.html @@ -1,83 +1,100 @@ -
+
- -
- - - - - - - - +
+
+
Admin Dashboard - Manage Organizations +
+

{{community.shortTitle}}

+
+
-
- +
+ +
-
-
-
No organizations found
+
+
+
-
- - -
-
-
-
-
- +
+
+
No organizations found
+
+
+ + +
+
+
+
+
+
+ +
+
{{affiliation.name}}
+ +
-
-
{{affiliation.name}}
- URL: {{affiliation.website_url}} -
-
-
-
+
+ + +
- -
-
-
-
-
+
+
+
+
- + diff --git a/src/app/pages/affiliations/affiliations.component.ts b/src/app/pages/affiliations/affiliations.component.ts index 29e0c9c..011ac0e 100644 --- a/src/app/pages/affiliations/affiliations.component.ts +++ b/src/app/pages/affiliations/affiliations.component.ts @@ -13,8 +13,8 @@ import {Page} from "../../openaireLibrary/utils/entities/adminTool/page"; import {FormBuilder, FormGroup, Validators} from "@angular/forms"; import {Subscription} from "rxjs"; import {CommunityService} from "../../openaireLibrary/connect/community/community.service"; - -declare var UIkit; +import {CommunityInfo} from "../../openaireLibrary/connect/community/communityInfo"; +import {NotificationHandler} from "../../openaireLibrary/utils/notification-handler"; @Component({ selector: 'affiliations', @@ -26,11 +26,12 @@ export class AffiliationsComponent implements OnInit, OnDestroy { public index = 0; public affiliations: Affiliation[]; public affiliationFb: FormGroup; - public communityId: string; + public community: CommunityInfo; public organizationsPage: Page; public page: number = 1; public pageSize: number = 10; private subs: any[] = []; + public stickyPageHeader: boolean = false; @ViewChild('affiliationModal') affiliationModal: AlertModal; @ViewChild('removeAffiliationModal') removeAffiliationModal: AlertModal; @@ -46,11 +47,13 @@ export class AffiliationsComponent implements OnInit, OnDestroy { ngOnInit() { this.loading = true; - this.subs.push(this.route.params.subscribe(params => { - this.communityId = params['community']; - this.title.setTitle(this.communityId.toUpperCase() + ' | Organizations'); - this.getAffiliations(); - this.organizationsPageStatus(); + this.subs.push(this.communityService.getCommunityAsObservable().subscribe( community => { + this.community = community; + if (this.community) { + this.title.setTitle(this.community.shortTitle.toUpperCase() + ' | Organizations'); + this.getAffiliations(); + this.organizationsPageStatus(); + } })); } @@ -64,14 +67,14 @@ export class AffiliationsComponent implements OnInit, OnDestroy { getAffiliations() { this.loading = true; - this.affiliationService.initAffiliations(this.communityId); + this.affiliationService.initAffiliations(this.community.communityId); this.affiliationService.affiliations.subscribe( affiliations => { this.affiliations = affiliations; this.loading = false; }, error => { - console.error("Affiliations Component: Error getting affiliations for community with id: " + this.communityId, error); + console.error("Affiliations Component: Error getting affiliations for community with id: " + this.community.communityId, error); this.loading = false; } ); @@ -86,7 +89,7 @@ export class AffiliationsComponent implements OnInit, OnDestroy { this.index = index; if (index === -1) { affiliation = new Affiliation(); - affiliation.communityId = this.communityId; + affiliation.communityId = this.community.communityId; this.affiliationModal.alertTitle = 'Add Organization'; this.affiliationModal.okButtonText = 'Add'; } else { @@ -135,7 +138,7 @@ export class AffiliationsComponent implements OnInit, OnDestroy { editAffiliation() { this.loading = true; - this.affiliationService.updateAffiliation(this.properties.communityAPI + this.communityId + '/organizations', + this.affiliationService.updateAffiliation(this.properties.communityAPI + this.community.communityId + '/organizations', this.affiliationFb.value).subscribe((affiliation) => { if (affiliation) { if (this.index === -1) { @@ -158,7 +161,7 @@ export class AffiliationsComponent implements OnInit, OnDestroy { removeAffiliation() { this.loading = true; - this.affiliationService.deleteAffiliation(this.properties.communityAPI + this.communityId + '/organizations', + this.affiliationService.deleteAffiliation(this.properties.communityAPI + this.community.communityId + '/organizations', this.affiliations[this.index].id).subscribe((deleteOK) => { this.affiliations.splice(this.index, 1); if (this.currentPage.length === 0) { @@ -172,37 +175,25 @@ export class AffiliationsComponent implements OnInit, OnDestroy { } private organizationsPageStatus() { - this.helpContentService.getCommunityPagesByRoute(this.communityId, '/organizations', this.properties.adminToolsAPIURL).subscribe((page) => { + this.helpContentService.getCommunityPagesByRoute(this.community.communityId, '/organizations', this.properties.adminToolsAPIURL).subscribe((page) => { this.organizationsPage = page; }) } handleUpdateError(message: string) { - UIkit.notification(message, { - status: 'danger', - timeout: 6000, - pos: 'bottom-right' - }); + NotificationHandler.rise(message, "danger"); this.loading = false; } handleUpdateSuccess(message) { - UIkit.notification(message, { - status: 'success', - timeout: 6000, - pos: 'bottom-right' - }); + NotificationHandler.rise(message); this.loading = false; } enableAffiliations() { - this.helpContentService.togglePages(this.communityId, [this.organizationsPage._id], true, this.properties.adminToolsAPIURL).subscribe(() => { + this.helpContentService.togglePages(this.community.communityId, [this.organizationsPage._id], true, this.properties.adminToolsAPIURL).subscribe(() => { this.organizationsPage.isEnabled = true; - UIkit.notification('Organizations Page has been enabled successfully', { - status: 'success', - timeout: 6000, - pos: 'bottom-right' - }); + NotificationHandler.rise('Organizations Page has been enabled successfully'); }, error => { this.handleUpdateError('An error has been occurred. Try again later!'); }); diff --git a/src/app/pages/affiliations/affiliations.module.ts b/src/app/pages/affiliations/affiliations.module.ts index 9e4deea..6dd1d69 100644 --- a/src/app/pages/affiliations/affiliations.module.ts +++ b/src/app/pages/affiliations/affiliations.module.ts @@ -19,11 +19,12 @@ import {NoLoadPaging} from "../../openaireLibrary/searchPages/searchUtils/no-loa import {LoadingModule} from "../../openaireLibrary/utils/loading/loading.module"; import {UrlPrefixModule} from "../../openaireLibrary/utils/pipes/url-prefix.module"; import {HelpContentService} from "../../services/help-content.service"; +import {PagingModule} from "../../openaireLibrary/utils/paging.module"; @NgModule({ imports: [ AffiliationsRoutingModule, CommonModule, FormsModule, RouterModule, - AlertModalModule, ReactiveFormsModule, InputModule, PageContentModule, CommunityInfoModule, IconsModule, NoLoadPaging, LoadingModule, UrlPrefixModule + AlertModalModule, ReactiveFormsModule, InputModule, PageContentModule, CommunityInfoModule, IconsModule, NoLoadPaging, LoadingModule, UrlPrefixModule, PagingModule ], declarations: [ AffiliationsComponent diff --git a/src/app/pages/manage-communities/manage-communities.component.ts b/src/app/pages/manage-communities/manage-communities.component.ts index cb1c3bc..e3019ac 100644 --- a/src/app/pages/manage-communities/manage-communities.component.ts +++ b/src/app/pages/manage-communities/manage-communities.component.ts @@ -42,38 +42,40 @@ type Tab = 'all' | 'communities' | 'ris'; placeholder="Search Communities" searchInputClass="outer" class="uk-width-1-3@xl uk-width-2-5@l uk-width-1-2@m uk-width-1-1 uk-flex uk-flex-right">
-
- -
-
-
-
-

Research Communities

-
- - - -
-
- No communities found +
+
+ +
+
+
+
+
No communities to manage yet
-
-

- No communities to manage yet -

-
-
-

Research Initiatives

-
- - - +
+
+

Research Communities

+
+ + + +
+
+ No communities found +
-
- No initiatives found +
+

Research Initiatives

+
+ + + +
+
+ No initiatives found +
diff --git a/src/app/pages/usernotifications/manage-user-notifications.component.html b/src/app/pages/usernotifications/manage-user-notifications.component.html index ec77f72..2013ccc 100644 --- a/src/app/pages/usernotifications/manage-user-notifications.component.html +++ b/src/app/pages/usernotifications/manage-user-notifications.component.html @@ -23,10 +23,10 @@
-
+
-
+
Notify me for any changes in the managers list
-
+
Notify me for new members
@@ -45,7 +45,7 @@

-
+
Notify me for any linking actions related to your community
diff --git a/src/app/pages/users/personal-info/personal-info.component.ts b/src/app/pages/users/personal-info/personal-info.component.ts index b0fb0fc..d2e5292 100644 --- a/src/app/pages/users/personal-info/personal-info.component.ts +++ b/src/app/pages/users/personal-info/personal-info.component.ts @@ -47,7 +47,10 @@ declare var UIkit;
-
+
+
+ +
@@ -86,17 +89,15 @@ declare var UIkit;
-
-
+
+
-
-
{{affiliation.value.name}}
- +
{{affiliation.value.name}}
+
@@ -116,7 +117,7 @@ declare var UIkit;
@@ -133,9 +134,6 @@ declare var UIkit;
-
- -