diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-09 00:11:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-09 00:11:09 +0300 |
commit | 3d42e098d9658853984534c9dfc2bf76284a8ac0 (patch) | |
tree | 269e9d9e017124f5f6d841311661832ea7e4eff8 /app/assets/javascripts/gitlab_version_check | |
parent | a3487798aeff89daff78749e6d6f392d3ca23687 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/gitlab_version_check')
-rw-r--r-- | app/assets/javascripts/gitlab_version_check/components/security_patch_upgrade_alert.vue | 76 | ||||
-rw-r--r-- | app/assets/javascripts/gitlab_version_check/index.js | 25 |
2 files changed, 0 insertions, 101 deletions
diff --git a/app/assets/javascripts/gitlab_version_check/components/security_patch_upgrade_alert.vue b/app/assets/javascripts/gitlab_version_check/components/security_patch_upgrade_alert.vue deleted file mode 100644 index 89dc68ec73e..00000000000 --- a/app/assets/javascripts/gitlab_version_check/components/security_patch_upgrade_alert.vue +++ /dev/null @@ -1,76 +0,0 @@ -<script> -import { GlAlert, GlSprintf, GlLink, GlButton } from '@gitlab/ui'; -import { s__ } from '~/locale'; -import Tracking from '~/tracking'; -import { UPGRADE_DOCS_URL, ABOUT_RELEASES_PAGE } from '../constants'; - -export default { - name: 'SecurityPatchUpgradeAlert', - i18n: { - alertTitle: s__('VersionCheck|Critical security upgrade available'), - alertBody: s__( - 'VersionCheck|You are currently on version %{currentVersion}. We strongly recommend upgrading your GitLab installation. %{link}', - ), - learnMore: s__('VersionCheck|Learn more about this critical security release.'), - primaryButtonText: s__('VersionCheck|Upgrade now'), - }, - components: { - GlAlert, - GlSprintf, - GlLink, - GlButton, - }, - mixins: [Tracking.mixin()], - props: { - currentVersion: { - type: String, - required: true, - }, - }, - mounted() { - this.track('render', { - label: 'security_patch_upgrade_alert', - property: this.currentVersion, - }); - }, - methods: { - trackLearnMoreClick() { - this.track('click_link', { - label: 'security_patch_upgrade_alert_learn_more', - property: this.currentVersion, - }); - }, - trackUpgradeNowClick() { - this.track('click_link', { - label: 'security_patch_upgrade_alert_upgrade_now', - property: this.currentVersion, - }); - }, - }, - UPGRADE_DOCS_URL, - ABOUT_RELEASES_PAGE, -}; -</script> - -<template> - <gl-alert :title="$options.i18n.alertTitle" variant="danger" :dismissible="false"> - <gl-sprintf :message="$options.i18n.alertBody"> - <template #currentVersion> - <span class="gl-font-weight-bold">{{ currentVersion }}</span> - </template> - <template #link> - <gl-link :href="$options.ABOUT_RELEASES_PAGE" @click="trackLearnMoreClick">{{ - $options.i18n.learnMore - }}</gl-link> - </template> - </gl-sprintf> - <template #actions> - <gl-button - :href="$options.UPGRADE_DOCS_URL" - variant="confirm" - @click="trackUpgradeNowClick" - >{{ $options.i18n.primaryButtonText }}</gl-button - > - </template> - </gl-alert> -</template> diff --git a/app/assets/javascripts/gitlab_version_check/index.js b/app/assets/javascripts/gitlab_version_check/index.js index edb7e9abe49..dff09d2cb51 100644 --- a/app/assets/javascripts/gitlab_version_check/index.js +++ b/app/assets/javascripts/gitlab_version_check/index.js @@ -1,7 +1,6 @@ import Vue from 'vue'; import { parseBoolean, convertObjectPropsToCamelCase } from '~/lib/utils/common_utils'; import GitlabVersionCheckBadge from './components/gitlab_version_check_badge.vue'; -import SecurityPatchUpgradeAlert from './components/security_patch_upgrade_alert.vue'; import SecurityPatchUpgradeAlertModal from './components/security_patch_upgrade_alert_modal.vue'; const mountGitlabVersionCheckBadge = (el) => { @@ -33,25 +32,6 @@ const mountGitlabVersionCheckBadge = (el) => { } }; -const mountSecurityPatchUpgradeAlert = (el) => { - const { currentVersion } = el.dataset; - - try { - return new Vue({ - el, - render(createElement) { - return createElement(SecurityPatchUpgradeAlert, { - props: { - currentVersion, - }, - }); - }, - }); - } catch { - return null; - } -}; - const mountSecurityPatchUpgradeAlertModal = (el) => { const { currentVersion, version } = el.dataset; @@ -78,16 +58,11 @@ const mountSecurityPatchUpgradeAlertModal = (el) => { export default () => { const renderedApps = []; - const securityPatchUpgradeAlert = document.getElementById('js-security-patch-upgrade-alert'); const securityPatchUpgradeAlertModal = document.getElementById( 'js-security-patch-upgrade-alert-modal', ); const versionCheckBadges = [...document.querySelectorAll('.js-gitlab-version-check-badge')]; - if (securityPatchUpgradeAlert) { - renderedApps.push(mountSecurityPatchUpgradeAlert(securityPatchUpgradeAlert)); - } - if (securityPatchUpgradeAlertModal) { renderedApps.push(mountSecurityPatchUpgradeAlertModal(securityPatchUpgradeAlertModal)); } |