Skip to content
Snippets Groups Projects
Commit a0c52ba3 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-6999 Add fav icon and build info

parent a3aa7b84
Branches
Tags
No related merge requests found
Showing
with 149 additions and 60 deletions
export class BuildInfoE2EComponent { export class BuildInfoE2EComponent {
private readonly locatorVersion: string = 'build-version'; private readonly locatorBuildInfo: string = 'build-info';
private readonly locatorBuildTime: string = 'build-time'; private readonly locatorBuildTime: string = 'build-time';
public getVersion() { public getBuildInfo() {
return cy.getTestElement(this.locatorVersion); return cy.getTestElement(this.locatorBuildInfo);
} }
public getBuildTime() { public getBuildTime() {
......
...@@ -14,8 +14,8 @@ describe('Buildinfo', () => { ...@@ -14,8 +14,8 @@ describe('Buildinfo', () => {
}); });
describe('get buildinfo', () => { describe('get buildinfo', () => {
it('should show version', () => { it('should show build info', () => {
exist(buildInfo.getVersion()); exist(buildInfo.getBuildInfo());
header.getCurrentUserProfile().logout(); header.getCurrentUserProfile().logout();
}); });
}); });
......
...@@ -8,24 +8,22 @@ ...@@ -8,24 +8,22 @@
"targets": { "targets": {
"build": { "build": {
"executor": "@angular-devkit/build-angular:browser", "executor": "@angular-devkit/build-angular:browser",
"outputs": [ "outputs": ["{options.outputPath}"],
"{options.outputPath}"
],
"options": { "options": {
"outputPath": "dist/apps/admin", "outputPath": "dist/apps/admin",
"index": "apps/admin/src/index.html", "index": "apps/admin/src/index.html",
"main": "apps/admin/src/main.ts", "main": "apps/admin/src/main.ts",
"polyfills": [ "polyfills": ["zone.js"],
"zone.js"
],
"tsConfig": "apps/admin/tsconfig.app.json", "tsConfig": "apps/admin/tsconfig.app.json",
"assets": [ "assets": [
"apps/admin/src/favicon.ico", "apps/admin/src/assets",
"apps/admin/src/assets" {
], "input": "apps/admin/src/favicon",
"styles": [ "glob": "**/*",
"apps/admin/src/styles.scss" "output": ""
}
], ],
"styles": ["apps/admin/src/styles.scss"],
"scripts": [], "scripts": [],
"stylePreprocessorOptions": { "stylePreprocessorOptions": {
"includePaths": [ "includePaths": [
...@@ -87,15 +85,11 @@ ...@@ -87,15 +85,11 @@
}, },
"lint": { "lint": {
"executor": "@nx/eslint:lint", "executor": "@nx/eslint:lint",
"outputs": [ "outputs": ["{options.outputFile}"]
"{options.outputFile}"
]
}, },
"test": { "test": {
"executor": "@nx/jest:jest", "executor": "@nx/jest:jest",
"outputs": [ "outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"{workspaceRoot}/coverage/{projectRoot}"
],
"options": { "options": {
"jestConfig": "apps/admin/jest.config.ts" "jestConfig": "apps/admin/jest.config.ts"
} }
...@@ -108,20 +102,14 @@ ...@@ -108,20 +102,14 @@
}, },
"container": { "container": {
"executor": "@nx-tools/nx-container:build", "executor": "@nx-tools/nx-container:build",
"dependsOn": [ "dependsOn": ["build"],
"build"
],
"options": { "options": {
"engine": "docker", "engine": "docker",
"push": false, "push": false,
"metadata": { "metadata": {
"images": [ "images": ["docker.ozg-sh.de/admin-client"],
"docker.ozg-sh.de/admin-client"
],
"load": true, "load": true,
"tags": [ "tags": ["build-latest"]
"build-latest"
]
} }
} }
} }
......
...@@ -37,6 +37,6 @@ ...@@ -37,6 +37,6 @@
<unavailable-page></unavailable-page> <unavailable-page></unavailable-page>
</ng-template> </ng-template>
</main> </main>
<alfa-build-info *ngIf="apiRoot" [apiRoot]="apiRoot" data-test-id="build-info" />
</div> </div>
<footer data-test-id="build-version">Version: {{ apiRoot.version }}</footer>
</ng-container> </ng-container>
import { ApiRootLinkRel, ApiRootResource, ApiRootService } from '@alfa-client/api-root-shared'; import { ApiRootLinkRel, ApiRootResource, ApiRootService } from '@alfa-client/api-root-shared';
import { import { HasLinkPipe, createEmptyStateResource, createStateResource } from '@alfa-client/tech-shared';
HasLinkPipe,
createEmptyStateResource,
createStateResource,
} from '@alfa-client/tech-shared';
import { import {
Mock, Mock,
dispatchEventFromFixture, dispatchEventFromFixture,
...@@ -24,6 +20,7 @@ import { ...@@ -24,6 +20,7 @@ import {
} from '@ods/system'; } from '@ods/system';
import { AuthenticationService } from 'authentication'; import { AuthenticationService } from 'authentication';
import { createApiRootResource } from 'libs/api-root-shared/test/api-root'; import { createApiRootResource } from 'libs/api-root-shared/test/api-root';
import { BuildInfoComponent } from 'libs/navigation/src/lib/build-info/build-info.component';
import { getDataTestIdOf } from 'libs/tech-shared/test/data-test'; import { getDataTestIdOf } from 'libs/tech-shared/test/data-test';
import { MockComponent, MockDirective } from 'ng-mocks'; import { MockComponent, MockDirective } from 'ng-mocks';
import { of } from 'rxjs'; import { of } from 'rxjs';
...@@ -36,7 +33,7 @@ describe('AppComponent', () => { ...@@ -36,7 +33,7 @@ describe('AppComponent', () => {
let fixture: ComponentFixture<AppComponent>; let fixture: ComponentFixture<AppComponent>;
const adminHeaderSelector: string = getDataTestIdOf('admin-header'); const adminHeaderSelector: string = getDataTestIdOf('admin-header');
const buildVersionSelector: string = getDataTestIdOf('build-version'); const buildInfoSelector: string = getDataTestIdOf('build-info');
const userProfileButtonSelector: string = getDataTestIdOf('user-profile-button'); const userProfileButtonSelector: string = getDataTestIdOf('user-profile-button');
const navigationSelector: string = getDataTestIdOf('navigation'); const navigationSelector: string = getDataTestIdOf('navigation');
const logoLink: string = getDataTestIdOf('logo-link'); const logoLink: string = getDataTestIdOf('logo-link');
...@@ -62,6 +59,7 @@ describe('AppComponent', () => { ...@@ -62,6 +59,7 @@ describe('AppComponent', () => {
MockComponent(UnavailablePageComponent), MockComponent(UnavailablePageComponent),
MockComponent(NavbarComponent), MockComponent(NavbarComponent),
MockComponent(NavItemComponent), MockComponent(NavItemComponent),
MockComponent(BuildInfoComponent),
HasLinkPipe, HasLinkPipe,
MockDirective(RouterOutlet), MockDirective(RouterOutlet),
], ],
...@@ -160,9 +158,7 @@ describe('AppComponent', () => { ...@@ -160,9 +158,7 @@ describe('AppComponent', () => {
describe('navigation', () => { describe('navigation', () => {
beforeEach(() => {}); beforeEach(() => {});
it('should show links if configuration link exists', () => { it('should show links if configuration link exists', () => {
component.apiRootStateResource$ = of( component.apiRootStateResource$ = of(createStateResource(createApiRootResource([ApiRootLinkRel.CONFIGURATION])));
createStateResource(createApiRootResource([ApiRootLinkRel.CONFIGURATION])),
);
fixture.detectChanges(); fixture.detectChanges();
const navbarElement: HTMLElement = getElementFromFixture(fixture, navigationSelector); const navbarElement: HTMLElement = getElementFromFixture(fixture, navigationSelector);
...@@ -181,17 +177,15 @@ describe('AppComponent', () => { ...@@ -181,17 +177,15 @@ describe('AppComponent', () => {
}); });
describe('build version', () => { describe('build version', () => {
const apiResource: ApiRootResource = createApiRootResource(); it('should not be rendered if api root not loaded', () => {
notExistsAsHtmlElement(fixture, buildInfoSelector);
beforeEach(() => {
component.apiRootStateResource$ = of(createStateResource(apiResource));
}); });
it('should show after apiRoot loaded', () => { it('should show after apiRoot loaded', () => {
component.apiRootStateResource$ = of(createStateResource(createApiRootResource()));
fixture.detectChanges(); fixture.detectChanges();
const buildVersionElement = getElementFromFixture(fixture, buildVersionSelector); existsAsHtmlElement(fixture, buildInfoSelector);
expect(buildVersionElement.textContent.trim()).toEqual(`Version: ${apiResource.version}`);
}); });
}); });
...@@ -199,9 +193,7 @@ describe('AppComponent', () => { ...@@ -199,9 +193,7 @@ describe('AppComponent', () => {
beforeEach(() => {}); beforeEach(() => {});
it('should exist if configuration resource available', () => { it('should exist if configuration resource available', () => {
component.apiRootStateResource$ = of( component.apiRootStateResource$ = of(createStateResource(createApiRootResource([ApiRootLinkRel.CONFIGURATION])));
createStateResource(createApiRootResource([ApiRootLinkRel.CONFIGURATION])),
);
fixture.detectChanges(); fixture.detectChanges();
......
import { AdminSettingsModule } from '@admin-client/admin-settings'; import { AdminSettingsModule } from '@admin-client/admin-settings';
import { ApiRootModule } from '@alfa-client/api-root-shared'; import { ApiRootModule } from '@alfa-client/api-root-shared';
import { EnvironmentModule } from '@alfa-client/environment-shared'; import { EnvironmentModule } from '@alfa-client/environment-shared';
import { NavigationModule } from '@alfa-client/navigation';
import { TechSharedModule } from '@alfa-client/tech-shared'; import { TechSharedModule } from '@alfa-client/tech-shared';
import { CommonModule } from '@angular/common'; import { CommonModule, registerLocaleData } from '@angular/common';
import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http'; import { HTTP_INTERCEPTORS, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import localeDe from '@angular/common/locales/de';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser'; import { BrowserModule } from '@angular/platform-browser';
...@@ -36,6 +38,8 @@ import { UserRolesPageComponent } from '../pages/users-roles/user-roles-page/use ...@@ -36,6 +38,8 @@ import { UserRolesPageComponent } from '../pages/users-roles/user-roles-page/use
import { AppComponent } from './app.component'; import { AppComponent } from './app.component';
import { appRoutes } from './app.routes'; import { appRoutes } from './app.routes';
registerLocaleData(localeDe);
@NgModule({ @NgModule({
declarations: [ declarations: [
AppComponent, AppComponent,
...@@ -53,6 +57,7 @@ import { appRoutes } from './app.routes'; ...@@ -53,6 +57,7 @@ import { appRoutes } from './app.routes';
DropdownMenuButtonComponent, DropdownMenuButtonComponent,
NavItemComponent, NavItemComponent,
NavbarComponent, NavbarComponent,
NavigationModule,
OrgaUnitIconComponent, OrgaUnitIconComponent,
LogoutIconComponent, LogoutIconComponent,
UsersIconComponent, UsersIconComponent,
......
alfa-client/apps/admin/src/favicon/apple-touch-icon.png

10.5 KiB

This diff is collapsed.
alfa-client/apps/admin/src/favicon/logo192.png

11.8 KiB

alfa-client/apps/admin/src/favicon/logo512.png

55.8 KiB

{
"name": "Alfa Administration",
"short_name": "Administration Client",
"icons": [
{
"src": "favicon.svg",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo192.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo512.png",
"type": "image/png",
"sizes": "512x512"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
...@@ -5,11 +5,11 @@ ...@@ -5,11 +5,11 @@
<title>admin</title> <title>admin</title>
<base href="/" /> <base href="/" />
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" type="image/x-icon" href="favicon.ico" /> <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="/apple-touch-icon.png" />
<link rel="manifest" href="/manifest.json" />
</head> </head>
<body <body class="flex max-h-full min-h-full overflow-hidden bg-white text-black dark:bg-slate-900 dark:text-slate-100">
class="flex max-h-full min-h-full overflow-hidden bg-white text-black dark:bg-slate-900 dark:text-slate-100"
>
<app-root class="flex w-full flex-col"></app-root> <app-root class="flex w-full flex-col"></app-root>
</body> </body>
</html> </html>
...@@ -30,6 +30,4 @@ ...@@ -30,6 +30,4 @@
<span data-test-id="build-time">{{ buildTime }}</span> <span data-test-id="build-time">{{ buildTime }}</span>
</ng-container> </ng-container>
</p> </p>
<p *ngIf="isNotProduction" data-test-id="not-production-text" class="test-environment text-error"> <p *ngIf="isNotProduction" data-test-id="not-production-text" class="test-environment text-error">Achtung Testumgebung</p>
Achtung Testumgebung
</p>
...@@ -21,8 +21,8 @@ ...@@ -21,8 +21,8 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen * Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen. * unter der Lizenz sind dem Lizenztext zu entnehmen.
*/ */
import { Component, Input } from '@angular/core';
import { ApiRootResource } from '@alfa-client/api-root-shared'; import { ApiRootResource } from '@alfa-client/api-root-shared';
import { Component, Input } from '@angular/core';
import * as DateUtil from '@alfa-client/tech-shared'; import * as DateUtil from '@alfa-client/tech-shared';
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment