fix: no policy probe -> ui handels it
MODIFY
src/app/components/my-apps-policies/my-apps-policies.component.html
src/app/components/my-apps-policies/my-apps-policies.component.html
<app-policy-card [policy]="policy"></app-policy-card>
</div>
<div class="grid-divider"><div></div></div>
- <div class="policy-charts-grid">
+ <div class="policy-charts-grid" *ngIf="policy.probe; else noProbe">
<div>
<app-gauge-chart [gaugeData]="policy.mainGaugeData" [icon]="policy.icon"></app-gauge-chart>
</div>
</div>
</div>
</div>
+
+<ng-template #noProbe>
+ <div class="dp-center">
+ <app-no-data [text]="'APPS.NO_PROBES' | translate" [textClass]="'text-big2'"></app-no-data>
+ </div>
+</ng-template>

MODIFY
src/app/components/my-apps-summary/my-apps-summary.component.html
src/app/components/my-apps-summary/my-apps-summary.component.html
</div>
</div>
<div class="grid-divider"><div></div></div>
- <div *ngIf="contract!.policies.length > 0; else noPolicies" class="policies">
+ <div *ngIf="contract!.policies.length > 0 && contract!.policies[0].probe ; else noPolicies" class="policies">
<ng-container *ngFor="let policy of contract!.policies">
<app-policy-card-light [policy]="policy" [contract]="contract" (sectionChanged)="sectionChanged($event)"></app-policy-card-light>
</ng-container>

MODIFY
src/app/components/my-apps/my-apps.component.html
src/app/components/my-apps/my-apps.component.html
</div>
</div>
<div *ngFor="let contract of cliCon.value" class="app-api">
-
<!-- Menu for the API -->
<div class="app-api-menu">
<div>

MODIFY
src/app/components/my-apps/my-apps.component.ts
src/app/components/my-apps/my-apps.component.ts
@@ -150,7 +150,13 @@ export class MyAppsComponent implements OnInit {
private fetchPolicyProbes(){
this.contracts.forEach((contract: IContractExt) => {
contract.policies.forEach((policy: IPolicyExt) => {
- this.policyService.getPolicyProbe(contract, policy).subscribe((probes: any) => {
+ this.policyService.getPolicyProbe(contract, policy).pipe(
+ catchError((err) => {
+ console.warn(err);
+ this.policyService.initPolicy(policy);
+ return EMPTY;
+ })
+ ).subscribe((probes: any) => {
policy.probe = probes[0];
this.policyService.initPolicy(policy);
this.policyService.setGaugeDataForPolicy(policy);

MODIFY
src/app/interfaces/ICommunication.ts
src/app/interfaces/ICommunication.ts
@@ -501,7 +501,7 @@ export interface IClientVersion {
/** @format int64 */
id: number;
client: IClient;
- status: 'Created' | 'Ready' | 'Registered' | 'Retired' | 'AwaitingApproval';
+ status: 'Created' | 'Ready' | 'Registered' | 'Retired' | 'AwaitingApproval' | 'Unregistered';
version: string;
createdBy: string;

MODIFY
src/app/interfaces/IStatus.ts
src/app/interfaces/IStatus.ts
@@ -4,7 +4,8 @@ export type IClientStatus =
| 'Ready'
| 'Retired'
| 'AwaitingApproval'
- | 'Registered';
+ | 'Registered'
+ | 'Unregistered';
export type IStatusColors = 'mediumseagreen' | 'darkred' | 'coral';
export type ApiStatusColorMap = Map<IApiStatus | IClientStatus, IStatusColors>;
@@ -16,6 +17,7 @@ export const statusColorMap: ApiStatusColorMap = new Map<
['Created', 'coral'],
['Ready', 'mediumseagreen'],
['Retired', 'darkred'],
+ ['Unregistered', 'darkred'],
['Published', 'mediumseagreen'],
['AwaitingApproval', 'coral'],
['Registered', 'mediumseagreen'],

MODIFY
src/app/services/policy/policy.service.ts
src/app/services/policy/policy.service.ts
@@ -218,6 +218,9 @@ export class PolicyService {
}
public setGaugeDataForPolicy(policy: IPolicyExt) {
+ if (!policy.probe)
+ return;
+
policy.mainGaugeData = this.generateMainGaugeData(policy);
policy.timeGaugeData = this.generateTimeGaugeData(policy);
}

MODIFY
src/assets/i18n/en.json
src/assets/i18n/en.json
"APPS_AND_APIS": "Apps and APIs",
"NO_APPS_FOUND": "No applications were found",
"FAILED_WHILE_FETCHING_CLIENTS": "Failed while fetching applications",
- "REMOVE_CLIENT_FAILED": "Failed while removing the client"
+ "REMOVE_CLIENT_FAILED": "Failed while removing the client",
+ "NO_PROBES": "Failed while fetching the current policy data"
},
"CLIENT_CREATE" : {
"SELECT": "Select from available Applications"
"CONDITION_LIGHT": "<b>{{limit}}</b> requests per <b>{{timeUnit}}</b>"
},
"TransferQuotaPolicy": {
- "TITLE": "Quota Policy",
+ "TITLE": "Transfer Quota Policy",
"DESCRIPTION": "You can transfer a maximum of <b>{{limit}}</b> of data per <b>{{timeUnit}}</b>",
"MORE_INFO": "The following headers in the response contain useful information relating to quota limit:",
"LIMIT": "Quota limit allowance (per time period)",

fix: no policy probe -> ui handels it