Skip to content

Commit

Permalink
fix(Project):removed allow to create
Browse files Browse the repository at this point in the history
  • Loading branch information
dweinholz committed Sep 20, 2024
1 parent 41bb111 commit 9afdae3
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 57 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ export class Application {
totalCreditsExtensionCredits: number = 0
totalLifetimeExtensionCredits: number = 0
show_member_names: boolean
allow_machines_starting: boolean = false
project_application_member_applications: ProjectMemberApplication[]
project_application_manager_comment: string
project_application_testimonial_submitted: boolean
Expand Down
25 changes: 1 addition & 24 deletions src/app/projectmanagement/overview.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -590,12 +590,6 @@ <h3>
: 'Resource modification requested'
}}
</button>
<a
*ngIf="!project_application?.project_application_openstack_project && isAbleToStart()"
class="btn btn-outline-success"
[href]="(project_application | isMigratedProject) ? NEW_SVM_PORTAL_LINK : '#/virtualmachines/newVM'"
>Start a VM</a
>
<a
*ngIf="project_application?.project_application_openstack_project"
class="btn btn-outline-success"
Expand Down Expand Up @@ -934,6 +928,7 @@ <h3>
id="projectSettingsCard"
*ngIf="
project_application &&
project_application.project_application_openstack_project &&
((project_application | hasstatusinlist: Application_States.APPROVED) ||
(project_application | hasstatusinlist: Application_States.MODIFICATION_REQUESTED) ||
(project_application | hasstatusinlist: Application_States.MODIFICATION_DECLINED))
Expand Down Expand Up @@ -964,24 +959,6 @@ <h3>
>
</div>
</li>
<li *ngIf="!project_application.project_application_openstack_project" class="list-group-item">
<div class="form-check form-switch">
<input
class="form-check-input"
type="checkbox"
id="toggle_starting_of_machines"
[(ngModel)]="project_application.allow_machines_starting"
*ngIf="!project_application.project_application_openstack_project"
(click)="toggleStartingOfMachines()"
[disabled]="
toggleLocked || !(project_application?.user_is_pi || project_application?.user_is_admin)
"
/>
<label class="help-block" style="vertical-align: middle" for="toggle_starting_of_machines"
>Non-administrators are allowed to start machines</label
>
</div>
</li>
</ul>
</div>
</div>
Expand Down
32 changes: 0 additions & 32 deletions src/app/projectmanagement/overview.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -560,25 +560,6 @@ export class OverviewComponent extends ApplicationBaseClassComponent implements
)
}

/**
* Checks if user is able to start a machine, when the
* project is a SimpleVM project.
*/
isAbleToStart(): boolean {
if (this.resourceDataLoaded) {
if (!this.project_application?.project_application_openstack_project) {
if (
this.vmsInUse < this.maximumVMs &&
(this.project_application.user_is_admin || this.project_application.allow_machines_starting)
) {
return true
}
}
}

return false
}

/**
* If the application is an openstack application, the requested/approved resources will be set for maximum VMs.
* For SimpleVM also the VMs in use are set.
Expand Down Expand Up @@ -653,19 +634,6 @@ export class OverviewComponent extends ApplicationBaseClassComponent implements
)
}

toggleStartingOfMachines(): void {
this.toggleLocked = true
this.groupService.toggleStartingMachines(this.project_application.project_application_perun_id).subscribe(
(res: any): void => {
this.project_application.allow_machines_starting = res['allow_machines_starting']
this.toggleLocked = false
},
() => {
this.toggleLocked = false
}
)
}

switchToggleLocked(check: boolean): void {
this.toggleLocked = check
}
Expand Down

0 comments on commit 9afdae3

Please sign in to comment.