Skip to content

Commit

Permalink
added scenario close button (#68)
Browse files Browse the repository at this point in the history
Signed-off-by: Eamon Bauman <eamon@eamonbauman.com>
  • Loading branch information
ebauman authored Jun 30, 2020
1 parent 2a7c5f7 commit fe7361f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
17 changes: 17 additions & 0 deletions src/app/scenario/step.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<button class="btn" [class.btn-success-outline]="(this.scenario.stepcount-1) != this.stepnumber"
[class.btn-success]="(this.scenario.stepcount-1) == this.stepnumber" (click)="goFinish()">Finish <clr-icon
shape="check"></clr-icon></button>
<button class="btn" [class.btn-outline]="(this.scenario.stepcount-1) != this.stepnumber" (click)="goClose()">Close Scenario <clr-icon
shape="window-close"></clr-icon></button>
<ng-container *ngIf="scenario.pauseable">
<button class="btn" (click)="pause()">
<clr-icon shape="pause" class="is-solid"></clr-icon> Pause Scenario
Expand Down Expand Up @@ -81,6 +83,21 @@ <h4 class="card-title">{{ step.title | atob }}</h4>
</div>
</div>

<clr-modal [(clrModalOpen)]="closeOpen">
<h3 class="modal-title">
Are you sure you want to close this scenario?
</h3>
<div class="modal-body">
<p>
Closing a scenario will retain your existing VMs. You may choose another scenario or return to this one.
</p>
</div>
<div class="modal-footer">
<button class="btn btn-outline" (click)="closeOpen = false">Cancel</button>
<button class="btn btn-success-outline" (click)="actuallyClose()">Close Scenario</button>
</div>
</clr-modal>

<clr-modal [(clrModalOpen)]="finishOpen">
<h3 class="modal-title">
Are you sure you want to finish?
Expand Down
10 changes: 9 additions & 1 deletion src/app/scenario/step.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class StepComponent implements OnInit, DoCheck {
public shellStatus: Map<string, string> = new Map();

public finishOpen: boolean = false;

public closeOpen: boolean = false;

public params: ParamMap;

Expand Down Expand Up @@ -345,6 +345,14 @@ export class StepComponent implements OnInit, DoCheck {

}

goClose() {
this.closeOpen = true;
}

actuallyClose() {
this.router.navigateByUrl("/app/home");
}

public pause() {
this.ssService.pause(this.session.id)
.pipe(
Expand Down

0 comments on commit fe7361f

Please sign in to comment.