diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-10 03:08:40 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-10 03:08:40 +0300 |
commit | 707312855bd32e4504638456c7043be5ca14aacd (patch) | |
tree | b86c1e7260d33d335ab720a7930d34c2ae43c8d6 /app/assets | |
parent | 413c91fda942270905873684a58041f8c65f878c (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/ci_settings_general_pipeline/index.js | 19 | ||||
-rw-r--r-- | app/assets/javascripts/pages/projects/settings/ci_cd/show/index.js | 2 |
2 files changed, 21 insertions, 0 deletions
diff --git a/app/assets/javascripts/ci_settings_general_pipeline/index.js b/app/assets/javascripts/ci_settings_general_pipeline/index.js new file mode 100644 index 00000000000..5053786fbba --- /dev/null +++ b/app/assets/javascripts/ci_settings_general_pipeline/index.js @@ -0,0 +1,19 @@ +export const initGeneralPipelinesOptions = () => { + const forwardDeploymentEnabledCheckbox = document.getElementById( + 'project_ci_cd_settings_attributes_forward_deployment_enabled', + ); + const forwardDeploymentRollbackAllowedCheckbox = document.getElementById( + 'project_ci_cd_settings_attributes_forward_deployment_rollback_allowed', + ); + + if (forwardDeploymentRollbackAllowedCheckbox && forwardDeploymentEnabledCheckbox) { + forwardDeploymentRollbackAllowedCheckbox.disabled = !forwardDeploymentEnabledCheckbox.checked; + + forwardDeploymentEnabledCheckbox.addEventListener('change', () => { + if (!forwardDeploymentEnabledCheckbox.checked) { + forwardDeploymentRollbackAllowedCheckbox.checked = false; + } + forwardDeploymentRollbackAllowedCheckbox.disabled = !forwardDeploymentEnabledCheckbox.checked; + }); + } +}; 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 b2681267e06..4a5d5580c08 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 @@ -14,6 +14,7 @@ import { initCiSecureFiles } from '~/ci_secure_files'; import initDeployTokens from '~/deploy_tokens'; import { initProjectRunners } from '~/ci/runner/project_runners'; import { initProjectRunnersRegistrationDropdown } from '~/ci/runner/project_runners/register'; +import { initGeneralPipelinesOptions } from '~/ci_settings_general_pipeline'; // Initialize expandable settings panels initSettingsPanels(); @@ -51,3 +52,4 @@ initRefSwitcherBadges(); initInstallRunner(); initTokenAccess(); initCiSecureFiles(); +initGeneralPipelinesOptions(); |