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

index.js « users « pages « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 134962721d21218ffa735c1a251ff1df1ea3f2df (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
import $ from 'jquery';
import { setCookie } from '~/lib/utils/common_utils';
import UserCallout from '~/user_callout';
import { initProfileTabs, initUserAchievements } from '~/profile';
import { initUserActionsApp } from '~/users/profile/actions';
import UserTabs from './user_tabs';

function initUserProfile(action) {
  // TODO: Remove both Vue and legacy JS tabs code/feature flag uses with the
  // removal of the old navigation.
  // See https://gitlab.com/gitlab-org/gitlab/-/issues/435899.

  if (gon.features?.profileTabsVue) {
    initProfileTabs();
  } else {
    // eslint-disable-next-line no-new
    new UserTabs({ parentEl: '.user-profile', action });
  }

  // hide project limit message
  $('.hide-project-limit-message').on('click', (e) => {
    e.preventDefault();
    setCookie('hide_project_limit_message', 'false');
    $(this).parents('.project-limit-message').remove();
  });
}

const page = $('body').attr('data-page');
const action = page.split(':')[1];
initUserProfile(action);
initUserAchievements();
initUserActionsApp();
new UserCallout(); // eslint-disable-line no-new