refactor: translations, bug fixes
MODIFY
src/app/components/marketplace-api-description/marketplace-api-description.component.html
src/app/components/marketplace-api-description/marketplace-api-description.component.html
src="https://github.com/apiman/apiman/raw/master/manager/ui/war/plugins/api-manager/img/about-logo.png"
/>
</span>
- <p id="shortDescription">{{ markdown.substr(0, 240) }}</p>
+ <p id="shortDescription">{{ api.api.description.substr(0, 240) }}</p>
</div>
<mat-grid-list cols="4" rowHeight="1:1">
<mat-grid-tile colspan="3" id="long-description-tile">
<div class="box" data-simplebar>
- <markdown [data]="markdown"></markdown>
+ <markdown [data]="api.extendedDescription"></markdown>
</div>
</mat-grid-tile>
<mat-grid-tile colspan="1">

MODIFY
src/app/components/marketplace-api-description/marketplace-api-description.component.ts
src/app/components/marketplace-api-description/marketplace-api-description.component.ts
@@ -11,54 +11,6 @@ export class MarketplaceApiDescriptionComponent implements OnInit {
@Input() isLatest!: boolean;
features: string[] = ['fast', 'free', 'fancy features'];
- markdown: string =
- '# In inmotae messes et tamen sustinuit fieri\n' +
- '\n' +
- '## Iam nataque prospexit\n' +
- '\n' +
- 'Lorem markdownum accingere levatae inspicitur leve Nereides offensa *renidenti\n' +
- 'deflent illis* licet operum sonitum descendere multo, errorem nec ille. Monstra\n' +
- 'superest, si negat diebus alimenta vibrantia aderas loquendo in nec **bicorni**\n' +
- 'advena dixit herosmaxime adpulit arduus dum!\n' +
- '\n' +
- '1. Cristis vetus totumque celeremque creber sacris et\n' +
- '2. Care membra positis centum\n' +
- '3. Sparsitque Bacchus\n' +
- '4. Ausim dixi vittam orbem\n' +
- '5. Tempora pars mutua Oceano soporiferam Iove imis\n' +
- '6. Quem metus\n' +
- '\n' +
- 'Se vitae, sede visus illa, virgaque amnis matris protinus parentis se furor\n' +
- 'quotiens, tempora. Nec iuro et fieri et flere redit opta arma et quidem\n' +
- '[plurimus](http://negat.org/) cuius. Palustris Bromumque transformat tu virtus\n' +
- 'tritumque armat formam iube varias crudelesque dedit. Supplex ipse, omnes neque\n' +
- 'Haemoniam ipsoque sanguine mox suppressa montes. Cervos renuente, pavor aere\n' +
- 'durat revocata?\n' +
- '\n' +
- ' var ios = -2;\n' +
- ' fileItunesSchema = software;\n' +
- ' cold_meta_wimax += boxExpansion - ribbonWord * version_ripcording_os(\n' +
- ' languageHyperlinkStatus);\n' +
- '\n' +
- '## De pastor natos refluum\n' +
- '\n' +
- 'Et ora, est et moderere intra procorum, suam ut instare nam. Obstipuere\n' +
- '**secundi vertice**. Levavit cum molitur caput dederat lumina.\n' +
- '\n' +
- '1. Ibat pependit auguris quid\n' +
- '2. Lupos vietum\n' +
- '3. Rerum sumptis percusso texitur ferrum novitatis quodque\n' +
- '\n' +
- 'Producet fluentia prope Titania extenuatur Arethusa corpora *tela geras reddita*\n' +
- 'fallaces sola tibi et admonitu, formosior. Suos reduxit *supremo* amicius!\n' +
- '\n' +
- '> Regione magorum iuvenis latosque coeunt: necis enim,\n' +
- '> [Theseu](http://www.exsiccata-vultu.net/) Arethusae vincat *altera carcere*\n' +
- '> vetito tenetque regales, leonem? Praestiteris alas: sagitta satis sua retexit\n' +
- '> restare amore aliquis montesque. Quoque egressa exhalat inque; si Procris?\n' +
- '\n' +
- 'Inplevere maior. Ubi aut supplicium Averna, ciet percussis Praebuimus saepe\n' +
- 'fugisse quae est: a.';
constructor() {}

MODIFY
src/app/components/marketplace-client-app/marketplace-client-app.component.html
src/app/components/marketplace-client-app/marketplace-client-app.component.html
/>
</mat-form-field>
</form>
- <button mat-raised-button color="primary" class="ml-20" (click)="addClient()">
+ <button mat-raised-button color="primary" class="ml-20" [disabled]="clickedRows.size > 0 || clientName.length === 0" (click)="addClient()">
{{ "COMMON.CREATE" | translate }}
</button>
</div>

MODIFY
src/app/components/marketplace-client-app/marketplace-client-app.component.ts
src/app/components/marketplace-client-app/marketplace-client-app.component.ts
@@ -11,6 +11,7 @@ import {HttpErrorResponse} from '@angular/common/http';
import {catchError, switchMap} from 'rxjs/operators';
import {forkJoin, of} from 'rxjs';
import {TranslateService} from '@ngx-translate/core';
+import {KeycloakHelperService} from "../../services/keycloak-helper/keycloak-helper.service";
@Component({
selector: 'app-marketplace-client-app',
@@ -30,7 +31,8 @@ export class MarketplaceClientAppComponent implements OnInit {
constructor(
private backend: BackendService,
private snackbar: SnackbarService,
- private translator: TranslateService
+ private translator: TranslateService,
+ private keycloakHelper: KeycloakHelperService
) {}
ngOnInit(): void {
@@ -53,7 +55,7 @@ export class MarketplaceClientAppComponent implements OnInit {
const orgId: string =
this.organizations.length > 1
? this.organizationId
- : this.organizations[0].id;
+ : this.keycloakHelper.getUsername();
this.backend.createClient(orgId, this.clientName)
.pipe(
switchMap((client: IClient) => {
@@ -68,7 +70,7 @@ export class MarketplaceClientAppComponent implements OnInit {
this.createTableView(results);
},
(error) => {
- this.snackbar.showErrorSnackBar(error);
+ this.snackbar.showErrorSnackBar(error.error.message);
}
);
}
@@ -120,10 +122,9 @@ export class MarketplaceClientAppComponent implements OnInit {
}
private createTableView(results: [IOrganizationSummary[], IClientSummary[]]) {
- const organizations = results[0];
const clients = results[1];
this.organizations = results[0];
- if (organizations.length > 1) {
+ if (this.organizations.length > 1) {
this.displayedColumns = ['org-name', 'name'];
}
this.dataSource = new MatTableDataSource(results[1]);

MODIFY
src/app/components/marketplace-signup-stepper/marketplace-signup-stepper.component.ts
src/app/components/marketplace-signup-stepper/marketplace-signup-stepper.component.ts
@@ -126,10 +126,10 @@ export class MarketplaceSignupStepperComponent implements OnInit {
this.translator.instant('WIZARD.SUCCESS')
);
this.contract = contract;
- if (['Ready', 'Created'].includes(this.contract.client.status)) {
- stepper.next();
- } else {
+ if ('AwaitingApproval' === this.contract.client.status) {
void this.router.navigate(['approval']);
+ } else {
+ stepper.next();
}
},
(error) => this.snackbar.showErrorSnackBar(error.message, error)

MODIFY
src/app/components/my-apps-use-api/my-apps-use-api.component.html
src/app/components/my-apps-use-api/my-apps-use-api.component.html
<input
matInput
readonly
- value="{{ 'X-API-Key: ' + apiKey }}"
+ value="{{ apiKey }}"
[placeholder]="'COMMON.HTTP_HEADER' | translate"
/>
<button
[disabled]="disableButtons"
- [cdkCopyToClipboard]="'X-API-Key: ' + apiKey"
+ [cdkCopyToClipboard]="apiKey"
mat-icon-button
matSuffix
class="input-icon-btn"
<input
matInput
readonly
- value="{{ endpoint + '?apikey=' + apiKey }}"
+ value="{{ endpoint }}"
[placeholder]="'COMMON.QUERY_PARAMETER' | translate"
/>
<button
[disabled]="disableButtons"
- [cdkCopyToClipboard]="endpoint + '?apikey=' + apiKey"
+ [cdkCopyToClipboard]="endpoint"
mat-icon-button
matSuffix
class="input-icon-btn"

MODIFY
src/app/components/my-apps-use-api/my-apps-use-api.component.ts
src/app/components/my-apps-use-api/my-apps-use-api.component.ts
@@ -54,8 +54,8 @@ export class MyAppsUseApiComponent implements OnInit, OnChanges {
private initProperties() {
if (this.contract) {
this.disableButtons = false;
- this.apiKey = this.contract.client.apikey;
- this.endpoint = this.contract.managedEndpoint;
+ this.apiKey = `X-API-Key: ${this.contract.client.apikey}`;
+ this.endpoint = `${this.contract.managedEndpoint}?apikey=${this.contract.client.apikey}`;
this.orgId = this.contract.api.api.organization.id;
this.apiId = this.contract.api.api.id;
this.apiVersion = this.contract.api.version;

MODIFY
src/app/interfaces/ICommunication.ts
src/app/interfaces/ICommunication.ts
@@ -83,6 +83,7 @@ export interface IApiVersion {
parsePayload: boolean;
disableKeysStrip: boolean;
definitionUrl: string;
+ extendedDescription: string;
}
export interface IOrganization {
@@ -498,7 +499,7 @@ export interface IClientVersion {
/** @format int64 */
id: number;
client: IClient;
- status: 'Created' | 'Ready' | 'Registered' | 'Retired';
+ status: 'Created' | 'Ready' | 'Registered' | 'Retired' | 'AwaitingApproval';
version: string;
createdBy: string;

MODIFY
src/app/services/backend/backend.service.ts
src/app/services/backend/backend.service.ts
@@ -127,7 +127,7 @@ export class BackendService {
name: this.keycloakHelper.getUsername(),
description: ''
};
- const path = '/devportal/organizations';
+ const path = 'devportal/organizations';
return this.http.post<IOrganization>(this.generateUrl(path), org);
}

MODIFY
src/assets/i18n/de.json
src/assets/i18n/de.json
"POLICIES": {
"RATE_LIMIT": {
"TITLE": "Rate Limiting Policy",
- "DESCRIPTION": "You will be rate limited to <strong>{{limit}}</strong> requests per <strong>{{timeUnit}}</strong>",
+ "DESCRIPTION": "You will be rate limited to <b>{{limit}}</b> requests per <b>{{timeUnit}}</b>",
"MORE_INFO": "The following headers in the response contain useful information relating to rate limit,",
"LIMIT": "Rate limit allowance (per time period)",
"REMAINING": "Rate limit allowance remaining",
},
"QUOTA": {
"TITLE": "Quota Policy",
- "DESCRIPTION": "You can transfer a maximum of {{limit}} of data per {{timeUnit}}",
+ "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)",
"REMAINING": "Quota limit allowance remaining",

MODIFY
src/assets/i18n/en.json
src/assets/i18n/en.json
"POLICIES": {
"RATE_LIMIT": {
"TITLE": "Rate Limiting Policy",
- "DESCRIPTION": "You will be rate limited to <strong>{{limit}}</strong> requests per <strong>{{timeUnit}}</strong>",
+ "DESCRIPTION": "You will be rate limited to <b>{{limit}}</b> requests per <b>{{timeUnit}}</b>",
"MORE_INFO": "The following headers in the response contain useful information relating to rate limit,",
"LIMIT": "Rate limit allowance (per time period)",
"REMAINING": "Rate limit allowance remaining",
},
"QUOTA": {
"TITLE": "Quota Policy",
- "DESCRIPTION": "You can transfer a maximum of {{limit}} of data per {{timeUnit}}",
+ "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)",
"REMAINING": "Quota limit allowance remaining",

refactor: translations, bug fixes