[umbrella]: Fix browse stakeholders. Add umbrella route. Update libraries

This commit is contained in:
Konstantinos Triantafyllou 2024-06-11 17:33:15 +03:00
parent bb9408efe3
commit fb9a82a35e
9 changed files with 209 additions and 159 deletions

View File

@ -29,6 +29,11 @@ import {HelperFunctions} from "../openaireLibrary/utils/HelperFunctions.class";
data: {hasInternalSidebar: true},
pathMatch: 'full'
},
{
path: 'umbrella',
loadChildren: () => import('../openaireLibrary/monitor-admin/umbrella/umbrella.module').then(m => m.UmbrellaModule),
pathMatch: 'full'
},
{
path: 'admin-tools',
loadChildren: () => import('../admin-tools/admin-tools-routing.module').then(m => m.AdminToolsRoutingModule),

View File

@ -4,6 +4,7 @@ import {OpenaireErrorPageComponent} from './error/errorPage.component';
import {AdminLoginGuard} from "./openaireLibrary/login/adminLoginGuard.guard";
import {LoginGuard} from "./openaireLibrary/login/loginGuard.guard";
import {AdminDashboardGuard} from "./openaireLibrary/monitor-admin/utils/adminDashboard.guard";
import {HasDashboardGuard} from "./openaireLibrary/monitor/services/hasDashboard.guard";
const routes: Routes = [
{
@ -59,6 +60,7 @@ const routes: Routes = [
{
path: '',
loadChildren: () => import('./monitor/monitor.module').then(m => m.MonitorModule),
canActivateChild: [HasDashboardGuard],
data: {isFrontPage: true}
},
{

View File

@ -1,141 +1,159 @@
<div *ngIf="loading">
<loading [full]="true"></loading>
<loading [full]="true"></loading>
</div>
<div *ngIf="!loading" [class.monitor]="isFrontPage">
<div id="modal-container"></div>
<ng-container *ngIf="!isHidden">
<navbar *ngIf="hasHeader" portal="monitor_dashboard" [header]="menuHeader" [userMenuItems]=userMenuItems [menuItems]="menuItems" [user]="user"
[notificationConfiguration]="isMobile && user && notificationGroupsInitialized?notificationConfiguration:null"></navbar>
<div *ngIf="isChild" class="uk-banner uk-padding uk-padding-remove-horizontal uk-light">
<div class="uk-container uk-container-large">
<div class="uk-padding-small uk-padding-remove-vertical">
<div class="uk-grid uk-grid-large uk-flex-middle uk-margin-medium-bottom" uk-grid>
<div class="uk-width-expand">
<div class="uk-grid uk-grid-small uk-flex-middle" uk-grid>
<div class="uk-card uk-card-default uk-padding-small">
<img *ngIf="stakeholder.logoUrl; else elseBlock" [src]="stakeholder | logoUrl" [alt]="stakeholder.name + ' logo'" class="uk-height-max-xsmall" style="max-width: 180px;">
<ng-template #elseBlock>
<img src="assets/common-assets/placeholder.png" alt="OpenAIRE placeholder logo" class="uk-height-max-xsmall" style="max-width: 180px;">
</ng-template>
<div id="modal-container"></div>
<ng-container *ngIf="!isHidden">
<navbar *ngIf="hasHeader" portal="monitor_dashboard" [header]="menuHeader" [userMenuItems]=userMenuItems
[menuItems]="menuItems" [user]="user"
[notificationConfiguration]="isMobile && user && notificationGroupsInitialized?notificationConfiguration:null"></navbar>
<div *ngIf="isChild" class="uk-banner uk-padding uk-padding-remove-horizontal uk-light">
<div class="uk-container uk-container-large">
<div class="uk-padding-small uk-padding-remove-vertical">
<div class="uk-grid uk-grid-large uk-flex-middle uk-margin-medium-bottom" uk-grid>
<div class="uk-width-expand">
<div class="uk-grid uk-grid-small uk-flex-middle" uk-grid>
<div class="uk-card uk-card-default uk-padding-small">
<img *ngIf="stakeholder.logoUrl; else elseBlock" [src]="stakeholder | logoUrl"
[alt]="stakeholder.name + ' logo'" class="uk-height-max-xsmall"
style="height: 65px; max-width: 180px;">
<ng-template #elseBlock>
<img src="assets/common-assets/placeholder.png" alt="OpenAIRE placeholder logo"
class="uk-height-max-xsmall" style="height: 65px; max-width: 180px;">
</ng-template>
</div>
<div class="uk-width-expand uk-margin-small-left">
<h1 class="uk-h5 uk-margin-remove uk-text-truncate">{{ stakeholder.name }}</h1>
<div class="uk-text-small uk-margin-small-top">
<breadcrumbs [breadcrumbs]="breadcrumbs"></breadcrumbs>
</div>
</div>
</div>
</div>
<div *ngIf="stakeholder.otherParents?.length" class="uk-width-auto">
<div class="uk-text-small uk-margin-small-bottom">
Other related {{ stakeholderUtils.entities.stakeholders.toLowerCase() }}
</div>
<div class="uk-flex uk-flex-middle">
<a *ngFor="let item of stakeholder.otherParents" [routerLink]="item.alias"
class="uk-link-reset uk-margin-small-right">
<button class="uk-icon-button uk-button-default" [attr.uk-tooltip]="item.name">
<img *ngIf="item.logoUrl; else elseBlock" [src]="item | logoUrl"
[alt]="item.name + ' logo'" style="max-width: 35px;">
<ng-template #elseBlock>
<img src="assets/common-assets/placeholder.png"
alt="OpenAIRE placeholder logo" style="max-width: 35px;">
</ng-template>
</button>
</a>
</div>
</div>
</div>
</div>
<div class="uk-width-expand uk-margin-small-left">
<h1 class="uk-h5 uk-margin-remove uk-text-truncate">{{stakeholder.name}}</h1>
<div class="uk-text-small uk-margin-small-top">
<breadcrumbs [breadcrumbs]="breadcrumbs"></breadcrumbs>
</div>
</div>
</div>
</div>
<div *ngIf="stakeholder.otherParents?.length" class="uk-width-auto">
<div class="uk-text-small uk-margin-small-bottom">
Other related {{stakeholderUtils.entities.stakeholders.toLowerCase()}}
</div>
<div class="uk-flex uk-flex-middle">
<a *ngFor="let item of stakeholder.otherParents" [routerLink]="item.alias" class="uk-link-reset uk-margin-small-right">
<button class="uk-icon-button uk-button-default">
<img *ngIf="item.logoUrl; else elseBlock" [src]="item | logoUrl" [alt]="item.name + ' logo'" style="max-width: 35px;">
<ng-template #elseBlock>
<img src="assets/common-assets/placeholder.png" alt="OpenAIRE placeholder logo" style="max-width: 35px;">
</ng-template>
</button>
</a>
</div>
<div class="uk-banner-footer uk-padding-remove">
<ul class="uk-banner-tab uk-flex-center">
<li [class.uk-active]="!isSearch">
<a [routerLink]="[stakeholder.parent.alias, 'browse', stakeholder.type, stakeholder.alias]">
{{ stakeholderUtils.entities.stakeholder }}
</a>
</li>
<li [class.uk-active]="isSearch">
<a [routerLink]="properties.searchLinkToResults">
Browse {{ openaireEntities.RESULTS }}
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
<div class="uk-banner-footer uk-padding-remove">
<ul class="uk-banner-tab uk-flex-center">
<li [class.uk-active]="!isSearch">
<a [routerLink]="[stakeholder.parent.alias, 'browse', stakeholder.type, stakeholder.alias]">
{{stakeholderUtils.entities.stakeholder}}
</a>
</li>
<li [class.uk-active]="isSearch">
<a [routerLink]="properties.searchLinkToResults">
Browse {{openaireEntities.RESULTS}}
</a>
</li>
</ul>
</div>
</div>
<div *ngIf="isUmbrella" class="uk-banner uk-padding-remove">
<ul class="uk-banner-tab uk-flex-center">
<li [class.uk-active]="!isBrowse">
<a [routerLink]="stakeholder.alias">
{{ stakeholderUtils.entities.stakeholder }}
</a>
</li>
<li *ngFor="let type of stakeholder.umbrella.types" [class.uk-active]="isBrowse && activeType === type"
[class.uk-hidden]="stakeholder.umbrella.children[type].length === 0">
<a [routerLink]="stakeholder.alias + '/browse/' + type">
Browse {{ stakeholderUtils.entities[type + 's'] }}
</a>
</li>
</ul>
</div>
<div *ngIf="isUmbrella" class="uk-banner uk-padding-remove">
<ul class="uk-banner-tab uk-flex-center">
<li [class.uk-active]="!isBrowse">
<a [routerLink]="stakeholder.alias">
{{stakeholderUtils.entities.stakeholder}}
</a>
</li>
<li *ngFor="let item of stakeholder.umbrella.children | keyvalue" [class.uk-active]="isBrowse">
<a [routerLink]="stakeholder.alias + '/browse/' + item.key">
Browse {{stakeholderUtils.entities[item.key+'s']}}
</a>
</li>
</ul>
</div>
<div>
<div class="sidebar_main_swipe uk-flex uk-background-default" [class.sidebar_main_active]="open && (hasSidebar || hasAdminMenu || hasInternalSidebar)"
[class.sidebar_mini]="!open && (hasSidebar || hasAdminMenu || hasInternalSidebar)" [class.sidebar_hover]="hover">
<dashboard-sidebar *ngIf="stakeholder && isFrontPage && hasSidebar && !hasInternalSidebar" queryParamsHandling="merge" [items]="sideBarItems"
[activeItem]="activeTopic?activeTopic.alias:null" [activeSubItem]="activeCategory?activeCategory.alias:null"></dashboard-sidebar>
<dashboard-sidebar *ngIf="hasAdminMenu && !hasInternalSidebar" [items]="adminMenuItems" [backItem]="backItem"></dashboard-sidebar>
<main class="uk-width-1-1">
<router-outlet></router-outlet>
</main>
</div>
<bottom id="bottom" *ngIf="isFrontPage" [centered]="true" [properties]="properties" [showMenuItems]="true"></bottom>
<notification-sidebar *ngIf="!isMobile && user && notificationGroupsInitialized" [configuration]="notificationConfiguration" [user]="user"></notification-sidebar>
<cache-indicators *ngIf="stakeholder && !isFrontPage && isCurator()" [alias]="stakeholder.alias"></cache-indicators>
<div *ngIf="view" class="preview uk-text-small uk-flex uk-flex-middle">
<span>You are currently in a <span class="uk-text-bold">"Preview"</span> mode. <span class="uk-visible@m"><a (click)="removeView()">The current view</a> of this dashboard may differ.</span></span>
</div>
</div>
</ng-container>
<div *ngIf="projectUpdate && !isFrontPage" class="project-update">
<div *ngIf="projectUpdate === 'danger'" class="uk-alert uk-alert-danger" uk-alert>
<a class="uk-alert-close" uk-close></a>
<div class="uk-text-bold uk-text-small">Projects Status: Urgent Update Needed</div>
<div class="uk-margin-xsmall-top uk-text-xsmall">
Your project list was last updated more than a year ago. Please send an updated project list to
<a href="mailto:mining@openaire.eu">mining@openaire.eu</a> or contact <a [href]="monitorLink + '/contact-us'">support</a>.
</div>
</div>
<div *ngIf="projectUpdate === 'warning'" class="uk-alert uk-alert-warning" uk-alert>
<a class="uk-alert-close" uk-close></a>
<div class="uk-text-bold uk-text-small">Projects Status: Update Needed</div>
<div class="uk-margin-xsmall-top uk-text-xsmall">
Your project list was last updated between 6 to 12 months ago. Please send an updated project list to
<a href="mailto:mining@openaire.eu">mining@openaire.eu</a> or contact <a [href]="monitorLink + '/contact-us'" target="_blank" class="custom-external">support</a>.
</div>
</div>
</div>
<div *ngIf="isHidden" class="private-data uk-light dark">
<div class="uk-section uk-section-small uk-container uk-container-small uk-text-center">
<img src="assets/common-assets/logo-services/monitor/inverted.svg" style="height: 80px;">
<h1 class="uk-h4 uk-margin-large-top">Private Content</h1>
<div class="uk-text-large">
The contents of this dashboard are only visible to invited members.
</div>
<div class="uk-margin-large-top uk-margin-large-bottom">
<icon name="incognito" ratio="7"></icon>
</div>
<div class="uk-margin-medium-bottom">
<div *ngIf="!user">
If you are a member of this dashboard, please sign in.
</div>
<div>
If you want to be a member of this dashboard - Contact us.
<div class="sidebar_main_swipe uk-flex uk-background-default"
[class.sidebar_main_active]="open && (hasSidebar || hasAdminMenu || hasInternalSidebar)"
[class.sidebar_mini]="!open && (hasSidebar || hasAdminMenu || hasInternalSidebar)"
[class.sidebar_hover]="hover">
<dashboard-sidebar *ngIf="stakeholder && isFrontPage && hasSidebar && !hasInternalSidebar"
queryParamsHandling="merge" [items]="sideBarItems"
[activeItem]="activeTopic?activeTopic.alias:null"
[activeSubItem]="activeCategory?activeCategory.alias:null"></dashboard-sidebar>
<dashboard-sidebar *ngIf="hasAdminMenu && !hasInternalSidebar" [items]="adminMenuItems"
[backItem]="backItem"></dashboard-sidebar>
<main class="uk-width-1-1">
<router-outlet></router-outlet>
</main>
</div>
<bottom id="bottom" *ngIf="isFrontPage" [centered]="true" [properties]="properties"
[showMenuItems]="true"></bottom>
<notification-sidebar *ngIf="!isMobile && user && notificationGroupsInitialized"
[configuration]="notificationConfiguration" [user]="user"></notification-sidebar>
<cache-indicators *ngIf="stakeholder && !isFrontPage && isCurator()"
[alias]="stakeholder.alias"></cache-indicators>
<div *ngIf="view" class="preview uk-text-small uk-flex uk-flex-middle">
<span>You are currently in a <span class="uk-text-bold">"Preview"</span> mode. <span
class="uk-visible@m"><a (click)="removeView()">The current view</a> of this dashboard may differ.</span></span>
</div>
</div>
</ng-container>
<div *ngIf="projectUpdate && !isFrontPage" class="project-update">
<div *ngIf="projectUpdate === 'danger'" class="uk-alert uk-alert-danger" uk-alert>
<a class="uk-alert-close" uk-close></a>
<div class="uk-text-bold uk-text-small">Projects Status: Urgent Update Needed</div>
<div class="uk-margin-xsmall-top uk-text-xsmall">
Your project list was last updated more than a year ago. Please send an updated project list to
<a href="mailto:mining@openaire.eu">mining@openaire.eu</a> or contact <a
[href]="monitorLink + '/contact-us'">support</a>.
</div>
</div>
<div *ngIf="projectUpdate === 'warning'" class="uk-alert uk-alert-warning" uk-alert>
<a class="uk-alert-close" uk-close></a>
<div class="uk-text-bold uk-text-small">Projects Status: Update Needed</div>
<div class="uk-margin-xsmall-top uk-text-xsmall">
Your project list was last updated between 6 to 12 months ago. Please send an updated project list to
<a href="mailto:mining@openaire.eu">mining@openaire.eu</a> or contact <a
[href]="monitorLink + '/contact-us'" target="_blank" class="custom-external">support</a>.
</div>
</div>
</div>
<div class="uk-flex uk-flex-center uk-flex-middle">
<a *ngIf="!user" class="uk-button uk-button-primary uk-margin-right" (click)="login()">Sign in</a>
<a class="uk-button uk-button-secondary" [href]="monitorLink + '/contact-us'">Contact us</a>
</div>
</div>
</div>
<role-verification *ngIf="stakeholder" [id]="stakeholder.alias" [name]="stakeholder.name" [dashboard]="'OpenAIRE Monitor'"
[type]="stakeholder.type" [userInfoLink]="monitorLink + '/user-info'"></role-verification>
<div *ngIf="isHidden" class="private-data uk-light dark">
<div class="uk-section uk-section-small uk-container uk-container-small uk-text-center">
<img src="assets/common-assets/logo-services/monitor/inverted.svg" style="height: 80px;">
<h1 class="uk-h4 uk-margin-large-top">Private Content</h1>
<div class="uk-text-large">
The contents of this dashboard are only visible to invited members.
</div>
<div class="uk-margin-large-top uk-margin-large-bottom">
<icon name="incognito" ratio="7"></icon>
</div>
<div class="uk-margin-medium-bottom">
<div *ngIf="!user">
If you are a member of this dashboard, please sign in.
</div>
<div>
If you want to be a member of this dashboard - Contact us.
</div>
</div>
<div class="uk-flex uk-flex-center uk-flex-middle">
<a *ngIf="!user" class="uk-button uk-button-primary uk-margin-right" (click)="login()">Sign in</a>
<a class="uk-button uk-button-secondary" [href]="monitorLink + '/contact-us'">Contact us</a>
</div>
</div>
</div>
<role-verification *ngIf="stakeholder" [id]="stakeholder.alias" [name]="stakeholder.name"
[dashboard]="'OpenAIRE Monitor'"
[type]="stakeholder.type" [userInfoLink]="monitorLink + '/user-info'"></role-verification>
</div>

View File

@ -6,7 +6,13 @@ import {StakeholderService} from "./openaireLibrary/monitor/services/stakeholder
import {Subscription} from "rxjs";
import {LayoutService} from "./openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
import {MenuItem} from "./openaireLibrary/sharedComponents/menu";
import {Category, Stakeholder, Topic, Visibility} from "./openaireLibrary/monitor/entities/stakeholder";
import {
Category,
Stakeholder,
StakeholderType,
Topic,
Visibility
} from "./openaireLibrary/monitor/entities/stakeholder";
import {LinksResolver} from "./search/links-resolver";
import {Header} from "./openaireLibrary/sharedComponents/navigationBar.component";
import {ConfigurationService} from "./openaireLibrary/utils/configuration/configuration.service";
@ -66,6 +72,7 @@ export class AppComponent extends SidebarBaseComponent implements OnInit {
projectUpdate: 'danger' | 'warning';
paramsSubscription: Subscription;
openaireEntities = OpenaireEntities;
activeType: StakeholderType;
constructor(protected _route: ActivatedRoute,
protected _router: Router,
@ -113,7 +120,6 @@ export class AppComponent extends SidebarBaseComponent implements OnInit {
this.subscriptions.push(this.data.subscribe(data => {
if (data && data.portal) {
this.setProperties(data.portal);
this.configurationService.initPortal(this.properties, this.properties.adminToolsCommunity);
}
}));
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
@ -134,14 +140,15 @@ export class AppComponent extends SidebarBaseComponent implements OnInit {
this.paramsSubscription = this.params.subscribe(params => {
if (this.paramsResolved) {
this.loading = true;
this.activeType = params['type'];
if (params && params['stakeholder']) {
let callback = (stakeholder) => {
let callback = (stakeholder: Stakeholder) => {
if (stakeholder) {
this.stakeholder = stakeholder;
if (this.isChild) {
this.breadcrumbs = [
{name: this.stakeholder.parent.name, route: this.stakeholder.parent.alias},
{name: this.stakeholder.type, route: this.stakeholder.parent.alias + '/browse/' + this.stakeholder.type},
{name: this.stakeholderUtils.entities[this.stakeholder.type + 's'], route: this.stakeholder.parent.alias + '/browse/' + this.stakeholder.type},
{name: this.stakeholder.name}
];
}
@ -216,6 +223,7 @@ export class AppComponent extends SidebarBaseComponent implements OnInit {
this.subscriptions.push(this.stakeholderService.getMyStakeholders(this.properties.monitorServiceAPIURL).subscribe(manageStakeholder => {
let stakeholders = manageStakeholder.standalone;
stakeholders.concat(manageStakeholder.umbrella);
stakeholders.concat(manageStakeholder.dependent);
stakeholders.forEach(stakeholder => {
this.notificationConfiguration.availableGroups.push({
value: Role.manager(stakeholder.type, stakeholder.alias),
@ -320,6 +328,9 @@ export class AppComponent extends SidebarBaseComponent implements OnInit {
this.adminMenuItems.push(new MenuItem("indicators", "Indicators", "", "/admin/" + this.stakeholder.alias + '/indicators', false, [], [], {}, {name: 'bar_chart'}, null, "uk-visible@m"));
if (this.stakeholder.defaultId) {
this.adminMenuItems.push(new MenuItem("users", "Users", "", "/admin/" + this.stakeholder.alias + "/users", false, [], [], {}, {name: 'group'}, null, "uk-visible@m", "/admin/" + this.stakeholder.alias + "/users"));
if(this.stakeholder.umbrella) {
this.adminMenuItems.push(new MenuItem("umbrella", "Umbrella", "", "/admin/" + this.stakeholder.alias + "/umbrella", false, [], [], {}, {name: 'workspaces'}, null, "uk-visible@m", "/admin/" + this.stakeholder.alias + "/umbrella"));
}
if (this.isCurator()) {
this.adminMenuItems.push(new MenuItem("admin-tools", "Pages & Entities", "", "/admin/" + this.stakeholder.alias + "/admin-tools/pages", false, [], [], {}, {name: 'description'}, null, "uk-visible@m", "/admin/" + this.stakeholder.alias + "/admin-tools"));
}

View File

@ -60,8 +60,7 @@
<div *ngFor="let item of filteredStakeholders.slice((currentPage-1)*pageSize, currentPage*pageSize)">
<a [routerLink]="'./' + item.alias" class="uk-link-reset" [class.uk-disabled]="!hasPermission(item)">
<div class="uk-card uk-card-default uk-card-hover" [class.uk-disabled]="!hasPermission(item)">
<div *ngIf="item.visibility && item.visibility !== 'PUBLIC'"
[ngClass]="isMobile?'uk-flex uk-flex-middle uk-flex-right uk-margin-small-right uk-margin-small-top':'uk-position-top-right uk-margin-small-top uk-margin-small-right uk-flex uk-flex-column uk-flex-middle'">
<div *ngIf="item.visibility" [ngClass]="isMobile?'uk-flex uk-flex-middle uk-flex-right uk-margin-small-right uk-margin-small-top':'uk-position-top-right uk-margin-small-top uk-margin-small-right uk-flex uk-flex-column uk-flex-middle'">
<icon [name]="visibilityIcon.get(item.visibility)" [ratio]="isMobile?0.8:1" [flex]="true"></icon>
</div>
<div class="uk-padding-small top-info">

View File

@ -2,7 +2,9 @@ import {ChangeDetectorRef, Component} from "@angular/core";
import {ActivatedRoute, Router} from "@angular/router";
import {LayoutService} from "../openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
import {FormBuilder} from "@angular/forms";
import {BrowseStakeholderBaseComponent} from "../openaireLibrary/monitor/browse-stakeholder/browse-stakeholder-base.component";
import {
BrowseStakeholderBaseComponent
} from "../openaireLibrary/monitor/browse-stakeholder/browse-stakeholder-base.component";
import {StakeholderInfo, Visibility} from "../openaireLibrary/monitor/entities/stakeholder";
import {StakeholderService} from "../openaireLibrary/monitor/services/stakeholder.service";
import {UserManagementService} from "../openaireLibrary/services/user-management.service";
@ -18,12 +20,13 @@ import {Title} from "@angular/platform-browser";
export class BrowseStakeholdersComponent extends BrowseStakeholderBaseComponent<StakeholderInfo> {
user: User;
stakeholderUtils: StakeholderUtils = new StakeholderUtils();
sortBy = 'alphAsc';
visibilityIcon: Map<Visibility, string> = new Map<Visibility, string> ([
visibilityIcon: Map<Visibility, string> = new Map<Visibility, string>([
["PUBLIC", 'earth'],
["PRIVATE", 'incognito'],
["RESTRICTED", 'restricted']
]);
constructor(protected _route: ActivatedRoute,
protected _router: Router,
protected _title: Title,
@ -44,27 +47,39 @@ export class BrowseStakeholdersComponent extends BrowseStakeholderBaseComponent<
}
}));
this.subscriptions.push(this.stakeholderService.getStakeholderAsObservable().subscribe(data => {
this.title = "Monitor Dashboard | " + data.name + " | " + "Browse " + this.stakeholderUtils.entities[this.stakeholderType + 's'];
this.description = "Monitor Dashboard | " + data.name + " | " + "Browse " + this.stakeholderUtils.entities[this.stakeholderType + 's'];
this.setMetadata();
if (data.umbrella.children[this._route.snapshot.params['type']] == null) {
this.navigateToError();
}
this.stakeholders = data.umbrella.children[this._route.snapshot.params['type']];
this.stakeholders.forEach(stakeholder => {
stakeholder.isManager = this.isManager(stakeholder);
stakeholder.isMember = this.isMember(stakeholder)
});
this.filteredStakeholders = this.stakeholders;
this.showLoading = false;
this.subscriptions.push(this._route.params.subscribe(params => {
this.stakeholderType = params['type'];
this.reset();
this.title = "Monitor Dashboard | " + data.name + " | " + "Browse " + this.entities[this.stakeholderType + 's'];
this.description = "Monitor Dashboard | " + data.name + " | " + "Browse " + this.entities[this.stakeholderType + 's'];
this.setMetadata();
if (data.umbrella.children[this._route.snapshot.params['type']] == null) {
this.navigateToError();
}
this.stakeholders = data.umbrella.children[this._route.snapshot.params['type']];
this.stakeholders.forEach(stakeholder => {
stakeholder.isManager = this.isManager(stakeholder);
stakeholder.isMember = this.isMember(stakeholder)
});
this.filteredStakeholders = this.stakeholders;
this.showLoading = false;
}));
}));
}
reset() {
this.sortBy = 'alphAsc';
this.sortByChanged();
this.sizeChanged(10);
this.keywordControl.setValue(null);
this.gridView = true;
}
private isManager(stakeholder) {
return Session.isPortalAdministrator(this.user) || Session.isMonitorCurator(this.user)
|| Session.isCommunityCurator(this.user) || Session.isManager(stakeholder.type, stakeholder.alias, this.user);
|| Session.isCommunityCurator(this.user) || Session.isManager(stakeholder.type, stakeholder.alias, this.user);
}
private isMember(stakeholder) {
return this.isManager(stakeholder) || Session.isSubscribedTo(stakeholder.type, stakeholder.alias, this.user);
}

View File

@ -11,7 +11,7 @@ import {IconsModule} from "../openaireLibrary/utils/icons/icons.module";
import {LogoUrlPipeModule} from "../openaireLibrary/utils/pipes/logoUrlPipe.module";
import {Monitor} from "../monitor/monitor";
import {IconsService} from "../openaireLibrary/utils/icons/icons.service";
import {incognito, restricted} from "../openaireLibrary/utils/icons/icons";
import {earth, incognito, restricted} from "../openaireLibrary/utils/icons/icons";
let routes: Routes = new Monitor(':child').routes;
routes.splice(0, 0, {path: '', component: BrowseStakeholdersComponent, canDeactivate: [PreviousRouteRecorder], data: {hasSidebar: false}});
@ -26,6 +26,6 @@ routes.splice(0, 0, {path: '', component: BrowseStakeholdersComponent, canDeacti
})
export class BrowseStakeholdersModule {
constructor(private iconsService: IconsService) {
this.iconsService.registerIcons([incognito, restricted]);
this.iconsService.registerIcons([earth, incognito, restricted]);
}
}
}

@ -1 +1 @@
Subproject commit 472eeef32675ff6bffafb2591abd96f49438f85d
Subproject commit 96e63ae8c04d44de332a829010bc7ad69afb431a

@ -1 +1 @@
Subproject commit 99e7fe14bc804271116cc8ee54f2547e4f04034f
Subproject commit c7848e0107c9505116f0951b2669429629b82735