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
6aea0191
Commit
6aea0191
authored
Aug 18, 2020
by
Thomas Randolph
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Switch file-by-file nav to use the Pagination component
parent
1cae31cd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
19 deletions
+24
-19
app/assets/javascripts/diffs/components/app.vue
app/assets/javascripts/diffs/components/app.vue
+19
-19
app/assets/stylesheets/pages/merge_requests.scss
app/assets/stylesheets/pages/merge_requests.scss
+5
-0
No files found.
app/assets/javascripts/diffs/components/app.vue
View file @
6aea0191
<
script
>
import
{
mapState
,
mapGetters
,
mapActions
}
from
'
vuex
'
;
import
{
GlLoadingIcon
,
GlButton
Group
,
GlButton
,
GlAlert
}
from
'
@gitlab/ui
'
;
import
{
GlLoadingIcon
,
GlButton
,
GlAlert
,
GlPagination
}
from
'
@gitlab/ui
'
;
import
Mousetrap
from
'
mousetrap
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
getParameterByName
,
parseBoolean
}
from
'
~/lib/utils/common_utils
'
;
...
...
@@ -37,7 +37,7 @@ export default {
TreeList
,
GlLoadingIcon
,
PanelResizer
,
Gl
ButtonGroup
,
Gl
Pagination
,
GlButton
,
GlAlert
,
},
...
...
@@ -169,6 +169,16 @@ export default {
isDiffHead
()
{
return
parseBoolean
(
getParameterByName
(
'
diff_head
'
));
},
previousFile
()
{
const
currentFile
=
this
.
currentDiffIndex
+
1
;
return
currentFile
>=
2
?
currentFile
-
1
:
null
;
},
nextFile
()
{
const
currentFile
=
this
.
currentDiffIndex
+
1
;
return
currentFile
<
this
.
diffFiles
.
length
?
currentFile
+
1
:
null
;
},
},
watch
:
{
commit
(
newCommit
,
oldCommit
)
{
...
...
@@ -509,23 +519,13 @@ export default {
:can-current-user-fork=
"canCurrentUserFork"
:view-diffs-file-by-file=
"viewDiffsFileByFile"
/>
<div
v-if=
"viewDiffsFileByFile"
class=
"d-flex gl-justify-content-center"
>
<gl-button-group>
<gl-button
:disabled=
"currentDiffIndex === 0"
data-testid=
"singleFilePrevious"
@
click=
"navigateToDiffFileIndex(currentDiffIndex - 1)"
>
{{
__
(
'
Prev
'
)
}}
</gl-button>
<gl-button
:disabled=
"currentDiffIndex === diffFiles.length - 1"
data-testid=
"singleFileNext"
@
click=
"navigateToDiffFileIndex(currentDiffIndex + 1)"
>
{{
__
(
'
Next
'
)
}}
</gl-button>
</gl-button-group>
<div
v-if=
"viewDiffsFileByFile"
class=
"file-by-file-navigation"
>
<gl-pagination
:value=
"currentDiffIndex + 1"
:prev-page=
"previousFile"
:next-page=
"nextFile"
@
input=
"val => navigateToDiffFileIndex(val - 1)"
/>
</div>
</
template
>
<no-changes
v-else
:changes-empty-state-illustration=
"changesEmptyStateIllustration"
/>
...
...
app/assets/stylesheets/pages/merge_requests.scss
View file @
6aea0191
...
...
@@ -1035,3 +1035,8 @@ $mr-widget-min-height: 69px;
.diff-file-row.is-active
{
background-color
:
$gray-50
;
}
.file-by-file-navigation
{
display
:
grid
;
place-items
:
center
;
}
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