diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-18 23:02:30 +0300 |
commit | 41fe97390ceddf945f3d967b8fdb3de4c66b7dea (patch) | |
tree | 9c8d89a8624828992f06d892cd2f43818ff5dcc8 /app/assets/javascripts/diffs/components | |
parent | 0804d2dc31052fb45a1efecedc8e06ce9bc32862 (diff) |
Add latest changes from gitlab-org/gitlab@14-9-stable-eev14.9.0-rc42
Diffstat (limited to 'app/assets/javascripts/diffs/components')
5 files changed, 53 insertions, 25 deletions
diff --git a/app/assets/javascripts/diffs/components/commit_item.vue b/app/assets/javascripts/diffs/components/commit_item.vue index df7cf83b3f0..ba10f6deb29 100644 --- a/app/assets/javascripts/diffs/components/commit_item.vue +++ b/app/assets/javascripts/diffs/components/commit_item.vue @@ -72,8 +72,6 @@ export default { return this.author.id ? this.author.id : ''; }, authorUrl() { - // name: 'mailto:' is a false positive: https://gitlab.com/gitlab-org/frontend/eslint-plugin-i18n/issues/26#possible-false-positives - // eslint-disable-next-line @gitlab/require-i18n-strings return this.author.web_url || `mailto:${this.commit.author_email}`; }, authorAvatar() { diff --git a/app/assets/javascripts/diffs/components/diff_content.vue b/app/assets/javascripts/diffs/components/diff_content.vue index 858d9e221ae..7ed5713ebfa 100644 --- a/app/assets/javascripts/diffs/components/diff_content.vue +++ b/app/assets/javascripts/diffs/components/diff_content.vue @@ -163,8 +163,8 @@ export default { v-if="diffFile.discussions.length" class="diff-file-discussions" :discussions="diffFile.discussions" - :should-collapse-discussions="true" - :render-avatar-badge="true" + should-collapse-discussions + render-avatar-badge /> <diff-file-drafts :file-hash="diffFileHash" class="diff-file-discussions" /> <note-form diff --git a/app/assets/javascripts/diffs/components/diff_file_header.vue b/app/assets/javascripts/diffs/components/diff_file_header.vue index 3cf1f69b08c..495c87a695c 100644 --- a/app/assets/javascripts/diffs/components/diff_file_header.vue +++ b/app/assets/javascripts/diffs/components/diff_file_header.vue @@ -431,7 +431,7 @@ export default { class="js-ide-edit-blob" data-qa-selector="edit_in_ide_button" > - {{ __('Edit in Web IDE') }} + {{ __('Open in Web IDE') }} </gl-dropdown-item> </template> diff --git a/app/assets/javascripts/diffs/components/diff_view.vue b/app/assets/javascripts/diffs/components/diff_view.vue index 333bf1b356c..f46b0a538f1 100644 --- a/app/assets/javascripts/diffs/components/diff_view.vue +++ b/app/assets/javascripts/diffs/components/diff_view.vue @@ -1,4 +1,5 @@ <script> +import { GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui'; import { mapGetters, mapState, mapActions } from 'vuex'; import { IdState } from 'vendor/vue-virtual-scroller'; import DraftNote from '~/batch_comments/components/draft_note.vue'; @@ -19,6 +20,9 @@ export default { DiffCommentCell, DraftNote, }, + directives: { + SafeHtml, + }, mixins: [ draftCommentsMixin, glFeatureFlagsMixin(), @@ -173,15 +177,17 @@ export default { <div class="diff-grid-left diff-grid-3-col left-side"> <div class="diff-td diff-line-num"></div> <div v-if="inline" class="diff-td diff-line-num"></div> - <div class="diff-td line_content left-side gl-white-space-normal!"> - {{ line.left.rich_text }} - </div> + <div + v-safe-html="line.left.rich_text" + class="diff-td line_content left-side gl-white-space-normal!" + ></div> </div> <div v-if="!inline" class="diff-grid-right diff-grid-3-col right-side"> <div class="diff-td diff-line-num"></div> - <div class="diff-td line_content right-side gl-white-space-normal!"> - {{ line.left.rich_text }} - </div> + <div + v-safe-html="line.left.rich_text" + class="diff-td line_content right-side gl-white-space-normal!" + ></div> </div> </div> </template> diff --git a/app/assets/javascripts/diffs/components/hidden_files_warning.vue b/app/assets/javascripts/diffs/components/hidden_files_warning.vue index baf7471582a..b9962682848 100644 --- a/app/assets/javascripts/diffs/components/hidden_files_warning.vue +++ b/app/assets/javascripts/diffs/components/hidden_files_warning.vue @@ -1,6 +1,19 @@ <script> -/* eslint-disable @gitlab/vue-require-i18n-strings */ +import { GlAlert, GlSprintf } from '@gitlab/ui'; +import { __ } from '~/locale'; + +export const i18n = { + title: __('Too many changes to show.'), + plainDiff: __('Plain diff'), + emailPatch: __('Email patch'), +}; + export default { + i18n, + components: { + GlAlert, + GlSprintf, + }, props: { total: { type: String, @@ -23,17 +36,28 @@ export default { </script> <template> - <div class="alert alert-warning"> - <h4> - {{ __('Too many changes to show.') }} - <div class="float-right"> - <a :href="plainDiffPath" class="btn btn-sm"> {{ __('Plain diff') }} </a> - <a :href="emailPatchPath" class="btn btn-sm"> {{ __('Email patch') }} </a> - </div> - </h4> - <p> - To preserve performance only <strong> {{ visible }} of {{ total }} </strong> files are - displayed. - </p> - </div> + <gl-alert + variant="warning" + :title="$options.i18n.title" + :primary-button-text="$options.i18n.plainDiff" + :primary-button-link="plainDiffPath" + :secondary-button-text="$options.i18n.emailPatch" + :secondary-button-link="emailPatchPath" + :dismissible="false" + > + <gl-sprintf + :message=" + sprintf( + __( + 'To preserve performance only %{strongStart}%{visible} of %{total}%{strongEnd} files are displayed.', + ), + { visible, total }, + ) + " + > + <template #strong="{ content }"> + <strong>{{ content }}</strong> + </template> + </gl-sprintf> + </gl-alert> </template> |