diff options
Diffstat (limited to 'app/assets/javascripts/security_configuration/components/app.vue')
-rw-r--r-- | app/assets/javascripts/security_configuration/components/app.vue | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/app/assets/javascripts/security_configuration/components/app.vue b/app/assets/javascripts/security_configuration/components/app.vue index d0c4ad3646c..34910781247 100644 --- a/app/assets/javascripts/security_configuration/components/app.vue +++ b/app/assets/javascripts/security_configuration/components/app.vue @@ -4,10 +4,9 @@ import { __, s__ } from '~/locale'; import LocalStorageSync from '~/vue_shared/components/local_storage_sync.vue'; import UserCalloutDismisser from '~/vue_shared/components/user_callout_dismisser.vue'; import SectionLayout from '~/vue_shared/security_configuration/components/section_layout.vue'; -import currentLicenseQuery from '~/security_configuration/graphql/current_license.query.graphql'; import AutoDevOpsAlert from './auto_dev_ops_alert.vue'; import AutoDevOpsEnabledAlert from './auto_dev_ops_enabled_alert.vue'; -import { AUTO_DEVOPS_ENABLED_ALERT_DISMISSED_STORAGE_KEY, LICENSE_ULTIMATE } from './constants'; +import { AUTO_DEVOPS_ENABLED_ALERT_DISMISSED_STORAGE_KEY } from './constants'; import FeatureCard from './feature_card.vue'; import TrainingProviderList from './training_provider_list.vue'; import UpgradeBanner from './upgrade_banner.vue'; @@ -51,17 +50,6 @@ export default { TrainingProviderList, }, inject: ['projectFullPath', 'vulnerabilityTrainingDocsPath'], - apollo: { - currentLicensePlan: { - query: currentLicenseQuery, - update({ currentLicense }) { - return currentLicense?.plan; - }, - error() { - this.hasCurrentLicenseFetchError = true; - }, - }, - }, props: { augmentedSecurityFeatures: { type: Array, @@ -96,13 +84,15 @@ export default { required: false, default: '', }, + securityTrainingEnabled: { + type: Boolean, + required: true, + }, }, data() { return { autoDevopsEnabledAlertDismissedProjects: [], errorMessage: '', - currentLicensePlan: '', - hasCurrentLicenseFetchError: false, }; }, computed: { @@ -123,12 +113,6 @@ export default { !this.autoDevopsEnabledAlertDismissedProjects.includes(this.projectFullPath) ); }, - shouldShowVulnerabilityManagementTab() { - // if the query fails (if the plan is `null` also means an error has occurred) we still want to show the feature - const hasQueryError = this.hasCurrentLicenseFetchError || this.currentLicensePlan === null; - - return hasQueryError || this.currentLicensePlan === LICENSE_ULTIMATE; - }, }, methods: { dismissAutoDevopsEnabledAlert() { @@ -270,7 +254,7 @@ export default { </section-layout> </gl-tab> <gl-tab - v-if="shouldShowVulnerabilityManagementTab" + v-if="securityTrainingEnabled" data-testid="vulnerability-management-tab" :title="$options.i18n.vulnerabilityManagement" query-param-value="vulnerability-management" |