Commit 37541114 authored by Phil Hughes's avatar Phil Hughes
parent d860ab19
...@@ -69,7 +69,7 @@ export default { ...@@ -69,7 +69,7 @@ export default {
type="button" type="button"
@click="handleToggle" @click="handleToggle"
> >
<i :class="toggleChevronClass" class="fa" aria-hidden="true"> </i> <i :class="toggleChevronClass" class="fa" aria-hidden="true"></i>
{{ __('Toggle discussion') }} {{ __('Toggle discussion') }}
</button> </button>
</div> </div>
...@@ -81,19 +81,18 @@ export default { ...@@ -81,19 +81,18 @@ export default {
:data-user-id="author.id" :data-user-id="author.id"
:data-username="author.username" :data-username="author.username"
> >
<slot name="note-header-info"></slot>
<span class="note-header-author-name">{{ author.name }}</span> <span class="note-header-author-name">{{ author.name }}</span>
<span v-if="author.status_tooltip_html" v-html="author.status_tooltip_html"></span> <span v-if="author.status_tooltip_html" v-html="author.status_tooltip_html"></span>
<span class="note-headline-light"> @{{ author.username }} </span> <span class="note-headline-light">@{{ author.username }}</span>
</a> </a>
<span v-else> {{ __('A deleted user') }} </span> <span v-else>{{ __('A deleted user') }}</span>
<span class="note-headline-light"> <span class="note-headline-light">
<span class="note-headline-meta"> <span class="note-headline-meta">
<span class="system-note-message"> <slot></slot> </span> <span class="system-note-message"> <slot></slot> </span>
<template v-if="createdAt"> <template v-if="createdAt">
<span class="system-note-separator"> <span class="system-note-separator">
<template v-if="actionText"> <template v-if="actionText">{{ actionText }}</template>
{{ actionText }}
</template>
</span> </span>
<a <a
:href="noteTimestampLink" :href="noteTimestampLink"
...@@ -107,8 +106,7 @@ export default { ...@@ -107,8 +106,7 @@ export default {
class="fa fa-spinner fa-spin editing-spinner" class="fa fa-spinner fa-spin editing-spinner"
aria-label="Comment is being updated" aria-label="Comment is being updated"
aria-hidden="true" aria-hidden="true"
> ></i>
</i>
</span> </span>
</span> </span>
</div> </div>
......
...@@ -31,6 +31,10 @@ export default { ...@@ -31,6 +31,10 @@ export default {
}, },
methods: { methods: {
resolveHandler(resolvedState = false) { resolveHandler(resolvedState = false) {
if (this.note && this.note.isDraft) {
return this.$emit('toggleResolveStatus');
}
this.isResolving = true; this.isResolving = true;
const isResolved = this.discussionResolved || resolvedState; const isResolved = this.discussionResolved || resolvedState;
const discussion = this.resolveAsThread; const discussion = this.resolveAsThread;
......
...@@ -191,6 +191,9 @@ export const firstUnresolvedDiscussionId = (state, getters) => diffOrder => { ...@@ -191,6 +191,9 @@ export const firstUnresolvedDiscussionId = (state, getters) => diffOrder => {
return getters.unresolvedDiscussionsIdsByDate[0]; return getters.unresolvedDiscussionsIdsByDate[0];
}; };
export const getDiscussion = state => discussionId =>
state.discussions.find(discussion => discussion.id === discussionId);
export const commentsDisabled = state => state.commentsDisabled; export const commentsDisabled = state => state.commentsDisabled;
// prevent babel-plugin-rewire from generating an invalid default during karma tests // prevent babel-plugin-rewire from generating an invalid default during karma tests
......
...@@ -261,4 +261,12 @@ describe('Getters Notes Store', () => { ...@@ -261,4 +261,12 @@ describe('Getters Notes Store', () => {
expect(getters.firstUnresolvedDiscussionId(state, localGettersFalsy)(false)).toBeFalsy(); expect(getters.firstUnresolvedDiscussionId(state, localGettersFalsy)(false)).toBeFalsy();
}); });
}); });
describe('getDiscussion', () => {
it('returns discussion by ID', () => {
state.discussions.push({ id: '1' });
expect(getters.getDiscussion(state)('1')).toEqual({ id: '1' });
});
});
}); });
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