From f2026815766bdebb410ea52caeaa0e98297cca10 Mon Sep 17 00:00:00 2001 From: olli <144932831+OLILHR@users.noreply.github.com> Date: Fri, 27 Sep 2024 13:31:50 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Handle=20empty=20direction=20met?= =?UTF-8?q?a=20information=20(#240)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Make direction meta information nullable * Format * Bump version to v0.0.8 * Add text if the direction is empty * update unit test * add pulumi to prettierignore * apply prettier --------- Co-authored-by: kevin --- .prettierignore | 1 + docker-compose.yaml | 2 +- pulumi/Pulumi.dev.yaml | 2 +- .../ahbs/views/ahb-page/ahb-page.component.spec.ts | 8 ++++++-- .../ahbs/views/ahb-page/ahb-page.component.ts | 11 ++++++++++- 5 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.prettierignore b/.prettierignore index 64e90b98f..04f59a7f7 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,2 +1,3 @@ src/app/core/api azure-mock/data +pulumi diff --git a/docker-compose.yaml b/docker-compose.yaml index 62455c40f..80c7cab1b 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -19,7 +19,7 @@ services: build: dockerfile: ./Dockerfile ports: - - 4000:4000 + - 4000:4000 environment: - PORT=4000 - AZURE_BLOB_STORAGE_CONNECTION_STRING=DefaultEndpointsProtocol=http;AccountName=devstoreaccount1;AccountKey=Eby8vdM02xNOcqFlqUwJPLlmEtlCDXJ1OUzFT50uSRZ6IFsuFq2UVErCz4I6tq/K1SZFPTOtr/KBHBeksoGMGw==;BlobEndpoint=http://host.docker.internal:10000/devstoreaccount1; diff --git a/pulumi/Pulumi.dev.yaml b/pulumi/Pulumi.dev.yaml index d98963e8c..2a76d335e 100644 --- a/pulumi/Pulumi.dev.yaml +++ b/pulumi/Pulumi.dev.yaml @@ -7,7 +7,7 @@ config: ahb-tabellen:ghcr_token: secure: AAABAEg7fEk2P91sxA8mlsQ5AueGPcKpU5H8jCLGvH82HsWD1NkdQLT69wDwMfdI7Nc+jSdwJC4Wx/ym4m3HUMGxgeK9RJt0 ahb-tabellen:imageName: ghcr.io/hochfrequenz/ahbesser - ahb-tabellen:imageTag: v0.0.7 + ahb-tabellen:imageTag: v0.0.8 ahb-tabellen:memory: "2" ahb-tabellen:bedingungsbaumBaseUrl: https://bedingungsbaum.stage.hochfrequenz.de azure-native:location: germanywestcentral diff --git a/src/app/features/ahbs/views/ahb-page/ahb-page.component.spec.ts b/src/app/features/ahbs/views/ahb-page/ahb-page.component.spec.ts index bbd75876b..9cd1fed21 100644 --- a/src/app/features/ahbs/views/ahb-page/ahb-page.component.spec.ts +++ b/src/app/features/ahbs/views/ahb-page/ahb-page.component.spec.ts @@ -78,8 +78,12 @@ describe('AhbPageComponent', () => { const testDirection = ''; const result = component.getSenderEmpfaenger(testDirection); - expect(result.sender).toBe(''); - expect(result.empfaenger).toBe(''); + expect(result.sender).toBe( + 'MSCONS-Nachrichten können von verschiedenen Marktrollen gesendet werden.', + ); + expect(result.empfaenger).toBe( + 'MSCONS-Nachrichten können von verschiedenen Marktrollen empfangen werden.', + ); }); // Add more tests here diff --git a/src/app/features/ahbs/views/ahb-page/ahb-page.component.ts b/src/app/features/ahbs/views/ahb-page/ahb-page.component.ts index 7ed24b2d4..fc8ba9067 100644 --- a/src/app/features/ahbs/views/ahb-page/ahb-page.component.ts +++ b/src/app/features/ahbs/views/ahb-page/ahb-page.component.ts @@ -153,10 +153,19 @@ export class AhbPageComponent implements OnInit { } // splitting meta.direction into sender and empfaenger - getSenderEmpfaenger(direction: string): { + getSenderEmpfaenger(direction: string | null): { sender: string; empfaenger: string; } { + if (!direction) { + return { + sender: + 'MSCONS-Nachrichten können von verschiedenen Marktrollen gesendet werden.', + empfaenger: + 'MSCONS-Nachrichten können von verschiedenen Marktrollen empfangen werden.', + }; + } + const [sender, empfaenger] = direction .split(' an ') .map((part) => part.trim());