Commit f05696dc authored by Thomas Randolph's avatar Thomas Randolph

Expand the collapsed file UI and make it more visible

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