Commit a03b429c authored by Filipa Lacerda's avatar Filipa Lacerda

Merge branch 'jprovazn-issuable-data' into 'master'

Don't convert issuable_initial_data into JSON

See merge request gitlab-org/gitlab-ce!17318
parents d1ceb600 22addf26
...@@ -234,7 +234,7 @@ module IssuablesHelper ...@@ -234,7 +234,7 @@ module IssuablesHelper
data.merge!(updated_at_by(issuable)) data.merge!(updated_at_by(issuable))
data.to_json data
end end
def updated_at_by(issuable) def updated_at_by(issuable)
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
.issue-details.issuable-details .issue-details.issuable-details
.detail-page-description.content-block .detail-page-description.content-block
%script#js-issuable-app-initial-data{ type: "application/json" }= issuable_initial_data(@issue) %script#js-issuable-app-initial-data{ type: "application/json" }= issuable_initial_data(@issue).to_json
#js-issuable-app #js-issuable-app
%h2.title= markdown_field(@issue, :title) %h2.title= markdown_field(@issue, :title)
- if @issue.description.present? - if @issue.description.present?
......
...@@ -173,23 +173,23 @@ describe IssuablesHelper do ...@@ -173,23 +173,23 @@ describe IssuablesHelper do
@project = issue.project @project = issue.project
expected_data = { expected_data = {
'endpoint' => "/#{@project.full_path}/issues/#{issue.iid}", endpoint: "/#{@project.full_path}/issues/#{issue.iid}",
'updateEndpoint' => "/#{@project.full_path}/issues/#{issue.iid}.json", updateEndpoint: "/#{@project.full_path}/issues/#{issue.iid}.json",
'canUpdate' => true, canUpdate: true,
'canDestroy' => true, canDestroy: true,
'issuableRef' => "##{issue.iid}", issuableRef: "##{issue.iid}",
'markdownPreviewPath' => "/#{@project.full_path}/preview_markdown", markdownPreviewPath: "/#{@project.full_path}/preview_markdown",
'markdownDocsPath' => '/help/user/markdown', markdownDocsPath: '/help/user/markdown',
'issuableTemplates' => [], issuableTemplates: [],
'projectPath' => @project.path, projectPath: @project.path,
'projectNamespace' => @project.namespace.path, projectNamespace: @project.namespace.path,
'initialTitleHtml' => issue.title, initialTitleHtml: issue.title,
'initialTitleText' => issue.title, initialTitleText: issue.title,
'initialDescriptionHtml' => '<p dir="auto">issue text</p>', initialDescriptionHtml: '<p dir="auto">issue text</p>',
'initialDescriptionText' => 'issue text', initialDescriptionText: 'issue text',
'initialTaskStatus' => '0 of 0 tasks completed' initialTaskStatus: '0 of 0 tasks completed'
} }
expect(JSON.parse(helper.issuable_initial_data(issue))).to eq(expected_data) expect(helper.issuable_initial_data(issue)).to eq(expected_data)
end end
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment