summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/pages/projects/index.js
blob: 196798a9076d13b78504cd3907895285c935a91d (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
import initGkeDropdowns from '~/create_cluster/gke_cluster';
import initGkeNamespace from '~/projects/gke_cluster_namespace';
import PersistentUserCallout from '../../persistent_user_callout';
import Project from './project';
import ShortcutsNavigation from '../../behaviors/shortcuts/shortcuts_navigation';

document.addEventListener('DOMContentLoaded', () => {
  const { page } = document.body.dataset;
  const newClusterViews = [
    'projects:clusters:new',
    'projects:clusters:create_gcp',
    'projects:clusters:create_user',
  ];

  if (newClusterViews.indexOf(page) > -1) {
    const callout = document.querySelector('.gcp-signup-offer');
    PersistentUserCallout.factory(callout);

    initGkeDropdowns();
    initGkeNamespace();
  }

  new Project(); // eslint-disable-line no-new
  new ShortcutsNavigation(); // eslint-disable-line no-new
});