Fix my apps page to show retired apis
MODIFY
src/app/components/my-apps-summary/my-apps-summary.component.html
src/app/components/my-apps-summary/my-apps-summary.component.html
~ imitations under the License.
-->
-<div class="summary">
+<div
+ class="summary"
+ *ngIf="contract!.api.status !== 'Retired'; else apiRetired">
<div class="endpoints">
<div class="api-endpoint">
<div>
[text]="'APPS.NO_POLICIES_FOR_API' | translate"></app-no-data>
</ng-template>
</div>
+<ng-template #apiRetired>
+ <app-no-data
+ class="dp-center"
+ style="display: grid"
+ [textClass]="'text-big3'"
+ [text]="'APPS.RETIRED_API' | translate">
+ </app-no-data>
+</ng-template>

MODIFY
src/app/components/my-apps/my-apps.component.html
src/app/components/my-apps/my-apps.component.html
{{ 'APPS.SUMMARY' | translate }}
</span>
</div>
+ <div *ngIf="contract!.api.status !== 'Retired'">
<div>
<span
(click)="setSection(contract, 'use-api')"
{{ 'APPS.POLICIES' | translate }}
</span>
</div>
+ </div>
<div>
<!-- TODO Add this later -->
<!-- <span-->

MODIFY
src/app/components/my-apps/my-apps.component.ts
src/app/components/my-apps/my-apps.component.ts
@@ -160,7 +160,7 @@ export class MyAppsComponent implements OnInit {
contract.plan.version
),
- this.backend.getManagedApiEndpoint(
+ this.apiService.getManagedApiEndpoint(
orgId,
contract.api.api.id,
contract.api.version
@@ -207,7 +207,10 @@ export class MyAppsComponent implements OnInit {
return [
...new Map(
- clients.map((clientSummary) => [clientSummary.id, clientSummary])
+ clients.map((clientSummary) => [
+ clientSummary.organizationId + clientSummary.id,
+ clientSummary
+ ])
).values()
];
}

MODIFY
src/app/services/api/api.service.ts
src/app/services/api/api.service.ts
import { Injectable } from '@angular/core';
import { BackendService } from '../backend/backend.service';
-import { Observable, throwError } from 'rxjs';
+import { Observable, of, throwError } from 'rxjs';
import { catchError, retry, switchMap } from 'rxjs/operators';
import {
IApiSummary,
IApiVersion,
+ IApiVersionEndpointSummary,
IApiVersionSummary,
ISearchCriteria,
ISearchResultsApiSummary
@@ -82,6 +83,20 @@ export class ApiService {
);
}
+ getManagedApiEndpoint(
+ orgId: string,
+ apiId: string,
+ apiVersion: string
+ ): Observable<IApiVersionEndpointSummary> {
+ return this.backendService
+ .getManagedApiEndpoint(orgId, apiId, apiVersion)
+ .pipe(
+ catchError(() => {
+ return of({} as IApiVersionEndpointSummary);
+ })
+ );
+ }
+
isApiDocAvailable(apiVersion: IApiVersion): boolean {
return (
apiVersion.definitionType === 'SwaggerYAML' ||

MODIFY
src/assets/i18n/en.json
src/assets/i18n/en.json
"NO_APPS_FOUND": "No applications were found",
"FAILED_WHILE_FETCHING_APPLICATIONS": "Failed while fetching applications",
"REMOVE_APPLICATION_FAILED": "Failed while removing the application",
- "NO_PROBES": "Failed while fetching the current policy data"
+ "NO_PROBES": "Failed while fetching the current policy data",
+ "RETIRED_API": "This API is retired and can no longer be used."
},
"APPLICATION_CREATE": {
"SELECT": "Select from available Applications"

Fix my apps page to show retired apis