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
cf4fb53f
Commit
cf4fb53f
authored
Jan 26, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
normalize headers correctly
i18n flash message
parent
c49fecde
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
13 deletions
+5
-13
app/assets/javascripts/compare.js
app/assets/javascripts/compare.js
+1
-1
app/assets/javascripts/compare_autocomplete.js
app/assets/javascripts/compare_autocomplete.js
+2
-1
app/assets/javascripts/groups/groups_filterable_list.js
app/assets/javascripts/groups/groups_filterable_list.js
+2
-11
No files found.
app/assets/javascripts/compare.js
View file @
cf4fb53f
...
...
@@ -77,7 +77,7 @@ export default class Compare {
}).
then
(({
data
})
=>
{
loading
.
hide
();
$target
.
html
(
data
);
var
className
=
'
.
'
+
$target
[
0
].
className
.
replace
(
'
'
,
'
.
'
);
const
className
=
'
.
'
+
$target
[
0
].
className
.
replace
(
'
'
,
'
.
'
);
localTimeAgo
(
$
(
'
.js-timeago
'
,
className
));
});
}
...
...
app/assets/javascripts/compare_autocomplete.js
View file @
cf4fb53f
/* eslint-disable func-names, space-before-function-paren, one-var, no-var, one-var-declaration-per-line, object-shorthand, comma-dangle, prefer-arrow-callback, no-else-return, newline-per-chained-call, wrap-iife, max-len */
import
{
__
}
from
'
./locale
'
;
import
axios
from
'
./lib/utils/axios_utils
'
;
import
flash
from
'
./flash
'
;
...
...
@@ -19,7 +20,7 @@ export default function initCompareAutocomplete() {
},
}).
then
(({
data
})
=>
{
callback
(
data
);
}).
catch
(()
=>
flash
(
'
Error fetching refs
'
));
}).
catch
(()
=>
flash
(
__
(
'
Error fetching refs
'
)
));
},
selectable
:
true
,
filterable
:
true
,
...
...
app/assets/javascripts/groups/groups_filterable_list.js
View file @
cf4fb53f
import
FilterableList
from
'
~/filterable_list
'
;
import
eventHub
from
'
./event_hub
'
;
import
{
getParameterByName
}
from
'
../lib/utils/common_utils
'
;
import
{
normalizeHeaders
,
getParameterByName
}
from
'
../lib/utils/common_utils
'
;
export
default
class
GroupFilterableList
extends
FilterableList
{
constructor
({
form
,
filter
,
holder
,
filterEndpoint
,
pagePath
,
dropdownSel
,
filterInputField
})
{
...
...
@@ -97,20 +97,11 @@ export default class GroupFilterableList extends FilterableList {
onFilterSuccess
(
res
,
queryData
)
{
const
currentPath
=
this
.
getPagePath
(
queryData
);
const
paginationData
=
{
'
X-Per-Page
'
:
res
.
headers
[
'
x-per-page
'
],
'
X-Page
'
:
res
.
headers
[
'
x-page
'
],
'
X-Total
'
:
res
.
headers
[
'
x-total
'
],
'
X-Total-Pages
'
:
res
.
headers
[
'
x-total-pages
'
],
'
X-Next-Page
'
:
res
.
headers
[
'
x-next-page
'
],
'
X-Prev-Page
'
:
res
.
headers
[
'
x-prev-page
'
],
};
window
.
history
.
replaceState
({
page
:
currentPath
,
},
document
.
title
,
currentPath
);
eventHub
.
$emit
(
'
updateGroups
'
,
res
.
data
,
Object
.
prototype
.
hasOwnProperty
.
call
(
queryData
,
this
.
filterInputField
));
eventHub
.
$emit
(
'
updatePagination
'
,
paginationData
);
eventHub
.
$emit
(
'
updatePagination
'
,
normalizeHeaders
(
res
.
headers
)
);
}
}
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