diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-10 18:13:04 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-05-10 18:13:04 +0300 |
commit | 4e9ceea7f8ff3e097ad45f6f54c1b7165248e848 (patch) | |
tree | 6cc413c085934f15c789d539f69dcb89600c71fb /app/assets/javascripts/environments | |
parent | 0e0df204c1a0d859ccbbe1be83a5e09a53381f17 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/environments')
3 files changed, 22 insertions, 8 deletions
diff --git a/app/assets/javascripts/environments/components/environment_item.vue b/app/assets/javascripts/environments/components/environment_item.vue index 1e9924246b9..1486a66fe13 100644 --- a/app/assets/javascripts/environments/components/environment_item.vue +++ b/app/assets/javascripts/environments/components/environment_item.vue @@ -16,6 +16,7 @@ import CiIcon from '~/vue_shared/components/ci_icon.vue'; import CommitComponent from '~/vue_shared/components/commit.vue'; import TooltipOnTruncate from '~/vue_shared/components/tooltip_on_truncate/tooltip_on_truncate.vue'; import timeagoMixin from '~/vue_shared/mixins/timeago'; +import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import eventHub from '../event_hub'; import ActionsComponent from './environment_actions.vue'; import DeleteComponent from './environment_delete.vue'; @@ -56,7 +57,7 @@ export default { directives: { GlTooltip: GlTooltipDirective, }, - mixins: [timeagoMixin], + mixins: [timeagoMixin, glFeatureFlagsMixin()], props: { model: { @@ -532,6 +533,10 @@ export default { return this.model.metrics_path || ''; }, + canShowMetricsLink() { + return Boolean(!this.glFeatures.removeMonitorMetrics && this.monitoringUrl); + }, + terminalPath() { return this.model?.terminal_path ?? ''; }, @@ -544,7 +549,7 @@ export default { return ( this.actions.length > 0 || this.externalURL || - this.monitoringUrl || + this.canShowMetricsLink || this.canStopEnvironment || this.canDeleteEnvironment || this.canRetry @@ -568,7 +573,7 @@ export default { return Boolean( this.canRetry || this.canShowAutoStopDate || - this.monitoringUrl || + this.canShowMetricsLink || this.terminalPath || this.canDeleteEnvironment, ); @@ -856,10 +861,11 @@ export default { /> <monitoring-button-component - v-if="monitoringUrl" + v-if="canShowMetricsLink" :monitoring-url="monitoringUrl" data-track-action="click_button" data-track-label="environment_monitoring" + data-testid="environment-monitoring" /> <terminal-button-component diff --git a/app/assets/javascripts/environments/components/environments_detail_header.vue b/app/assets/javascripts/environments/components/environments_detail_header.vue index 072c8a08256..1e555347011 100644 --- a/app/assets/javascripts/environments/components/environments_detail_header.vue +++ b/app/assets/javascripts/environments/components/environments_detail_header.vue @@ -4,6 +4,7 @@ import csrf from '~/lib/utils/csrf'; import { __, s__ } from '~/locale'; import TimeAgo from '~/vue_shared/components/time_ago_tooltip.vue'; import timeagoMixin from '~/vue_shared/mixins/timeago'; +import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; import DeleteEnvironmentModal from './delete_environment_modal.vue'; import StopEnvironmentModal from './stop_environment_modal.vue'; @@ -21,7 +22,7 @@ export default { GlModalDirective, GlTooltip, }, - mixins: [timeagoMixin], + mixins: [timeagoMixin, glFeatureFlagsMixin()], props: { environment: { type: Object, @@ -88,6 +89,9 @@ export default { shouldShowTerminalButton() { return this.canAdminEnvironment && this.environment.hasTerminals; }, + shouldShowMetricsButton() { + return Boolean(!this.glFeatures.removeMonitorMetrics && this.shouldShowExternalUrlButton); + }, }, }; </script> @@ -135,7 +139,7 @@ export default { >{{ $options.i18n.externalButtonText }}</gl-button > <gl-button - v-if="shouldShowExternalUrlButton" + v-if="shouldShowMetricsButton" v-gl-tooltip.hover data-testid="metrics-button" :href="metricsPath" diff --git a/app/assets/javascripts/environments/components/new_environment_item.vue b/app/assets/javascripts/environments/components/new_environment_item.vue index ee197bbcd45..912c558c3ce 100644 --- a/app/assets/javascripts/environments/components/new_environment_item.vue +++ b/app/assets/javascripts/environments/components/new_environment_item.vue @@ -133,7 +133,7 @@ export default { return Boolean( this.retryPath || this.canShowAutoStopDate || - this.metricsPath || + this.canShowMetricsLink || this.terminalPath || this.canDeleteEnvironment, ); @@ -157,6 +157,9 @@ export default { metricsPath() { return this.environment?.metricsPath ?? ''; }, + canShowMetricsLink() { + return Boolean(!this.glFeatures.removeMonitorMetrics && this.metricsPath); + }, terminalPath() { return this.environment?.terminalPath ?? ''; }, @@ -307,10 +310,11 @@ export default { /> <monitoring - v-if="metricsPath" + v-if="canShowMetricsLink" :monitoring-url="metricsPath" data-track-action="click_button" data-track-label="environment_monitoring" + data-testid="environment-monitoring" /> <terminal |