diff --git a/src/app/app.component.ts b/src/app/app.component.ts index 4e5b031342..4a948187a2 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -1,7 +1,7 @@ import { AfterViewInit, ApplicationRef, Component, OnInit, ViewChild } from '@angular/core' import { ModalDirective } from 'ngx-bootstrap/modal' -import { Angulartics2Matomo } from 'angulartics2' import { VoService } from './api-connector/vo.service' +import { TitleService } from './title.service' /** * App component. @@ -21,7 +21,7 @@ export class AppComponent implements AfterViewInit, OnInit { constructor( private appRef: ApplicationRef, - private angulartics2Matomo: Angulartics2Matomo + private titleService: TitleService ) { /* if (environment.production) { const isStable = appRef.isStable.pipe(first(isStable => isStable === true)); @@ -41,10 +41,7 @@ export class AppComponent implements AfterViewInit, OnInit { } ngOnInit(): void { - this.angulartics2Matomo.startTracking() - // this.voService.isVo().subscribe((result: IResponseTemplate) => { - // setVO(result.value); - // }) + this.titleService.init() } ngAfterViewInit(): void {} diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 94429a6ae3..961ab08b13 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -1,6 +1,6 @@ import { HashLocationStrategy, LocationStrategy, CommonModule } from '@angular/common' import { ErrorHandler, NgModule } from '@angular/core' -import { BrowserModule } from '@angular/platform-browser' +import { BrowserModule, Title } from '@angular/platform-browser' import { BsDropdownModule } from 'ngx-bootstrap/dropdown' import { TabsModule } from 'ngx-bootstrap/tabs' import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http' @@ -46,6 +46,7 @@ import { VoService } from './api-connector/vo.service' import { TokenInterceptor } from './api-connector/token-interceptor' import { PipeModuleModule } from './pipe-module/pipe-module.module' import { FacilityService } from './api-connector/facility.service' +import { TitleService } from './title.service' /** * App module. @@ -114,6 +115,8 @@ import { FacilityService } from './api-connector/facility.service' CookieService, VoService, FacilityService, + Title, + TitleService, provideHttpClient(withInterceptorsFromDi()) ] }) diff --git a/src/app/app.routing.ts b/src/app/app.routing.ts index 74ca79b893..6ead6f2e35 100644 --- a/src/app/app.routing.ts +++ b/src/app/app.routing.ts @@ -1,103 +1,111 @@ /* eslint-disable */ -import {NgModule} from '@angular/core' -import {RouterModule, Routes} from '@angular/router' +import { NgModule } from '@angular/core' +import { RouterModule, Routes } from '@angular/router' // Layouts -import {ConsentInfoComponent} from './consent-info.component' -import {FullLayoutComponent} from './layouts/full-layout.component' -import {MemberGuardService} from './member-guard.service' -import {RegistrationInfoComponent} from './registration-info.component' -import {LoggedInGuard} from './logged-in-guard.service' -import {CreditsCalculatorComponent} from './credits-calculator/credits-calculator.component' -import {VoGuardService} from './shared/guards/vo-guard.service'; +import { ConsentInfoComponent } from './consent-info.component' +import { FullLayoutComponent } from './layouts/full-layout.component' +import { MemberGuardService } from './member-guard.service' +import { RegistrationInfoComponent } from './registration-info.component' +import { LoggedInGuard } from './logged-in-guard.service' +import { CreditsCalculatorComponent } from './credits-calculator/credits-calculator.component' +import { VoGuardService } from './shared/guards/vo-guard.service' export const routes: Routes = [ - { - path: '', - redirectTo: 'userinfo', - pathMatch: 'full', + { + path: '', + redirectTo: 'userinfo', + pathMatch: 'full', + data: { + title: 'de.NBI Cloud Portal - Profile', }, - { - path: 'registration-info', - component: RegistrationInfoComponent, - pathMatch: 'full', + }, + { + path: 'registration-info', + component: RegistrationInfoComponent, + pathMatch: 'full', + data: { + title: 'de.NBI Cloud Portal - Registration Info', }, - { - path: 'consent-info', - component: ConsentInfoComponent, - pathMatch: 'full', + }, + { + path: 'consent-info', + component: ConsentInfoComponent, + pathMatch: 'full', + data: { + title: 'de.NBI Cloud Portal - Consent Info', }, - { - path: '', - component: FullLayoutComponent, - canActivate: [MemberGuardService], - data: { - title: 'de.NBI Cloud Portal', - }, - children: [ - { - path: 'userinfo', - canActivate: [LoggedInGuard], + }, + { + path: '', + component: FullLayoutComponent, + canActivate: [MemberGuardService], + data: { + title: 'de.NBI Cloud Portal', + }, + children: [ + { + path: 'userinfo', + canActivate: [LoggedInGuard], - // eslint-disable-next-line @typescript-eslint/promise-function-async - loadChildren: () => import('./userinfo/userinfo.module').then(m => m.UserinfoModule), - }, - { - path: 'help', - canActivate: [LoggedInGuard], + + loadChildren: () => import('./userinfo/userinfo.module').then(m => m.UserinfoModule), + }, + { + path: 'help', + canActivate: [LoggedInGuard], - // eslint-disable-next-line @typescript-eslint/promise-function-async - loadChildren: () => import('./help/help.module').then(m => m.HelpModule), - }, - { - path: 'project-management', - canActivate: [LoggedInGuard], + + loadChildren: () => import('./help/help.module').then(m => m.HelpModule), + }, + { + path: 'project-management', + canActivate: [LoggedInGuard], - loadChildren: () => import('./projectmanagement/projectmanagement.module').then(m => m.ProjectManagementModule), - }, - { - path: 'applications', - canActivate: [LoggedInGuard], + loadChildren: () => import('./projectmanagement/projectmanagement.module').then(m => m.ProjectManagementModule), + }, + { + path: 'applications', + canActivate: [LoggedInGuard], - loadChildren: () => import('./applications/applications.module').then(m => m.ApplicationsModule), - }, - { - path: 'virtualmachines', - canActivate: [LoggedInGuard], + loadChildren: () => import('./applications/applications.module').then(m => m.ApplicationsModule), + }, + { + path: 'virtualmachines', + canActivate: [LoggedInGuard], - loadChildren: () => import('./virtualmachines/vm.module').then(m => m.VmModule), - }, - { - path: 'vo-manager', - loadChildren: () => import('./vo_manager/VoManager.module').then(m => m.VoManagerModule), - canActivate: [VoGuardService] - }, - { - path: 'facility-manager', - canActivate: [LoggedInGuard], + loadChildren: () => import('./virtualmachines/vm.module').then(m => m.VmModule), + }, + { + path: 'vo-manager', + loadChildren: () => import('./vo_manager/VoManager.module').then(m => m.VoManagerModule), + canActivate: [VoGuardService], + }, + { + path: 'facility-manager', + canActivate: [LoggedInGuard], - loadChildren: () => import('./facility_manager/facilitymanager.module').then(m => m.FacilitymanagerModule), - }, - { - path: 'credits-calculator', - canActivate: [LoggedInGuard], - component: CreditsCalculatorComponent, + loadChildren: () => import('./facility_manager/facilitymanager.module').then(m => m.FacilitymanagerModule), + }, + { + path: 'credits-calculator', + canActivate: [LoggedInGuard], + component: CreditsCalculatorComponent, - loadChildren: () => - import('./credits-calculator/credits-calculator.module').then(m => m.CreditsCalculatorModule), - }, - ], - }, + loadChildren: () => + import('./credits-calculator/credits-calculator.module').then(m => m.CreditsCalculatorModule), + }, + ], + }, ] /** * App routing module. */ @NgModule({ - imports: [RouterModule.forRoot(routes, {})], - exports: [RouterModule], - providers: [MemberGuardService, LoggedInGuard], + imports: [RouterModule.forRoot(routes, {})], + exports: [RouterModule], + providers: [MemberGuardService, LoggedInGuard], }) -export class AppRoutingModule { -} +export class AppRoutingModule {} /* eslint-enable */ diff --git a/src/app/applications/application-formular/application-formular.component.ts b/src/app/applications/application-formular/application-formular.component.ts index a02952aa7d..4842e14079 100644 --- a/src/app/applications/application-formular/application-formular.component.ts +++ b/src/app/applications/application-formular/application-formular.component.ts @@ -1,6 +1,6 @@ -import { ChangeDetectorRef, Component, Input, OnInit, ViewChild, inject } from '@angular/core' +import { ChangeDetectorRef, Component, Input, OnInit, ViewChild } from '@angular/core' import { NgForm } from '@angular/forms' -import { MatomoTracker } from 'ngx-matomo-client' + import { Flavor } from '../../virtualmachines/virtualmachinemodels/flavor' import { FlavorService } from '../../api-connector/flavor.service' import { FlavorType } from '../../virtualmachines/virtualmachinemodels/flavorType' @@ -51,8 +51,6 @@ export class ApplicationFormularComponent extends ApplicationBaseClassComponent @Input() is_validation: boolean = false @Input() hash: string - private readonly tracker = inject(MatomoTracker) - userinfo: Userinfo valid_pi_affiliations unknownPiAffiliationsConfirmation: boolean = false @@ -115,11 +113,6 @@ export class ApplicationFormularComponent extends ApplicationBaseClassComponent } ngOnInit(): void { - if (!this.is_validation) { - const typeStr: string = this.openstack_project ? ' Openstack' : 'SimpleVM' - this.tracker.trackPageView(`New Application Formular: ${typeStr}`) - } - this.getUserinfo() this.getListOfFlavors() this.getListOfTypes() @@ -257,7 +250,6 @@ export class ApplicationFormularComponent extends ApplicationBaseClassComponent * gets a list of all available Flavors from the flavorservice and puts them into the array flavorList */ getListOfFlavors(): void { - this.flavorService.getListOfFlavorsAvailable().subscribe((flavors: Flavor[]): void => { this.flavorList = flavors }) diff --git a/src/app/applications/applications.component.ts b/src/app/applications/applications.component.ts index 26e4b118b7..2c58f8e304 100644 --- a/src/app/applications/applications.component.ts +++ b/src/app/applications/applications.component.ts @@ -1,8 +1,7 @@ - -import { ChangeDetectorRef, Component, OnDestroy, OnInit, inject } from '@angular/core' +import { ChangeDetectorRef, Component, OnDestroy, OnInit } from '@angular/core' import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal' import { Subscription } from 'rxjs' -import { MatomoTracker } from 'ngx-matomo-client' + import { ApplicationsService } from '../api-connector/applications.service' import { ApiSettings } from '../api-connector/api-settings.service' import { Application } from './application.model/application.model' @@ -22,7 +21,6 @@ import { CreditsService } from '../api-connector/credits.service' import { NotificationModalComponent } from '../shared/modal/notification-modal' import { ConfirmationActions } from '../shared/modal/confirmation_actions' import { ApplicationTabStates } from '../shared/enums/application-tab-states' - /** * Application Overview component. @@ -42,7 +40,6 @@ import { ApplicationTabStates } from '../shared/enums/application-tab-states' ] }) export class ApplicationsComponent extends ApplicationBaseClassComponent implements OnInit, OnDestroy { - private readonly tracker = inject(MatomoTracker) title: string = 'Application Overview' tab_state: number = ApplicationTabStates.SUBMITTED ApplicationTabStates: typeof ApplicationTabStates = ApplicationTabStates @@ -100,7 +97,6 @@ export class ApplicationsComponent extends ApplicationBaseClassComponent impleme } ngOnInit(): void { - this.tracker.trackPageView('Application Overview') this.is_vo_admin = is_vo if (this.is_vo_admin) { this.getApplicationNumbers() @@ -154,7 +150,6 @@ export class ApplicationsComponent extends ApplicationBaseClassComponent impleme const facilityname: string = res['Facility'] const facilityId: number = res['FacilityId'] if (facilityId) { - app.project_application_compute_center = new ComputecenterComponent( facilityId.toString(), facilityname, diff --git a/src/app/applications/type-overview.component.ts b/src/app/applications/type-overview.component.ts index 431a14d968..e67b0d1983 100644 --- a/src/app/applications/type-overview.component.ts +++ b/src/app/applications/type-overview.component.ts @@ -1,5 +1,5 @@ -import { Component, OnInit, inject } from '@angular/core' -import { MatomoTracker } from 'ngx-matomo-client' +import { Component, OnInit } from '@angular/core' + import { WIKI_WORKSHOPS, OPENSTACK_LINK, PROJECT_TYPES_LINK, SIMPLE_VM_LINK } from '../../links/links' import { is_vo } from '../shared/globalvar' @@ -12,8 +12,6 @@ import { is_vo } from '../shared/globalvar' styleUrls: ['./type-overview.component.css'] }) export class TypeOverviewComponent implements OnInit { - private readonly tracker = inject(MatomoTracker) - title: string = 'Project Type Overview' openstack_color: string = '#ed1944' simplevm_color: string = '#00adef' @@ -40,7 +38,6 @@ export class TypeOverviewComponent implements OnInit { OPENSTACK_LINK: string = OPENSTACK_LINK ngOnInit(): any { - this.tracker.trackPageView('New Project - Project Type Overview') this.simpleVM_logo_link = `${this.static_img_folder}simpleVM_Logo.svg` this.simpleVM_curve_logo = `${this.static_img_folder}/simplevm-info-page/flatlearning.svg` this.simpleVM_ease_logo = `${this.static_img_folder}/simplevm-info-page/easytouse.svg` diff --git a/src/app/credits-calculator/credits-calculator.component.ts b/src/app/credits-calculator/credits-calculator.component.ts index 5d238b22a4..a032097dd6 100644 --- a/src/app/credits-calculator/credits-calculator.component.ts +++ b/src/app/credits-calculator/credits-calculator.component.ts @@ -1,6 +1,6 @@ -import { Component, OnInit, inject } from '@angular/core' +import { Component, OnInit } from '@angular/core' import { UntypedFormControl, UntypedFormGroup } from '@angular/forms' -import { MatomoTracker } from 'ngx-matomo-client' + import { FacilityService } from '../api-connector/facility.service' import { FlavorService } from '../api-connector/flavor.service' import { Flavor } from '../virtualmachines/virtualmachinemodels/flavor' @@ -20,7 +20,6 @@ import { ResourceWeight } from './resource-weights.model/resource-weights.model' providers: [FacilityService, FlavorService, CreditsService, GroupService] }) export class CreditsCalculatorComponent implements OnInit { - private readonly tracker = inject(MatomoTracker) title: string = 'Credits Calculator' got_all_cc: boolean = false got_all_flavor: boolean = false @@ -59,12 +58,9 @@ export class CreditsCalculatorComponent implements OnInit { private flavor_service: FlavorService, private credits_service: CreditsService, private group_service: GroupService - ) { - - } + ) {} ngOnInit(): void { - this.tracker.trackPageView('Credits Calculator') this.flavor_service.getListOfTypesAvailable().subscribe((result: FlavorType[]) => { this.flavor_types = result }) diff --git a/src/app/facility_manager/facility.application.component.ts b/src/app/facility_manager/facility.application.component.ts index 5e411130dc..6aa9ba49a2 100644 --- a/src/app/facility_manager/facility.application.component.ts +++ b/src/app/facility_manager/facility.application.component.ts @@ -1,5 +1,5 @@ -import { ChangeDetectorRef, Component, OnInit, inject } from '@angular/core' -import { MatomoTracker } from 'ngx-matomo-client' +import { ChangeDetectorRef, Component, OnInit } from '@angular/core' + import { FacilityService } from '../api-connector/facility.service' import { UserService } from '../api-connector/user.service' import { GroupService } from '../api-connector/group.service' @@ -8,7 +8,7 @@ import { Application } from '../applications/application.model/application.model import { Application_States } from '../shared/shared_modules/baseClass/abstract-base-class' import { ApplicationsService } from '../api-connector/applications.service' import { ApplicationBaseClassComponent } from '../shared/shared_modules/baseClass/application-base-class.component' - + enum TabStates { 'SUBMITTED' = 0, 'CREDITS_EXTENSION' = 1, @@ -27,7 +27,6 @@ enum TabStates { providers: [FacilityService, UserService, GroupService, ApplicationsService, ApiSettings] }) export class FacilityApplicationComponent extends ApplicationBaseClassComponent implements OnInit { - private readonly tracker = inject(MatomoTracker) numberOfExtensionRequests: number = 0 numberOfModificationRequests: number = 0 numberOfCreditRequests: number = 0 @@ -226,7 +225,6 @@ export class FacilityApplicationComponent extends ApplicationBaseClassComponent } ngOnInit(): void { - this.tracker.trackPageView('Facility Application Overview') this.facilityService.getManagerFacilities().subscribe((result: any): void => { this.managerFacilities = result this.selectedFacility = this.managerFacilities[0] diff --git a/src/app/facility_manager/facilityprojectsoverview.component.ts b/src/app/facility_manager/facilityprojectsoverview.component.ts index a3f0d0a506..b2c559922d 100644 --- a/src/app/facility_manager/facilityprojectsoverview.component.ts +++ b/src/app/facility_manager/facilityprojectsoverview.component.ts @@ -1,7 +1,7 @@ -import { Component, Input, OnInit, QueryList, ViewChildren, inject } from '@angular/core' +import { Component, Input, OnInit, QueryList, ViewChildren } from '@angular/core' import { Observable, take } from 'rxjs' import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal' -import { MatomoTracker } from 'ngx-matomo-client' + import { ProjectMember } from '../projectmanagement/project_member.model' import { environment } from '../../environments/environment' import { ApiSettings } from '../api-connector/api-settings.service' @@ -31,7 +31,6 @@ import { ProjectCsvTemplatedEmailModalComponent } from '../shared/modal/email/pr providers: [FacilityService, UserService, GroupService, ApiSettings, NewsService, ProjectSortService] }) export class FacilityProjectsOverviewComponent extends AbstractBaseClass implements OnInit { - private readonly tracker = inject(MatomoTracker) @Input() voRegistrationLink: string = environment.voRegistrationLink title: string = 'Projects Overview' @@ -146,7 +145,6 @@ export class FacilityProjectsOverviewComponent extends AbstractBaseClass impleme } ngOnInit(): void { - this.tracker.trackPageView('Facility Project Overview') this.facilityService.getManagerFacilities().subscribe((result: any): void => { this.managerFacilities = result this.selectedFacility = this.managerFacilities[0] diff --git a/src/app/facility_manager/imagetags.component.ts b/src/app/facility_manager/imagetags.component.ts index 0b9a827c16..9d9470ea1e 100644 --- a/src/app/facility_manager/imagetags.component.ts +++ b/src/app/facility_manager/imagetags.component.ts @@ -1,6 +1,6 @@ -import { Component, OnInit, inject } from '@angular/core' +import { Component, OnInit } from '@angular/core' import { forkJoin } from 'rxjs' -import { MatomoTracker } from 'ngx-matomo-client' + import { ImageService } from '../api-connector/image.service' import { BlockedImageTag, BlockedImageTagResenv, ImageLogo, ImageMode, ImageTag } from './image-tag' import { FacilityService } from '../api-connector/facility.service' @@ -15,8 +15,6 @@ import { BiocondaService } from '../api-connector/bioconda.service' providers: [ImageService, FacilityService, BiocondaService] }) export class ImageTagComponent implements OnInit { - private readonly tracker = inject(MatomoTracker) - title: string = 'Image Tags' isLoaded: boolean = false @@ -106,7 +104,6 @@ export class ImageTagComponent implements OnInit { } ngOnInit(): void { - this.tracker.trackPageView('Image Tags') this.facilityService.getManagerFacilities().subscribe((result: any): void => { this.managerFacilities = result this.selectedFacility = this.managerFacilities[0] diff --git a/src/app/facility_manager/newsmanagement/news-manager.component.ts b/src/app/facility_manager/newsmanagement/news-manager.component.ts index fcb16717bc..2bd3a15991 100644 --- a/src/app/facility_manager/newsmanagement/news-manager.component.ts +++ b/src/app/facility_manager/newsmanagement/news-manager.component.ts @@ -1,8 +1,8 @@ -import { Component, OnDestroy, OnInit, ViewChild, inject } from '@angular/core' +import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core' import { UntypedFormControl, UntypedFormGroup, Validators } from '@angular/forms' import { BehaviorSubject, Subscription } from 'rxjs' import { ModalDirective } from 'ngx-bootstrap/modal' -import { MatomoTracker } from 'ngx-matomo-client' + import { NewsService } from '../../api-connector/news.service' import { FacilityService } from '../../api-connector/facility.service' import { environment } from '../../../environments/environment' @@ -17,7 +17,6 @@ import { WIKI_MOTD } from '../../../links/links' providers: [NewsService, FacilityService] }) export class NewsManagerComponent implements OnInit, OnDestroy { - private readonly tracker = inject(MatomoTracker) title: string = 'News Management' public production: boolean = environment.production WIKI_MOTD: string = WIKI_MOTD @@ -71,7 +70,6 @@ export class NewsManagerComponent implements OnInit, OnDestroy { * Method on site initialization. */ ngOnInit(): void { - this.tracker.trackPageView('News Management') this.subscription.add( this.facilityService.getComputeCenters().subscribe((computeCenters: any[]): void => { this.computeCenters = computeCenters diff --git a/src/app/facility_manager/resources/resources.component.ts b/src/app/facility_manager/resources/resources.component.ts index 6f32985719..929c1d9e42 100644 --- a/src/app/facility_manager/resources/resources.component.ts +++ b/src/app/facility_manager/resources/resources.component.ts @@ -1,6 +1,6 @@ -import { Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core' +import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' import { download, mkConfig, generateCsv, CsvOutput } from 'export-to-csv' -import { MatomoTracker } from 'ngx-matomo-client' + import { Resources } from '../../vo_manager/resources/resources' import { FacilityService } from '../../api-connector/facility.service' import { ObjectStorageFactor } from './object-storage-factor' @@ -19,7 +19,6 @@ import { GPUSpecification } from './gpu-specification' providers: [FacilityService] }) export class ResourcesComponent implements OnInit { - private readonly tracker = inject(MatomoTracker) title: string = 'Resource Overview' tableId: string = 'contentToConvert' @@ -152,7 +151,6 @@ export class ResourcesComponent implements OnInit { } ngOnInit(): void { - this.tracker.trackPageView('Facility Resources') this.facilityService.getManagerFacilities().subscribe((result: [string, number][]): void => { this.managerFacilities = result this.selectedFacility = this.managerFacilities[0] diff --git a/src/app/help/help.component.ts b/src/app/help/help.component.ts index ff9158341c..13064913ec 100644 --- a/src/app/help/help.component.ts +++ b/src/app/help/help.component.ts @@ -1,5 +1,5 @@ -import { Component, OnInit, inject } from '@angular/core' -import { MatomoTracker } from 'ngx-matomo-client' +import { Component, OnInit } from '@angular/core' + import { WIKI, CLOUD_PORTAL_SUPPORT_MAIL, STATUS_LINK, SUPPORT_LINK, ZAMMAD_HELPDESK_LINK } from '../../links/links' /** * Help component. @@ -10,7 +10,6 @@ import { WIKI, CLOUD_PORTAL_SUPPORT_MAIL, STATUS_LINK, SUPPORT_LINK, ZAMMAD_HELP providers: [] }) export class HelpComponent implements OnInit { - private readonly tracker = inject(MatomoTracker) WIKI: string = WIKI CLOUD_PORTAL_SUPPORT_MAIL: string = CLOUD_PORTAL_SUPPORT_MAIL STATUS_LINK: string = STATUS_LINK @@ -18,7 +17,5 @@ export class HelpComponent implements OnInit { ZAMMAD_HELPDESK_LINK: string = ZAMMAD_HELPDESK_LINK title: string = 'Help' - ngOnInit(): void { - this.tracker.trackPageView('Help') - } + ngOnInit(): void {} } diff --git a/src/app/projectmanagement/overview.component.ts b/src/app/projectmanagement/overview.component.ts index f54c962d94..83bbafa40a 100644 --- a/src/app/projectmanagement/overview.component.ts +++ b/src/app/projectmanagement/overview.component.ts @@ -2,12 +2,11 @@ import { ChangeDetectorRef, Component, ElementRef, - Inject, OnDestroy, OnInit, Renderer2, ViewChild, - inject + Inject } from '@angular/core' import moment from 'moment' import { forkJoin, Observable, Subscription } from 'rxjs' @@ -15,7 +14,7 @@ import { ActivatedRoute, Router } from '@angular/router' import { DOCUMENT } from '@angular/common' import { Chart } from 'chart.js' import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal' -import { MatomoTracker } from 'ngx-matomo-client' + import { environment } from '../../environments/environment' import { ProjectMemberApplication } from './project_member_application' import { Userinfo } from '../userinfo/userinfo.model' @@ -70,7 +69,6 @@ import { WITHDRAWAL_TYPES, WithdrawModalComponent } from './modals/withdraw/with ] }) export class OverviewComponent extends ApplicationBaseClassComponent implements OnInit, OnDestroy { - private readonly tracker = inject(MatomoTracker) bsModalRef: BsModalRef modificationRequestDisabled: boolean = false lifetimeExtensionDisabled: boolean = false @@ -199,7 +197,6 @@ export class OverviewComponent extends ApplicationBaseClassComponent implements this.project_application = null this.project_members = [] this.application_id = paramsId.id - this.tracker.trackPageView(`Project Overview for pid: ${paramsId.id}`) this.is_vo_admin = is_vo this.getApplication() @@ -1035,7 +1032,7 @@ export class OverviewComponent extends ApplicationBaseClassComponent implements (): void => { this.updateNotificationModal('Success', 'The application has been successfully removed', true, 'success') this.fullLayout.getGroupsEnumeration() - + void this.router.navigate(['/userinfo']) }, (): void => { diff --git a/src/app/title.service.ts b/src/app/title.service.ts new file mode 100644 index 0000000000..9f5e66e98a --- /dev/null +++ b/src/app/title.service.ts @@ -0,0 +1,37 @@ +import { Injectable } from '@angular/core' +import { Title } from '@angular/platform-browser' +import { Router, NavigationEnd } from '@angular/router' +import { filter, map } from 'rxjs/operators' + +@Injectable({ + providedIn: 'root' +}) +export class TitleService { + constructor( + private title: Title, + private router: Router + ) {} + + init() { + this.router.events + .pipe( + filter(event => event instanceof NavigationEnd), + map(() => this.router.routerState.root), + map(route => { + while (route.firstChild) route = route.firstChild + + return route + }), + map(route => route.snapshot.data['title']) + ) + .subscribe((title: string) => { + if (title) { + this.title.setTitle(title) + // Optionally, ensure Matomo gets the updated title + if (window['_paq']) { + window['_paq'].push(['setDocumentTitle', title]) + } + } + }) + } +} diff --git a/src/app/userinfo/userinfo.component.ts b/src/app/userinfo/userinfo.component.ts index d8c6b2c6c8..97f05a8d07 100644 --- a/src/app/userinfo/userinfo.component.ts +++ b/src/app/userinfo/userinfo.component.ts @@ -1,7 +1,7 @@ -import { Component, EventEmitter, OnInit, inject } from '@angular/core' +import { Component, EventEmitter, OnInit } from '@angular/core' import { forkJoin } from 'rxjs' import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal' -import { MatomoTracker } from 'ngx-matomo-client' + import { Userinfo } from './userinfo.model' import { ApiSettings } from '../api-connector/api-settings.service' import { KeyService } from '../api-connector/key.service' @@ -122,8 +122,6 @@ export class UserInfoComponent implements OnInit { confirmEventEmitter: EventEmitter = new EventEmitter() - private readonly tracker = inject(MatomoTracker) - constructor( private groupService: GroupService, private userService: UserService, @@ -156,7 +154,6 @@ export class UserInfoComponent implements OnInit { } ngOnInit(): void { - this.tracker.trackPageView('User Info') this.getUserinfo() this.isFreemiumActive() this.isUserSimpleVmMember() @@ -255,7 +252,6 @@ export class UserInfoComponent implements OnInit { } showLeaveResultModal(success: boolean): void { - const initialState = { notificationModalTitle: success ? 'Success' : 'An error occured', notificationModalType: success ? 'info' : 'danger', diff --git a/src/app/validation-application/validation-application.component.ts b/src/app/validation-application/validation-application.component.ts index 4161399656..697e894a75 100644 --- a/src/app/validation-application/validation-application.component.ts +++ b/src/app/validation-application/validation-application.component.ts @@ -1,6 +1,6 @@ -import { AfterViewChecked, ChangeDetectorRef, Component, OnInit, inject } from '@angular/core' +import { AfterViewChecked, ChangeDetectorRef, Component, OnInit } from '@angular/core' import { ActivatedRoute } from '@angular/router' -import { MatomoTracker } from 'ngx-matomo-client' + import { ApplicationsService } from '../api-connector/applications.service' import { Application } from '../applications/application.model/application.model' import { ApplicationBaseClassComponent } from '../shared/shared_modules/baseClass/application-base-class.component' @@ -15,7 +15,6 @@ import { FlavorService } from '../api-connector/flavor.service' providers: [ApplicationsService, FlavorService] }) export class ValidationApplicationComponent extends ApplicationBaseClassComponent implements OnInit, AfterViewChecked { - private readonly tracker = inject(MatomoTracker) application: Application isLoadedApplication: boolean = false hash: string @@ -49,8 +48,6 @@ export class ValidationApplicationComponent extends ApplicationBaseClassComponen ngOnInit(): void { this.activatedRoute.params.subscribe((paramsId: any): void => { this.hash = paramsId.hash - this.tracker.trackPageView(`Application validation for hash: ${paramsId.hash}`) - this.applicationsService.getApplicationValidationByHash(this.hash).subscribe( (app: Application): void => { this.application = new Application(app) diff --git a/src/app/virtualmachines/addvm.component.ts b/src/app/virtualmachines/addvm.component.ts index ba8646872f..03952561bd 100644 --- a/src/app/virtualmachines/addvm.component.ts +++ b/src/app/virtualmachines/addvm.component.ts @@ -1,4 +1,4 @@ -import { Component, DoCheck, OnDestroy, OnInit, ViewChild, inject } from '@angular/core' +import { Component, DoCheck, OnDestroy, OnInit, ViewChild } from '@angular/core' import { forkJoin, Subscription } from 'rxjs' import { Router } from '@angular/router' import { @@ -10,7 +10,7 @@ import { WIKI_VOLUME_OVERVIEW } from 'links/links' import { KeyValue } from '@angular/common' -import { MatomoTracker } from 'ngx-matomo-client' + import { Image } from './virtualmachinemodels/image' import { Flavor } from './virtualmachinemodels/flavor' import { Userinfo } from '../userinfo/userinfo.model' @@ -55,7 +55,6 @@ import { ImageService } from '../api-connector/image.service' ] }) export class VirtualMachineComponent implements OnInit, DoCheck, OnDestroy { - private readonly tracker = inject(MatomoTracker) SIXTY_SIX_PERCENT: number = 66 SEVENTY_FIVE: number = 75 @@ -255,9 +254,7 @@ export class VirtualMachineComponent implements OnInit, DoCheck, OnDestroy { private router: Router, private condaService: BiocondaService, private applicationsService: ApplicationsService - ) { - - } + ) {} /** * Get flavors for the project. @@ -333,7 +330,6 @@ export class VirtualMachineComponent implements OnInit, DoCheck, OnDestroy { return false } - return new RegExp('^[\\w]+$', 'i').test(text) } @@ -348,7 +344,6 @@ export class VirtualMachineComponent implements OnInit, DoCheck, OnDestroy { checkStorageNumber(): boolean { if (!(this.volumeStorage > 0)) { return false - } else { return ( this.selectedProjectRessources.used_volume_storage + this.getStorageInList() + this.volumeStorage <= @@ -523,7 +518,7 @@ export class VirtualMachineComponent implements OnInit, DoCheck, OnDestroy { if (newVm.status) { if (newVm['volume_error']) { this.progress_bar_width = 50 - + this.progress_bar_status = 'At least 1 volume could not be created due to invalid naming. This will not stop the machine creation process.' setTimeout((): void => { @@ -554,7 +549,6 @@ export class VirtualMachineComponent implements OnInit, DoCheck, OnDestroy { } async delay(ms: number): Promise { - await new Promise((resolve: any): any => setTimeout(resolve, ms)) } @@ -784,7 +778,6 @@ export class VirtualMachineComponent implements OnInit, DoCheck, OnDestroy { } ngOnInit(): void { - this.tracker.trackPageView('Create New Instance') this.initializeData() this.is_vo = is_vo } diff --git a/src/app/virtualmachines/clusters/add-cluster/add-cluster.component.ts b/src/app/virtualmachines/clusters/add-cluster/add-cluster.component.ts index ee07af14aa..90f09aa8e0 100644 --- a/src/app/virtualmachines/clusters/add-cluster/add-cluster.component.ts +++ b/src/app/virtualmachines/clusters/add-cluster/add-cluster.component.ts @@ -1,8 +1,8 @@ -import { ChangeDetectorRef, Component, OnDestroy, OnInit, ViewChild, inject } from '@angular/core' +import { ChangeDetectorRef, Component, OnDestroy, OnInit, ViewChild } from '@angular/core' import { forkJoin, Subscription } from 'rxjs' import { Router } from '@angular/router' import { KeyValue } from '@angular/common' -import { MatomoTracker } from 'ngx-matomo-client' + import { GroupService } from '../../../api-connector/group.service' import { ImageService } from '../../../api-connector/image.service' import { KeyService } from '../../../api-connector/key.service' @@ -48,7 +48,6 @@ import { ProjectMember } from '../../../projectmanagement/project_member.model' ] }) export class AddClusterComponent implements OnInit, OnDestroy { - private readonly tracker = inject(MatomoTracker) is_vo: boolean = false CLOUD_PORTAL_SUPPORT_MAIL: string = CLOUD_PORTAL_SUPPORT_MAIL STATUS_LINK: string = STATUS_LINK @@ -180,9 +179,7 @@ export class AddClusterComponent implements OnInit, OnDestroy { private applicationsService: ApplicationsService, private condaService: BiocondaService, private cdRef: ChangeDetectorRef - ) { - - } + ) {} calcWorkerInstancesCount(): void { let count: number = 0 @@ -327,7 +324,7 @@ export class AddClusterComponent implements OnInit, OnDestroy { const flavors_to_filter: Flavor[] = this.flavors.filter( (flavor: Flavor): boolean => used_flavors.indexOf(flavor) < 0 ) - + this.selectedBatch.usable_flavors = flavors_to_filter.filter((flav: Flavor): boolean => this.selectedProjectRessources.filterFlavorsTest(flav, this.selectedWorkerBatches, this.selectedMasterFlavor) ) @@ -359,7 +356,6 @@ export class AddClusterComponent implements OnInit, OnDestroy { removeBatch(batch: WorkerBatch): void { const idx: number = this.selectedWorkerBatches.indexOf(batch) if (batch === this.selectedBatch) { - for (let i = idx; i < this.selectedWorkerBatches.length; i++) { this.selectedWorkerBatches[i].index -= 1 } @@ -528,7 +524,6 @@ export class AddClusterComponent implements OnInit, OnDestroy { } ngOnInit(): void { - this.tracker.trackPageView('Create Cluster') this.initializeData() this.generateRandomName() this.subscription.add( diff --git a/src/app/virtualmachines/clusters/clusterdetail/clusterdetail.component.ts b/src/app/virtualmachines/clusters/clusterdetail/clusterdetail.component.ts index bdcbfe3500..c6e963d280 100644 --- a/src/app/virtualmachines/clusters/clusterdetail/clusterdetail.component.ts +++ b/src/app/virtualmachines/clusters/clusterdetail/clusterdetail.component.ts @@ -1,9 +1,9 @@ -import { Component, OnDestroy, OnInit, inject } from '@angular/core' +import { Component, OnDestroy, OnInit } from '@angular/core' import { ActivatedRoute } from '@angular/router' import { Subscription } from 'rxjs' import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal' import { ClipboardService } from 'ngx-clipboard' -import { MatomoTracker } from 'ngx-matomo-client' + import { Clusterinfo } from '../clusterinfo' import { VirtualmachineService } from '../../../api-connector/virtualmachine.service' import { VirtualMachineStates } from '../../virtualmachinemodels/virtualmachinestates' @@ -28,7 +28,6 @@ import { TemplateNames } from '../../conda/template-names' providers: [VirtualmachineService] }) export class ClusterdetailComponent implements OnInit, OnDestroy { - private readonly tracker = inject(MatomoTracker) WIKI_RSTUDIO_LINK: string = WIKI_RSTUDIO_LINK WIKI_GUACAMOLE_LINK: string = WIKI_GUACAMOLE_LINK WIKI_VOLUME_OVERVIEW: string = WIKI_VOLUME_OVERVIEW @@ -64,7 +63,6 @@ export class ClusterdetailComponent implements OnInit, OnDestroy { ngOnInit(): void { this.activatedRoute.params.subscribe((paramsId: any): void => { this.cluster_id = paramsId.id - this.tracker.trackPageView(`Cluster Detail Page: ${paramsId.id}`) this.setClusterById() }) } diff --git a/src/app/virtualmachines/clusters/clusteroverview/clusterOverview.component.ts b/src/app/virtualmachines/clusters/clusteroverview/clusterOverview.component.ts index f93fe328e7..f755999e3f 100644 --- a/src/app/virtualmachines/clusters/clusteroverview/clusterOverview.component.ts +++ b/src/app/virtualmachines/clusters/clusteroverview/clusterOverview.component.ts @@ -1,10 +1,9 @@ - -import { Component, OnDestroy, OnInit, inject } from '@angular/core' +import { Component, OnDestroy, OnInit } from '@angular/core' import { debounceTime, distinctUntilChanged } from 'rxjs/operators' import { Subject, Subscription } from 'rxjs' import { UntypedFormBuilder } from '@angular/forms' import { ClipboardService } from 'ngx-clipboard' -import { MatomoTracker } from 'ngx-matomo-client' + import { VirtualmachineService } from '../../../api-connector/virtualmachine.service' import { FullLayoutComponent } from '../../../layouts/full-layout.component' import { UserService } from '../../../api-connector/user.service' @@ -46,7 +45,7 @@ export const SCALING_SCRIPT_NAME: string = 'scaling.py' }) export class ClusterOverviewComponent extends AbstractBaseClass implements OnInit, OnDestroy { title: string = 'Cluster Overview' - private readonly tracker = inject(MatomoTracker) + private subscription: Subscription = new Subscription() VirtualMachineStates: VirtualMachineStates = new VirtualMachineStates() @@ -279,7 +278,6 @@ export class ClusterOverviewComponent extends AbstractBaseClass implements OnIni } ngOnInit(): void { - this.tracker.trackPageView('Cluster Overview') this.getClusters() this.is_vo_admin = is_vo this.get_is_facility_manager() diff --git a/src/app/virtualmachines/snapshots/snapshotOverview.component.ts b/src/app/virtualmachines/snapshots/snapshotOverview.component.ts index 9ef72d54bc..834ca2da70 100644 --- a/src/app/virtualmachines/snapshots/snapshotOverview.component.ts +++ b/src/app/virtualmachines/snapshots/snapshotOverview.component.ts @@ -1,7 +1,7 @@ -import { Component, OnInit, inject } from '@angular/core' +import { Component, OnInit } from '@angular/core' import { forkJoin, Subject } from 'rxjs' import { debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators' -import { MatomoTracker } from 'ngx-matomo-client' + import { ImageService } from '../../api-connector/image.service' import { SnapshotModel } from './snapshot.model' import { IResponseTemplate } from '../../api-connector/response-template' @@ -11,7 +11,6 @@ import { SnapshotPage } from './snapshotPage.model' import { ApplicationsService } from '../../api-connector/applications.service' import { IsMigratedProjectIdPipe } from '../../pipe-module/pipes/migratedList' - enum Snapshot_Delete_Statuses { WAITING = 0, SUCCESS = 1, @@ -27,7 +26,6 @@ enum Snapshot_Delete_Statuses { providers: [FacilityService, ImageService] }) export class SnapshotOverviewComponent implements OnInit { - private readonly tracker = inject(MatomoTracker) snapshot_page: SnapshotPage = new SnapshotPage() WIKI_SNAPSHOTS: string = WIKI_SNAPSHOTS CLOUD_PORTAL_SUPPORT_MAIL: string = CLOUD_PORTAL_SUPPORT_MAIL @@ -212,7 +210,6 @@ export class SnapshotOverviewComponent implements OnInit { } ngOnInit(): void { - this.tracker.trackPageView('Snapshot Overview') this.getSnapshots() this.filterChanged diff --git a/src/app/virtualmachines/vmOverview.component.ts b/src/app/virtualmachines/vmOverview.component.ts index d33eacb5ba..231d550242 100644 --- a/src/app/virtualmachines/vmOverview.component.ts +++ b/src/app/virtualmachines/vmOverview.component.ts @@ -1,8 +1,8 @@ -import { Component, OnDestroy, OnInit, QueryList, ViewChildren, inject } from '@angular/core' +import { Component, OnDestroy, OnInit, QueryList, ViewChildren } from '@angular/core' import { debounceTime, distinctUntilChanged } from 'rxjs/operators' import { Subject, Subscription } from 'rxjs' import { ClipboardService } from 'ngx-clipboard' -import { MatomoTracker } from 'ngx-matomo-client' + import { VirtualmachineService } from '../api-connector/virtualmachine.service' import { VirtualMachine } from './virtualmachinemodels/virtualmachine' import { VirtualMachinePage } from './virtualmachinemodels/virtualMachinePage' @@ -27,7 +27,6 @@ import { ApplicationsService } from '../api-connector/applications.service' providers: [FacilityService, ImageService, UserService, FullLayoutComponent, GroupService, ClientService] }) export class VmOverviewComponent implements OnInit, OnDestroy { - private readonly tracker = inject(MatomoTracker) /** * Title of page */ @@ -173,12 +172,9 @@ export class VmOverviewComponent implements OnInit, OnDestroy { private groupService: GroupService, private applicationsService: ApplicationsService - ) { - - } + ) {} ngOnInit(): void { - this.tracker.trackPageView('Instance Overview') this.set_cluster_allowed() this.getVms() this.is_vo_admin = is_vo diff --git a/src/app/virtualmachines/vmdetail/vmdetail.component.ts b/src/app/virtualmachines/vmdetail/vmdetail.component.ts index 8b74f55a79..ff679dcf29 100644 --- a/src/app/virtualmachines/vmdetail/vmdetail.component.ts +++ b/src/app/virtualmachines/vmdetail/vmdetail.component.ts @@ -1,10 +1,10 @@ -import { Component, OnInit, ChangeDetectorRef, inject } from '@angular/core' +import { Component, OnInit, ChangeDetectorRef } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' import { Subject, Subscription } from 'rxjs' import { debounceTime, distinctUntilChanged } from 'rxjs/operators' import { ClipboardService } from 'ngx-clipboard' import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal' -import { MatomoTracker } from 'ngx-matomo-client' + import { FlavorService } from '../../api-connector/flavor.service' import { ApplicationsService } from '../../api-connector/applications.service' import { FacilityService } from '../../api-connector/facility.service' @@ -64,7 +64,6 @@ import { NotificationModalComponent } from '../../shared/modal/notification-moda ] }) export class VmDetailComponent extends AbstractBaseClass implements OnInit { - private readonly tracker = inject(MatomoTracker) vm_id: string conda_logs: Condalog title: string = 'Instance Detail' @@ -196,7 +195,6 @@ export class VmDetailComponent extends AbstractBaseClass implements OnInit { ngOnInit(): void { this.activatedRoute.params.subscribe((paramsId: any): void => { this.vm_id = paramsId.id - this.tracker.trackPageView(`Instance Detail Page: ${paramsId.id}`) this.getVmCondaLogs() this.getVmById() this.snapshotSearchTerm @@ -266,7 +264,6 @@ export class VmDetailComponent extends AbstractBaseClass implements OnInit { }) } - check_status_loop_vol( volume: Volume, initial_timeout: number = this.checkStatusTimeout, @@ -278,7 +275,6 @@ export class VmDetailComponent extends AbstractBaseClass implements OnInit { setTimeout((): void => { const idx: number = this.virtualMachine.volumes.indexOf(volume) if (volume.volume_openstackid) { - this.virtualmachineService.getVolumeById(volume.volume_openstackid).subscribe((vol: Volume): void => { if (expected_storage && vol.volume_storage !== expected_storage) { return this.check_status_loop_vol(volume, this.checkStatusTimeout, final_state, expected_storage) diff --git a/src/app/virtualmachines/volumes/volumeOverview.component.ts b/src/app/virtualmachines/volumes/volumeOverview.component.ts index 14c3d120de..96000e0086 100644 --- a/src/app/virtualmachines/volumes/volumeOverview.component.ts +++ b/src/app/virtualmachines/volumes/volumeOverview.component.ts @@ -1,8 +1,8 @@ -import { Component, OnDestroy, OnInit, ViewChild, inject } from '@angular/core' +import { Component, OnDestroy, OnInit, ViewChild } from '@angular/core' import { forkJoin, lastValueFrom, Subject, Subscription } from 'rxjs' import { debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators' import { AbstractControl, UntypedFormControl, ValidatorFn } from '@angular/forms' -import { MatomoTracker } from 'ngx-matomo-client' + import { Volume } from './volume' import { VirtualmachineService } from '../../api-connector/virtualmachine.service' import { VirtualMachine } from '../virtualmachinemodels/virtualmachine' @@ -30,7 +30,6 @@ import { IsMigratedProjectIdPipe } from '../../pipe-module/pipes/migratedList' }) export class VolumeOverviewComponent extends AbstractBaseClass implements OnInit, OnDestroy { @ViewChild('errorModal') errorModal: any - private readonly tracker = inject(MatomoTracker) volume_page: VolumePage = new VolumePage() @@ -281,7 +280,6 @@ export class VolumeOverviewComponent extends AbstractBaseClass implements OnInit } ngOnInit(): void { - this.tracker.trackPageView('Volume Overview') this.getVolumes() this.getUserApprovedProjects() this.facilityService.getManagerFacilities().subscribe((result: any): void => { @@ -457,7 +455,6 @@ export class VolumeOverviewComponent extends AbstractBaseClass implements OnInit await this.updateVolume(newVolume) let volume: Volume = this.get_volume_from_list_by_id(newVolume.volume_openstackid) while (volume.volume_status !== VolumeStates.AVAILABLE) { - await this.updateVolume(newVolume) volume = this.get_volume_from_list_by_id(newVolume.volume_openstackid) @@ -678,7 +675,6 @@ export class VolumeOverviewComponent extends AbstractBaseClass implements OnInit return null } - check_status_loop( volume: Volume, initial_timeout: number = this.checkStatusTimeout, @@ -686,12 +682,10 @@ export class VolumeOverviewComponent extends AbstractBaseClass implements OnInit expected_storage?: number ): void { setTimeout( - async (): Promise => { await this.updateVolume(volume) const updated_volume: Volume = this.get_volume_from_list_by_id(volume.volume_openstackid) - if (expected_storage && updated_volume.volume_storage !== expected_storage) { return this.check_status_loop(volume, this.checkStatusTimeout, final_state, expected_storage) } else if (expected_storage && updated_volume.volume_storage === expected_storage) { diff --git a/src/app/virtualmachines/workshop/add-workshop/add-workshop.component.ts b/src/app/virtualmachines/workshop/add-workshop/add-workshop.component.ts index 90ba88e0a4..8180c2ca71 100644 --- a/src/app/virtualmachines/workshop/add-workshop/add-workshop.component.ts +++ b/src/app/virtualmachines/workshop/add-workshop/add-workshop.component.ts @@ -1,9 +1,9 @@ -import { Component, DoCheck, OnDestroy, OnInit, ViewChild, inject } from '@angular/core' +import { Component, DoCheck, OnDestroy, OnInit, ViewChild } from '@angular/core' import { Subscription } from 'rxjs' import { KeyValue } from '@angular/common' import transliterate from '@sindresorhus/transliterate' import { Router } from '@angular/router' -import { MatomoTracker } from 'ngx-matomo-client' + import { Workshop } from '../workshop.model' import { Userinfo } from '../../../userinfo/userinfo.model' import { GroupService } from '../../../api-connector/group.service' @@ -37,7 +37,6 @@ import { BiocondaService } from '../../../api-connector/bioconda.service' ] }) export class AddWorkshopComponent implements OnInit, OnDestroy, DoCheck { - private readonly tracker = inject(MatomoTracker) title: string = 'New workshop VMs' WIKI_WORKSHOPS: string = WIKI_WORKSHOPS @@ -125,12 +124,9 @@ export class AddWorkshopComponent implements OnInit, OnDestroy, DoCheck { private workshop_service: WorkshopService, private router: Router, private condaService: BiocondaService - ) { - - } + ) {} ngOnInit(): void { - this.tracker.trackPageView('New Workshop') this.get_applications() this.get_user_data() } @@ -407,7 +403,6 @@ export class AddWorkshopComponent implements OnInit, OnDestroy, DoCheck { } async delay(ms: number): Promise { - await new Promise((resolve: any): any => setTimeout(resolve, ms)) } diff --git a/src/app/virtualmachines/workshop/workshop-overview/workshop-overview.component.ts b/src/app/virtualmachines/workshop/workshop-overview/workshop-overview.component.ts index 58d80657c4..4b46a074ea 100644 --- a/src/app/virtualmachines/workshop/workshop-overview/workshop-overview.component.ts +++ b/src/app/virtualmachines/workshop/workshop-overview/workshop-overview.component.ts @@ -1,6 +1,6 @@ -import { Component, OnInit, OnDestroy, ViewChild, inject } from '@angular/core' +import { Component, OnInit, OnDestroy, ViewChild } from '@angular/core' import { Subscription } from 'rxjs' -import { MatomoTracker } from 'ngx-matomo-client' + import { Workshop } from '../workshop.model' import { GroupService } from '../../../api-connector/group.service' import { UrlData } from '../workshop-urlinfo.model' @@ -22,7 +22,6 @@ interface MemberVm { providers: [GroupService, WorkshopService] }) export class WorkshopOverviewComponent implements OnInit, OnDestroy { - private readonly tracker = inject(MatomoTracker) title: string = 'Workshop management' @ViewChild('confirmInterferingSlotModal') confirmInterfereModal: any @@ -66,12 +65,9 @@ export class WorkshopOverviewComponent implements OnInit, OnDestroy { constructor( private workshopService: WorkshopService, private groupService: GroupService - ) { - - } + ) {} ngOnInit(): void { - this.tracker.trackPageView('Workshop Overview') this.newWorkShopTimeFrame = new WorkshopTimeFrame({ id: null, end_time: new Date(), diff --git a/src/app/vo_manager/VoOverviewComponent.ts b/src/app/vo_manager/VoOverviewComponent.ts index 6eecf277e0..11856f0364 100644 --- a/src/app/vo_manager/VoOverviewComponent.ts +++ b/src/app/vo_manager/VoOverviewComponent.ts @@ -1,9 +1,9 @@ -import { Component, OnDestroy, OnInit, QueryList, ViewChild, ViewChildren, inject } from '@angular/core' +import { Component, OnDestroy, OnInit, QueryList, ViewChild, ViewChildren } from '@angular/core' import { DomSanitizer } from '@angular/platform-browser' import { Observable, Subscription, take } from 'rxjs' import { BsModalRef, BsModalService, ModalDirective } from 'ngx-bootstrap/modal' import * as FileSaver from 'file-saver' -import { MatomoTracker } from 'ngx-matomo-client' + import { VoService } from '../api-connector/vo.service' import { ProjectMember } from '../projectmanagement/project_member.model' import { GroupService } from '../api-connector/group.service' @@ -33,7 +33,6 @@ import { ProjectCsvTemplatedEmailModalComponent } from '../shared/modal/email/pr providers: [VoService, GroupService, FacilityService, ProjectSortService] }) export class VoOverviewComponent extends AbstractBaseClass implements OnInit, OnDestroy { - private readonly tracker = inject(MatomoTracker) title: string = 'VO Overview' public emailSubject: string public emailReply: string = '' @@ -106,7 +105,6 @@ export class VoOverviewComponent extends AbstractBaseClass implements OnInit, On } ngOnInit(): void { - this.tracker.trackPageView('Vo Overview') this.getVoProjects() this.getComputeCenters() this.voService.getNewsletterSubscriptionCounter().subscribe((result: IResponseTemplate): void => { diff --git a/src/app/vo_manager/clients/clientOverview.component.ts b/src/app/vo_manager/clients/clientOverview.component.ts index ab726b2163..ae5f677762 100644 --- a/src/app/vo_manager/clients/clientOverview.component.ts +++ b/src/app/vo_manager/clients/clientOverview.component.ts @@ -1,7 +1,7 @@ -import { Component, OnDestroy, OnInit, inject } from '@angular/core' +import { Component, OnDestroy, OnInit } from '@angular/core' import { Subscription } from 'rxjs' import { BsModalRef, BsModalService } from 'ngx-bootstrap/modal' -import { MatomoTracker } from 'ngx-matomo-client' + import { Client } from './client.model' import { ClientService } from '../../api-connector/client.service' import { ApiSettings } from '../../api-connector/api-settings.service' @@ -62,7 +62,6 @@ export class ClientOverviewComponent implements OnInit, OnDestroy { isLoaded: boolean = false subscription: Subscription = new Subscription() - private readonly tracker = inject(MatomoTracker) constructor( private facilityService: FacilityService, @@ -173,7 +172,6 @@ export class ClientOverviewComponent implements OnInit, OnDestroy { } ngOnInit(): void { - this.tracker.trackPageView('VO Clients Overview') this.is_vo_admin = is_vo this.getClientsChecked() this.getComputeCenters() diff --git a/src/app/vo_manager/maintenance/maintenance.component.ts b/src/app/vo_manager/maintenance/maintenance.component.ts index 015f54008c..a28d782e3b 100644 --- a/src/app/vo_manager/maintenance/maintenance.component.ts +++ b/src/app/vo_manager/maintenance/maintenance.component.ts @@ -1,9 +1,9 @@ -import { Component, OnInit, inject } from '@angular/core' +import { Component, OnInit } from '@angular/core' import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms' import { BsModalService } from 'ngx-bootstrap/modal' import 'svg2pdf.js' -import { MatomoTracker } from 'ngx-matomo-client' + import { WorkshopService } from '../../api-connector/workshop.service' import { WorkshopTimeFrame } from '../../virtualmachines/workshop/workshopTimeFrame.model' import { VoService } from '../../api-connector/vo.service' @@ -20,7 +20,6 @@ import { NotificationModalComponent } from '../../shared/modal/notification-moda providers: [WorkshopService, VoService] }) export class MaintenanceComponent implements OnInit { - private readonly tracker = inject(MatomoTracker) is_vo_admin: boolean = false title: string = 'Maintenance' @@ -46,7 +45,6 @@ export class MaintenanceComponent implements OnInit { ) {} ngOnInit(): void { - this.tracker.trackPageView('Maintenance') this.newMaintenanceTimeFrame = new MaintenanceTimeFrame({ name: '', start_time: new Date(), diff --git a/src/app/vo_manager/number-charts/number-charts.component.ts b/src/app/vo_manager/number-charts/number-charts.component.ts index 5490f41ca4..3e989a8879 100644 --- a/src/app/vo_manager/number-charts/number-charts.component.ts +++ b/src/app/vo_manager/number-charts/number-charts.component.ts @@ -1,10 +1,10 @@ -import { Component, OnInit, inject } from '@angular/core' +import { Component, OnInit } from '@angular/core' import html2canvas from 'html2canvas' import * as saveSVG from 'save-svg-as-png' import bb, { areaSpline, bar, Chart } from 'billboard.js' import { jsPDF } from 'jspdf' import * as d3 from 'd3' -import { MatomoTracker } from 'ngx-matomo-client' + import { NumbersService } from '../../api-connector/numbers.service' import 'svg2pdf.js' @@ -18,7 +18,6 @@ import 'svg2pdf.js' providers: [NumbersService] }) export class NumberChartsComponent implements OnInit { - private readonly tracker = inject(MatomoTracker) is_vo_admin: boolean = true title: string = 'Cloud Numbers' @@ -63,7 +62,6 @@ export class NumberChartsComponent implements OnInit { private endDatesResources: any[] = ['x'] ngOnInit(): void { - this.tracker.trackPageView('Cloud Numbers') this.getData() } @@ -116,7 +114,7 @@ export class NumberChartsComponent implements OnInit { const imgWidth: number = 208 const imgHeight: number = (canvas.height * imgWidth) / canvas.width const contentDataURL: string = canvas.toDataURL('image/png') - + const pdf: jsPDF = new jsPDF('p', 'mm', 'a4') // A4 size page of PDF const position: number = 0 pdf.addImage(contentDataURL, 'PNG', 0, position, imgWidth, imgHeight) diff --git a/src/app/vo_manager/resources/resources.component.ts b/src/app/vo_manager/resources/resources.component.ts index a2eb454afe..9043d7a03e 100644 --- a/src/app/vo_manager/resources/resources.component.ts +++ b/src/app/vo_manager/resources/resources.component.ts @@ -1,7 +1,7 @@ -import { Component, ElementRef, OnInit, ViewChild, inject } from '@angular/core' +import { Component, ElementRef, OnInit, ViewChild } from '@angular/core' import { CsvOutput, download, generateCsv, mkConfig } from 'export-to-csv' -import { MatomoTracker } from 'ngx-matomo-client' + import { VoService } from '../../api-connector/vo.service' import { Resources } from './resources' @@ -15,7 +15,6 @@ import { Resources } from './resources' providers: [VoService] }) export class ResourcesComponent implements OnInit { - private readonly tracker = inject(MatomoTracker) title: string = 'VO Overview: Resources' @ViewChild('resourcesTable') pdfTable: ElementRef @@ -56,7 +55,5 @@ export class ResourcesComponent implements OnInit { download(csvConfig)(csv) } - ngOnInit(): void { - this.tracker.trackPageView('VO Overview Resources') - } + ngOnInit(): void {} } diff --git a/src/environments/environment.ts b/src/environments/environment.ts index 3419178d3b..98c1d2bf81 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -5,8 +5,8 @@ const VO_NAME: string = window['env']['VO_NAME'] || 'denbi-dev' const NEW_SIMPLE_VM: string = window['env']['NEW_SIMPLE_VM'] || 'https://simplevm.denbi.de' -const MATOMO_SITE_ID = window['env']['MATOMO_SITE_ID'] || 0 -const MATOMO_TRACKING_URL = window['env']['MATOMO_TRACKING_URL'] || '' +const MATOMO_SITE_ID = window['env']['MATOMO_SITE_ID'] || 22 +const MATOMO_TRACKING_URL = window['env']['MATOMO_TRACKING_URL'] || 'https://piwik.cebitec.uni-bielefeld.de/' export const environment: any = { WIKI_PRE: 'https://portal-dev.denbi.de/wiki/',