Skip to content

Commit

Permalink
Fix/modals (#6248)
Browse files Browse the repository at this point in the history
* feat(Application):fixed termination modal

* fixed public key modal

* refactored more modals

* refactored delete applicaiton modal

* refactored addmember and member applications modal

* refactored notification message

* refactored terminate project modal

* refactored decline terminate project modal

* refactored more

* updated tests
  • Loading branch information
dweinholz authored Oct 15, 2024
1 parent 7af3d7e commit 2e448c0
Show file tree
Hide file tree
Showing 69 changed files with 1,549 additions and 1,510 deletions.
4 changes: 3 additions & 1 deletion src/app/api-connector/applications.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ import { User } from '../applications/application.model/user.model'
/**
* Service which provides methods for creating application.
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class ApplicationsService {
constructor(private http: HttpClient) {
this.http = http
Expand Down
4 changes: 3 additions & 1 deletion src/app/api-connector/client.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import { IResponseTemplate } from './response-template'
/**
* Service which provides client methods.
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class ClientService {
clientURL: string = `${ApiSettings.getApiBaseURL()}clients/`

Expand Down
4 changes: 3 additions & 1 deletion src/app/api-connector/facility.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import { GeneralStorageFactor } from '../facility_manager/resources/general-stor
/**
* Service which provides methods for the facilities.
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class FacilityService {
constructor(private http: HttpClient) {
this.http = http
Expand Down
4 changes: 3 additions & 1 deletion src/app/api-connector/group.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import { ProjectMember } from '../projectmanagement/project_member.model'
/**
* Service which provides Group methods.
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class GroupService {
constructor(private http: HttpClient) {
this.http = http
Expand Down
4 changes: 3 additions & 1 deletion src/app/api-connector/image.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import { BlockedImageTag, BlockedImageTagResenv, ImageLogo, ImageMode, ImageTag
/**
* Service which provides image methods.
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class ImageService {
constructor(private http: HttpClient) {}

Expand Down
4 changes: 3 additions & 1 deletion src/app/api-connector/key.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import { BlacklistedResponse } from './response-interfaces'
/**
* Service which provides public key methods.
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class KeyService {
constructor(private http: HttpClient) {}

Expand Down
4 changes: 3 additions & 1 deletion src/app/api-connector/news.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ import { News } from '../news/news.model'
/**
* Service which provides methods for the facilities.
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class NewsService {
constructor(private http: HttpClient) {
this.http = http
Expand Down
4 changes: 3 additions & 1 deletion src/app/api-connector/numbers.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { ApiSettings } from './api-settings.service'
/**
* Class to get numbers from the api for graphs
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class NumbersService {
constructor(private http: HttpClient) {
this.http = http
Expand Down
4 changes: 3 additions & 1 deletion src/app/api-connector/token-interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { catchError } from 'rxjs/operators'
/**
* Interceptor which inserts withCredentials and csrf header
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class TokenInterceptor implements HttpInterceptor {
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
const skipIntercept: boolean = req.headers.has('skip')
Expand Down
4 changes: 3 additions & 1 deletion src/app/api-connector/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import { Userinfo } from '../userinfo/userinfo.model'
/**
* Service which provides user methods.
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class UserService {
constructor(private http: HttpClient) {
this.http = http
Expand Down
4 changes: 3 additions & 1 deletion src/app/api-connector/vo.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ import { MaintenanceTimeFrame } from '../vo_manager/maintenance/maintenanceTimeF
/**
* Service which provides vo methods.
*/
@Injectable()
@Injectable({
providedIn: 'root'
})
export class VoService {
constructor(private http: HttpClient) {}

Expand Down
4 changes: 3 additions & 1 deletion src/app/api-connector/workshop.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ import { Workshop } from '../virtualmachines/workshop/workshop.model'
import { WorkshopVM } from '../virtualmachines/workshop/workshop-vm.model'
import { WorkshopTimeFrame } from '../virtualmachines/workshop/workshopTimeFrame.model'

@Injectable()
@Injectable({
providedIn: 'root'
})
export class WorkshopService {
constructor(private http: HttpClient) {}

Expand Down
39 changes: 0 additions & 39 deletions src/app/app.component.html
Original file line number Diff line number Diff line change
@@ -1,40 +1 @@
<router-outlet></router-outlet>

<div
bsModal
#notificationModal="bs-modal"
class="modal fade"
tabindex="-1"
role="dialog"
aria-labelledby="Label"
aria-hidden="true"
>
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">{{ notificationModalTitle }}</h4>
<button
type="button"
class="btn-close"
style="cursor: pointer"
(click)="notificationModal.hide()"
aria-label="Close"
></button>
</div>
<div class="modal-body">
<div class="alert alert-{{ notificationModalType }}" role="alert">
{{ notificationModalMessage }}
</div>
</div>
<div class="modal-footer">
<button type="button" (click)="notificationModal.hide()" class="btn btn-secondary">Close</button>
<button type="button" (click)="notificationModal.hide(); reloadSite()" type="reset" class="btn btn-secondary">
Reload
</button>
</div>
</div>
<!-- /.modal-content -->
</div>
<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
5 changes: 1 addition & 4 deletions src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { AfterViewInit, ApplicationRef, Component, OnInit, ViewChild } from '@angular/core'
import { ModalDirective } from 'ngx-bootstrap/modal'
import { AfterViewInit, ApplicationRef, Component, OnInit } from '@angular/core'
import { VoService } from './api-connector/vo.service'
import { TitleService } from './title.service'

Expand All @@ -17,8 +16,6 @@ export class AppComponent implements AfterViewInit, OnInit {
'A new update is available. Please reload the site to use the new version of the portal.'
notificationModalType: string = 'info'

@ViewChild('notificationModal', { static: true }) modal: ModalDirective

constructor(
private appRef: ApplicationRef,
private titleService: TitleService
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { is_vo } from '../../shared/globalvar'
import { CreditsService } from '../../api-connector/credits.service'
import { Application_States } from '../../shared/shared_modules/baseClass/abstract-base-class'
import { User } from '../application.model/user.model'
import { NotificationModalComponent } from '../../shared/modal/notification-modal'

/**
* Class which displays the details of an application.
Expand Down Expand Up @@ -97,11 +98,10 @@ export class ApplicationDetailComponent extends ApplicationBaseClassComponent im
applicationsService: ApplicationsService,
userService: UserService,
facilityService: FacilityService,
creditsService: CreditsService,
cdrRef: ChangeDetectorRef
cdrRef: ChangeDetectorRef,
notificationModal: NotificationModalComponent
) {
super(userService, applicationsService, facilityService, cdrRef)
this.creditsService = creditsService
super(userService, applicationsService, facilityService, notificationModal, cdrRef)
}

ngOnInit(): void {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import {
import { UserService } from '../../api-connector/user.service'
import { Userinfo } from '../../userinfo/userinfo.model'
import { User } from '../application.model/user.model'
import { NotificationModalComponent } from '../../shared/modal/notification-modal'

/**
* Application formular component.
Expand Down Expand Up @@ -107,9 +108,10 @@ export class ApplicationFormularComponent extends ApplicationBaseClassComponent
private fullLayout: FullLayoutComponent,
userService: UserService,
applicationsService: ApplicationsService,
cdrRef: ChangeDetectorRef
cdrRef: ChangeDetectorRef,
notificationModal: NotificationModalComponent
) {
super(userService, applicationsService, null, cdrRef)
super(userService, applicationsService, null, notificationModal, cdrRef)
}

ngOnInit(): void {
Expand Down
5 changes: 3 additions & 2 deletions src/app/applications/applications.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ export class ApplicationsComponent extends ApplicationBaseClassComponent impleme
private modalService: BsModalService,
facilityService: FacilityService,
private flavorService: FlavorService,
cdrRef: ChangeDetectorRef
cdrRef: ChangeDetectorRef,
notificationModal: NotificationModalComponent
) {
super(userService, applicationsService, facilityService, cdrRef)
super(userService, applicationsService, facilityService, notificationModal, cdrRef)
}

ngOnDestroy() {
Expand Down
Loading

0 comments on commit 2e448c0

Please sign in to comment.