feat(ui): add application information to account page
For debugging purposes we need to know which version of the API Developer Portal is used.
We added this informationen to the account page, which is mainly used for debugging purposes.
MODIFY
src/app/components/account-organization-permissions/account-organization-permissions.component.html
src/app/components/account-organization-permissions/account-organization-permissions.component.html
'ACCOUNT.API_MANAGEMENT.NO_PERMISSIONS' | translate
}}"></app-no-data>
</ng-template>
+ <div>
+ <hr />
+ <p id="app-info-header">
+ {{ 'ACCOUNT.API_MANAGEMENT.VERSION' | translate }}
+ </p>
+ <p id="app-info-version">{{ version }}</p>
+ </div>
</mat-expansion-panel>
</mat-accordion>

MODIFY
src/app/components/account-organization-permissions/account-organization-permissions.component.scss
src/app/components/account-organization-permissions/account-organization-permissions.component.scss
+/*!
+ * Copyright 2022 Scheer PAS Schweiz AG
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * imitations under the License.
+ */
+
ul {
padding-right: 10px;
width: 100%;
@@ -6,3 +22,7 @@ ul {
.api-management-permission {
margin-bottom: 20px;
}
+
+#app-info-header {
+ font-size: 1.1rem;
+}

MODIFY
src/app/components/account-organization-permissions/account-organization-permissions.component.spec.ts
src/app/components/account-organization-permissions/account-organization-permissions.component.spec.ts
+/*
+ * Copyright 2022 Scheer PAS Schweiz AG
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * imitations under the License.
+ */
+
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { AccountOrganizationPermissionsComponent } from './account-organization-permissions.component';

MODIFY
src/app/components/account-organization-permissions/account-organization-permissions.component.ts
src/app/components/account-organization-permissions/account-organization-permissions.component.ts
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { ICurrentUser } from 'src/app/interfaces/ICommunication';
-
+import { environment } from '../../../environments/environment';
@Component({
selector: 'app-account-organization-permissions',
changeDetection: ChangeDetectionStrategy.OnPush,
@@ -25,6 +25,7 @@ import { ICurrentUser } from 'src/app/interfaces/ICommunication';
})
export class AccountOrganizationPermissionsComponent {
public apiManagementPermissions: Map<string, Array<string>>;
+ public version = environment.version;
constructor() {
this.apiManagementPermissions = new Map();

ADD
src/app/interfaces/IEnvironment.ts
+/*
+ * Copyright 2022 Scheer PAS Schweiz AG
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * imitations under the License.
+ */
+
+export interface IEnvironment {
+ production: boolean;
+ configFilePath: string;
+ version: string;
+}

MODIFY
src/assets/i18n/de.json
src/assets/i18n/de.json
},
"API_MANAGEMENT": {
"TITLE": "Scheer PAS API Management",
- "NO_PERMISSIONS": "Sie haben derzeit keine API Management Berechtigungen"
+ "NO_PERMISSIONS": "Sie haben derzeit keine API Management Berechtigungen",
+ "VERSION": "Version"
}
},
"CLIENTS": {

MODIFY
src/assets/i18n/en.json
src/assets/i18n/en.json
},
"API_MANAGEMENT": {
"TITLE": "Scheer PAS API Management",
- "NO_PERMISSIONS": "You do not have any API Management permissions"
+ "NO_PERMISSIONS": "You do not have any API Management permissions",
+ "VERSION": "Version"
}
},
"CLIENTS": {

MODIFY
src/environments/environment.prod.ts
src/environments/environment.prod.ts
* imitations under the License.
*/
-export const environment = {
+import { IEnvironment } from '../app/interfaces/IEnvironment';
+import packageJson from './../../package.json';
+
+export const environment: IEnvironment = {
production: true,
- configFilePath: 'assets/config.json5'
+ configFilePath: 'assets/config.json5',
+ version: packageJson.version
};

MODIFY
src/environments/environment.ts
src/environments/environment.ts
// `ng build` replaces `environment.ts` with `environment.prod.ts`.
// The list of file replacements can be found in `angular.json`.
-export const environment = {
+import { IEnvironment } from '../app/interfaces/IEnvironment';
+import packageJson from './../../package.json';
+
+export const environment: IEnvironment = {
production: false,
- configFilePath: 'assets/local-config.json5'
+ configFilePath: 'assets/local-config.json5',
+ version: packageJson.version
};
/*

feat(ui): add application information to account page

For debugging purposes we need to know which version of the API Developer Portal is used.
We added this informationen to the account page, which is mainly used for debugging purposes.