fix(ui): remove sign-up button for unpublished APIs
Checks if apiVersion.status is published before displaying 'Sign-Up' Button
Closes:
MODIFY
src/app/components/plan-card-list/plan-card-list.component.html
src/app/components/plan-card-list/plan-card-list.component.html
<div>
<mat-divider></mat-divider>
<button
+ *ngIf="apiVersion.status === 'Published'"
class="sign-up-button"
mat-raised-button
color="primary"

MODIFY
src/app/components/plan-card-list/plan-card-list.component.ts
src/app/components/plan-card-list/plan-card-list.component.ts
@@ -9,7 +9,6 @@ import { switchMap } from 'rxjs/operators';
import { forkJoin } from 'rxjs';
import { flatArray } from '../../shared/utility';
import { IApiVersionExt } from '../../interfaces/IApiVersionExt';
-import { KeycloakService } from 'keycloak-angular';
@Component({
selector: 'app-plan-card-list',

MODIFY
src/app/guards/auth.guard.ts
src/app/guards/auth.guard.ts
import { Injectable } from '@angular/core';
-import {
- ActivatedRouteSnapshot,
- Router,
- RouterStateSnapshot,
- UrlTree
-} from '@angular/router';
+import { Router, UrlTree } from '@angular/router';
import { KeycloakAuthGuard, KeycloakService } from 'keycloak-angular';
import { KeycloakHelperService } from '../services/keycloak-helper/keycloak-helper.service';
import { BackendService } from '../services/backend/backend.service';
@@ -25,15 +20,7 @@ export class AuthGuard extends KeycloakAuthGuard {
super(router, keycloakAngular);
}
- /**
- * If not authenticated this guard forces a login and starts the automatic token refresh mechanism
- * @param route the current route
- * @param state the current state
- */
- async isAccessAllowed(
- route: ActivatedRouteSnapshot,
- state: RouterStateSnapshot
- ): Promise<boolean | UrlTree> {
+ async isAccessAllowed(): Promise<boolean | UrlTree> {
if (!this.authenticated) {
await this.keycloakAngular.login({
redirectUri: window.location.href

fix(ui): remove sign-up button for unpublished APIs

Checks if apiVersion.status is published before displaying 'Sign-Up' Button

Closes: #48