Commit f43c5ef4 authored by Thomas Randolph's avatar Thomas Randolph

Bring the metadata endpoint into the MR Notes app

parent 433ae04f
...@@ -25,6 +25,9 @@ export default () => { ...@@ -25,6 +25,9 @@ export default () => {
return { return {
noteableData, noteableData,
endpoints: {
metadata: notesDataset.endpointMetadata,
},
currentUserData: JSON.parse(notesDataset.currentUserData), currentUserData: JSON.parse(notesDataset.currentUserData),
notesData: JSON.parse(notesDataset.notesData), notesData: JSON.parse(notesDataset.notesData),
helpPagePath: notesDataset.helpPagePath, helpPagePath: notesDataset.helpPagePath,
...@@ -54,6 +57,7 @@ export default () => { ...@@ -54,6 +57,7 @@ export default () => {
}, },
created() { created() {
this.setActiveTab(window.mrTabs.getCurrentAction()); this.setActiveTab(window.mrTabs.getCurrentAction());
this.setEndpoints(this.endpoints);
}, },
mounted() { mounted() {
this.notesCountBadge = $('.issuable-details').find('.notes-tab .badge'); this.notesCountBadge = $('.issuable-details').find('.notes-tab .badge');
...@@ -65,7 +69,7 @@ export default () => { ...@@ -65,7 +69,7 @@ export default () => {
window.mrTabs.eventHub.$off('MergeRequestTabChange', this.setActiveTab); window.mrTabs.eventHub.$off('MergeRequestTabChange', this.setActiveTab);
}, },
methods: { methods: {
...mapActions(['setActiveTab']), ...mapActions(['setActiveTab', 'setEndpoints']),
updateDiscussionTabCounter() { updateDiscussionTabCounter() {
this.notesCountBadge.text(this.discussionTabCounter); this.notesCountBadge.text(this.discussionTabCounter);
}, },
......
...@@ -63,6 +63,7 @@ ...@@ -63,6 +63,7 @@
- add_page_startup_api_call widget_project_json_merge_request_path(@project, @merge_request, format: :json) - add_page_startup_api_call widget_project_json_merge_request_path(@project, @merge_request, format: :json)
- add_page_startup_api_call cached_widget_project_json_merge_request_path(@project, @merge_request, format: :json) - add_page_startup_api_call cached_widget_project_json_merge_request_path(@project, @merge_request, format: :json)
#js-vue-mr-discussions{ data: { notes_data: notes_data(@merge_request, Feature.enabled?(:paginated_notes, @project)).to_json, #js-vue-mr-discussions{ data: { notes_data: notes_data(@merge_request, Feature.enabled?(:paginated_notes, @project)).to_json,
endpoint_metadata: @endpoint_metadata_url,
noteable_data: serialize_issuable(@merge_request, serializer: 'noteable'), noteable_data: serialize_issuable(@merge_request, serializer: 'noteable'),
noteable_type: 'MergeRequest', noteable_type: 'MergeRequest',
target_type: 'merge_request', target_type: 'merge_request',
......
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