Conversation
Contributor
There was a problem hiding this comment.
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 reachesSummary(e.g., through updates/migrations). Prefer keeping Razor encoding (or sanitize/whitelist HTML at render time before usingHtml.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
isLastpadding logic appears inverted: previously padding was applied to non-last rows to create spacing, but nowpadding-bottom: 25px;is applied only whenisLastis 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 reachesSummary(e.g., through updates/migrations). Prefer keeping Razor encoding (or sanitize/whitelist HTML at render time before usingHtml.Raw).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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>
This was referenced Mar 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes for