-
Notifications
You must be signed in to change notification settings - Fork 33
30749 Audit history component #2290
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
Updates the Audit History display text to match the latest design wording for analyst queue review steps.
Changes:
- Replaced status-label rendering with a new
getActionDescription(step)formatter. - Updated the audit history header line to render the new action description.
- Bumped
ppr-uipackage version from6.0.5to6.0.6.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| ppr-ui/src/components/queue/AuditHistory.vue | Updates audit history wording/formatting via a new action-description formatter and template change. |
| ppr-ui/package.json | Version bump. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const match = step.changeNote.match(/Removing assignee (.+?)(?:\.)?$/i) | ||
| const newAssignee = match ? match[1].trim() : '' | ||
| return `Reviewer <span class="font-normal grey7">${newAssignee}</span> unassigned` |
Copilot
AI
Feb 10, 2026
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.
This logic depends on parsing step.changeNote with a very specific regex. If the backend wording changes or the note doesn't match, newAssignee becomes empty and the UI will render a blank highlighted span. Consider a safer fallback (eg, omit the name when not present) and/or avoid string-parsing altogether by sending a structured assignee field for audit steps.
| const match = step.changeNote.match(/Removing assignee (.+?)(?:\.)?$/i) | |
| const newAssignee = match ? match[1].trim() : '' | |
| return `Reviewer <span class="font-normal grey7">${newAssignee}</span> unassigned` | |
| const match = step.changeNote ? step.changeNote.match(/Removing assignee (.+?)(?:\.)?$/i) : null | |
| const newAssignee = match && match[1] ? match[1].trim() : '' | |
| if (newAssignee) { | |
| return `Reviewer <span class="font-normal grey7">${newAssignee}</span> unassigned` | |
| } | |
| // Fallback: if we cannot parse an assignee name, show a generic message without a blank span | |
| return 'Reviewer unassigned' |
| <div class="font-bold text-gray-900"> | ||
| Registration {{ getStatusLabel(step.statusType) }} | ||
| <span v-html="getActionDescription(step)"/> | ||
| <span v-if="step.username" class="font-normal gray7"> |
Copilot
AI
Feb 10, 2026
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.
Using v-html to render the action description will inject raw HTML into the DOM. Since getActionDescription() interpolates values derived from step.changeNote, this creates an XSS risk (and makes the rendering logic harder to reason about). Prefer rendering plain text with normal template bindings (eg, conditional spans in the template), or escape/sanitize any dynamic content before using v-html.
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.
Agree with CP here, if any information is user entered, that is driving a derived value that ends up used in the v-html, we will need to sanitize the values.
I think the value to look into would be changeNote maybe?
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.
getActionDescription returns a string anyway. no need to worry.
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.
You bet, as long as any of that string value isn't collected from a user input field.
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.
They are values retrieved from the API. I’ve updated the code to handle cases where changeNote is missing and make it compatible.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
cameron-eyds
left a comment
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.
Looks good, just had the one question!
| <div class="font-bold text-gray-900"> | ||
| Registration {{ getStatusLabel(step.statusType) }} | ||
| <span v-html="getActionDescription(step)"/> | ||
| <span v-if="step.username" class="font-normal gray7"> |
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.
Agree with CP here, if any information is user entered, that is driving a derived value that ends up used in the v-html, we will need to sanitize the values.
I think the value to look into would be changeNote maybe?
| <div class="font-bold text-gray-900"> | ||
| Registration {{ getStatusLabel(step.statusType) }} | ||
| <span v-html="getActionDescription(step)"/> | ||
| <span v-if="step.username" class="font-normal gray7"> |
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.
You bet, as long as any of that string value isn't collected from a user input field.
Issue #: /bcgov/entity###
bcgov/entity#30749
Description of changes:
updated the history wording to match the design
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the PPR license (Apache 2.0).