BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
6f5f7e40
Commit
6f5f7e40
authored
Aug 07, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert ?full_data=1 -> ?view=full_data
parent
fecb1a2f
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
22 additions
and
10 deletions
+22
-10
issue_comment_form.vue
...ssets/javascripts/notes/components/issue_comment_form.vue
+1
-1
issue_discussion.vue
app/assets/javascripts/notes/components/issue_discussion.vue
+1
-1
issue_note.vue
app/assets/javascripts/notes/components/issue_note.vue
+1
-1
notes_actions.rb
app/controllers/concerns/notes_actions.rb
+4
-2
notes_helper.rb
app/helpers/notes_helper.rb
+5
-3
_discussion.html.haml
app/views/projects/issues/_discussion.html.haml
+1
-1
notes_helper_spec.rb
spec/helpers/notes_helper_spec.rb
+8
-0
mock_data.js
spec/javascripts/notes/mock_data.js
+1
-1
No files found.
app/assets/javascripts/notes/components/issue_comment_form.vue
View file @
6f5f7e40
...
...
@@ -105,7 +105,7 @@
endpoint
:
this
.
endpoint
,
flashContainer
:
this
.
$el
,
data
:
{
full_data
:
true
,
view
:
'full_data'
,
note
:
{
noteable_type
:
'Issue'
,
noteable_id
:
this
.
getIssueData
.
id
,
...
...
app/assets/javascripts/notes/components/issue_discussion.vue
View file @
6f5f7e40
...
...
@@ -100,7 +100,7 @@
target_type
:
'issue'
,
target_id
:
this
.
discussion
.
noteable_id
,
note
:
{
note
:
noteText
},
full_data
:
true
,
view
:
'full_data'
,
},
};
...
...
app/assets/javascripts/notes/components/issue_note.vue
View file @
6f5f7e40
...
...
@@ -78,7 +78,7 @@
const
data
=
{
endpoint
:
this
.
note
.
path
,
note
:
{
full_data
:
true
,
view
:
'full_data'
,
target_type
:
'issue'
,
target_id
:
this
.
note
.
noteable_id
,
note
:
{
note
:
noteText
},
...
...
app/controllers/concerns/notes_actions.rb
View file @
6f5f7e40
...
...
@@ -18,7 +18,8 @@ module NotesActions
@notes
=
prepare_notes_for_rendering
(
@notes
)
notes_json
[
:notes
]
=
if
params
[
:full_data
]
case
params
[
:view
]
when
'full_data'
note_serializer
.
represent
(
@notes
)
else
@notes
.
map
{
|
note
|
note_json
(
note
)
}
...
...
@@ -87,7 +88,8 @@ module NotesActions
if
note
.
persisted?
attrs
[
:valid
]
=
true
if
params
[
:full_data
]
case
params
[
:view
]
when
'full_data'
attrs
.
merge!
(
note_serializer
.
represent
(
note
))
else
attrs
.
merge!
(
...
...
app/helpers/notes_helper.rb
View file @
6f5f7e40
...
...
@@ -93,11 +93,13 @@ module NotesHelper
end
end
def
notes_url
def
notes_url
(
extra_params
=
{})
if
@snippet
.
is_a?
(
PersonalSnippet
)
snippet_notes_path
(
@snippet
)
snippet_notes_path
(
@snippet
,
extra_params
)
else
project_noteable_notes_path
(
@project
,
target_id:
@noteable
.
id
,
target_type:
@noteable
.
class
.
name
.
underscore
)
params
=
{
target_id:
@noteable
.
id
,
target_type:
@noteable
.
class
.
name
.
underscore
}
project_noteable_notes_path
(
@project
,
params
.
merge
(
extra_params
))
end
end
...
...
app/views/projects/issues/_discussion.html.haml
View file @
6f5f7e40
...
...
@@ -9,7 +9,7 @@
new_session_path:
new_session_path
(
:user
,
redirect_to_referer:
'yes'
),
markdown_docs:
help_page_path
(
'user/markdown'
),
quick_actions_docs:
help_page_path
(
'user/project/quick_actions'
),
notes_path:
"#{notes_url}?full_data=1"
,
notes_path:
notes_url
(
view:
'full_data'
)
,
last_fetched_at:
Time
.
now
.
to_i
,
issue_data:
serialize_issuable
(
@issue
),
current_user_data:
UserSerializer
.
new
.
represent
(
current_user
).
to_json
}}
...
...
spec/helpers/notes_helper_spec.rb
View file @
6f5f7e40
...
...
@@ -205,6 +205,14 @@ describe NotesHelper do
expect
(
helper
.
notes_url
).
to
eq
(
"/nm/test/noteable/issue/
#{
@noteable
.
id
}
/notes"
)
end
it
'adds extra params'
do
namespace
=
create
(
:namespace
,
path:
'nm'
)
@project
=
create
(
:project
,
path:
'test'
,
namespace:
namespace
)
@noteable
=
create
(
:issue
,
project:
@project
)
expect
(
helper
.
notes_url
(
view:
'full_data'
)).
to
eq
(
"/nm/test/noteable/issue/
#{
@noteable
.
id
}
/notes?view=full_data"
)
end
end
describe
'#note_url'
do
...
...
spec/javascripts/notes/mock_data.js
View file @
6f5f7e40
...
...
@@ -3,7 +3,7 @@ export const notesDataMock = {
lastFetchedAt
:
'1501862675'
,
markdownDocs
:
'/help/user/markdown'
,
newSessionPath
:
'/users/sign_in?redirect_to_referer=yes'
,
notesPath
:
'/gitlab-org/gitlab-ce/noteable/issue/98/notes?
full_data=1
'
,
notesPath
:
'/gitlab-org/gitlab-ce/noteable/issue/98/notes?
view=full_data
'
,
quickActionsDocs
:
'/help/user/project/quick_actions'
,
registerPath
:
'/users/sign_in?redirect_to_referer=yes#register-pane'
,
};
...
...
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