Welcome to mirror list, hosted at ThFree Co, Russian Federation.

index.js « attention_requests « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2a142ab46e51371f23a82a0cef7b95b521fe13e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import Vue from 'vue';
import VueApollo from 'vue-apollo';
import { __ } from '~/locale';
import createDefaultClient from '~/lib/graphql';
import NavigationPopover from './components/navigation_popover.vue';

Vue.use(VueApollo);

const apolloProvider = new VueApollo({
  defaultClient: createDefaultClient(),
});

export const initTopNavPopover = () => {
  const el = document.getElementById('js-need-attention-nav-onboarding');

  if (!el) return;

  // eslint-disable-next-line no-new
  new Vue({
    el,
    apolloProvider,
    provide: {
      observerElSelector: '.user-counter.dropdown',
      observerElToggledClass: 'show',
      message: [
        __(
          '%{strongStart}Need your attention%{strongEnd} are the merge requests that need your help to move forward, as an assignee or reviewer.',
        ),
      ],
      featureName: 'attention_requests_top_nav',
      popoverTarget: '#js-need-attention-nav',
    },
    render(h) {
      return h(NavigationPopover);
    },
  });
};

export const initSideNavPopover = () => {
  const el = document.getElementById('js-need-attention-sidebar-onboarding');

  if (!el) return;

  // eslint-disable-next-line no-new
  new Vue({
    el,
    apolloProvider,
    provide: {
      observerElSelector: '.js-right-sidebar',
      observerElToggledClass: 'right-sidebar-expanded',
      message: [
        __(
          'To ask someone to look at a merge request, select %{strongStart}Request attention%{strongEnd}. Select again to remove the request.',
        ),
        __(
          'Some actions remove attention requests, like a reviewer approving or anyone merging the merge request.',
        ),
      ],
      featureName: 'attention_requests_side_nav',
      popoverTarget: '.js-attention-request-toggle',
      showAttentionIcon: true,
      delay: 500,
      popoverCssClass: 'attention-request-sidebar-popover',
    },
    render(h) {
      return h(NavigationPopover);
    },
  });
};

export default () => {
  initTopNavPopover();
};