Commit 3c9eede5 authored by Phil Hughes's avatar Phil Hughes

Merge branch 'tor/defect/single-quote-escapes' into 'master'

Fix character escaping in Resolved By tooltips

See merge request gitlab-org/gitlab!59428
parents 0cccf8e1 8cb78430
...@@ -50,12 +50,18 @@ export default { ...@@ -50,12 +50,18 @@ export default {
return this.resolveDiscussion ? 'is-resolving-discussion' : 'is-unresolving-discussion'; return this.resolveDiscussion ? 'is-resolving-discussion' : 'is-unresolving-discussion';
}, },
resolveButtonTitle() { resolveButtonTitle() {
const escapeParameters = false;
if (this.isDraft || this.discussionId) return this.resolvedStatusMessage; if (this.isDraft || this.discussionId) return this.resolvedStatusMessage;
let title = __('Resolve thread'); let title = __('Resolve thread');
if (this.resolvedBy) { if (this.resolvedBy) {
title = sprintf(__('Resolved by %{name}'), { name: this.resolvedBy.name }); title = sprintf(
__('Resolved by %{name}'),
{ name: this.resolvedBy.name },
escapeParameters,
);
} }
return title; return title;
......
---
title: Fix character escaping in Resolved By tooltips
merge_request: 59428
author:
type: fixed
...@@ -151,6 +151,22 @@ describe('noteActions', () => { ...@@ -151,6 +151,22 @@ describe('noteActions', () => {
const assignUserButton = wrapper.find('[data-testid="assign-user"]'); const assignUserButton = wrapper.find('[data-testid="assign-user"]');
expect(assignUserButton.exists()).toBe(false); expect(assignUserButton.exists()).toBe(false);
}); });
it('should render the correct (unescaped) name in the Resolved By tooltip', () => {
const complexUnescapedName = 'This is a Ǝ\'𝞓\'E "cat"?';
wrapper = mountNoteActions({
...props,
canResolve: true,
isResolving: false,
isResolved: true,
resolvedBy: {
name: complexUnescapedName,
},
});
const { resolveButton } = wrapper.vm.$refs;
expect(resolveButton.$el.getAttribute('title')).toBe(`Resolved by ${complexUnescapedName}`);
});
}); });
}); });
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment