Skip to content

Ticket history + minor fixes#54

Merged
Lantzify merged 8 commits intomainfrom
2.4.0
Mar 14, 2026
Merged

Ticket history + minor fixes#54
Lantzify merged 8 commits intomainfrom
2.4.0

Conversation

@Lantzify
Copy link
Copy Markdown
Owner

Copilot AI review requested due to automatic review settings March 14, 2026 18:51
Copy link
Copy Markdown
Contributor

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 addresses ticket UX and operational issues by adding paging for ticket comments/history, refining ticket history generation (including email/comment events), and updating default email template paths to work with Razor Class Library changes.

Changes:

  • Add paged APIs + UI pagination for ticket comments and ticket history.
  • Update ticket history notifications to record Created / Comment / SentEmail events.
  • Adjust default email template paths and enable MVC Razor support for email template rendering.

Reviewed changes

Copilot reviewed 28 out of 28 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/uSupport/wwwroot/components/tickets/uSupportCommentsComponent.js Load comments via new paged API and refresh after posting a comment
src/uSupport/wwwroot/components/tickets/uSupportCommentsComponent.html Add pagination UI and prevent comment textbox from triggering dirty-check
src/uSupport/wwwroot/components/resources/uSupport.ticketComment.resources.js Add getPagedCommentsForTicket resource method
src/uSupport/wwwroot/components/resources/uSupport.ticket.resources.js Add getPagedHistoryByTicketId resource method
src/uSupport/wwwroot/components/propertyEditors/readonly/uSupport.readonly.controller.js Remove debug console.log
src/uSupport/wwwroot/components/overlays/openTicket.html Stop passing preloaded comments into comments component
src/uSupport/wwwroot/backoffice/tickets/tickets.edit.controller.js Switch to paged history loading for the edit view
src/uSupport/wwwroot/backoffice/tickets/apps/ticket/ticket.html Stop passing preloaded comments into comments component
src/uSupport/wwwroot/backoffice/tickets/apps/history/history.html Bind to controller VM, add pagination UI, and add Email change rendering
src/uSupport/wwwroot/backoffice/tickets/apps/history/history.controller.js Add paged history loading logic
src/uSupport/wwwroot/backoffice/settings/settings.overview.controller.js Update example/default email template paths in settings overview
src/uSupport/uSupport.csproj Enable MVC Razor support for view rendering
src/uSupport/Views/Partials/uSupport/Emails/UpdateTicketEmail.cshtml Render ticket summary as raw HTML and refactor comments markup
src/uSupport/Views/Partials/uSupport/Emails/NewTicketEmail.cshtml Render ticket summary as raw HTML
src/uSupport/Services/uSupportTicketService.cs Move create-history behavior to notification handler flow
src/uSupport/Services/uSupportTicketHistoryService.cs Add paged history service method
src/uSupport/Services/uSupportTicketCommentService.cs Add paged comments service method
src/uSupport/Services/uSupportSettingsService.cs Add “send email on comment” setting and emit email-sending history notification
src/uSupport/Services/Interfaces/IuSupportTicketCommentService.cs Expose paged comments method
src/uSupport/Services/Interfaces/IuSupportSettingsService.cs Expose “send email on comment” setting
src/uSupport/Services/Interfaces/IuSupportHistoryService.cs Expose paged history method
src/uSupport/Notifications/Tickets/EmailSendingNotification.cs New notification for email-sending events
src/uSupport/Notifications/Handlers/TicketHistoryNotificationHandler.cs Handle Created / SentEmail / Comment history events
src/uSupport/Helpers/uSupportPageHelper.cs Generalize paging helper to uSupportPage<T>
src/uSupport/Dtos/Settings/uSupportSettingsTicket.cs Add “send email on comment” and update default template paths
src/uSupport/Controllers/uSupportTicketCommentAuthorizedApiController.cs Add paged comments endpoint + email-on-comment logic
src/uSupport/Controllers/uSupportTicketAuthorizedApiController.cs Add paged history endpoint
src/uSupport/Composers/uSupportNotificationComposer.cs Register additional history-related notification handlers
Comments suppressed due to low confidence (4)

src/uSupport/Views/Partials/uSupport/Emails/NewTicketEmail.cshtml:49

  • @Html.Raw(Model.Summary) renders unencoded HTML into the email body. Even if the summary is usually sanitized, this bypasses Razor’s default encoding and can lead to HTML/script injection in outgoing emails if any unsanitized content reaches Summary (e.g., through updates/migrations). Prefer keeping Razor encoding (or sanitize/whitelist HTML at render time before using Html.Raw).
    src/uSupport/Views/Partials/uSupport/Emails/UpdateTicketEmail.cshtml:89
  • The comments table is now only rendered when Model.Comments.Count() > 1. If there is exactly 1 comment (or 0), the entire "Comment" section will be empty. This looks unintended for update emails; render the table whenever there is at least one comment (or render a fallback message when there are none).
    src/uSupport/Views/Partials/uSupport/Emails/UpdateTicketEmail.cshtml:80
  • The isLast padding logic appears inverted: previously padding was applied to non-last rows to create spacing, but now padding-bottom: 25px; is applied only when isLast is true. If the intent is spacing between comment rows, apply padding to the non-last rows (or rename the variable to reflect the intended condition).
    src/uSupport/Views/Partials/uSupport/Emails/UpdateTicketEmail.cshtml:49
  • @Html.Raw(Model.Summary) renders unencoded HTML into the email body. Even if the summary is usually sanitized, this bypasses Razor’s default encoding and can lead to HTML/script injection in outgoing emails if any unsanitized content reaches Summary (e.g., through updates/migrations). Prefer keeping Razor encoding (or sanitize/whitelist HTML at render time before using Html.Raw).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/uSupport/wwwroot/backoffice/settings/settings.overview.controller.js Outdated
Comment thread src/uSupport/wwwroot/backoffice/tickets/tickets.edit.controller.js Outdated
Comment thread src/uSupport/Services/uSupportTicketHistoryService.cs Outdated
Comment thread src/uSupport/Services/uSupportTicketHistoryService.cs
Comment thread src/uSupport/Services/uSupportSettingsService.cs
Comment thread src/uSupport/wwwroot/backoffice/tickets/apps/history/history.html Outdated
Comment thread src/uSupport/wwwroot/backoffice/tickets/apps/history/history.html
Lantzify and others added 6 commits March 14, 2026 20:04
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@Lantzify Lantzify merged commit aed5be8 into main Mar 14, 2026
4 checks passed
@Lantzify Lantzify deleted the 2.4.0 branch March 14, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants