Commit 71bedb16 authored by Natalia Tepluhina's avatar Natalia Tepluhina

Merge branch '300657-user-participants-widget-issue-mr' into 'master'

Use participants widget on isse and MR pages [RUN AS-IF-FOSS]

See merge request gitlab-org/gitlab!61963
parents 6fb0fccb 0eef5949
<script>
import Store from '../../stores/sidebar_store';
import participants from './participants.vue';
export default {
components: {
participants,
},
props: {
mediator: {
type: Object,
required: true,
},
},
data() {
return {
store: new Store(),
};
},
};
</script>
<template>
<div class="block participants">
<participants
:loading="store.isFetching.participants"
:participants="store.participants"
:number-of-less-participants="7"
/>
</div>
</template>
...@@ -64,5 +64,6 @@ export default { ...@@ -64,5 +64,6 @@ export default {
:loading="isLoading" :loading="isLoading"
:participants="participants" :participants="participants"
:number-of-less-participants="7" :number-of-less-participants="7"
class="block participants"
/> />
</template> </template>
...@@ -14,6 +14,7 @@ import CollapsedAssigneeList from '~/sidebar/components/assignees/collapsed_assi ...@@ -14,6 +14,7 @@ import CollapsedAssigneeList from '~/sidebar/components/assignees/collapsed_assi
import SidebarAssigneesWidget from '~/sidebar/components/assignees/sidebar_assignees_widget.vue'; import SidebarAssigneesWidget from '~/sidebar/components/assignees/sidebar_assignees_widget.vue';
import SidebarConfidentialityWidget from '~/sidebar/components/confidential/sidebar_confidentiality_widget.vue'; import SidebarConfidentialityWidget from '~/sidebar/components/confidential/sidebar_confidentiality_widget.vue';
import SidebarDueDateWidget from '~/sidebar/components/date/sidebar_date_widget.vue'; import SidebarDueDateWidget from '~/sidebar/components/date/sidebar_date_widget.vue';
import SidebarParticipantsWidget from '~/sidebar/components/participants/sidebar_participants_widget.vue';
import SidebarReferenceWidget from '~/sidebar/components/reference/sidebar_reference_widget.vue'; import SidebarReferenceWidget from '~/sidebar/components/reference/sidebar_reference_widget.vue';
import { apolloProvider } from '~/sidebar/graphql'; import { apolloProvider } from '~/sidebar/graphql';
import Translate from '../vue_shared/translate'; import Translate from '../vue_shared/translate';
...@@ -21,7 +22,6 @@ import SidebarAssignees from './components/assignees/sidebar_assignees.vue'; ...@@ -21,7 +22,6 @@ import SidebarAssignees from './components/assignees/sidebar_assignees.vue';
import CopyEmailToClipboard from './components/copy_email_to_clipboard.vue'; import CopyEmailToClipboard from './components/copy_email_to_clipboard.vue';
import SidebarLabels from './components/labels/sidebar_labels.vue'; import SidebarLabels from './components/labels/sidebar_labels.vue';
import IssuableLockForm from './components/lock/issuable_lock_form.vue'; import IssuableLockForm from './components/lock/issuable_lock_form.vue';
import sidebarParticipants from './components/participants/sidebar_participants.vue';
import SidebarReviewers from './components/reviewers/sidebar_reviewers.vue'; import SidebarReviewers from './components/reviewers/sidebar_reviewers.vue';
import SidebarSeverity from './components/severity/sidebar_severity.vue'; import SidebarSeverity from './components/severity/sidebar_severity.vue';
import SidebarSubscriptionsWidget from './components/subscriptions/sidebar_subscriptions_widget.vue'; import SidebarSubscriptionsWidget from './components/subscriptions/sidebar_subscriptions_widget.vue';
...@@ -314,21 +314,29 @@ function mountLockComponent() { ...@@ -314,21 +314,29 @@ function mountLockComponent() {
}); });
} }
function mountParticipantsComponent(mediator) { function mountParticipantsComponent() {
const el = document.querySelector('.js-sidebar-participants-entry-point'); const el = document.querySelector('.js-sidebar-participants-entry-point');
if (!el) return; if (!el) return;
const { fullPath, iid } = getSidebarOptions();
// eslint-disable-next-line no-new // eslint-disable-next-line no-new
new Vue({ new Vue({
el, el,
apolloProvider,
components: { components: {
sidebarParticipants, SidebarParticipantsWidget,
}, },
render: (createElement) => render: (createElement) =>
createElement('sidebar-participants', { createElement('sidebar-participants-widget', {
props: { props: {
mediator, iid: String(iid),
fullPath,
issuableType:
isInIssuePage() || isInIncidentPage() || isInDesignPage()
? IssuableType.Issue
: IssuableType.MergeRequest,
}, },
}), }),
}); });
...@@ -435,7 +443,7 @@ export function mountSidebar(mediator) { ...@@ -435,7 +443,7 @@ export function mountSidebar(mediator) {
mountDueDateComponent(mediator); mountDueDateComponent(mediator);
mountReferenceComponent(mediator); mountReferenceComponent(mediator);
mountLockComponent(); mountLockComponent();
mountParticipantsComponent(mediator); mountParticipantsComponent();
mountSubscriptionsComponent(); mountSubscriptionsComponent();
mountCopyEmailComponent(); mountCopyEmailComponent();
......
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