Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
2940c918
Commit
2940c918
authored
Oct 28, 2020
by
Samantha Ming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make files header responsive
Issue:
https://gitlab.com/gitlab-org/gitlab/-/issues/218666
parent
272eeb10
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
24 additions
and
44 deletions
+24
-44
app/assets/javascripts/diffs/components/diff_file_header.vue
app/assets/javascripts/diffs/components/diff_file_header.vue
+4
-4
app/assets/stylesheets/framework/files.scss
app/assets/stylesheets/framework/files.scss
+6
-31
app/helpers/blob_helper.rb
app/helpers/blob_helper.rb
+2
-2
app/views/projects/blob/_header.html.haml
app/views/projects/blob/_header.html.haml
+1
-1
app/views/projects/blob/_header_content.html.haml
app/views/projects/blob/_header_content.html.haml
+1
-1
app/views/projects/diffs/_file_header.html.haml
app/views/projects/diffs/_file_header.html.haml
+4
-4
changelogs/unreleased/218666-show-lsf-for-long-name.yml
changelogs/unreleased/218666-show-lsf-for-long-name.yml
+5
-0
spec/features/merge_request/user_views_diffs_spec.rb
spec/features/merge_request/user_views_diffs_spec.rb
+1
-1
No files found.
app/assets/javascripts/diffs/components/diff_file_header.vue
View file @
2940c918
...
@@ -213,7 +213,7 @@ export default {
...
@@ -213,7 +213,7 @@ export default {
class="js-file-title file-title file-title-flex-parent"
class="js-file-title file-title file-title-flex-parent"
@click.self="handleToggleFile"
@click.self="handleToggleFile"
>
>
<div
class=
"file-header-content
gl-display-flex gl-align-items-center gl-pr-0!
"
>
<div
class=
"file-header-content"
>
<gl-icon
<gl-icon
v-if=
"collapsible"
v-if=
"collapsible"
ref=
"collapseIcon"
ref=
"collapseIcon"
...
@@ -226,7 +226,7 @@ export default {
...
@@ -226,7 +226,7 @@ export default {
<a
<a
ref=
"titleWrapper"
ref=
"titleWrapper"
:v-once=
"!viewDiffsFileByFile"
:v-once=
"!viewDiffsFileByFile"
class=
"gl-mr-2 gl-text-decoration-none! gl-
text-truncate
"
class=
"gl-mr-2 gl-text-decoration-none! gl-
word-break-all
"
:href=
"titleLink"
:href=
"titleLink"
@
click=
"handleFileNameClick"
@
click=
"handleFileNameClick"
>
>
...
@@ -280,12 +280,12 @@ export default {
...
@@ -280,12 +280,12 @@ export default {
{{
diffFile
.
a_mode
}}
→
{{
diffFile
.
b_mode
}}
{{
diffFile
.
a_mode
}}
→
{{
diffFile
.
b_mode
}}
</small>
</small>
<span
v-if=
"isUsingLfs"
class=
"label label-lfs gl-mr-2"
>
{{
__
(
'
LFS
'
)
}}
</span>
<span
v-if=
"isUsingLfs"
class=
"
badge
label label-lfs gl-mr-2"
>
{{
__
(
'
LFS
'
)
}}
</span>
</div>
</div>
<div
<div
v-if=
"!diffFile.submodule && addMergeRequestButtons"
v-if=
"!diffFile.submodule && addMergeRequestButtons"
class=
"file-actions d-flex align-items-center
flex-wrap
"
class=
"file-actions d-flex align-items-center
gl-ml-auto gl-align-self-start
"
>
>
<diff-stats
:added-lines=
"diffFile.added_lines"
:removed-lines=
"diffFile.removed_lines"
/>
<diff-stats
:added-lines=
"diffFile.added_lines"
:removed-lines=
"diffFile.removed_lines"
/>
<gl-button-group
class=
"gl-pt-0!"
>
<gl-button-group
class=
"gl-pt-0!"
>
...
...
app/assets/stylesheets/framework/files.scss
View file @
2940c918
...
@@ -45,11 +45,6 @@
...
@@ -45,11 +45,6 @@
}
}
.file-actions
{
.file-actions
{
position
:
absolute
;
top
:
5px
;
right
:
15px
;
margin-left
:
auto
;
.btn
:not
(
.btn-icon
)
{
.btn
:not
(
.btn-icon
)
{
padding
:
0
10px
;
padding
:
0
10px
;
font-size
:
13px
;
font-size
:
13px
;
...
@@ -342,30 +337,14 @@ span.idiff {
...
@@ -342,30 +337,14 @@ span.idiff {
padding
:
$gl-padding-8
$gl-padding
;
padding
:
$gl-padding-8
$gl-padding
;
margin
:
0
;
margin
:
0
;
border-radius
:
$border-radius-default
$border-radius-default
0
0
;
border-radius
:
$border-radius-default
$border-radius-default
0
0
;
}
.file-header-content
{
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
padding-right
:
30px
;
position
:
relative
;
width
:
auto
;
@media
(
max-width
:
map-get
(
$grid-breakpoints
,
sm
)
-1
)
{
width
:
100%
;
}
}
.file-holder
&
{
@include
media-breakpoint-up
(
md
)
{
.file-actions
{
flex-wrap
:
nowrap
;
position
:
static
;
}
}
}
}
.btn-clipboard
{
.file-header-content
{
position
:
absolute
;
padding-right
:
30px
;
right
:
0
;
}
}
a
{
a
{
...
@@ -384,15 +363,11 @@ span.idiff {
...
@@ -384,15 +363,11 @@ span.idiff {
z-index
:
2
;
z-index
:
2
;
}
}
@include
media-breakpoint-down
(
xs
)
{
@include
media-breakpoint-down
(
sm
)
{
display
:
block
;
display
:
block
;
.file-actions
{
.file-actions
{
white-space
:
normal
;
margin-top
:
5px
;
.btn-group
{
padding-top
:
5px
;
}
}
}
}
}
}
}
...
...
app/helpers/blob_helper.rb
View file @
2940c918
...
@@ -68,7 +68,7 @@ module BlobHelper
...
@@ -68,7 +68,7 @@ module BlobHelper
def
edit_blob_button
(
project
=
@project
,
ref
=
@ref
,
path
=
@path
,
options
=
{})
def
edit_blob_button
(
project
=
@project
,
ref
=
@ref
,
path
=
@path
,
options
=
{})
return
unless
blob
=
readable_blob
(
options
,
path
,
project
,
ref
)
return
unless
blob
=
readable_blob
(
options
,
path
,
project
,
ref
)
common_classes
=
"btn btn-primary js-edit-blob m
l
-2
#{
options
[
:extra_class
]
}
"
common_classes
=
"btn btn-primary js-edit-blob m
r
-2
#{
options
[
:extra_class
]
}
"
data
=
{
track_event:
'click_edit'
,
track_label:
'Edit'
}
data
=
{
track_event:
'click_edit'
,
track_label:
'Edit'
}
if
Feature
.
enabled?
(
:web_ide_primary_edit
,
project
.
group
)
if
Feature
.
enabled?
(
:web_ide_primary_edit
,
project
.
group
)
...
@@ -88,7 +88,7 @@ module BlobHelper
...
@@ -88,7 +88,7 @@ module BlobHelper
def
ide_edit_button
(
project
=
@project
,
ref
=
@ref
,
path
=
@path
,
blob
:)
def
ide_edit_button
(
project
=
@project
,
ref
=
@ref
,
path
=
@path
,
blob
:)
return
unless
blob
return
unless
blob
common_classes
=
'btn btn-primary ide-edit-button m
l
-2'
common_classes
=
'btn btn-primary ide-edit-button m
r
-2'
data
=
{
track_event:
'click_edit_ide'
,
track_label:
'Web IDE'
}
data
=
{
track_event:
'click_edit_ide'
,
track_label:
'Web IDE'
}
unless
Feature
.
enabled?
(
:web_ide_primary_edit
,
project
.
group
)
unless
Feature
.
enabled?
(
:web_ide_primary_edit
,
project
.
group
)
...
...
app/views/projects/blob/_header.html.haml
View file @
2940c918
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
.js-file-title.file-title-flex-parent
.js-file-title.file-title-flex-parent
=
render
'projects/blob/header_content'
,
blob:
blob
=
render
'projects/blob/header_content'
,
blob:
blob
.file-actions
<
.file-actions
.gl-display-flex.gl-flex-fill-1.gl-align-self-start.gl-md-justify-content-end
<
=
render
'projects/blob/viewer_switcher'
,
blob:
blob
unless
blame
=
render
'projects/blob/viewer_switcher'
,
blob:
blob
unless
blame
-
if
Feature
.
enabled?
(
:consolidated_edit_button
,
@project
)
-
if
Feature
.
enabled?
(
:consolidated_edit_button
,
@project
)
=
render
'shared/web_ide_button'
,
blob:
blob
=
render
'shared/web_ide_button'
,
blob:
blob
...
...
app/views/projects/blob/_header_content.html.haml
View file @
2940c918
.file-header-content
.file-header-content
=
blob_icon
blob
.
mode
,
blob
.
name
=
blob_icon
blob
.
mode
,
blob
.
name
%strong
.file-title-name
{
data:
{
qa_selector:
'file_name_content'
}
}
%strong
.file-title-name
.gl-word-break-all
{
data:
{
qa_selector:
'file_name_content'
}
}
=
blob
.
name
=
blob
.
name
=
copy_file_path_button
(
blob
.
path
)
=
copy_file_path_button
(
blob
.
path
)
...
...
app/views/projects/diffs/_file_header.html.haml
View file @
2940c918
...
@@ -18,13 +18,13 @@
...
@@ -18,13 +18,13 @@
-
if
diff_file
.
renamed_file?
-
if
diff_file
.
renamed_file?
-
old_path
,
new_path
=
mark_inline_diffs
(
diff_file
.
old_path
,
diff_file
.
new_path
)
-
old_path
,
new_path
=
mark_inline_diffs
(
diff_file
.
old_path
,
diff_file
.
new_path
)
%strong
.file-title-name.has-tooltip
{
data:
{
title:
diff_file
.
old_path
,
container:
'body'
}
}
%strong
.file-title-name.has-tooltip
.gl-word-break-all
{
data:
{
title:
diff_file
.
old_path
,
container:
'body'
}
}
=
old_path
=
old_path
→
→
%strong
.file-title-name.has-tooltip
{
data:
{
title:
diff_file
.
new_path
,
container:
'body'
}
}
%strong
.file-title-name.has-tooltip
.gl-word-break-all
{
data:
{
title:
diff_file
.
new_path
,
container:
'body'
}
}
=
new_path
=
new_path
-
else
-
else
%strong
.file-title-name.has-tooltip
{
data:
{
title:
diff_file
.
file_path
,
container:
'body'
}
}
%strong
.file-title-name.has-tooltip
.gl-word-break-all
{
data:
{
title:
diff_file
.
file_path
,
container:
'body'
}
}
=
diff_file
.
file_path
=
diff_file
.
file_path
-
if
diff_file
.
deleted_file?
-
if
diff_file
.
deleted_file?
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
=
copy_file_path_button
(
diff_file
.
file_path
)
=
copy_file_path_button
(
diff_file
.
file_path
)
-
if
diff_file
.
mode_changed?
-
if
diff_file
.
mode_changed?
%small
%small
.mr-1
#{
diff_file
.
a_mode
}
→
#{
diff_file
.
b_mode
}
#{
diff_file
.
a_mode
}
→
#{
diff_file
.
b_mode
}
-
if
diff_file
.
stored_externally?
&&
diff_file
.
external_storage
==
:lfs
-
if
diff_file
.
stored_externally?
&&
diff_file
.
external_storage
==
:lfs
...
...
changelogs/unreleased/218666-show-lsf-for-long-name.yml
0 → 100644
View file @
2940c918
---
title
:
Make files header responsive and remove truncate name
merge_request
:
46406
author
:
type
:
changed
spec/features/merge_request/user_views_diffs_spec.rb
View file @
2940c918
...
@@ -61,7 +61,7 @@ RSpec.describe 'User views diffs', :js do
...
@@ -61,7 +61,7 @@ RSpec.describe 'User views diffs', :js do
end
end
it
'expands all diffs'
do
it
'expands all diffs'
do
first
(
'.
js-file-title
'
).
click
first
(
'.
diff-toggle-caret
'
).
click
expect
(
page
).
to
have_button
(
'Expand all'
)
expect
(
page
).
to
have_button
(
'Expand all'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment