gitlab-org--gitlab-foss/app/assets/javascripts/pages/admin/clusters/index.js
Enrique Alcantara b4cc539d3c
Move gke_cluster_dropdowns to create_cluster dir
This commit creates a create_cluster directory to collect
all Vue applications related to creating kubernetes applications
using gitlab.

It also moves the gke_cluster_dropdowns collection of apps to
the create_cluster directory. gke_cluster_dropdowns contains
dropdown components used to select configuration options to
create a Kubernetes cluster in Google Cloud.
2019-08-27 09:16:01 -04:00

21 lines
594 B
JavaScript

import PersistentUserCallout from '~/persistent_user_callout';
import initGkeDropdowns from '~/create_cluster/gke_cluster';
function initGcpSignupCallout() {
const callout = document.querySelector('.gcp-signup-offer');
PersistentUserCallout.factory(callout);
}
document.addEventListener('DOMContentLoaded', () => {
const { page } = document.body.dataset;
const newClusterViews = [
'admin:clusters:new',
'admin:clusters:create_gcp',
'admin:clusters:create_user',
];
if (newClusterViews.indexOf(page) > -1) {
initGcpSignupCallout();
initGkeDropdowns();
}
});