Skip to content

Commit

Permalink
🩹 Handle empty direction meta information (#240)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
OLILHR and hf-krechan authored Sep 27, 2024
1 parent 2ae1e01 commit f202681
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
src/app/core/api
azure-mock/data
pulumi
2 changes: 1 addition & 1 deletion docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion pulumi/Pulumi.dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
11 changes: 10 additions & 1 deletion src/app/features/ahbs/views/ahb-page/ahb-page.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit f202681

Please sign in to comment.