diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/monitoring/components/charts/time_series.vue | 22 | ||||
-rw-r--r-- | app/assets/javascripts/monitoring/components/dashboard.vue | 7 | ||||
-rw-r--r-- | app/assets/stylesheets/pages/prometheus.scss | 11 | ||||
-rw-r--r-- | app/models/project.rb | 2 | ||||
-rw-r--r-- | app/services/projects/destroy_service.rb | 4 | ||||
-rw-r--r-- | app/services/projects/hashed_storage/base_repository_service.rb | 10 |
6 files changed, 36 insertions, 20 deletions
diff --git a/app/assets/javascripts/monitoring/components/charts/time_series.vue b/app/assets/javascripts/monitoring/components/charts/time_series.vue index 04aced985c8..76fb35aaa78 100644 --- a/app/assets/javascripts/monitoring/components/charts/time_series.vue +++ b/app/assets/javascripts/monitoring/components/charts/time_series.vue @@ -1,6 +1,6 @@ <script> import { s__, __ } from '~/locale'; -import { GlLink, GlButton } from '@gitlab/ui'; +import { GlLink, GlButton, GlTooltip } from '@gitlab/ui'; import { GlAreaChart, GlLineChart, GlChartSeriesLabel } from '@gitlab/ui/dist/charts'; import dateFormat from 'dateformat'; import { debounceByAnimationFrame, roundOffFloat } from '~/lib/utils/common_utils'; @@ -16,6 +16,7 @@ export default { components: { GlAreaChart, GlLineChart, + GlTooltip, GlButton, GlChartSeriesLabel, GlLink, @@ -72,6 +73,7 @@ export default { isDeployment: false, sha: '', }, + showTitleTooltip: false, width: 0, height: chartHeight, svgs: {}, @@ -202,6 +204,12 @@ export default { watch: { containerWidth: 'onResize', }, + mounted() { + const graphTitleEl = this.$refs.graphTitle; + if (graphTitleEl && graphTitleEl.scrollWidth > graphTitleEl.offsetWidth) { + this.showTitleTooltip = true; + } + }, beforeDestroy() { window.removeEventListener('resize', debouncedResize); }, @@ -265,8 +273,16 @@ export default { <template> <div class="prometheus-graph"> <div class="prometheus-graph-header"> - <h5 class="prometheus-graph-title js-graph-title">{{ graphData.title }}</h5> - <div class="prometheus-graph-widgets js-graph-widgets"> + <h5 + ref="graphTitle" + class="prometheus-graph-title js-graph-title text-truncate append-right-8" + > + {{ graphData.title }} + </h5> + <gl-tooltip :target="() => $refs.graphTitle" :disabled="!showTitleTooltip"> + {{ graphData.title }} + </gl-tooltip> + <div class="prometheus-graph-widgets js-graph-widgets flex-fill"> <slot></slot> </div> </div> diff --git a/app/assets/javascripts/monitoring/components/dashboard.vue b/app/assets/javascripts/monitoring/components/dashboard.vue index b5ed54a6e25..084f736911f 100644 --- a/app/assets/javascripts/monitoring/components/dashboard.vue +++ b/app/assets/javascripts/monitoring/components/dashboard.vue @@ -475,7 +475,10 @@ export default { :project-path="projectPath" group-id="monitor-time-series-chart" > - <div class="d-flex align-items-center"> + <div + class="d-flex align-items-center" + :class="alertWidgetAvailable ? 'justify-content-between' : 'justify-content-end'" + > <alert-widget v-if="alertWidgetAvailable && graphData" :modal-id="`alert-modal-${index}-${graphIndex}`" @@ -486,7 +489,7 @@ export default { /> <gl-dropdown v-gl-tooltip - class="mx-2" + class="ml-2 mr-3" toggle-class="btn btn-transparent border-0" :right="true" :no-caret="true" diff --git a/app/assets/stylesheets/pages/prometheus.scss b/app/assets/stylesheets/pages/prometheus.scss index 72f1b5307ec..245efd91ec8 100644 --- a/app/assets/stylesheets/pages/prometheus.scss +++ b/app/assets/stylesheets/pages/prometheus.scss @@ -39,11 +39,14 @@ align-items: center; justify-content: space-between; margin-bottom: $gl-padding-8; +} - h5 { - font-size: $gl-font-size-large; - margin: 0; - } +.prometheus-graph-title { + font-size: $gl-font-size-large; +} + +.alert-current-setting { + max-width: 240px; } .prometheus-graph-cursor { diff --git a/app/models/project.rb b/app/models/project.rb index 29fe9aad62a..9bd9f969331 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -2312,7 +2312,7 @@ class Project < ApplicationRecord end def repository_with_same_path_already_exists? - gitlab_shell.exists?(repository_storage, "#{disk_path}.git") + gitlab_shell.repository_exists?(repository_storage, "#{disk_path}.git") end def set_timestamps_for_create diff --git a/app/services/projects/destroy_service.rb b/app/services/projects/destroy_service.rb index 5fdf98c3c5e..90e703e7050 100644 --- a/app/services/projects/destroy_service.rb +++ b/app/services/projects/destroy_service.rb @@ -123,11 +123,9 @@ module Projects mv_repository(old_path, new_path) end - # rubocop: disable CodeReuse/ActiveRecord def repo_exists?(path) - gitlab_shell.exists?(project.repository_storage, path + '.git') + gitlab_shell.repository_exists?(project.repository_storage, path + '.git') end - # rubocop: enable CodeReuse/ActiveRecord def mv_repository(from_path, to_path) return true unless repo_exists?(from_path) diff --git a/app/services/projects/hashed_storage/base_repository_service.rb b/app/services/projects/hashed_storage/base_repository_service.rb index f97a28b8c3b..b7e9d3e8791 100644 --- a/app/services/projects/hashed_storage/base_repository_service.rb +++ b/app/services/projects/hashed_storage/base_repository_service.rb @@ -20,16 +20,13 @@ module Projects protected - # rubocop: disable CodeReuse/ActiveRecord def has_wiki? - gitlab_shell.exists?(project.repository_storage, "#{old_wiki_disk_path}.git") + gitlab_shell.repository_exists?(project.repository_storage, "#{old_wiki_disk_path}.git") end - # rubocop: enable CodeReuse/ActiveRecord - # rubocop: disable CodeReuse/ActiveRecord def move_repository(from_name, to_name) - from_exists = gitlab_shell.exists?(project.repository_storage, "#{from_name}.git") - to_exists = gitlab_shell.exists?(project.repository_storage, "#{to_name}.git") + from_exists = gitlab_shell.repository_exists?(project.repository_storage, "#{from_name}.git") + to_exists = gitlab_shell.repository_exists?(project.repository_storage, "#{to_name}.git") # If we don't find the repository on either original or target we should log that as it could be an issue if the # project was not originally empty. @@ -46,7 +43,6 @@ module Projects gitlab_shell.mv_repository(project.repository_storage, from_name, to_name) end - # rubocop: enable CodeReuse/ActiveRecord def rollback_folder_move move_repository(new_disk_path, old_disk_path) |