From 82c8c7f5ea9807f1d0cdc852216caffbac87ae85 Mon Sep 17 00:00:00 2001 From: "k.triantafyllou" Date: Tue, 28 Jun 2022 21:15:05 +0300 Subject: [PATCH] Finish UI of subscribers, managers, notification settings and personal info. Change claims property to dl170 for development --- package.json | 2 +- src/app/openaireLibrary | 2 +- .../manage-user-notifications.component.html | 116 ++++++------ .../manage-user-notifications.component.ts | 141 +++++++------- .../manage-user-notifications.module.ts | 7 +- ...onent.css => personal-info.component.less} | 11 +- .../personal-info/personal-info.component.ts | 173 +++++++++--------- .../users-managers.component.ts | 2 +- src/app/pages/users/users-routing.module.ts | 2 +- .../users-subscribers.component.ts | 23 ++- src/app/pages/users/users-tabs.component.ts | 6 +- src/assets/common-assets | 2 +- src/assets/dashboard-theme | 2 +- src/assets/openaire-theme | 2 +- src/environments/environment.ts | 2 +- 15 files changed, 256 insertions(+), 237 deletions(-) rename src/app/pages/users/personal-info/{personal-info.component.css => personal-info.component.less} (62%) diff --git a/package.json b/package.json index eb5fdd2..cb616b2 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,7 @@ "version": "1.0.0", "scripts": { "ng": "ng", - "start": "ng serve --host 0.0.0.0 --disable-host-check --port=5001", + "start": "ng serve --host 0.0.0.0 --disable-host-check --port=5000", "build": "ng build", "build-dev": "ng build --configuration=development", "build-beta": "ng build --configuration=beta", diff --git a/src/app/openaireLibrary b/src/app/openaireLibrary index 5e1fde7..9b5607f 160000 --- a/src/app/openaireLibrary +++ b/src/app/openaireLibrary @@ -1 +1 @@ -Subproject commit 5e1fde78411e2913c3757534a073ace32a4eacf2 +Subproject commit 9b5607fbd0204b44fb2c650df77fcb88f613fc2e diff --git a/src/app/pages/usernotifications/manage-user-notifications.component.html b/src/app/pages/usernotifications/manage-user-notifications.component.html index 309c5f4..1d973be 100644 --- a/src/app/pages/usernotifications/manage-user-notifications.component.html +++ b/src/app/pages/usernotifications/manage-user-notifications.component.html @@ -1,75 +1,73 @@ -
+
+
+
+
Admin Dashboard - Manage Notification Settings
+

{{community.shortTitle}}

+
+
-
-
-
- - -
Notifications settings
-
+
+
+ +
-
-
- -
Manage Notifications
-
-
-
- Notifications for manager list changes {{userNotifications.notifyForNewManagers ? '(Enabled)' : '(Disabled)'}}
- - +
+
+
+
+
+
+ Notify me for any changes in the managers list
+ + {{userNotifications.notifyForNewManagers?' Enabled':'Disabled'}} + +
+
+
+ Notify me for new members
+ + {{userNotifications.notifyForNewSubscribers?' Enabled':'Disabled'}} + +
+
+
-
Notifications for new - subscribers {{userNotifications.notifyForNewSubscribers ? '(Enabled)' : '(Disabled)'}}
- +
+ Notify me for any linking actions related to your community
+ + {{notification.notify?' Enabled':'Disabled'}}
-
-
-
-
Notify for - links - {{notification.notify ? '(Enabled)' : '(Disabled)'}}
- - -
-
-
- - - {{fr.label}} - - -
- +
+
Set Notification Frequency
+
+
-
- -
- +
+ +
+
diff --git a/src/app/pages/usernotifications/manage-user-notifications.component.ts b/src/app/pages/usernotifications/manage-user-notifications.component.ts index 6e42463..edfcc40 100644 --- a/src/app/pages/usernotifications/manage-user-notifications.component.ts +++ b/src/app/pages/usernotifications/manage-user-notifications.component.ts @@ -11,73 +11,79 @@ import {UserManagementService} from '../../openaireLibrary/services/user-managem import {Title} from '@angular/platform-browser'; import {CommunityService} from '../../openaireLibrary/connect/community/community.service'; import {properties} from '../../../environments/environment'; -import { Subscriber} from 'rxjs'; +import {Subscriber} from 'rxjs'; import {MailPrefsService} from '../../openaireLibrary/connect/userEmailPreferences/mailPrefs.service'; +import {CommunityInfo} from "../../openaireLibrary/connect/community/communityInfo"; +import {Option} from "../../openaireLibrary/sharedComponents/input/input.component"; declare var UIkit; + @Component({ selector: 'manage-user-notifications', templateUrl: './manage-user-notifications.component.html', }) export class ManageUserNotificationsComponent implements OnInit { - + @Input('group') myForm: FormGroup; - + public properties: EnvProperties = null; - public communityId; - public userNotifications:UserNotificationsRights = null; - public initialUserNotifications:UserNotificationsRights = null; + public community: CommunityInfo; + public userNotifications: UserNotificationsRights = null; + public initialUserNotifications: UserNotificationsRights = null; public notifications = null; public initialNotifications = []; public userEmail = null; - + public stickyPageHeader: boolean = false; public showLoading = true; public hasChanged = false; public user: User; private subscriptions = []; - - frequencyOptions = [{label:"Daily", value: 24}, {label:"Every two days", value: 48}, {label:"Weekly", value: 168}] + + frequencyOptions: Option[] = [{label: "Daily", value: 24}, {label: "Every two days", value: 48}, {label: "Weekly", value: 168}] + constructor(private route: ActivatedRoute, private _router: Router, public _fb: FormBuilder, private title: Title, - private _manageUserNotificationsService: ManageUserNotificationsService, - private element: ElementRef, private userManagementService: UserManagementService, private communityService: CommunityService, private _mailPrefsService: MailPrefsService,) { + private manageUserNotificationsService: ManageUserNotificationsService, + private element: ElementRef, private userManagementService: UserManagementService, + private communityService: CommunityService, + private mailPrefsService: MailPrefsService) { } - + ngOnInit() { - + this.properties = properties; HelperFunctions.scroll(); this.subscriptions.push(this.communityService.getCommunityAsObservable().subscribe(community => { - if(community) { - this.communityId =community.communityId; - this.title.setTitle( this.communityId.toUpperCase() + ' | User Notifications'); + if (community) { + this.community = community; + this.title.setTitle(this.community.shortTitle.toUpperCase() + ' | User Notifications'); this.showLoading = true; this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => { this.user = user; if (this.user) { this.userEmail = this.user.email; - this.subscriptions.push(this._manageUserNotificationsService.getUserNotifications(this.properties, this.communityId).subscribe( + this.subscriptions.push(this.manageUserNotificationsService.getUserNotifications(this.properties, this.community.communityId).subscribe( userNotifications => { this.initialUserNotifications = userNotifications; if (this.initialUserNotifications['notifyForNewManagers'] == null || this.initialUserNotifications['notifyForNewSubscribers'] == null) { - if(Session.isManager("community",this.communityId, this.user)) { + if (Session.isManager("community", this.community.communityId, this.user)) { this.initialUserNotifications = new UserNotificationsRights(true, true, ""); - }else{ + } else { this.initialUserNotifications = new UserNotificationsRights(false, false, ""); } } - + this.userNotifications = JSON.parse(JSON.stringify(this.initialUserNotifications)); this.getClaimsNotifications(); }, error => { if (error.status === 404) { - if(Session.isManager("community",this.communityId, this.user)) { + if (Session.isManager("community", this.community.communityId, this.user)) { this.initialUserNotifications = new UserNotificationsRights(true, true, ""); - }else{ + } else { this.initialUserNotifications = new UserNotificationsRights(false, false, ""); } this.userNotifications = JSON.parse(JSON.stringify(this.initialUserNotifications)); @@ -92,28 +98,38 @@ export class ManageUserNotificationsComponent implements OnInit { } })); } - getClaimsNotifications(){ - this.subscriptions.push(this._mailPrefsService.getUserEmailPreferencesForCommunity(this.communityId, this.properties.claimsAPIURL).subscribe( + + getClaimsNotifications() { + this.subscriptions.push(this.mailPrefsService.getUserEmailPreferencesForCommunity(this.community.communityId, this.properties.claimsAPIURL).subscribe( data => { - this.initialNotifications = data.data; - this.notifications = JSON.parse(JSON.stringify( this.initialNotifications )); + if (data.code != 204) { + this.initialNotifications = data.data; + } else { + if (Session.isManager("community", this.community.communityId, this.user)) { + this.initialNotifications = [{notify: true, frequency: 24, openaireId: this.community.communityId}]; + } else { + this.initialNotifications = [{notify: false, frequency: 24, openaireId: this.community.communityId}]; + } + } + this.notifications = JSON.parse(JSON.stringify(this.initialNotifications)); this.showLoading = false; }, err => { - if(err.status === 404) { - if(Session.isManager("community",this.communityId, this.user)) { - this.initialNotifications = [{notify: true, frequency:24, openaireId: this.communityId}]; - }else{ - this.initialNotifications = [{notify: false, frequency:24, openaireId: this.communityId}]; + if (err.status === 404) { + if (Session.isManager("community", this.community.communityId, this.user)) { + this.initialNotifications = [{notify: true, frequency: 24, openaireId: this.community.communityId}]; + } else { + this.initialNotifications = [{notify: false, frequency: 24, openaireId: this.community.communityId}]; } - this.notifications = JSON.parse(JSON.stringify( this.initialNotifications )); - }else{ - this.handleError("Error getting user email preferences for community with id: "+this.communityId, err); + this.notifications = JSON.parse(JSON.stringify(this.initialNotifications)); + } else { + this.handleError("Error getting user email preferences for community with id: " + this.community.communityId, err); } this.showLoading = false; } )); } + ngOnDestroy() { this.subscriptions.forEach(value => { if (value instanceof Subscriber) { @@ -121,47 +137,44 @@ export class ManageUserNotificationsComponent implements OnInit { } }); } - - + + public updateUserNotifications() { if (!Session.isLoggedIn()) { this._router.navigate(['/user-info'], {queryParams: {'errorCode': LoginErrorCodes.NOT_VALID, 'redirectUrl': this._router.url}}); } else { - if (this.communityId != null && this.communityId !== '') { - // this.mailPrefs.saveNotification(0); - - // this.successfulSaveMessage = ''; + if (this.community.communityId != null && this.community.communityId !== '') { this.showLoading = true; const userNotifications = this.parseUpdatedUserNotifications(); - this.subscriptions.push(this._manageUserNotificationsService.updateUserNotifications(this.properties, this.communityId, userNotifications).subscribe( + this.subscriptions.push(this.manageUserNotificationsService.updateUserNotifications(this.properties, this.community.communityId, userNotifications).subscribe( userNotifications => { this.initialUserNotifications = JSON.parse(JSON.stringify(this.userNotifications)); this.handleSuccessfulSave('Notification settings saved!'); }, error => this.handleUpdateError('System error updating user notifications', error) )); - this.subscriptions.push(this._mailPrefsService.saveUserEmailPreferences(this.notifications[0], this.properties.claimsAPIURL).subscribe( + this.subscriptions.push(this.mailPrefsService.saveUserEmailPreferences(this.notifications[0], this.properties.claimsAPIURL).subscribe( data => { - this.initialNotifications[0] = JSON.parse(JSON.stringify( this.notifications[0] )); + this.initialNotifications[0] = JSON.parse(JSON.stringify(this.notifications[0])); this.handleSuccessfulSave('Claims notification settings saved!'); }, err => { //console.log(err); - this.handleError("Error saving user email preferences: "+JSON.stringify(this.notifications[0]), err); + this.handleError("Error saving user email preferences: " + JSON.stringify(this.notifications[0]), err); } )); } this.resetChange(); } } - + private parseUpdatedUserNotifications(): {} { const userNotifications = {}; - + userNotifications['notifyForNewManagers'] = this.userNotifications.notifyForNewManagers; userNotifications['notifyForNewSubscribers'] = this.userNotifications.notifyForNewSubscribers; - + if (this.userNotifications.managerEmail) { userNotifications['managerEmail'] = this.userNotifications.managerEmail; } @@ -172,7 +185,7 @@ export class ManageUserNotificationsComponent implements OnInit { // } return userNotifications; } - + public resetForm() { if (!Session.isLoggedIn()) { this._router.navigate(['/user-info'], { @@ -180,8 +193,8 @@ export class ManageUserNotificationsComponent implements OnInit { }); } else { // this.mailPrefs.restoreNotification(0); - this.notifications[0] = JSON.parse(JSON.stringify( this.initialNotifications[0] )); - + this.notifications[0] = JSON.parse(JSON.stringify(this.initialNotifications[0])); + if (this.userNotifications && this.initialUserNotifications) { // this.successfulSaveMessage = ''; this.showLoading = true; @@ -191,7 +204,7 @@ export class ManageUserNotificationsComponent implements OnInit { this.resetChange(); } } - + public changeValueForNewManagers(notifyForManagers: any) { if (!Session.isLoggedIn()) { this._router.navigate(['/user-info'], { @@ -202,7 +215,7 @@ export class ManageUserNotificationsComponent implements OnInit { this.change(); } } - + public changeValueForNewSubscribers(notifyForSubscribers: any) { if (!Session.isLoggedIn()) { this._router.navigate(['/user-info'], { @@ -213,24 +226,24 @@ export class ManageUserNotificationsComponent implements OnInit { this.change(); } } - + private change() { this.hasChanged = true; // this.successfulSaveMessage = ''; // this.successfulResetMessage = ''; } - + private resetChange() { this.hasChanged = false; } - + handleUpdateError(message: string, error) { // this.updateErrorMessage = message; console.log('Server responded: ' + error); - + this.showLoading = false; } - + handleError(message: string, error) { // this.errorMessage = message; console.log('Server responded: ' + error); @@ -241,7 +254,7 @@ export class ManageUserNotificationsComponent implements OnInit { }); this.showLoading = false; } - + handleSuccessfulSave(message) { this.showLoading = false; // this.successfulSaveMessage = message; @@ -251,15 +264,15 @@ export class ManageUserNotificationsComponent implements OnInit { pos: 'bottom-right' }); } - + changeNotify(notification: any, checked: boolean, index: number) { - notification.notify = checked; - this.change(); + notification.notify = checked; + this.change(); } - + changeFrequency() { this.change(); } - - + + } diff --git a/src/app/pages/usernotifications/manage-user-notifications.module.ts b/src/app/pages/usernotifications/manage-user-notifications.module.ts index ab0d7b8..f1bdc46 100644 --- a/src/app/pages/usernotifications/manage-user-notifications.module.ts +++ b/src/app/pages/usernotifications/manage-user-notifications.module.ts @@ -5,7 +5,6 @@ import {FormsModule} from '@angular/forms'; import {ManageUserNotificationsComponent} from './manage-user-notifications.component'; import {ManageUserNotificationsService} from './manage-user-notifications.service'; -import {MailPrefsModule} from '../../openaireLibrary/connect/userEmailPreferences/mailsPrefs.module'; import {ManageUserNotificationsRoutingModule} from './manage-user-notifications-routing.module'; import {UsersTabsModule} from '../users/users-tabs.module'; import {PageContentModule} from '../../openaireLibrary/dashboard/sharedComponents/page-content/page-content.module'; @@ -13,16 +12,18 @@ import { MatSelectModule } from '@angular/material/select'; import { MatSlideToggleModule } from '@angular/material/slide-toggle'; import {LoadingModule} from '../../openaireLibrary/utils/loading/loading.module'; import {SharedModule} from '../../openaireLibrary/shared/shared.module'; +import {MailPrefsService} from "../../openaireLibrary/connect/userEmailPreferences/mailPrefs.service"; +import {InputModule} from "../../openaireLibrary/sharedComponents/input/input.module"; @NgModule({ imports: [ - ManageUserNotificationsRoutingModule, RouterModule, CommonModule, FormsModule, MailPrefsModule, UsersTabsModule, PageContentModule, MatSlideToggleModule, LoadingModule, SharedModule, MatSelectModule + ManageUserNotificationsRoutingModule, RouterModule, CommonModule, FormsModule, UsersTabsModule, PageContentModule, MatSlideToggleModule, LoadingModule, SharedModule, MatSelectModule, InputModule ], declarations: [ ManageUserNotificationsComponent ], providers: [ - ManageUserNotificationsService + ManageUserNotificationsService, MailPrefsService ], exports: [ ManageUserNotificationsComponent diff --git a/src/app/pages/users/personal-info/personal-info.component.css b/src/app/pages/users/personal-info/personal-info.component.less similarity index 62% rename from src/app/pages/users/personal-info/personal-info.component.css rename to src/app/pages/users/personal-info/personal-info.component.less index d97c500..5603067 100644 --- a/src/app/pages/users/personal-info/personal-info.component.css +++ b/src/app/pages/users/personal-info/personal-info.component.less @@ -1,10 +1,4 @@ -form { - font-family: "Roboto", sans-serif; -} - -form .connected { - color: rgba(var(--text-color-rgb), 0.5); -} +@import (reference) "~src/assets/openaire-theme/less/_import-variables"; form .image { position: relative; @@ -20,9 +14,8 @@ form .image icon { } form .image img { - box-shadow: 0 3px 6px #00000029; + box-shadow: @global-medium-box-shadow; border-radius: 50%; - margin-bottom: 10px; width: 120px; height: 120px; object-fit: cover; 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 50e2041..4613f91 100644 --- a/src/app/pages/users/personal-info/personal-info.component.ts +++ b/src/app/pages/users/personal-info/personal-info.component.ts @@ -15,39 +15,40 @@ import {HelpContentService} from "../../../services/help-content.service"; import {Page} from "../../../domain/page"; import {CommunityService} from "../../../openaireLibrary/connect/community/community.service"; import {StringUtils} from "../../../openaireLibrary/utils/string-utils.class"; +import {CommunityInfo} from "../../../openaireLibrary/connect/community/communityInfo"; declare var UIkit; @Component({ selector: 'personal-info', template: ` -
+
+
+
+
Admin Dashboard - Manage Personal Info & + Affiliations +
+

{{community.shortTitle}}

+
+
-
-
-
-
- Personal Info & Affiliations - (unsaved changes) -
-
-
- - -
+
+
+ +
-
-
+
+
@@ -67,57 +68,61 @@ declare var UIkit;
-
{{user.firstname + ' ' + user.lastname}}
- +
-
-
+
My Affiliations
- - - - +
-
-
-
-
+
+
+
+
+
-
+
{{affiliation.value.name}}
- URL: {{affiliation.value.website_url}} -
-
- + +
@@ -134,7 +139,7 @@ declare var UIkit;
- +
Your personal data and photo are processed by OpenAIRE in conformity with personal data protection legal framework. @@ -145,26 +150,29 @@ declare var UIkit; if you have any inquiries.
- + -
-
-
-
+
+
+
+
- + - -
- Your personal information has been successfully saved.

- This information will be visible in Curators page of Research Community Dashboard, which is disabled. - Do you want to enable it now? -
+ + Your personal information has been successfully saved.

+ This information will be visible in Curators page of Research Community + Dashboard, which is disabled. + Do you want to enable it now?
`, - styleUrls: ['personal-info.component.css'] + styleUrls: ['personal-info.component.less'] }) export class PersonalInfoComponent implements OnInit, OnDestroy { /** Curator information */ @@ -175,7 +183,8 @@ export class PersonalInfoComponent implements OnInit, OnDestroy { public properties: EnvProperties = properties; public curatorsPage: Page; public newCurator = false; - public communityId: string; + public community: CommunityInfo; + public stickyPageHeader: boolean = false; /** Photo */ public photo: any = null; private photoChanged: boolean = false; @@ -205,11 +214,11 @@ export class PersonalInfoComponent implements OnInit, OnDestroy { ngOnInit() { this.subs.push(this.communityService.getCommunityAsObservable().subscribe(community => { - this.communityId = community.communityId; + this.community = community; this.subs.push(this.userManagementService.getUserInfo().subscribe(user => { this.user = user; if (this.user) { - this.title.setTitle(community.communityId.toUpperCase() + " | Personal Info"); + this.title.setTitle(community.shortTitle.toUpperCase() + " | Personal Info"); this.loading = true; this.subs.push(this.curatorService.getCurator(properties).subscribe(curator => { this.initCurator(curator); @@ -304,7 +313,7 @@ export class PersonalInfoComponent implements OnInit, OnDestroy { this.deletePhoto = false; this.initCurator(curator); this.reset(); - if(!this.curatorsEnabled) { + if (!this.curatorsEnabled) { this.curatorsEnabledOpen(); } this.loading = false; @@ -342,7 +351,7 @@ export class PersonalInfoComponent implements OnInit, OnDestroy { } private curatorsPageStatus() { - this.helpContentService.getCommunityPagesByRoute(this.communityId, '/curators', this.properties.adminToolsAPIURL).subscribe((page) => { + this.helpContentService.getCommunityPagesByRoute(this.community.communityId, '/curators', this.properties.adminToolsAPIURL).subscribe((page) => { this.curatorsPage = page; }); } @@ -412,7 +421,7 @@ export class PersonalInfoComponent implements OnInit, OnDestroy { editAffiliationOpen(index = -1) { this.index = index; let affiliation: Affiliation = new Affiliation(); - if(index === -1) { + if (index === -1) { this.affiliationModal.alertTitle = 'Add Affiliation'; this.affiliationModal.okButtonText = 'Add'; } else { @@ -436,14 +445,14 @@ export class PersonalInfoComponent implements OnInit, OnDestroy { let affiliation: Affiliation = this.affiliations.at(index).value; this.removeAffiliationModal.alertTitle = 'Delete Affiliation'; this.removeAffiliationModal.message = 'Do you want to remove ' + - affiliation.name + ' from your Affiliations?'; + affiliation.name + ' from your Affiliations?'; this.removeAffiliationModal.okButtonText = 'Yes'; this.removeAffiliationModal.cancelButtonText = 'No'; this.removeAffiliationModal.open(); } editAffiliation() { - if(this.index === -1) { + if (this.index === -1) { this.affiliations.push(this.affiliationFb); } else { this.affiliations.at(this.index).setValue(this.affiliationFb.value); @@ -465,14 +474,14 @@ export class PersonalInfoComponent implements OnInit, OnDestroy { } enableCurators() { - this.helpContentService.togglePages(this.communityId, [this.curatorsPage._id], true, this.properties.adminToolsAPIURL).subscribe(() => { + this.helpContentService.togglePages(this.community.communityId, [this.curatorsPage._id], true, this.properties.adminToolsAPIURL).subscribe(() => { this.curatorsPage.isEnabled = true; UIkit.notification('Curators Page has been enabled successfully', { status: 'success', timeout: 6000, pos: 'bottom-right' }); - },error => { + }, error => { this.handleUpdateError('An error has occurred. Try again later!'); }); } diff --git a/src/app/pages/users/users-managers/users-managers.component.ts b/src/app/pages/users/users-managers/users-managers.component.ts index f500f37..b566809 100644 --- a/src/app/pages/users/users-managers/users-managers.component.ts +++ b/src/app/pages/users/users-managers/users-managers.component.ts @@ -15,7 +15,7 @@ import {CommunityInfo} from "../../../openaireLibrary/connect/community/communit [link]="link" [role]="'manager'" [message]="message" [emailComposer]="emailComposer" (stickyEmitter)="stickyPageHeader = $event">
-
Admin Dashboard - Manage Users
+
Admin Dashboard - Manage Managers

{{community.shortTitle}}

diff --git a/src/app/pages/users/users-routing.module.ts b/src/app/pages/users/users-routing.module.ts index ca14bf5..a11917f 100644 --- a/src/app/pages/users/users-routing.module.ts +++ b/src/app/pages/users/users-routing.module.ts @@ -6,7 +6,7 @@ import {RouterModule} from '@angular/router'; RouterModule.forChild([ {path: '', redirectTo: 'manager', pathMatch: 'full'}, {path: 'manager', loadChildren: () => import('./users-managers/users-managers.module').then(m => m.UsersManagersModule)}, - {path: 'subscriber', loadChildren: () => import('./users-subscribers/users-subscribers.module').then(m => m.UsersSubscribersModule)}, + {path: 'member', loadChildren: () => import('./users-subscribers/users-subscribers.module').then(m => m.UsersSubscribersModule)}, { path: 'notifications', loadChildren: () => import('../usernotifications/manage-user-notifications.module').then(m => m.ManageUserNotificationsModule) diff --git a/src/app/pages/users/users-subscribers/users-subscribers.component.ts b/src/app/pages/users/users-subscribers/users-subscribers.component.ts index 4ace622..62e60e1 100644 --- a/src/app/pages/users/users-subscribers/users-subscribers.component.ts +++ b/src/app/pages/users/users-subscribers/users-subscribers.component.ts @@ -3,21 +3,28 @@ import {Title} from "@angular/platform-browser"; import {ActivatedRoute} from "@angular/router"; import {CommunityService} from "../../../openaireLibrary/connect/community/community.service"; import {Subscriber} from "rxjs"; +import {CommunityInfo} from "../../../openaireLibrary/connect/community/communityInfo"; @Component({ selector: 'users-subscribers', template: ` - - + +
+
+
Admin Dashboard - Manage Members
+

{{community.shortTitle}}

+
+
+
` }) export class UsersSubscribersComponent implements OnInit { - public communityId: string; - public name: string; - public type: string; + public community: CommunityInfo; public loading: boolean; public inviteDisableMessage: string; + public stickyPageHeader: boolean = false; private subscriptions: any[] = []; constructor(private communityService: CommunityService, @@ -29,10 +36,8 @@ export class UsersSubscribersComponent implements OnInit { this.loading = true; this.subscriptions.push(this.communityService.getCommunityAsObservable().subscribe(community => { if(community) { - this.communityId = community.communityId; - this.name = community.shortTitle; - this.title.setTitle(this.communityId.toUpperCase() + " | Subscribers"); - this.type = '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 subscribe to the Research community dashboard is disabled. Update the community status to enable invitations.
" } diff --git a/src/app/pages/users/users-tabs.component.ts b/src/app/pages/users/users-tabs.component.ts index 6dc4ca8..888103b 100644 --- a/src/app/pages/users/users-tabs.component.ts +++ b/src/app/pages/users/users-tabs.component.ts @@ -9,11 +9,11 @@ import {ActivatedRoute} from '@angular/router'; template: ` ` }) @@ -21,7 +21,7 @@ export class UsersTabsComponent implements OnInit { @Input() public type: string; @Input() - public tab: "manager"| "subscriber" | "notifications" | "claims" | "personal" = 'manager'; + public tab: "manager"| "member" | "notifications" | "claims" | "personal" = 'manager'; private subscriptions = []; isAManager: boolean = false; canManageNotifications: boolean = false; diff --git a/src/assets/common-assets b/src/assets/common-assets index 752859b..65cbf34 160000 --- a/src/assets/common-assets +++ b/src/assets/common-assets @@ -1 +1 @@ -Subproject commit 752859b10d3e110fdc9a4360bb7cb005ef6225ed +Subproject commit 65cbf342bc890aff15a8831711f69d9b35e6f85d diff --git a/src/assets/dashboard-theme b/src/assets/dashboard-theme index cd1a176..f79a0c8 160000 --- a/src/assets/dashboard-theme +++ b/src/assets/dashboard-theme @@ -1 +1 @@ -Subproject commit cd1a176ceb3aaa3493e16fc4d7ef67749655f351 +Subproject commit f79a0c8ddbbe2e0cb266034073513356fd801095 diff --git a/src/assets/openaire-theme b/src/assets/openaire-theme index ec73c67..8c45858 160000 --- a/src/assets/openaire-theme +++ b/src/assets/openaire-theme @@ -1 +1 @@ -Subproject commit ec73c67c591eca9fe68f7a6c6f65ce4332852b2f +Subproject commit 8c4585873a56165631bee6b9d33d11fe83fc897c diff --git a/src/environments/environment.ts b/src/environments/environment.ts index fc7dfe2..71c1a70 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -12,7 +12,7 @@ export let properties: EnvProperties = { 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/', + claimsAPIURL: 'http://dl170.madgik.di.uoa.gr:8180/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/",