Skip to content

Commit

Permalink
feat(Doi):added doi modal to modificaiton and termination requests (#…
Browse files Browse the repository at this point in the history
…6211)

* feat(Doi):added doi modal to modificaiton and termination requests

* audit fix

---------

Co-authored-by: denbicloud <[email protected]>
  • Loading branch information
dweinholz and denbicloud authored Sep 18, 2024
1 parent 9acafda commit 4e727fd
Show file tree
Hide file tree
Showing 6 changed files with 84 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,43 @@ <h4 class="modal-title">Experiences and publications</h4>
></button>
</div>
<div class="modal-body">
<div class="text-black-50 p-4">
We are very pleased that the de.NBI Cloud meets with your expectations and that you would like to extend your
project. As an academic cloud that provides its resources free of charge, we depend on our users.
<div class="custom-container">
@if (isModification) {
<p>
We are very pleased that the de.NBI Cloud meets with your expectations and that you would like to request
additional resources.
</p>
} @else if (isExtension) {
<p>
We are very pleased that the de.NBI Cloud meets with your expectations and that you would like to extend your
project.
</p>
} @else if (isTermination) {
<p>
We hope that your project on the de.NBI Cloud has been successful and that it has helped you achieve your
research goals.
</p>
}
<p>As an academic cloud providing free resources, we rely on our users' support.</p>
<hr />
In order to be able to continue to offer these services free of charge in the future, it is essential for us, for
example, to publish publications which resulted from the work in the de.NBI Cloud or are in any way connected to
it. Please enter the DOIs of those publications in the form below.
<hr />
We also want to promote the use of the cloud with positive experiences from users and the community in order to
make this service available to many more researchers. For this reason, we rely on testimonials from our users,
which we can use for this purpose. To submit a testimonial, please use the form below on this project overview
page. You can find an overview of already published testimonials <a href="{{ TESTIMONIAL_PAGE_LINK }}">here. </a>
<hr />
We really appreciate your help!

<p>To ensure the continued availability of these services, we kindly ask for your help in two ways:</p>
<ul>
<li class="list-item">
<strong>Publication acknowledgement</strong>: If you've published research resulting from work done in the
de.NBI Cloud or related to it, please enter the DOIs of those publications below. This helps us demonstrate
the impact of our services and secure future funding.
<hr />
</li>
<li class="list-item">
<strong>User testimonials</strong>: We'd love to hear about your positive experiences with the cloud! Your
testimonial will help us promote the service to other researchers and make it more widely available. Please
use the form on this project overview page to share your story. You can find already published testimonials
<a href="{{ TESTIMONIAL_PAGE_LINK }}">here</a>.
</li>
</ul>

<p><strong>We really appreciate your help!</strong></p>
</div>
</div>
<div class="modal-body">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.custom-container {
background-color: #f8f9fa;
color: #6c757d; /* secondary text color */
padding: 20px;
border: 1px solid #dee2e6;
border-radius: .25rem;
box-shadow: 0 .125rem .25rem rgba(0, 0, 0, 0.075);
}
.custom-container .list-item {
margin-bottom: 1rem;
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Component, EventEmitter, OnDestroy } from '@angular/core'
import { Component, EventEmitter, Input, OnDestroy } from '@angular/core'
import { BsModalRef } from 'ngx-bootstrap/modal'
import { Subscription } from 'rxjs'
import { TESTIMONIAL_PAGE_LINK, WIKI_PUBLICATIONS } from '../../../../links/links'
Expand All @@ -14,6 +14,10 @@ import { GroupService } from '../../../api-connector/group.service'
export class ExtensionEntryComponent implements OnDestroy {
private subscription: Subscription = new Subscription()
public event: EventEmitter<any> = new EventEmitter()
@Input() isTermination: boolean = false
@Input() isModification: boolean = false
@Input() isExtension: boolean = false

TESTIMONIAL_PAGE_LINK = TESTIMONIAL_PAGE_LINK

WIKI_PUBLICATIONS: string = WIKI_PUBLICATIONS
Expand All @@ -27,13 +31,17 @@ export class ExtensionEntryComponent implements OnDestroy {
constructor(
public bsModalRef: BsModalRef,
private groupService: GroupService
) {

}
) {}

ngOnDestroy(): void {
this.subscription.unsubscribe()
this.event.emit({ reloadDoi: false, showExtension: true })
if (this.isTermination) {
this.event.emit({ reloadDoi: false, showTermination: true, showModification: false, showExtension: false })
} else if (this.isModification) {
this.event.emit({ reloadDoi: false, showExtension: false, showModification: true, showTermination: false })
} else if (this.isExtension) {
this.event.emit({ reloadDoi: false, showExtension: true, showModification: false, showTermination: false })
}
}

isNewDoi(): boolean {
Expand Down
10 changes: 5 additions & 5 deletions src/app/projectmanagement/overview.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ <h3>
[ngStyle]="{
'width.%': calculateProgressBar(
project_application?.DaysRunning / project_application?.lifetime_days
)
),
}"
aria-valuemax="100"
aria-valuemin="0"
Expand Down Expand Up @@ -350,7 +350,7 @@ <h3>
Withdraw extension request
</button>
<button
(click)="showExtensionInformationModal()"
(click)="showApplicationRequestModal(ApplicationRequestType.Extension)"
*ngIf="
project_application.user_is_admin &&
!(
Expand Down Expand Up @@ -412,7 +412,7 @@ <h3>
</span>
</ng-container>
<button
(click)="terminateModal.show()"
(click)="showApplicationRequestModal(ApplicationRequestType.Termination)"
*ngIf="
project_application.user_is_admin &&
(project_application | hasstatusinlist: Application_States.APPROVED) &&
Expand Down Expand Up @@ -535,7 +535,7 @@ <h3>
</span>
</ng-container>
<button
(click)="showResourceModal()"
(click)="showApplicationRequestModal(ApplicationRequestType.Modification)"
*ngIf="
project_application.user_is_admin &&
!(
Expand Down Expand Up @@ -754,7 +754,7 @@ <h3>
'width.%': calculateProgressBar(
project_application?.project_application_current_credits /
project_application?.project_application_initial_credits
)
),
}"
aria-valuemax="100"
aria-valuemin="0"
Expand Down
16 changes: 14 additions & 2 deletions src/app/projectmanagement/overview.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ import { LifetimeRequestComponent } from './modals/lifetime-request/lifetime-req
import { CreditsRequestComponent } from './modals/credits-request/credits-request.component'
import { ExtensionEntryComponent } from './modals/testimonial/extension-entry.component'
import { WITHDRAWAL_TYPES, WithdrawModalComponent } from './modals/withdraw/withdraw-modal.component'
import { ApplicationRequestType } from '../shared/enums/application-request-type'

/**
* Projectoverview component.
*/
Expand Down Expand Up @@ -88,6 +90,7 @@ export class OverviewComponent extends ApplicationBaseClassComponent implements
NEW_SVM_PORTAL_LINK: string = NEW_SVM_PORTAL_LINK
@ViewChild('creditsChart') creditsCanvas: ElementRef
@ViewChild('publicKeyModal') publicKeyModal: any
@ViewChild('terminateModal') terminateModal: any
publicKeyToShow: string = ''
publicKeyMemberName: string = ''
project_id: string
Expand Down Expand Up @@ -359,18 +362,25 @@ export class OverviewComponent extends ApplicationBaseClassComponent implements
)
}

showExtensionInformationModal(): void {
showApplicationRequestModal(type: ApplicationRequestType): void {
const initialState = {
dois: this.dois,
application_id: this.application_id
application_id: this.application_id,
[`is${type}`]: true
}

this.bsModalRef = this.modalService.show(ExtensionEntryComponent, { initialState, class: 'modal-lg' })

this.subscription.add(
this.bsModalRef.content.event.subscribe((event: any): void => {
if (event.reloadDoi) {
this.getDois()
} else if (event.showModification) {
this.showResourceModal()
} else if (event.showExtension) {
this.showLifetimeExtensionModal()
} else if (event.showTermination) {
this.terminateModal.show()
}
})
)
Expand Down Expand Up @@ -1041,4 +1051,6 @@ export class OverviewComponent extends ApplicationBaseClassComponent implements
)
)
}

protected readonly ApplicationRequestType = ApplicationRequestType
}
5 changes: 5 additions & 0 deletions src/app/shared/enums/application-request-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export enum ApplicationRequestType {
Termination = 'Termination',
Modification = 'Modification',
Extension = 'Extension',
}

0 comments on commit 4e727fd

Please sign in to comment.