Commit f05696dc authored by Thomas Randolph's avatar Thomas Randolph

Expand the collapsed file UI and make it more visible

parent 9c5a27f0
<script> <script>
import { mapActions, mapGetters, mapState } from 'vuex'; import { mapActions, mapGetters, mapState } from 'vuex';
import { escape } from 'lodash'; import { escape } from 'lodash';
import { GlLoadingIcon, GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui'; import { GlButton, GlLoadingIcon, GlSafeHtmlDirective as SafeHtml } from '@gitlab/ui';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { __, sprintf } from '~/locale'; import { __, sprintf } from '~/locale';
import { deprecatedCreateFlash as createFlash } from '~/flash'; import { deprecatedCreateFlash as createFlash } from '~/flash';
...@@ -15,6 +15,7 @@ export default { ...@@ -15,6 +15,7 @@ export default {
components: { components: {
DiffFileHeader, DiffFileHeader,
DiffContent, DiffContent,
GlButton,
GlLoadingIcon, GlLoadingIcon,
}, },
directives: { directives: {
...@@ -205,11 +206,17 @@ export default { ...@@ -205,11 +206,17 @@ export default {
<div v-safe-html="errorMessage" class="nothing-here-block"></div> <div v-safe-html="errorMessage" class="nothing-here-block"></div>
</div> </div>
<template v-else> <template v-else>
<div v-show="isCollapsed" class="nothing-here-block diff-collapsed"> <div v-show="isCollapsed" class="gl-p-7 gl-text-center collapsed-file-warning">
{{ __('This diff is collapsed.') }} <p class="gl-mb-8 gl-mt-5">
<a class="click-to-expand js-click-to-expand" href="#" @click.prevent="handleToggle">{{ {{ __('This file is collapsed.') }}
__('Click to expand it.') </p>
}}</a> <gl-button
class="gl-alert-action gl-mb-5"
data-testid="expandButton"
@click="handleToggle"
>
{{ __('Expand file') }}
</gl-button>
</div> </div>
<diff-content <diff-content
v-show="!isCollapsed && !isFileTooLarge" v-show="!isCollapsed && !isFileTooLarge"
......
...@@ -10357,6 +10357,9 @@ msgstr "" ...@@ -10357,6 +10357,9 @@ msgstr ""
msgid "Expand dropdown" msgid "Expand dropdown"
msgstr "" msgstr ""
msgid "Expand file"
msgstr ""
msgid "Expand milestones" msgid "Expand milestones"
msgstr "" msgstr ""
...@@ -25739,6 +25742,9 @@ msgstr "" ...@@ -25739,6 +25742,9 @@ msgstr ""
msgid "This field is required." msgid "This field is required."
msgstr "" msgstr ""
msgid "This file is collapsed."
msgstr ""
msgid "This group" msgid "This group"
msgstr "" msgstr ""
......
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