Skip to content

Conversation

@tiimonn
Copy link
Collaborator

@tiimonn tiimonn commented Jun 30, 2025

No description provided.

@tiimonn tiimonn added the enhancement New feature or request label Jun 30, 2025
@tiimonn tiimonn linked an issue Jun 30, 2025 that may be closed by this pull request
@tiimonn tiimonn requested a review from Copilot June 30, 2025 12:15

This comment was marked as outdated.

@tiimonn tiimonn marked this pull request as draft June 30, 2025 12:17
@tiimonn tiimonn marked this pull request as ready for review June 30, 2025 12:56
@tiimonn tiimonn requested a review from Copilot June 30, 2025 12:56
Copy link

Copilot AI left a 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>
Copy link

Copilot AI Jun 30, 2025

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.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stfu

Copy link
Owner

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")
Copy link

Copilot AI Jun 30, 2025

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.

Suggested change
// writer.Header().Set("Access-Control-Allow-Origin", "http://localhost:4200")

Copilot uses AI. Check for mistakes.
Copy link
Collaborator Author

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

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes can be kept

@tiimonn tiimonn requested a review from LReg June 30, 2025 12:58
@tiimonn tiimonn changed the title [DRAFT] Add duration pipe and display event duration on webpage Add duration pipe and display event duration on webpage Jun 30, 2025
@LReg
Copy link
Owner

LReg commented Jul 1, 2025

Can you increase the min height of the TimeSlot Component? Then I am fine

@LReg LReg merged commit b06d105 into main Jul 1, 2025
1 check passed
@tiimonn tiimonn deleted the 4-display-event-duration-on-webpage branch July 1, 2025 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

display event duration on webpage

3 participants