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
d932bc42
Commit
d932bc42
authored
Dec 31, 2018
by
GitLab Bot
Browse files
Options
Browse Files
Download
Plain Diff
Automatic merge of gitlab-org/gitlab-ce master
parents
94b8dbbd
4d799818
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
66 additions
and
5 deletions
+66
-5
app/assets/javascripts/set_status_modal/emoji_menu_in_modal.js
...ssets/javascripts/set_status_modal/emoji_menu_in_modal.js
+1
-2
changelogs/unreleased/52888-status-emoji-should-not-be-added-to-awards-section-on-issue-page-2.yml
...should-not-be-added-to-awards-section-on-issue-page-2.yml
+5
-0
changelogs/unreleased/fj-55781-fix-api-blob-content-disposition.yml
.../unreleased/fj-55781-fix-api-blob-content-disposition.yml
+5
-0
lib/api/helpers.rb
lib/api/helpers.rb
+7
-1
spec/features/profiles/user_edit_profile_spec.rb
spec/features/profiles/user_edit_profile_spec.rb
+14
-0
spec/lib/api/helpers_spec.rb
spec/lib/api/helpers_spec.rb
+32
-0
spec/requests/api/files_spec.rb
spec/requests/api/files_spec.rb
+1
-1
spec/requests/api/repositories_spec.rb
spec/requests/api/repositories_spec.rb
+1
-1
No files found.
app/assets/javascripts/set_status_modal/emoji_menu_in_modal.js
View file @
d932bc42
...
...
@@ -12,9 +12,8 @@ class EmojiMenuInModal extends AwardsHandler {
this
.
bindEvents
();
}
postEmoji
(
$emojiButton
,
awardUrl
,
selectedEmoji
,
callback
)
{
postEmoji
(
$emojiButton
,
awardUrl
,
selectedEmoji
)
{
this
.
selectEmojiCallback
(
selectedEmoji
,
this
.
emoji
.
glEmojiTag
(
selectedEmoji
));
callback
();
}
}
...
...
changelogs/unreleased/52888-status-emoji-should-not-be-added-to-awards-section-on-issue-page-2.yml
0 → 100644
View file @
d932bc42
---
title
:
Prevent awards emoji being updated when updating status
merge_request
:
23470
author
:
type
:
fixed
changelogs/unreleased/fj-55781-fix-api-blob-content-disposition.yml
0 → 100644
View file @
d932bc42
---
title
:
Fix content-disposition in blobs and files API endpoint
merge_request
:
24078
author
:
type
:
fixed
lib/api/helpers.rb
View file @
d932bc42
...
...
@@ -535,7 +535,7 @@ module API
def
send_git_blob
(
repository
,
blob
)
env
[
'api.format'
]
=
:txt
content_type
'text/plain'
header
[
'Content-Disposition'
]
=
"attachment; filename=
#{
blob
.
name
.
inspect
}
"
header
[
'Content-Disposition'
]
=
content_disposition
(
'attachment'
,
blob
.
name
)
header
(
*
Gitlab
::
Workhorse
.
send_git_blob
(
repository
,
blob
))
end
...
...
@@ -568,5 +568,11 @@ module API
params
[
:archived
]
end
def
content_disposition
(
disposition
,
filename
)
disposition
+=
%(; filename=#{filename.inspect})
if
filename
.
present?
disposition
end
end
end
spec/features/profiles/user_edit_profile_spec.rb
View file @
d932bc42
...
...
@@ -147,6 +147,9 @@ describe 'User edit profile' do
end
context
'user menu'
do
let
(
:issue
)
{
create
(
:issue
,
project:
project
)}
let
(
:project
)
{
create
(
:project
)
}
def
open_user_status_modal
find
(
'.header-user-dropdown-toggle'
).
click
...
...
@@ -205,6 +208,17 @@ describe 'User edit profile' do
end
end
it
'does not update the awards panel emoji'
do
project
.
add_maintainer
(
user
)
visit
(
project_issue_path
(
project
,
issue
))
emoji
=
'biohazard'
open_user_status_modal
select_emoji
(
emoji
,
true
)
expect
(
page
.
all
(
'.award-control .js-counter'
)).
to
all
(
have_content
(
'0'
))
end
it
'adds message to user status'
do
message
=
'I have something to say'
open_user_status_modal
...
...
spec/lib/api/helpers_spec.rb
View file @
d932bc42
...
...
@@ -148,4 +148,36 @@ describe API::Helpers do
it_behaves_like
'user namespace finder'
end
describe
'#send_git_blob'
do
context
'content disposition'
do
let
(
:repository
)
{
double
}
let
(
:blob
)
{
double
(
name:
'foobar'
)
}
let
(
:send_git_blob
)
do
subject
.
send
(
:send_git_blob
,
repository
,
blob
)
end
before
do
allow
(
subject
).
to
receive
(
:env
).
and_return
({})
allow
(
subject
).
to
receive
(
:content_type
)
allow
(
subject
).
to
receive
(
:header
).
and_return
({})
allow
(
Gitlab
::
Workhorse
).
to
receive
(
:send_git_blob
)
end
context
'when blob name is null'
do
let
(
:blob
)
{
double
(
name:
nil
)
}
it
'returns only the disposition'
do
expect
(
send_git_blob
[
'Content-Disposition'
]).
to
eq
'attachment'
end
end
context
'when blob name is not null'
do
it
'returns disposition with the blob name'
do
expect
(
send_git_blob
[
'Content-Disposition'
]).
to
eq
'attachment; filename="foobar"'
end
end
end
end
end
spec/requests/api/files_spec.rb
View file @
d932bc42
...
...
@@ -190,7 +190,7 @@ describe API::Files do
get
api
(
url
,
current_user
),
params:
params
expect
(
headers
[
'Content-Disposition'
]).
to
match
(
/^attachment/
)
expect
(
headers
[
'Content-Disposition'
]).
to
eq
(
'attachment; filename="popen.rb"'
)
end
context
'when mandatory params are not given'
do
...
...
spec/requests/api/repositories_spec.rb
View file @
d932bc42
...
...
@@ -171,7 +171,7 @@ describe API::Repositories do
it
'forces attachment content disposition'
do
get
api
(
route
,
current_user
)
expect
(
headers
[
'Content-Disposition'
]).
to
match
(
/^attachment/
)
expect
(
headers
[
'Content-Disposition'
]).
to
eq
'attachment'
end
context
'when sha does not exist'
do
...
...
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