Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🩹 Handle empty direction meta information #240

Merged
merged 7 commits into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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