Skip to content
Snippets Groups Projects
Commit 6b2b8eec authored by Chris Hines's avatar Chris Hines
Browse files

fix up the launch dialog so that values are saved correctly

parent 20f7999d
No related branches found
No related tags found
2 merge requests!21New css dev,!9Dev
......@@ -20,9 +20,9 @@
<div fxLayout="column" fxLayoutAlign="space-between stretch" style="height: 100%; width: 100%">
<!-- <div fxFlex style="background: blue">app config</div> -->
<iframe *ngIf="appconfigurl != null" fxGrow=10 fxFlex [src]="appconfigsafeurl" style="border: none"></iframe>
<iframe *ngIf="appconfigurl != null" [src]="batchcmdsafeurl" style="height: 1px; min-height: 0px; border: none"></iframe>
<iframe *ngIf="appconfigurl != null" [src]="batchcmdsafeurl" style="height: 1px; min-height: 0px; border: none" #batchbuilderiframe></iframe>
<iframe *ngIf="appconfigurl == null" fxFlex [src]="batchcmdsafeurl" fxGrow=1 style="border: none"></iframe>
<iframe *ngIf="appconfigurl == null" fxFlex [src]="batchcmdsafeurl" fxGrow=1 style="border: none" #batchbuilderiframe></iframe>
<div fxLayout="row" fxLayoutAlign="space-around">
<button mat-button (click)="cancel()">Cancel</button><button mat-button (click)="launch()" #launchbtn>Launch</button>
......
......@@ -18,6 +18,7 @@ export class LaunchDialogComponent implements OnInit {
appconfigsafeurl: any;
rmListen: any;
@ViewChild('launchbtn', { read: ElementRef, static: false }) launchbtn: ElementRef;
@ViewChild('batchbuilderiframe', { read: ElementRef, static: false }) batchbuilderiframe: ElementRef;
setFocus: Boolean;
sub: Subscription;
......@@ -56,8 +57,10 @@ export class LaunchDialogComponent implements OnInit {
launch() {
console.log('cause app submission');
this.dialogRef.close();
this.submitAppService.launch();
console.log(this.batchbuilderiframe);
this.batchbuilderiframe.nativeElement.contentWindow.postMessage('launch selected',"*");
//this.dialogRef.close();
//this.submitAppService.launch();
}
......@@ -91,9 +94,16 @@ export class LaunchDialogComponent implements OnInit {
receiveMessage(event) {
if (event.data['batchcmd'] !== undefined) {
this.submitAppService.submitcmd.next(event.data['batchcmd']);
console.log('recieved a submit cmd');
console.log('recieveMessage'+this.submitAppService.submitcmd.value);
}
if (event.data['appData'] !== undefined) {
this.submitAppService.appData.next(event.data['appData']);
}
if (event.data == "close iframe") {
console.log('recieved close iframe');
timer(0).subscribe(() => { console.log("timer "+this.submitAppService.submitcmd.value) ; this.dialogRef.close(); this.submitAppService.launch()}); // complete the current event loop, ie receive all messages to get teh correct time before submitting
//this.submitAppService.launch();
}
}
}
......@@ -79,7 +79,6 @@ export class SubmitAppService {
}
canILaunch() {
console.log('in submitAppService, evaluatin can I launch');
if (this.submitcmd.value != null) {
if (this.app.value.url == null || this.appData.value != null ) {
this.readyToLaunch.next(true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment