Commit 981cde3f authored by Axel García's avatar Axel García

Use a helper to inject data into epic form

parent 0d582137
......@@ -5,6 +5,17 @@ module EpicsHelper
EpicPresenter.new(epic, current_user: current_user).show_data(author_icon: avatar_icon_for_user(epic.author), base_data: issuable_initial_data(epic))
end
def epic_new_app_data(group)
{
group_path: group.full_path,
group_epics_path: group_epics_path(group),
labels_fetch_path: group_labels_path(group, format: :json, only_group_labels: true, include_ancestor_groups: true),
labels_manage_path: group_labels_path(group),
markdown_preview_path: preview_markdown_path(group),
markdown_docs_path: help_page_path('user/markdown')
}
end
def epic_endpoint_query_params(opts)
opts[:data] ||= {}
opts[:data][:endpoint_query_params] = {
......
......@@ -2,4 +2,4 @@
- breadcrumb_title _("New")
- page_title _("New epic")
.js-epic-new{ data: { group_path: @group.full_path, group_epics_path: group_epics_path(@group), labels_fetch_path: group_labels_path(@group, format: :json, only_group_labels: true, include_ancestor_groups: true), labels_manage_path: group_labels_path(@group), markdown_preview_path: preview_markdown_path(@group), markdown_docs_path: help_page_path('user/markdown') } }
.js-epic-new{ data: epic_new_app_data(@group) }
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