X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=webapp%2Fsrc%2Fapp%2Fbuild%2Fbuild.component.ts;h=a1a965bfd1405e77e631b38a9b3953490299adb6;hb=1f19bfa9fcf0903dab6e5675f055f23cba1357b7;hp=e1076c5038ebc9ebf72b4486c31f35671fe97fc8;hpb=ec7051e1da665206f594c7616ad381bfeaea333a;p=src%2Fxds%2Fxds-server.git diff --git a/webapp/src/app/build/build.component.ts b/webapp/src/app/build/build.component.ts index e1076c5..a1a965b 100644 --- a/webapp/src/app/build/build.component.ts +++ b/webapp/src/app/build/build.component.ts @@ -44,9 +44,13 @@ export class BuildComponent implements OnInit, AfterViewChecked { ngOnInit() { this.config$ = this.configSvr.conf; this.config$.subscribe((cfg) => { - this.curProject = cfg.projects[0]; - - this.confValid = (cfg.projects.length && this.curProject.id != null); + if ("projects" in cfg) { + this.curProject = cfg.projects[0]; + this.confValid = (cfg.projects.length && this.curProject.id != null); + } else { + this.curProject = null; + this.confValid = false; + } }); // Command output data tunneling @@ -78,6 +82,10 @@ export class BuildComponent implements OnInit, AfterViewChecked { } make(args: string) { + if (!this.curProject) { + this.alertSvr.warning('No active project', true); + } + let prjID = this.curProject.id; this.cmdOutput += this._outputHeader(); @@ -91,7 +99,7 @@ export class BuildComponent implements OnInit, AfterViewChecked { }, err => { this.cmdInfo = 'Last command duration: ' + this._computeTime(t0); - this.alertSvr.add({ type: "danger", msg: 'ERROR: ' + err }); + this.alertSvr.error('ERROR: ' + err); }); }