-
Notifications
You must be signed in to change notification settings - Fork 0
Add duration pipe and display event duration on webpage #5
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a duration pipe to compute and display event durations on the webpage, while also updating some dependency injection patterns and asset references for consistency.
- Added a new DurationPipe for calculating event durations.
- Updated Angular services to use the new inject() API instead of constructor injection.
- Updated the main script reference in the HTML and made minor style adjustments to display the duration.
Reviewed Changes
Copilot reviewed 9 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| internal/ui/web/index.html | Updated the main script file reference. |
| internal/ui/angular-ui/src/app/services/tt/tt.service.ts | Switched to using inject() for dependency injection. |
| internal/ui/angular-ui/src/app/services/TimeSlot/time-slot.service.ts | Switched to using inject() for dependency injection. |
| internal/ui/angular-ui/src/app/duration.pipe.ts | Added a new pipe to compute duration from start and end times. |
| internal/ui/angular-ui/src/app/components/time-slot/time-slot.component.ts | Imported the DurationPipe into the time-slot component. |
| internal/ui/angular-ui/src/app/components/time-slot/time-slot.component.scss | Added styling for the duration display. |
| internal/ui/angular-ui/src/app/components/time-slot/time-slot.component.html | Included the duration pipe in the component template. |
| internal/api/api-webserver.go | Added a commented-out alternative CORS header for local development. |
| go.mod | Updated the version of the bbolt dependency. |
Files not reviewed (1)
- internal/ui/angular-ui/package-lock.json: Language not supported
| <div class="content-container"> | ||
| <div class="content"> | ||
| {{ timeSlot()?.Text }} | ||
| <span>{{ timeSlot()?.Start | duration:timeSlot()?.End }}</span> |
Copilot
AI
Jun 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] Consider caching the result of timeSlot() in a local variable or via an ngIf directive to avoid multiple invocations in the template, which can improve performance if timeSlot() is computationally expensive.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stfu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
der denkt das ist eine funktion
|
|
||
| func setCorsHeaders(writer http.ResponseWriter) { | ||
| writer.Header().Set("Access-Control-Allow-Origin", ui.WebserverUrl) | ||
| // writer.Header().Set("Access-Control-Allow-Origin", "http://localhost:4200") |
Copilot
AI
Jun 30, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] If this commented-out CORS header is no longer needed, consider removing it to keep the code clean.
| // writer.Header().Set("Access-Control-Allow-Origin", "http://localhost:4200") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted to leave it to easily enable debugging by just uncommenting it again
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes can be kept
|
Can you increase the min height of the TimeSlot Component? Then I am fine |
No description provided.