diff --git a/projects/ngx-launcher/src/lib/components/gitprovider-step/gitprovider-step.component.html b/projects/ngx-launcher/src/lib/components/gitprovider-step/gitprovider-step.component.html index af3b1a09..30bfa9cc 100644 --- a/projects/ngx-launcher/src/lib/components/gitprovider-step/gitprovider-step.component.html +++ b/projects/ngx-launcher/src/lib/components/gitprovider-step/gitprovider-step.component.html @@ -29,26 +29,26 @@

GitHub

Authorized Account Information

-
- -
+
+ +
+ *ngIf="gitHubDetails?.avatar !== undefined"> None + *ngIf="gitHubDetails?.login === undefined;"> None
-
- -
+
+ +
-
- -
+ +
Authorized Account Information
+ +
+ +
+
diff --git a/projects/ngx-launcher/src/lib/components/gitprovider-step/gitprovider-step.component.less b/projects/ngx-launcher/src/lib/components/gitprovider-step/gitprovider-step.component.less index 0abc0385..66e4713b 100644 --- a/projects/ngx-launcher/src/lib/components/gitprovider-step/gitprovider-step.component.less +++ b/projects/ngx-launcher/src/lib/components/gitprovider-step/gitprovider-step.component.less @@ -59,4 +59,10 @@ ul.dropdown-menu { max-height: 400px; } + .required { + color: @color-pf-red; + } + .padding-0 { + padding: 0; + } } diff --git a/projects/ngx-launcher/src/lib/components/gitprovider-step/gitprovider-step.component.ts b/projects/ngx-launcher/src/lib/components/gitprovider-step/gitprovider-step.component.ts index 5e4b330c..90f0f194 100644 --- a/projects/ngx-launcher/src/lib/components/gitprovider-step/gitprovider-step.component.ts +++ b/projects/ngx-launcher/src/lib/components/gitprovider-step/gitprovider-step.component.ts @@ -15,9 +15,10 @@ import { } from '@angular/core'; import { NgForm } from '@angular/forms'; import { Broadcaster } from 'ngx-base'; -import { Subscription } from 'rxjs'; +import { Subscription, throwError } from 'rxjs'; import { BuildTool } from './../../model/build-tool.model'; +import { catchError } from 'rxjs/operators'; import { LauncherStep } from '../../launcher-step'; import { LauncherComponent } from '../../launcher.component'; import { GitHubDetails } from '../../model/github-details.model'; @@ -43,6 +44,7 @@ export class GitproviderStepComponent extends LauncherStep implements AfterViewI detectedTool: BuildTool; runtimeDetectionSecVisible: boolean = false; isRuntimeDetected: boolean = false; + gitHubDetailLoaded: boolean = false; constructor(@Host() @Optional() public launcherComponent: LauncherComponent, private projectile: Projectile, @@ -86,8 +88,15 @@ export class GitproviderStepComponent extends LauncherStep implements AfterViewI this.launcherComponent.addStep(this); } - this.subscriptions.push(this.gitProviderService.getGitHubDetails().subscribe((val) => { + this.subscriptions.push(this.gitProviderService.getGitHubDetails().pipe( + catchError((error) => { + this.gitHubDetailLoaded = true; + return throwError(error); + }) + ) + .subscribe((val) => { if (val !== undefined) { + this.gitHubDetailLoaded = true; Object.assign(this.gitHubDetails, val); this.restore(); } diff --git a/src/app/service/demo-git-provider.service.ts b/src/app/service/demo-git-provider.service.ts index c17d7dde..9ad77b91 100644 --- a/src/app/service/demo-git-provider.service.ts +++ b/src/app/service/demo-git-provider.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { EMPTY, Observable, of } from 'rxjs'; +import { EMPTY, Observable, of, throwError } from 'rxjs'; import { delay } from 'rxjs/operators'; import { GitHubDetails } from '../../../projects/ngx-launcher/src/lib/model/github-details.model'; import { GitProviderService } from '../../../projects/ngx-launcher/src/lib/service/git-provider.service'; @@ -41,7 +41,7 @@ export class DemoGitProviderService implements GitProviderService { login: GitHubMock.user.login, organizations: this.existingRepo } as GitHubDetails; - return this.isPageRedirect() ? of(gitHubDetails) : EMPTY; + return this.isPageRedirect() ? of(gitHubDetails) : throwError({status: 404}); } /**