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
d50c67b3
Commit
d50c67b3
authored
Feb 12, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master' into ce-to-ee-2018-02-12
parents
f5cf3206
74c4d352
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
52 additions
and
29 deletions
+52
-29
app/assets/javascripts/diff.js
app/assets/javascripts/diff.js
+6
-1
app/assets/javascripts/gpg_badges.js
app/assets/javascripts/gpg_badges.js
+11
-6
app/views/groups/labels/new.html.haml
app/views/groups/labels/new.html.haml
+0
-1
changelogs/unreleased/group-label-page-breadcrumb.yml
changelogs/unreleased/group-label-page-breadcrumb.yml
+5
-0
config/application.rb
config/application.rb
+1
-0
spec/javascripts/gpg_badges_spec.js
spec/javascripts/gpg_badges_spec.js
+29
-21
No files found.
app/assets/javascripts/diff.js
View file @
d50c67b3
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
flash
from
'
~/flash
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
getLocationHash
}
from
'
./lib/utils/url_utility
'
;
import
FilesCommentButton
from
'
./files_comment_button
'
;
import
SingleFileDiff
from
'
./single_file_diff
'
;
...
...
@@ -69,7 +72,9 @@ export default class Diff {
const
view
=
file
.
data
(
'
view
'
);
const
params
=
{
since
,
to
,
bottom
,
offset
,
unfold
,
view
};
$
.
get
(
link
,
params
,
response
=>
$target
.
parent
().
replaceWith
(
response
));
axios
.
get
(
link
,
{
params
})
.
then
(({
data
})
=>
$target
.
parent
().
replaceWith
(
data
))
.
catch
(()
=>
flash
(
__
(
'
An error occurred while loading diff
'
)));
}
openAnchoredDiff
(
cb
)
{
...
...
app/assets/javascripts/gpg_badges.js
View file @
d50c67b3
import
{
parseQueryStringIntoObject
}
from
'
~/lib/utils/common_utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
flash
from
'
~/flash
'
;
import
{
__
}
from
'
~/locale
'
;
export
default
class
GpgBadges
{
static
fetch
()
{
const
badges
=
$
(
'
.js-loading-gpg-badge
'
);
...
...
@@ -5,13 +10,13 @@ export default class GpgBadges {
badges
.
html
(
'
<i class="fa fa-spinner fa-spin"></i>
'
);
$
.
get
({
url
:
form
.
data
(
'
signatures-path
'
),
data
:
form
.
serialize
(),
}).
done
((
response
)
=>
{
response
.
signatures
.
forEach
((
signature
)
=>
{
const
params
=
parseQueryStringIntoObject
(
form
.
serialize
());
return
axios
.
get
(
form
.
data
(
'
signatures-path
'
),
{
params
})
.
then
(({
data
})
=>
{
data
.
signatures
.
forEach
((
signature
)
=>
{
badges
.
filter
(
`[data-commit-sha="
${
signature
.
commit_sha
}
"]`
).
replaceWith
(
signature
.
html
);
});
});
})
.
catch
(()
=>
flash
(
__
(
'
An error occurred while loading commits
'
)));
}
}
app/views/groups/labels/new.html.haml
View file @
d50c67b3
-
breadcrumb_title
"Labels"
-
page_title
'New Label'
-
header_title
group_title
(
@group
,
'Labels'
,
group_labels_path
(
@group
))
%h3
.page-title
New Label
...
...
changelogs/unreleased/group-label-page-breadcrumb.yml
0 → 100644
View file @
d50c67b3
---
title
:
Fix breadcrumb on labels page for groups
merge_request
:
17045
author
:
Onuwa Nnachi Isaac
type
:
fixed
config/application.rb
View file @
d50c67b3
...
...
@@ -13,6 +13,7 @@ module Gitlab
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/redis/queues'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/redis/shared_state'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/request_context'
)
require_dependency
Rails
.
root
.
join
(
'lib/gitlab/current_settings'
)
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
...
...
spec/javascripts/gpg_badges_spec.js
View file @
d50c67b3
import
MockAdapter
from
'
axios-mock-adapter
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
GpgBadges
from
'
~/gpg_badges
'
;
describe
(
'
GpgBadges
'
,
()
=>
{
let
mock
;
const
dummyCommitSha
=
'
n0m0rec0ffee
'
;
const
dummyBadgeHtml
=
'
dummy html
'
;
const
dummyResponse
=
{
...
...
@@ -11,38 +14,43 @@ describe('GpgBadges', () => {
};
beforeEach
(()
=>
{
mock
=
new
MockAdapter
(
axios
);
setFixtures
(
`
<form
class="commits-search-form" data-signatures-path="/hello" action="/hello"
method="get">
<input name="utf8" type="hidden" value="✓">
<input type="search" name="search" id="commits-search"class="form-control search-text-input input-short">
</form>
<div class="parent-container">
<div class="js-loading-gpg-badge" data-commit-sha="
${
dummyCommitSha
}
"></div>
</div>
`
);
});
it
(
'
displays a loading spinner
'
,
()
=>
{
spyOn
(
$
,
'
get
'
).
and
.
returnValue
({
done
()
{
// intentionally left blank
},
});
afterEach
(()
=>
{
mock
.
restore
();
});
GpgBadges
.
fetch
();
it
(
'
displays a loading spinner
'
,
(
done
)
=>
{
mock
.
onGet
(
'
/hello
'
).
reply
(
200
);
expect
(
document
.
querySelector
(
'
.js-loading-gpg-badge:empty
'
)).
toBe
(
null
);
const
spinners
=
document
.
querySelectorAll
(
'
.js-loading-gpg-badge i.fa.fa-spinner.fa-spin
'
);
expect
(
spinners
.
length
).
toBe
(
1
);
GpgBadges
.
fetch
().
then
(()
=>
{
expect
(
document
.
querySelector
(
'
.js-loading-gpg-badge:empty
'
)).
toBe
(
null
);
const
spinners
=
document
.
querySelectorAll
(
'
.js-loading-gpg-badge i.fa.fa-spinner.fa-spin
'
);
expect
(
spinners
.
length
).
toBe
(
1
);
done
();
}).
catch
(
done
.
fail
);
});
it
(
'
replaces the loading spinner
'
,
()
=>
{
spyOn
(
$
,
'
get
'
).
and
.
returnValue
({
done
(
callback
)
{
callback
(
dummyResponse
);
},
});
GpgBadges
.
fetch
();
it
(
'
replaces the loading spinner
'
,
(
done
)
=>
{
mock
.
onGet
(
'
/hello
'
).
reply
(
200
,
dummyResponse
);
expect
(
document
.
querySelector
(
'
.js-loading-gpg-badge
'
)).
toBe
(
null
);
const
parentContainer
=
document
.
querySelector
(
'
.parent-container
'
);
expect
(
parentContainer
.
innerHTML
.
trim
()).
toEqual
(
dummyBadgeHtml
);
GpgBadges
.
fetch
().
then
(()
=>
{
expect
(
document
.
querySelector
(
'
.js-loading-gpg-badge
'
)).
toBe
(
null
);
const
parentContainer
=
document
.
querySelector
(
'
.parent-container
'
);
expect
(
parentContainer
.
innerHTML
.
trim
()).
toEqual
(
dummyBadgeHtml
);
done
();
}).
catch
(
done
.
fail
);
});
});
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