diff options
Diffstat (limited to 'app/assets/javascripts/batch_comments')
-rw-r--r-- | app/assets/javascripts/batch_comments/components/preview_item.vue | 14 | ||||
-rw-r--r-- | app/assets/javascripts/batch_comments/mixins/resolved_status.js | 16 |
2 files changed, 17 insertions, 13 deletions
diff --git a/app/assets/javascripts/batch_comments/components/preview_item.vue b/app/assets/javascripts/batch_comments/components/preview_item.vue index 756bcfdb3d0..753608cf6f7 100644 --- a/app/assets/javascripts/batch_comments/components/preview_item.vue +++ b/app/assets/javascripts/batch_comments/components/preview_item.vue @@ -41,13 +41,17 @@ export default { titleText() { const file = this.discussion ? this.discussion.diff_file : this.draft; - if (file) { + if (file?.file_path) { return file.file_path; } - return sprintf(__("%{authorsName}'s thread"), { - authorsName: this.discussion.notes.find((note) => !note.system).author.name, - }); + if (this.discussion) { + return sprintf(__("%{authorsName}'s thread"), { + authorsName: this.discussion.notes.find((note) => !note.system).author.name, + }); + } + + return __('Your new comment'); }, linePosition() { if (this.position?.position_type === IMAGE_DIFF_POSITION_TYPE) { @@ -94,7 +98,7 @@ export default { <span class="review-preview-item-header"> <gl-icon class="flex-shrink-0" :name="iconName" /> <span class="bold text-nowrap gl-align-items-center"> - <span class="review-preview-item-header-text block-truncated"> + <span class="review-preview-item-header-text block-truncated gl-ml-2"> {{ titleText }} </span> <template v-if="showLinePosition"> diff --git a/app/assets/javascripts/batch_comments/mixins/resolved_status.js b/app/assets/javascripts/batch_comments/mixins/resolved_status.js index 0b085da1ff9..bec360e3b2e 100644 --- a/app/assets/javascripts/batch_comments/mixins/resolved_status.js +++ b/app/assets/javascripts/batch_comments/mixins/resolved_status.js @@ -1,9 +1,7 @@ import { mapGetters } from 'vuex'; import { sprintf, s__, __ } from '~/locale'; -import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; export default { - mixins: [glFeatureFlagsMixin()], props: { discussionId: { type: String, @@ -52,16 +50,18 @@ export default { return this.resolveDiscussion ? 'is-resolving-discussion' : 'is-unresolving-discussion'; }, resolveButtonTitle() { - if (this.isDraft || this.discussionId) return this.resolvedStatusMessage; + const escapeParameters = false; - let title = __('Mark as resolved'); + if (this.isDraft || this.discussionId) return this.resolvedStatusMessage; - if (this.glFeatures.removeResolveNote) { - title = __('Resolve thread'); - } + let title = __('Resolve thread'); if (this.resolvedBy) { - title = sprintf(__('Resolved by %{name}'), { name: this.resolvedBy.name }); + title = sprintf( + __('Resolved by %{name}'), + { name: this.resolvedBy.name }, + escapeParameters, + ); } return title; |