2024-03-05 11:26:07 +01:00
|
|
|
import {AfterViewInit, ChangeDetectorRef, Component, HostListener, OnInit} from '@angular/core';
|
2023-10-23 15:46:00 +02:00
|
|
|
import {ActivatedRoute, Router} from "@angular/router";
|
2023-10-24 14:29:36 +02:00
|
|
|
import {MenuItem} from "./openaireLibrary/sharedComponents/menu";
|
2023-10-27 14:53:59 +02:00
|
|
|
import {Header} from "./openaireLibrary/sharedComponents/navigationBar.component";
|
2023-11-02 13:56:35 +01:00
|
|
|
import {ConfigurationService} from "./openaireLibrary/utils/configuration/configuration.service";
|
2023-11-02 15:39:57 +01:00
|
|
|
import {Irish} from "./shared/irish";
|
2023-12-18 12:27:40 +01:00
|
|
|
import {CustomFilterService} from "./openaireLibrary/shared/customFilter.service";
|
2023-11-09 13:34:34 +01:00
|
|
|
import {UserManagementService} from "./openaireLibrary/services/user-management.service";
|
2023-11-14 15:13:09 +01:00
|
|
|
import {Session, User} from "./openaireLibrary/login/utils/helper.class";
|
2023-11-13 14:00:45 +01:00
|
|
|
import {SmoothScroll} from "./openaireLibrary/utils/smooth-scroll";
|
2023-11-24 09:55:49 +01:00
|
|
|
import {LayoutService} from "./openaireLibrary/dashboard/sharedComponents/sidebar/layout.service";
|
2023-12-08 14:35:51 +01:00
|
|
|
import {StakeholderUtils} from "./openaireLibrary/monitor-admin/utils/indicator-utils";
|
|
|
|
import {ResearcherBaseComponent} from "./shared/researcher-base.component";
|
2023-12-19 16:23:59 +01:00
|
|
|
import {UserProfileService} from "./openaireLibrary/services/userProfile.service";
|
2023-12-22 10:21:14 +01:00
|
|
|
import {SearchOrcidService} from "./openaireLibrary/claims/claim-utils/service/searchOrcid.service";
|
|
|
|
import {SearchResearchResultsService} from "./openaireLibrary/services/searchResearchResults.service";
|
|
|
|
import {Identifier} from "./openaireLibrary/utils/string-utils.class";
|
2024-01-09 10:57:40 +01:00
|
|
|
import {ConnectHelper} from "./openaireLibrary/connect/connectHelper";
|
2023-10-23 14:26:21 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'app-root',
|
|
|
|
template: `
|
2024-01-11 15:04:38 +01:00
|
|
|
<div class="uk-background-default">
|
2023-11-24 09:55:49 +01:00
|
|
|
<navbar *ngIf="hasHeader" portal="irish_monitor" [menuItems]="menuItems" [showMenu]="true"
|
|
|
|
[header]="header" [user]="user" [userMenuItems]="userMenuItems"></navbar>
|
2024-01-11 15:04:38 +01:00
|
|
|
<div *ngIf="loading">
|
|
|
|
<loading [full]="true"></loading>
|
|
|
|
</div>
|
|
|
|
<div [class.uk-hidden]="loading" [ngClass]="rootClass">
|
2023-10-23 15:46:00 +02:00
|
|
|
<div id="modal-container"></div>
|
2023-11-13 14:00:45 +01:00
|
|
|
<main>
|
|
|
|
<router-outlet></router-outlet>
|
|
|
|
</main>
|
2024-03-12 18:27:23 +01:00
|
|
|
<help-pop-up *ngIf="hasHelpPopUp"></help-pop-up>
|
2023-10-23 15:46:00 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2023-12-06 14:14:43 +01:00
|
|
|
<cookie-law *ngIf="isClient" position="bottom" cookieName="cookieLawSeen-NOAMIreland">
|
2023-12-08 14:35:51 +01:00
|
|
|
National Open Access Monitor - Ireland, uses cookies in order to function properly.<br>
|
|
|
|
Cookies are small pieces of data that websites store in your browser to allow us to give you the best browsing
|
|
|
|
experience possible.
|
|
|
|
By using the National Open Access Monitor - Ireland portal you accept our use of cookies. <!--<a
|
2023-12-06 14:14:43 +01:00
|
|
|
href="https://www.openaire.eu/privacy-policy#cookies" target="_blank"> Read more <span class="uk-icon">
|
|
|
|
<svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg" icon="chevron-right"
|
|
|
|
ratio="1"><polyline fill="none" stroke="#000" stroke-width="1.03"
|
|
|
|
points="7 4 13 10 7 16"></polyline></svg>
|
|
|
|
</span></a>-->
|
|
|
|
</cookie-law>
|
2024-01-08 16:40:46 +01:00
|
|
|
<footer class="uk-text-center uk-text-small uk-border-top">
|
2024-01-11 15:04:38 +01:00
|
|
|
<div class="uk-tile-default">
|
|
|
|
<div class="uk-section uk-container">
|
|
|
|
<div class="uk-flex uk-flex-middle uk-flex-center">
|
|
|
|
<img src="assets/logo/small.svg" alt="National Open Access Monitor Ireland" style="width: 40px;"/>
|
|
|
|
<div class="uk-margin-small-left">
|
|
|
|
Platform in <span class="uk-text-bold">Pilot</span> Phase - Final Release June 2024
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
2024-01-12 09:23:45 +01:00
|
|
|
<div class="uk-margin-medium-bottom">
|
|
|
|
<a href="https://graph.openaire.eu" target="_blank" class="uk-width-1-1 uk-width-auto@m">
|
|
|
|
<img src="assets/common-assets/openaire-badge-1.png" alt="Powered by OpenAIRE graph" style="height: 17px;"></a>
|
2024-01-11 15:04:38 +01:00
|
|
|
</div>
|
|
|
|
<div class="uk-margin-bottom uk-container uk-container-small">
|
|
|
|
The National Open Access Monitor, Ireland is delivered as part of the National Open Access Monitor
|
|
|
|
Project,
|
|
|
|
managed by the <a href="https://irel.ie/" target="_blank">Irish Research eLibrary (IReL)</a> at
|
|
|
|
Maynooth University.
|
|
|
|
The project has received funding from Ireland's <a href="https://dri.ie/norf/" target="_blank">National
|
|
|
|
Open Research Forum (NORF)</a>
|
|
|
|
under the Open Research Fund Call.
|
|
|
|
</div>
|
|
|
|
<div class="uk-margin-bottom">
|
|
|
|
<img title="Rialtas" src="assets/Rialtas_Mark_Std_Colour.png"
|
|
|
|
class=" uk-padding-xsmall uk-padding-remove-vertical" style="height: 50px;">
|
|
|
|
<img title="HEA" src="assets/hea-logo.png" class=" uk-padding-xsmall uk-padding-remove-vertical"
|
|
|
|
style="height: 30px;">
|
|
|
|
<img title="Maynooth University" src="assets/Maynooth University Logo.png"
|
|
|
|
class=" uk-padding-small uk-padding-remove-vertical" style="height: 30px;">
|
2024-01-12 09:23:45 +01:00
|
|
|
<img title="NORF" src="assets/norf.jpg" class=" uk-padding-small uk-padding-remove-vertical" style="height: 30px;">
|
|
|
|
<img title="IRel" src="assets/IReL logo.png" class=" uk-padding-small uk-padding-remove-vertical"
|
2024-01-11 15:04:38 +01:00
|
|
|
style="height: 30px;">
|
|
|
|
<img title="OpenAIRE" src="assets/common-assets/common/Logo_Horizontal.png"
|
|
|
|
class=" uk-padding-small uk-padding-remove-vertical" style="height: 30px;">
|
|
|
|
</div>
|
2024-01-08 13:37:02 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</footer>
|
2023-11-13 14:00:45 +01:00
|
|
|
`
|
2023-10-23 14:26:21 +02:00
|
|
|
})
|
2024-01-11 15:04:38 +01:00
|
|
|
export class AppComponent extends ResearcherBaseComponent implements OnInit, AfterViewInit {
|
2023-10-23 15:46:00 +02:00
|
|
|
loading: boolean = false;
|
2023-10-24 14:29:36 +02:00
|
|
|
hasHeader: boolean = true;
|
2023-11-24 09:55:49 +01:00
|
|
|
rootClass: string;
|
2023-10-27 14:53:59 +02:00
|
|
|
header: Header = {
|
2023-10-24 14:29:36 +02:00
|
|
|
route: "/",
|
|
|
|
title: "Noami",
|
2023-12-11 11:16:29 +01:00
|
|
|
logoUrl: 'assets/logo/main.svg',
|
2023-12-13 10:13:30 +01:00
|
|
|
logoSmallUrl: 'assets/logo/small.svg',
|
2023-10-24 14:29:36 +02:00
|
|
|
position: 'left',
|
2024-01-08 16:12:04 +01:00
|
|
|
badge: true
|
2023-10-24 14:29:36 +02:00
|
|
|
};
|
2023-12-08 14:35:51 +01:00
|
|
|
menuItems: MenuItem[] = [];
|
2023-11-14 15:13:09 +01:00
|
|
|
userMenuItems: MenuItem[] = [];
|
2023-11-02 15:39:57 +01:00
|
|
|
irish: Irish = new Irish();
|
2023-11-09 13:34:34 +01:00
|
|
|
user: User;
|
2023-12-08 14:35:51 +01:00
|
|
|
isClient: boolean = false;
|
|
|
|
stakeholderUtils: StakeholderUtils = new StakeholderUtils();
|
2024-03-05 11:26:07 +01:00
|
|
|
windowWidth: number;
|
|
|
|
compactMenuItems: boolean = false;
|
2024-03-08 11:51:46 +01:00
|
|
|
hasHelpPopUp: boolean = true;
|
2023-10-27 14:53:59 +02:00
|
|
|
|
2023-11-09 13:34:34 +01:00
|
|
|
constructor(protected _route: ActivatedRoute,
|
|
|
|
protected _router: Router,
|
2023-12-06 14:33:14 +01:00
|
|
|
protected cdr: ChangeDetectorRef,
|
2023-11-24 09:55:49 +01:00
|
|
|
private layoutService: LayoutService,
|
2023-11-13 14:00:45 +01:00
|
|
|
private smoothScroll: SmoothScroll,
|
2023-11-24 09:55:49 +01:00
|
|
|
private configurationService: ConfigurationService,
|
2023-12-08 14:35:51 +01:00
|
|
|
private customFilterService: CustomFilterService,
|
|
|
|
private userManagementService: UserManagementService,
|
2024-01-11 15:04:38 +01:00
|
|
|
private userProfileService: UserProfileService,
|
2023-12-22 10:21:14 +01:00
|
|
|
protected _searchOrcidService: SearchOrcidService,
|
|
|
|
protected _searchResearchResultsService: SearchResearchResultsService
|
2023-12-08 14:35:51 +01:00
|
|
|
) {
|
2023-10-27 14:53:59 +02:00
|
|
|
super();
|
2024-01-09 10:57:40 +01:00
|
|
|
// this.configurationService.initStaticPortal(this.irish.portal);
|
|
|
|
// this.configurationService.initPortal(this.properties, this.properties.adminToolsCommunity);
|
|
|
|
this.setProperties(this.properties.adminToolsCommunity, this.properties.adminToolsPortalType);
|
2023-12-19 16:30:39 +01:00
|
|
|
this.userManagementService.fixRedirectURL = this.properties.afterLoginRedirectLink;
|
2024-01-09 09:08:09 +01:00
|
|
|
this.userManagementService.allowDoubleRedirectToFixAndCurrentPage = true;
|
2024-01-11 15:04:38 +01:00
|
|
|
}
|
2023-11-09 13:34:34 +01:00
|
|
|
|
2024-03-05 11:26:07 +01:00
|
|
|
@HostListener('window:resize', ['$event'])
|
|
|
|
onResize(event) {
|
|
|
|
this.getWindowWidth();
|
2024-03-06 12:33:26 +01:00
|
|
|
this.buildMenuItems();
|
2024-03-05 11:26:07 +01:00
|
|
|
}
|
|
|
|
|
2023-11-03 09:51:59 +01:00
|
|
|
ngOnDestroy() {
|
|
|
|
super.ngOnDestroy();
|
|
|
|
this.customFilterService.clearSubscriptions();
|
2023-11-13 14:00:45 +01:00
|
|
|
this.configurationService.clearSubscriptions();
|
|
|
|
this.smoothScroll.clearSubscriptions();
|
2023-12-19 16:23:59 +01:00
|
|
|
this.userProfileService.clearSubscriptions();
|
2023-11-03 09:51:59 +01:00
|
|
|
}
|
2023-10-27 14:53:59 +02:00
|
|
|
|
|
|
|
ngOnInit() {
|
2023-12-21 10:49:32 +01:00
|
|
|
this.isClient = typeof document !== 'undefined';
|
2024-03-08 11:51:46 +01:00
|
|
|
this.subscriptions.push(this.layoutService.hasHelpPopUp.subscribe(value => {
|
|
|
|
this.hasHelpPopUp = value;
|
|
|
|
}));
|
2024-03-06 12:33:26 +01:00
|
|
|
if(this.isClient) {
|
|
|
|
this.getWindowWidth();
|
|
|
|
}
|
2024-01-11 15:04:38 +01:00
|
|
|
if (this.properties.environment == 'beta') {
|
2024-01-08 16:12:04 +01:00
|
|
|
this.header.environmentBadge = {
|
2024-01-09 16:58:07 +01:00
|
|
|
asset: 'assets/badge/sandbox.svg'
|
2024-01-08 16:12:04 +01:00
|
|
|
}
|
|
|
|
} else {
|
|
|
|
this.header.environmentBadge = {
|
|
|
|
asset: 'assets/badge/pilot.svg',
|
2024-01-09 16:58:07 +01:00
|
|
|
routerLink: '/how-it-works/about'
|
2024-01-08 16:12:04 +01:00
|
|
|
}
|
|
|
|
}
|
2023-11-24 09:55:49 +01:00
|
|
|
this.subscriptions.push(this.userManagementService.getUserInfo().subscribe(user => {
|
2023-11-09 13:34:34 +01:00
|
|
|
this.user = user;
|
2024-01-11 15:04:38 +01:00
|
|
|
if (user) {
|
2023-12-19 16:23:59 +01:00
|
|
|
this.userProfileService.initUserProfile()
|
2024-01-11 15:04:38 +01:00
|
|
|
} else {
|
2023-12-19 16:23:59 +01:00
|
|
|
this.userProfileService.setUserProfile(null);
|
|
|
|
}
|
2023-11-09 13:34:34 +01:00
|
|
|
this.initialize();
|
2023-11-24 09:55:49 +01:00
|
|
|
}));
|
2024-01-11 15:04:38 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
ngAfterViewInit() {
|
2023-11-24 09:55:49 +01:00
|
|
|
this.subscriptions.push(this.layoutService.rootClass.subscribe(rootClass => {
|
2024-01-11 15:04:38 +01:00
|
|
|
this.loading = true;
|
|
|
|
this.cdr.detectChanges();
|
|
|
|
if (rootClass && this.isClient) {
|
2023-12-21 10:49:32 +01:00
|
|
|
let link = <HTMLLinkElement>document.getElementById('theme');
|
|
|
|
let append = false;
|
2024-01-11 15:04:38 +01:00
|
|
|
if (!link) {
|
2023-12-21 10:49:32 +01:00
|
|
|
link = document.createElement('link');
|
|
|
|
link.rel = 'stylesheet';
|
|
|
|
link.id = 'theme';
|
|
|
|
append = true;
|
|
|
|
}
|
|
|
|
link.href = rootClass + '.css';
|
|
|
|
link.onerror = (error) => console.log(error);
|
2024-01-11 15:04:38 +01:00
|
|
|
if (append) {
|
2023-12-21 10:49:32 +01:00
|
|
|
document.head.appendChild(link);
|
|
|
|
}
|
|
|
|
}
|
2023-11-24 09:55:49 +01:00
|
|
|
this.rootClass = rootClass;
|
2023-12-06 14:33:14 +01:00
|
|
|
this.cdr.detectChanges();
|
2024-01-11 15:04:38 +01:00
|
|
|
setTimeout(() => {
|
|
|
|
this.loading = false;
|
|
|
|
this.cdr.detectChanges();
|
|
|
|
}, 500)
|
2023-11-24 09:55:49 +01:00
|
|
|
}));
|
2023-10-27 14:53:59 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
initialize() {
|
2024-03-05 11:26:07 +01:00
|
|
|
this.buildMenuItems();
|
|
|
|
}
|
|
|
|
|
|
|
|
buildMenuItems() {
|
|
|
|
if(this.compactMenuItems) {
|
|
|
|
this.menuItems = [
|
|
|
|
new MenuItem("home", "Home", "", "/", false, [], null, {}, null, null, null),
|
|
|
|
new MenuItem("monitors", "Monitors", "", "", false, [], null, {}, null, null, null, "/monitors", "_blank", "internal", false,
|
|
|
|
[
|
|
|
|
new MenuItem("national", this.stakeholderUtils.entities.country, "", "/national", false, [], null, {}, null, null, null),
|
|
|
|
new MenuItem("rpo", this.stakeholderUtils.entities.organization, "", "/rpo", false, [], null, {}, null, null, null, "/rpo"),
|
|
|
|
new MenuItem("rfo", this.stakeholderUtils.entities.funder, "", "/rfo", false, [], null, {}, null, null, null, "/rfo"),
|
|
|
|
new MenuItem("researcher", "Researcher", "", "/researcher", false, [], null, {}, null, null, null, "/researcher"),
|
|
|
|
new MenuItem("repository", "Repository", "", "/repository", false, [], null, {}, null, null, null, "/repository")
|
|
|
|
]
|
|
|
|
)
|
|
|
|
];
|
|
|
|
} else {
|
|
|
|
this.menuItems = [
|
|
|
|
new MenuItem("home", "Home", "", "/", false, [], null, {}, null, null, null),
|
|
|
|
new MenuItem("national", this.stakeholderUtils.entities.country + ' ' + this.stakeholderUtils.entities.stakeholder, "", "/national", false, [], null, {}, null, null, null),
|
|
|
|
new MenuItem("rpo", this.stakeholderUtils.entities.organization + ' ' + this.stakeholderUtils.entities.stakeholders, "", "/rpo", false, [], null, {}, null, null, null, "/rpo"),
|
|
|
|
new MenuItem("rfo", this.stakeholderUtils.entities.funder + ' ' + this.stakeholderUtils.entities.stakeholders, "", "/rfo", false, [], null, {}, null, null, null, "/rfo"),
|
|
|
|
new MenuItem("researcher", "Researcher Monitors", "", "/researcher", false, [], null, {}, null, null, null, "/researcher"),
|
|
|
|
new MenuItem("repository", "Repository Monitors", "", "/repository", false, [], null, {}, null, null, null, "/repository")
|
|
|
|
];
|
|
|
|
}
|
2024-01-11 15:04:38 +01:00
|
|
|
if (this.properties.environment != "beta") {
|
2024-01-09 17:01:27 +01:00
|
|
|
this.menuItems.push(
|
2024-01-11 15:04:38 +01:00
|
|
|
new MenuItem("resources", "Resources & Help", "", "", false, [], null, {}, null, null, null, "/resources", "_blank", "internal", false,
|
|
|
|
[
|
|
|
|
new MenuItem("how-it-works", "How it works?", "", "", false, [], null, {}, null, null, null, null, "_self"),
|
|
|
|
new MenuItem("about", "About", "", "/how-it-works/about", false, [], null, {}, null, null, null, "/how-it-works/about"),
|
|
|
|
new MenuItem("the-5-monitors", "The 5 Monitors", "", "/how-it-works/the-5-monitors", false, [], null, {}, null, null, null, "/the-5-monitors"),
|
|
|
|
new MenuItem("user-actions", "User Actions", "", "/how-it-works/user-actions", false, [], null, {}, null, null, null, "/how-it-works/user-actions"),
|
|
|
|
new MenuItem("methodology", "Methodology", "", "", false, [], null, {}, null, null, null, null, "_self"),
|
|
|
|
new MenuItem("methodological-approach", "Methodological Approach", "", "/methodology/methodological-approach", false, [], null, {}, null, null, null, "/methodological-approach"),
|
|
|
|
new MenuItem("terminology-construction", "Terminology & Construction", "", "/methodology/terminology", false, [], null, {}, null, null, null, "/methodology/terminology"),
|
|
|
|
new MenuItem("", "", "", "", false, [], null, {}, null, null, null, null, "_self"),
|
|
|
|
new MenuItem("stats-logs", "Web Statistics & Activity Logs", "", "/stats-logs", false, [], null, {}, null, null, null, "/stats-logs"),
|
|
|
|
new MenuItem("engagement-training", "Engagement & Training", "", "/engagement-training", false, [], null, {}, null, null, null, "/engagement-training"),
|
|
|
|
new MenuItem("support", "Support", "", "/support", false, [], null, {}, null, null, null, "/support"),
|
|
|
|
]
|
|
|
|
)
|
2024-01-09 17:01:27 +01:00
|
|
|
)
|
|
|
|
}
|
2023-12-08 14:35:51 +01:00
|
|
|
if (this.user) {
|
|
|
|
this.userMenuItems = [];
|
2024-01-11 15:04:38 +01:00
|
|
|
if (this.user.orcid) {
|
2023-12-22 10:21:14 +01:00
|
|
|
this.authorId = Identifier.getRawORCID(this.user.orcid);
|
2023-12-08 14:35:51 +01:00
|
|
|
this.results = {
|
|
|
|
success: (res: string | number) => {
|
2024-01-11 15:04:38 +01:00
|
|
|
if (+res > 0) {
|
2023-12-08 14:35:51 +01:00
|
|
|
this.userMenuItems.push(new MenuItem("my-researcher", "My Researcher Monitor", "", "/researcher/" + this.authorId, false, [], null, {}, null, null, null, null));
|
|
|
|
this.staticUserItems();
|
2024-01-11 15:04:38 +01:00
|
|
|
} else {
|
2023-12-22 10:21:14 +01:00
|
|
|
this.staticUserItems();
|
2023-12-08 14:35:51 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.search();
|
|
|
|
} else {
|
|
|
|
this.staticUserItems();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2023-11-14 15:13:09 +01:00
|
|
|
|
2023-12-08 14:35:51 +01:00
|
|
|
staticUserItems() {
|
2024-02-14 15:57:53 +01:00
|
|
|
if(this.properties.environment != "beta"){
|
|
|
|
this.userMenuItems.push(new MenuItem("myorcidlinks", "My Orcid links", "", "/my-orcid-links", false, [], null, {}, null, null, null, null));
|
|
|
|
}
|
2023-12-08 14:35:51 +01:00
|
|
|
this.userMenuItems.push(
|
2024-01-08 09:16:20 +01:00
|
|
|
new MenuItem("myclaims", "My links", "", "/participate/myclaims", false, [], null, {}, null, null, null, null),
|
2023-11-14 16:25:08 +01:00
|
|
|
new MenuItem("claims", "Link", "", "/participate/claim", false, [], null, {}, null, null, null, null),
|
|
|
|
new MenuItem("upload-dois", "Upload DOIs", "", "/upload-dois", false, [], null, {}, null, null, null, null)
|
2023-12-08 14:35:51 +01:00
|
|
|
);
|
|
|
|
if (this.isAdmin) {
|
|
|
|
this.userMenuItems.push(new MenuItem("stakeholders", "Manage profiles", "", "/admin", false, [], [], {}, {name: 'settings'}));
|
2023-11-14 15:13:09 +01:00
|
|
|
}
|
2024-01-09 11:02:07 +01:00
|
|
|
if (Session.isPortalAdministrator(this.user)) {
|
2024-01-11 15:04:38 +01:00
|
|
|
this.userMenuItems.push(new MenuItem("adminOptions", "Super Admin options", "", "/admin/admin-tools/portals", false, [], [], {}, null, null, "uk-visible@m"));
|
2024-01-09 11:02:07 +01:00
|
|
|
}
|
2024-01-11 15:04:38 +01:00
|
|
|
if (Session.isPortalAdministrator(this.user) || Session.isCurator('country', this.user)) {
|
|
|
|
this.userMenuItems.push(new MenuItem("irishOptions", "Irish options", "", "/admin/irish/admin-tools/pages", false, [], [], {}, null, null, "uk-visible@m"));
|
2024-01-09 11:02:07 +01:00
|
|
|
}
|
2023-11-14 15:13:09 +01:00
|
|
|
}
|
|
|
|
|
2024-01-09 10:57:40 +01:00
|
|
|
setProperties(id, type = null) {
|
|
|
|
this.properties.adminToolsCommunity = id;
|
|
|
|
if (type) {
|
|
|
|
this.properties.adminToolsPortalType = type;
|
|
|
|
} else {
|
|
|
|
ConnectHelper.setPortalTypeFromPid(id);
|
|
|
|
}
|
|
|
|
this.configurationService.initPortal(this.properties, this.properties.adminToolsCommunity);
|
|
|
|
}
|
|
|
|
|
2023-11-14 15:13:09 +01:00
|
|
|
public get isAdmin() {
|
2024-02-26 14:55:46 +01:00
|
|
|
return Session.isPortalAdministrator(this.user) || Session.isMonitorCurator(this.user) || Session.isKindOfMonitorManager(this.user);
|
2023-10-23 15:46:00 +02:00
|
|
|
}
|
2024-03-05 11:26:07 +01:00
|
|
|
|
|
|
|
getWindowWidth() {
|
|
|
|
this.windowWidth = window.innerWidth;
|
|
|
|
let mBreakpoint = Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue('--uk-breakpoint-m'));
|
|
|
|
let xlBreakpoint = Number.parseInt(getComputedStyle(document.documentElement).getPropertyValue('--uk-breakpoint-xl'));
|
|
|
|
if(this.windowWidth > mBreakpoint && this.windowWidth <= xlBreakpoint) {
|
|
|
|
this.compactMenuItems = true;
|
|
|
|
} else {
|
|
|
|
this.compactMenuItems = false;
|
|
|
|
}
|
|
|
|
}
|
2023-10-23 14:26:21 +02:00
|
|
|
}
|