diff --git a/src/app/launch-dialog/launch-dialog.component.html b/src/app/launch-dialog/launch-dialog.component.html index 7d6690ac3b92bc26d929b9df57899ed66f06036f..b881ef7ebf5696e9b2543b737cd449c61037c0b2 100644 --- a/src/app/launch-dialog/launch-dialog.component.html +++ b/src/app/launch-dialog/launch-dialog.component.html @@ -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> diff --git a/src/app/launch-dialog/launch-dialog.component.ts b/src/app/launch-dialog/launch-dialog.component.ts index 783c09ccb993185756bc2979b43daa15e9d68ce1..5c87699160923811c06192a51d3c338cdc580e70 100644 --- a/src/app/launch-dialog/launch-dialog.component.ts +++ b/src/app/launch-dialog/launch-dialog.component.ts @@ -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(); + } } } diff --git a/src/app/submit-app.service.ts b/src/app/submit-app.service.ts index a90a8e03e0ac74a844cb89971dde1872cc0cf90e..97d34acce07e40529112882509a659b2a191629a 100644 --- a/src/app/submit-app.service.ts +++ b/src/app/submit-app.service.ts @@ -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);