diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-16 18:07:32 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-03-16 18:07:32 +0300 |
commit | db19df23733c768c564534a09de2e6718097ec95 (patch) | |
tree | f148eb0723f20a2442e0274089d567e1810ee8d2 /app/assets/javascripts/runner | |
parent | d2199d74936cd5cb9f45f569f723a5370ae5013e (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/assets/javascripts/runner')
3 files changed, 15 insertions, 17 deletions
diff --git a/app/assets/javascripts/runner/components/runner_pause_button.vue b/app/assets/javascripts/runner/components/runner_pause_button.vue index a1901c55e61..c88634bfbd9 100644 --- a/app/assets/javascripts/runner/components/runner_pause_button.vue +++ b/app/assets/javascripts/runner/components/runner_pause_button.vue @@ -3,7 +3,7 @@ import { GlButton, GlTooltipDirective } from '@gitlab/ui'; import runnerToggleActiveMutation from '~/runner/graphql/shared/runner_toggle_active.mutation.graphql'; import { createAlert } from '~/flash'; import { captureException } from '~/runner/sentry_utils'; -import { I18N_PAUSE, I18N_RESUME } from '../constants'; +import { I18N_PAUSE, I18N_PAUSE_TOOLTIP, I18N_RESUME, I18N_RESUME_TOOLTIP } from '../constants'; export default { name: 'RunnerPauseButton', @@ -52,11 +52,10 @@ export default { return null; }, tooltip() { - // Only show tooltip when compact. - // Also prevent a "sticky" tooltip: If this button is - // disabled, mouseout listeners don't run leaving the tooltip stuck - if (this.compact && !this.updating) { - return this.label; + // Prevent a "sticky" tooltip: If this button is disabled, + // mouseout listeners don't run leaving the tooltip stuck + if (!this.updating) { + return this.isActive ? I18N_PAUSE_TOOLTIP : I18N_RESUME_TOOLTIP; } return ''; }, @@ -102,7 +101,7 @@ export default { <template> <gl-button - v-gl-tooltip.hover.viewport="tooltip" + v-gl-tooltip="tooltip" v-bind="$attrs" :aria-label="ariaLabel" :icon="icon" diff --git a/app/assets/javascripts/runner/components/runner_paused_badge.vue b/app/assets/javascripts/runner/components/runner_paused_badge.vue index d1e6fa05e4d..27618290ce6 100644 --- a/app/assets/javascripts/runner/components/runner_paused_badge.vue +++ b/app/assets/javascripts/runner/components/runner_paused_badge.vue @@ -1,6 +1,6 @@ <script> import { GlBadge, GlTooltipDirective } from '@gitlab/ui'; -import { I18N_PAUSED_RUNNER_DESCRIPTION } from '../constants'; +import { I18N_PAUSED_DESCRIPTION } from '../constants'; export default { components: { @@ -9,17 +9,11 @@ export default { directives: { GlTooltip: GlTooltipDirective, }, - i18n: { - I18N_PAUSED_RUNNER_DESCRIPTION, - }, + I18N_PAUSED_DESCRIPTION, }; </script> <template> - <gl-badge - v-gl-tooltip="$options.i18n.I18N_PAUSED_RUNNER_DESCRIPTION" - variant="danger" - v-bind="$attrs" - > + <gl-badge v-gl-tooltip="$options.I18N_PAUSED_DESCRIPTION" variant="danger" v-bind="$attrs"> {{ s__('Runners|paused') }} </gl-badge> </template> diff --git a/app/assets/javascripts/runner/constants.js b/app/assets/javascripts/runner/constants.js index 7ac19210fb1..bd5be2175ad 100644 --- a/app/assets/javascripts/runner/constants.js +++ b/app/assets/javascripts/runner/constants.js @@ -37,13 +37,18 @@ export const I18N_STALE_RUNNER_DESCRIPTION = s__( // Actions export const I18N_EDIT = __('Edit'); + export const I18N_PAUSE = __('Pause'); +export const I18N_PAUSE_TOOLTIP = s__('Runners|Pause from accepting jobs'); +export const I18N_PAUSED_DESCRIPTION = s__('Runners|Not accepting jobs'); + export const I18N_RESUME = __('Resume'); +export const I18N_RESUME_TOOLTIP = s__('Runners|Resume accepting jobs'); + export const I18N_DELETE_RUNNER = s__('Runners|Delete runner'); export const I18N_DELETED_TOAST = s__('Runners|Runner %{name} was deleted'); export const I18N_LOCKED_RUNNER_DESCRIPTION = s__('Runners|You cannot assign to other projects'); -export const I18N_PAUSED_RUNNER_DESCRIPTION = s__('Runners|Not available to run jobs'); // Runner details |