summaryrefslogtreecommitdiff
path: root/app/assets/javascripts
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts')
-rw-r--r--app/assets/javascripts/notes/components/noteable_note.vue8
-rw-r--r--app/assets/javascripts/notes/stores/actions.js4
-rw-r--r--app/assets/javascripts/notes/stores/mutation_types.js1
-rw-r--r--app/assets/javascripts/notes/stores/mutations.js5
-rw-r--r--app/assets/javascripts/packages/details/components/package_history.vue4
5 files changed, 19 insertions, 3 deletions
diff --git a/app/assets/javascripts/notes/components/noteable_note.vue b/app/assets/javascripts/notes/components/noteable_note.vue
index 5999ded8721..adde1e85520 100644
--- a/app/assets/javascripts/notes/components/noteable_note.vue
+++ b/app/assets/javascripts/notes/components/noteable_note.vue
@@ -208,6 +208,7 @@ export default {
'scrollToNoteIfNeeded',
'updateAssignees',
'setSelectedCommentPositionHover',
+ 'updateDiscussionPosition',
]),
editHandler() {
this.isEditing = true;
@@ -250,8 +251,13 @@ export default {
...this.note.position,
};
- if (this.commentLineStart && this.line)
+ if (this.discussionRoot && this.commentLineStart && this.line) {
position.line_range = formatLineRange(this.commentLineStart, this.line);
+ this.updateDiscussionPosition({
+ discussionId: this.note.discussion_id,
+ position,
+ });
+ }
this.$emit('handleUpdateNote', {
note: this.note,
diff --git a/app/assets/javascripts/notes/stores/actions.js b/app/assets/javascripts/notes/stores/actions.js
index 4071409a352..ac57fcf2ea5 100644
--- a/app/assets/javascripts/notes/stores/actions.js
+++ b/app/assets/javascripts/notes/stores/actions.js
@@ -708,3 +708,7 @@ export const receiveDeleteDescriptionVersionError = ({ commit }, error) => {
export const updateAssignees = ({ commit }, assignees) => {
commit(types.UPDATE_ASSIGNEES, assignees);
};
+
+export const updateDiscussionPosition = ({ commit }, updatedPosition) => {
+ commit(types.UPDATE_DISCUSSION_POSITION, updatedPosition);
+};
diff --git a/app/assets/javascripts/notes/stores/mutation_types.js b/app/assets/javascripts/notes/stores/mutation_types.js
index 0c081d09c41..eb3447291bc 100644
--- a/app/assets/javascripts/notes/stores/mutation_types.js
+++ b/app/assets/javascripts/notes/stores/mutation_types.js
@@ -12,6 +12,7 @@ export const SHOW_PLACEHOLDER_NOTE = 'SHOW_PLACEHOLDER_NOTE';
export const TOGGLE_AWARD = 'TOGGLE_AWARD';
export const UPDATE_NOTE = 'UPDATE_NOTE';
export const UPDATE_DISCUSSION = 'UPDATE_DISCUSSION';
+export const UPDATE_DISCUSSION_POSITION = 'UPDATE_DISCUSSION_POSITION';
export const SET_DISCUSSION_DIFF_LINES = 'SET_DISCUSSION_DIFF_LINES';
export const SET_NOTES_FETCHED_STATE = 'SET_NOTES_FETCHED_STATE';
export const SET_NOTES_LOADING_STATE = 'SET_NOTES_LOADING_STATE';
diff --git a/app/assets/javascripts/notes/stores/mutations.js b/app/assets/javascripts/notes/stores/mutations.js
index a0fef8fc611..aa078f00569 100644
--- a/app/assets/javascripts/notes/stores/mutations.js
+++ b/app/assets/javascripts/notes/stores/mutations.js
@@ -278,6 +278,11 @@ export default {
Object.assign(selectedDiscussion, { ...note });
},
+ [types.UPDATE_DISCUSSION_POSITION](state, { discussionId, position }) {
+ const selectedDiscussion = state.discussions.find(disc => disc.id === discussionId);
+ if (selectedDiscussion) Object.assign(selectedDiscussion.position, { ...position });
+ },
+
[types.CLOSE_ISSUE](state) {
Object.assign(state.noteableData, { state: constants.CLOSED });
},
diff --git a/app/assets/javascripts/packages/details/components/package_history.vue b/app/assets/javascripts/packages/details/components/package_history.vue
index e3351f73791..ea1ed45266f 100644
--- a/app/assets/javascripts/packages/details/components/package_history.vue
+++ b/app/assets/javascripts/packages/details/components/package_history.vue
@@ -76,7 +76,7 @@ export default {
<history-element icon="commit" data-testid="commit">
<gl-sprintf :message="$options.i18n.commitText">
<template #link>
- <gl-link :href="`../../commit/${packagePipeline.sha}`">{{
+ <gl-link :href="packagePipeline.project.commit_url">{{
packagePipeline.sha
}}</gl-link>
</template>
@@ -88,7 +88,7 @@ export default {
<history-element icon="pipeline" data-testid="pipeline">
<gl-sprintf :message="$options.i18n.pipelineText">
<template #link>
- <gl-link :href="`../../pipelines/${packagePipeline.id}`"
+ <gl-link :href="packagePipeline.project.pipeline_url"
>#{{ packagePipeline.id }}</gl-link
>
</template>