summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-02-14 22:06:19 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-14 22:06:19 +0000
commita16072c2f88191585b0a69825b4b0fe53984cc80 (patch)
treeacc57b77209fd7a54512e75324b174e4cff6198a /app/assets
parent045e5c9a98f55302c35a50ff184d436ca3c3c0e3 (diff)
downloadgitlab-ce-a16072c2f88191585b0a69825b4b0fe53984cc80.tar.gz
Add latest changes from gitlab-org/gitlab@15-8-stable-ee
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/gitlab_version_check/components/security_patch_upgrade_alert.vue76
-rw-r--r--app/assets/javascripts/gitlab_version_check/index.js25
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));
}