diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-23 14:57:46 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-11-23 14:57:46 +0000 |
commit | 64fc6a9b19faca58ad0087b1a1cb11f7ed910015 (patch) | |
tree | fe4e98cfab4289850ee15965ae0b04648ee90207 /app/assets/javascripts/pages | |
parent | 6317794da29af0bccf95dece5b57b2be2c0977a4 (diff) | |
download | gitlab-ce-64fc6a9b19faca58ad0087b1a1cb11f7ed910015.tar.gz |
Add latest changes from gitlab-org/gitlab@13-6-stable-ee
Diffstat (limited to 'app/assets/javascripts/pages')
10 files changed, 63 insertions, 84 deletions
diff --git a/app/assets/javascripts/pages/admin/runners/index.js b/app/assets/javascripts/pages/admin/runners/index.js index 104b7eeaf96..e60c6133c7c 100644 --- a/app/assets/javascripts/pages/admin/runners/index.js +++ b/app/assets/javascripts/pages/admin/runners/index.js @@ -1,12 +1,11 @@ import initFilteredSearch from '~/pages/search/init_filtered_search'; import AdminRunnersFilteredSearchTokenKeys from '~/filtered_search/admin_runners_filtered_search_token_keys'; import { FILTERED_SEARCH } from '~/pages/constants'; -import { initInstallRunner } from '~/pages/shared/mount_runner_instructions'; -initFilteredSearch({ - page: FILTERED_SEARCH.ADMIN_RUNNERS, - filteredSearchTokenKeys: AdminRunnersFilteredSearchTokenKeys, - useDefaultState: true, +document.addEventListener('DOMContentLoaded', () => { + initFilteredSearch({ + page: FILTERED_SEARCH.ADMIN_RUNNERS, + filteredSearchTokenKeys: AdminRunnersFilteredSearchTokenKeys, + useDefaultState: true, + }); }); - -initInstallRunner(); diff --git a/app/assets/javascripts/pages/groups/clusters/destroy/index.js b/app/assets/javascripts/pages/groups/clusters/destroy/index.js index 487e7a14a16..8001d2dd1da 100644 --- a/app/assets/javascripts/pages/groups/clusters/destroy/index.js +++ b/app/assets/javascripts/pages/groups/clusters/destroy/index.js @@ -1,3 +1,5 @@ import ClustersBundle from '~/clusters/clusters_bundle'; -new ClustersBundle(); // eslint-disable-line no-new +document.addEventListener('DOMContentLoaded', () => { + new ClustersBundle(); // eslint-disable-line no-new +}); diff --git a/app/assets/javascripts/pages/groups/clusters/edit/index.js b/app/assets/javascripts/pages/groups/clusters/edit/index.js index 487e7a14a16..8001d2dd1da 100644 --- a/app/assets/javascripts/pages/groups/clusters/edit/index.js +++ b/app/assets/javascripts/pages/groups/clusters/edit/index.js @@ -1,3 +1,5 @@ import ClustersBundle from '~/clusters/clusters_bundle'; -new ClustersBundle(); // eslint-disable-line no-new +document.addEventListener('DOMContentLoaded', () => { + new ClustersBundle(); // eslint-disable-line no-new +}); diff --git a/app/assets/javascripts/pages/groups/clusters/index.js b/app/assets/javascripts/pages/groups/clusters/index.js index 3b92c244346..9f466e0d60a 100644 --- a/app/assets/javascripts/pages/groups/clusters/index.js +++ b/app/assets/javascripts/pages/groups/clusters/index.js @@ -1,5 +1,7 @@ import initCreateCluster from '~/create_cluster/init_create_cluster'; import initIntegrationForm from '~/clusters/forms/show/index'; -initCreateCluster(document, gon); -initIntegrationForm(); +document.addEventListener('DOMContentLoaded', () => { + initCreateCluster(document, gon); + initIntegrationForm(); +}); diff --git a/app/assets/javascripts/pages/groups/clusters/index/index.js b/app/assets/javascripts/pages/groups/clusters/index/index.js index 3b71517f017..744be65bfbe 100644 --- a/app/assets/javascripts/pages/groups/clusters/index/index.js +++ b/app/assets/javascripts/pages/groups/clusters/index/index.js @@ -1,6 +1,8 @@ import PersistentUserCallout from '~/persistent_user_callout'; import initClustersListApp from '~/clusters_list'; -const callout = document.querySelector('.gcp-signup-offer'); -PersistentUserCallout.factory(callout); -initClustersListApp(); +document.addEventListener('DOMContentLoaded', () => { + const callout = document.querySelector('.gcp-signup-offer'); + PersistentUserCallout.factory(callout); + initClustersListApp(); +}); diff --git a/app/assets/javascripts/pages/groups/clusters/new/index.js b/app/assets/javascripts/pages/groups/clusters/new/index.js index de9ded87ef3..876bab0b339 100644 --- a/app/assets/javascripts/pages/groups/clusters/new/index.js +++ b/app/assets/javascripts/pages/groups/clusters/new/index.js @@ -1,3 +1,5 @@ import initNewCluster from '~/clusters/new_cluster'; -initNewCluster(); +document.addEventListener('DOMContentLoaded', () => { + initNewCluster(); +}); diff --git a/app/assets/javascripts/pages/groups/clusters/show/index.js b/app/assets/javascripts/pages/groups/clusters/show/index.js index 5d202a8824f..ccf631b2c53 100644 --- a/app/assets/javascripts/pages/groups/clusters/show/index.js +++ b/app/assets/javascripts/pages/groups/clusters/show/index.js @@ -1,5 +1,7 @@ import ClustersBundle from '~/clusters/clusters_bundle'; import initClusterHealth from '~/pages/projects/clusters/show/cluster_health'; -new ClustersBundle(); // eslint-disable-line no-new -initClusterHealth(); +document.addEventListener('DOMContentLoaded', () => { + new ClustersBundle(); // eslint-disable-line no-new + initClusterHealth(); +}); diff --git a/app/assets/javascripts/pages/groups/settings/ci_cd/show/index.js b/app/assets/javascripts/pages/groups/settings/ci_cd/show/index.js index 3456048d718..e8d8c985ade 100644 --- a/app/assets/javascripts/pages/groups/settings/ci_cd/show/index.js +++ b/app/assets/javascripts/pages/groups/settings/ci_cd/show/index.js @@ -4,18 +4,18 @@ import initFilteredSearch from '~/pages/search/init_filtered_search'; import GroupRunnersFilteredSearchTokenKeys from '~/filtered_search/group_runners_filtered_search_token_keys'; import { FILTERED_SEARCH } from '~/pages/constants'; import initSharedRunnersForm from '~/group_settings/mount_shared_runners'; -import { initInstallRunner } from '~/pages/shared/mount_runner_instructions'; -// Initialize expandable settings panels -initSettingsPanels(); +document.addEventListener('DOMContentLoaded', () => { + // Initialize expandable settings panels + initSettingsPanels(); -initFilteredSearch({ - page: FILTERED_SEARCH.ADMIN_RUNNERS, - filteredSearchTokenKeys: GroupRunnersFilteredSearchTokenKeys, - anchor: FILTERED_SEARCH.GROUP_RUNNERS_ANCHOR, - useDefaultState: false, -}); + initFilteredSearch({ + page: FILTERED_SEARCH.ADMIN_RUNNERS, + filteredSearchTokenKeys: GroupRunnersFilteredSearchTokenKeys, + anchor: FILTERED_SEARCH.GROUP_RUNNERS_ANCHOR, + useDefaultState: false, + }); -initSharedRunnersForm(); -initVariableList(); -initInstallRunner(); + initSharedRunnersForm(); + initVariableList(); +}); diff --git a/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js b/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js index 5d4c1595342..d18cde4ac87 100644 --- a/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js +++ b/app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js @@ -4,32 +4,32 @@ import registrySettingsApp from '~/registry/settings/registry_settings_bundle'; import initVariableList from '~/ci_variable_list'; import initDeployFreeze from '~/deploy_freeze'; import initSettingsPipelinesTriggers from '~/ci_settings_pipeline_triggers'; -import { initInstallRunner } from '~/pages/shared/mount_runner_instructions'; -// Initialize expandable settings panels -initSettingsPanels(); +document.addEventListener('DOMContentLoaded', () => { + // Initialize expandable settings panels + initSettingsPanels(); -const runnerToken = document.querySelector('.js-secret-runner-token'); -if (runnerToken) { - const runnerTokenSecretValue = new SecretValues({ - container: runnerToken, - }); - runnerTokenSecretValue.init(); -} + const runnerToken = document.querySelector('.js-secret-runner-token'); + if (runnerToken) { + const runnerTokenSecretValue = new SecretValues({ + container: runnerToken, + }); + runnerTokenSecretValue.init(); + } -initVariableList(); + initVariableList(); -// hide extra auto devops settings based checkbox state -const autoDevOpsExtraSettings = document.querySelector('.js-extra-settings'); -const instanceDefaultBadge = document.querySelector('.js-instance-default-badge'); -document.querySelector('.js-toggle-extra-settings').addEventListener('click', event => { - const { target } = event; - if (instanceDefaultBadge) instanceDefaultBadge.style.display = 'none'; - autoDevOpsExtraSettings.classList.toggle('hidden', !target.checked); -}); + // hide extra auto devops settings based checkbox state + const autoDevOpsExtraSettings = document.querySelector('.js-extra-settings'); + const instanceDefaultBadge = document.querySelector('.js-instance-default-badge'); + document.querySelector('.js-toggle-extra-settings').addEventListener('click', event => { + const { target } = event; + if (instanceDefaultBadge) instanceDefaultBadge.style.display = 'none'; + autoDevOpsExtraSettings.classList.toggle('hidden', !target.checked); + }); -registrySettingsApp(); -initDeployFreeze(); + registrySettingsApp(); + initDeployFreeze(); -initSettingsPipelinesTriggers(); -initInstallRunner(); + initSettingsPipelinesTriggers(); +}); diff --git a/app/assets/javascripts/pages/shared/mount_runner_instructions.js b/app/assets/javascripts/pages/shared/mount_runner_instructions.js deleted file mode 100644 index b7662155339..00000000000 --- a/app/assets/javascripts/pages/shared/mount_runner_instructions.js +++ /dev/null @@ -1,32 +0,0 @@ -import Vue from 'vue'; -import VueApollo from 'vue-apollo'; -import createDefaultClient from '~/lib/graphql'; -import InstallRunnerInstructions from '~/vue_shared/components/runner_instructions/runner_instructions.vue'; - -Vue.use(VueApollo); - -export function initInstallRunner(componentId = 'js-install-runner') { - const installRunnerEl = document.getElementById(componentId); - const { projectPath, groupPath } = installRunnerEl?.dataset; - - if (installRunnerEl) { - const defaultClient = createDefaultClient(); - - const apolloProvider = new VueApollo({ - defaultClient, - }); - - // eslint-disable-next-line no-new - new Vue({ - el: installRunnerEl, - apolloProvider, - provide: { - projectPath, - groupPath, - }, - render(createElement) { - return createElement(InstallRunnerInstructions); - }, - }); - } -} |