fix: reorder config file and add translation strings
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
<div class="grid">
<div>
<h4>{{ "APPS.API_DOCS_TRY_NOW" | translate }}</h4>
- <p>{{ mockText }}</p>
+ <p>{{ "DESCRIPTIONS.TRY_IT_OUT" | translate }}</p>
</div>
<div id="try-it-now-btn">
<ng-container *ngIf="contract">
- <button mat-raised-button color="primary" [disabled]="disableButtons" [routerLink]="[
+ <button
+ mat-raised-button
+ color="primary"
+ [disabled]="disableButtons"
+ [routerLink]="[
'/swagger',
contract.client.client.organization.id,
contract.api.id,
contract.api.version
- ]">
+ ]"
+ >
{{ "APPS.VIEW_AND_TRY_NOW" | translate }}
</button>
</ng-container>
<div class="grid">
<div>
<h4>{{ "APPS.API_KEY" | translate }}</h4>
- <p>{{ mockText }}</p>
+ <p>{{ "DESCRIPTIONS.API_KEY" | translate }}</p>
</div>
<div>
<mat-form-field>
<div class="grid">
<div>
<h4>{{ "APPS.ENDPOINT" | translate }}</h4>
- <p>{{ mockText }}</p>
+ <p>{{ "DESCRIPTIONS.API_ENDPOINT" | translate }}</p>
</div>
<div>
<mat-form-field>
<div class="grid" *ngIf="hasOAuth">
<div>
<h4>{{ "APPS.AUTHENTICATION" | translate }}</h4>
- <p>{{ mockText }}</p>
+ <p>{{ "DESCRIPTIONS.OAUTH" | translate }}</p>
</div>
<div>
<mat-form-field>

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
import { Component, Input, OnChanges, OnInit } from '@angular/core';
import { BackendService } from '../../services/backend/backend.service';
import { SnackbarService } from '../../services/snackbar/snackbar.service';
-import {ISignUpInfo} from "../../interfaces/ISignUpInfo";
-import {SignUpService} from "../../services/sign-up/sign-up.service";
-import {IContractExt} from "../../interfaces/IContractExt";
+import { ISignUpInfo } from '../../interfaces/ISignUpInfo';
+import { SignUpService } from '../../services/sign-up/sign-up.service';
+import { IContractExt } from '../../interfaces/IContractExt';
+import { TranslateService } from '@ngx-translate/core';
@Component({
selector: 'app-my-apps-use-api',
@@ -14,17 +15,14 @@ export class MyAppsUseApiComponent implements OnInit, OnChanges {
@Input() contract?: IContractExt;
newContractDetails: ISignUpInfo;
- mockText =
- 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et';
-
apiKey = '';
endpoint = '';
oAuthServerUrl = '';
oAuthClientSecret = '';
previewText = {
- apiKey: 'You will be provided with an API-Key after sign-up',
- endpoint: 'You will be provided with an endpoint after sign-up',
+ apiKey: <string>this.translator.instant('WIZARD.API_KEY_PREVIEW'),
+ endpoint: <string>this.translator.instant('WIZARD.API_ENDPOINT_PREVIEW'),
oAuthServerUrl: 'http://example.org/auth/realms/example/foo',
oAuthClientSecret: '73b985d1-98b8-4d80-a89d-9dbee3b21a17',
};
@@ -35,6 +33,7 @@ export class MyAppsUseApiComponent implements OnInit, OnChanges {
private backend: BackendService,
private snackbar: SnackbarService,
private signUpService: SignUpService,
+ private translator: TranslateService
) {
this.newContractDetails = this.signUpService.getSignUpInfo();
}
@@ -50,7 +49,7 @@ export class MyAppsUseApiComponent implements OnInit, OnChanges {
private initProperties() {
if (this.contract) {
this.disableButtons = false;
- this.apiKey = this.contract!.client.apikey;
+ this.apiKey = this.contract.client.apikey;
this.endpoint = this.contract.managedEndpoint;
} else {
this.disableButtons = true;

MODIFY
src/assets/i18n/en.json
src/assets/i18n/en.json
"APPLICATION_ERROR": "You have to select one application first",
"TERMS_ERROR": "You have to accept the service terms",
"REDIRECT": "You will be redirected because of an invalid URL",
- "SUCCESS": "A contract has been successfully created"
+ "SUCCESS": "A contract has been successfully created",
+ "API_KEY_PREVIEW": "You will be provided an API-KEY after sign-up",
+ "API_ENDPOINT_PREVIEW": "You will be provided an endpoint after sign-up"
},
"POLICIES": {
"RATE_LIMIT": {
"REMAINING": "Quota limit allowance remaining",
"RESET": "Quota limit allowance remaining"
}
+ },
+ "DESCRIPTIONS": {
+ "TRY_IT_OUT": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et",
+ "API_KEY": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et",
+ "API_ENDPOINT": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et",
+ "OAUTH": "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et"
}
}

fix: reorder config file and add translation strings