Skip to content

Commit

Permalink
fix: respect courses pauseable flag (#210)
Browse files Browse the repository at this point in the history
Co-authored-by: Philip Prinz <[email protected]>
  • Loading branch information
jggoebel and Philip Prinz authored Sep 26, 2024
1 parent 3ef36d6 commit 4a28b3e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/app/course/course.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ export class Course {
// These are Scenario IDs
scenarios: string[];
keep_vm: boolean;
pauseable: boolean;
virtualmachines: Map<string, string>[];
}
2 changes: 1 addition & 1 deletion src/app/scenario/step.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h3 id="scenario-name" class="grid-container">
Finish
</button>

<ng-container *ngIf="scenario.pauseable && !isContentOnly">
<ng-container *ngIf="isPauseable()">
<button class="btn btn-pause" (click)="pause()">
<cds-icon shape="pause" solid></cds-icon> Pause
</button>
Expand Down
8 changes: 8 additions & 0 deletions src/app/scenario/step.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,14 @@ export class StepComponent implements OnInit, AfterViewInit, OnDestroy {
return exists;
}

isPauseable(): boolean {
if (this.isContentOnly !== '' && this.isContentOnly) return false;
if (this.course) {
return this.course.pauseable;
}
return this.scenario.pauseable;
}

getBrawlLanguages() {
return this.languageCommandService.getLanguageNames();
}
Expand Down

0 comments on commit 4a28b3e

Please sign in to comment.