Skip to content

Commit

Permalink
Merge branch 'dev' into deps/patch-all-minor-patch
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinholz authored Aug 27, 2024
2 parents 9326acf + a867303 commit 96a93a0
Show file tree
Hide file tree
Showing 33 changed files with 204 additions and 256 deletions.
9 changes: 3 additions & 6 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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));
Expand All @@ -41,10 +41,7 @@ export class AppComponent implements AfterViewInit, OnInit {
}

ngOnInit(): void {
this.angulartics2Matomo.startTracking()
// this.voService.isVo().subscribe((result: IResponseTemplate) => {
// setVO(<boolean><Boolean>result.value);
// })
this.titleService.init()
}

ngAfterViewInit(): void {}
Expand Down
5 changes: 4 additions & 1 deletion src/app/app.module.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -114,6 +115,8 @@ import { FacilityService } from './api-connector/facility.service'
CookieService,
VoService,
FacilityService,
Title,
TitleService,
provideHttpClient(withInterceptorsFromDi())
]
})
Expand Down
168 changes: 88 additions & 80 deletions src/app/app.routing.ts
Original file line number Diff line number Diff line change
@@ -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 */
Original file line number Diff line number Diff line change
@@ -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'
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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
})
Expand Down
9 changes: 2 additions & 7 deletions src/app/applications/applications.component.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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()
Expand Down Expand Up @@ -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,
Expand Down
7 changes: 2 additions & 5 deletions src/app/applications/type-overview.component.ts
Original file line number Diff line number Diff line change
@@ -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'

Expand All @@ -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'
Expand All @@ -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`
Expand Down
10 changes: 3 additions & 7 deletions src/app/credits-calculator/credits-calculator.component.ts
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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
Expand Down Expand Up @@ -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
})
Expand Down
Loading

0 comments on commit 96a93a0

Please sign in to comment.