Skip to content

Commit

Permalink
fix(Application):reload user from modification/lifetime request when …
Browse files Browse the repository at this point in the history
…approved
  • Loading branch information
dweinholz committed Oct 7, 2024
1 parent 7c7ed12 commit 18e0077
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export class ApplicationCardComponent extends AbstractBaseClass implements OnIni
this.applicationsService.getApplication(this.application.project_application_id.toString()).subscribe(
(aj: Application): void => {
this.application = aj
this.applicationDetailComponent.loadData()
},
(error: any): void => {
console.log(error)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,16 @@ export class ApplicationDetailComponent extends ApplicationBaseClassComponent im
ngOnInit(): void {
this.setTab(this.default_tab)

this.loadData()
this.is_vo_admin = is_vo
}

loadData() {
this.getPi()
this.getUser()
if (this.application.credits_allowed) {
this.getCurrentCredits()
}
this.is_vo_admin = is_vo
}

getUser() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Input, OnInit } from '@angular/core'
import { Component, Input, OnChanges, OnInit } from '@angular/core'
import { Application } from '../../application.model/application.model'
import { ApplicationBaseClassComponent } from '../../../shared/shared_modules/baseClass/application-base-class.component'
import { User } from '../../application.model/user.model'
Expand All @@ -10,13 +10,17 @@ import { User } from '../../application.model/user.model'
selector: 'app-lifetime-extension-detail',
templateUrl: './lifetime-extension-detail.component.html'
})
export class LifetimeExtensionDetailComponent extends ApplicationBaseClassComponent implements OnInit {
export class LifetimeExtensionDetailComponent extends ApplicationBaseClassComponent implements OnInit, OnChanges {
@Input() application: Application

ngOnInit() {
this.getRequestingUser()
}

ngOnChanges() {
this.getRequestingUser()
}

getRequestingUser() {
if (this.application.project_lifetime_request && !this.application.project_lifetime_request.user) {
this.applicationsService
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, Input, OnInit } from '@angular/core'
import { Component, Input, OnChanges, OnInit } from '@angular/core'
import { Application } from '../../application.model/application.model'
import { User } from '../../application.model/user.model'
import { ApplicationBaseClassComponent } from '../../../shared/shared_modules/baseClass/application-base-class.component'
Expand All @@ -18,7 +18,7 @@ interface FlavorDiff {
selector: 'app-resource-detail',
templateUrl: './resource-detail.component.html'
})
export class ResourceDetailComponent extends ApplicationBaseClassComponent implements OnInit {
export class ResourceDetailComponent extends ApplicationBaseClassComponent implements OnInit, OnChanges {
@Input() application: Application
@Input() is_vo_admin: boolean
@Input() current_credits: number
Expand All @@ -30,6 +30,11 @@ export class ResourceDetailComponent extends ApplicationBaseClassComponent imple
this.getModificationRequestingUser()
}

ngOnChanges() {
this.getFlavorChanges()
this.getModificationRequestingUser()
}

getModificationRequestingUser() {
if (this.application.project_modification_request && !this.application.project_modification_request.user) {
this.applicationsService.getModificationUser(this.application.project_application_id).subscribe((user: User) => {
Expand Down

0 comments on commit 18e0077

Please sign in to comment.