Skip to content

Commit

Permalink
Merge pull request #3766 from deNBI/refactor/workshop-overview
Browse files Browse the repository at this point in the history
feat(workshop): fix class, refactor wording
  • Loading branch information
eKatchko authored Oct 20, 2021
2 parents c8ba191 + ce4c197 commit 67d5253
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/app/projectmanagement/project_member.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export class ProjectMember {
publicKeySet: boolean;
groupAdmin: boolean;
hasVM: boolean = false;
vm_amount: number = 0;

constructor(project_member?: Partial<ProjectMember>) {
Object.assign(this, project_member);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
<div class="card" (click)="reset_on_workshop_change(); set_selected_workshop(workshop);"
style="cursor: pointer; width: 16rem; height: auto;">
<div class="card-header text-truncate"
[ngClass]="{'bg-success': (workshop.shortname === selected_workshop?.shortname)}"
data-toggle="tooltip" data-placement="top">
{{workshop.shortname}} - {{workshop.longname}}
</div>
Expand Down Expand Up @@ -214,7 +215,7 @@
<thead>
<tr>
<th>Full Name</th>
<th>Has VM</th>
<th>Vm started for this user in this workshop</th>
<th>Action</th>
</tr>
</thead>
Expand All @@ -224,6 +225,7 @@
<td>
<span *ngIf="member.hasVM" class="badge badge-success">
<span class="icon icon-check"></span>
{{member.vm_amount}} VMs started in this workshop for this user
</span>
<span *ngIf="!member.hasVM" class="badge badge-danger">
<span class="icon icon-close"></span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,19 @@ export class AddWorkshopComponent implements OnInit, OnDestroy, DoCheck {
}

get_workshops_for_application(): void {
this.workshops = [];
this.subscription.add(
this.workshop_service.getWorkshops(this.selected_project[1]).subscribe(
(workshops: Workshop[]) => {
this.workshops = workshops;
for (const workshop of workshops) {
this.subscription.add(
this.workshop_service.loadWorkshopWithVms(workshop.id).subscribe(
(workshop_with_vms: Workshop) => {
this.workshops.push(workshop_with_vms);
},
),
);
}
},
),
);
Expand Down Expand Up @@ -277,10 +286,12 @@ export class AddWorkshopComponent implements OnInit, OnDestroy, DoCheck {
this.workshop_data_loaded = true;

for (const member of this.project_members) {
member.vm_amount = 0;
member.hasVM = false;
for (const workshopvm of this.selected_workshop.vm_list) {
if (member.elixirId === workshopvm.elixirid) {
member.hasVM = true;
member.vm_amount += 1;
}
}
}
Expand Down

0 comments on commit 67d5253

Please sign in to comment.