Commit 59814bbf authored by Jose Ivan Vargas's avatar Jose Ivan Vargas

Merge branch '296606-use-gl-badge-in-pipeline-url-component' into 'master'

Use GlBadge for badges in pipeline_url.vue

See merge request gitlab-org/gitlab!51058
parents 53b4b26f 1b897409
<script> <script>
import { GlLink, GlPopover, GlSprintf, GlTooltipDirective } from '@gitlab/ui'; import { GlLink, GlPopover, GlSprintf, GlTooltipDirective, GlBadge } from '@gitlab/ui';
import { SCHEDULE_ORIGIN } from '../../constants'; import { SCHEDULE_ORIGIN } from '../../constants';
export default { export default {
...@@ -7,6 +7,7 @@ export default { ...@@ -7,6 +7,7 @@ export default {
GlLink, GlLink,
GlPopover, GlPopover,
GlSprintf, GlSprintf,
GlBadge,
}, },
directives: { directives: {
GlTooltip: GlTooltipDirective, GlTooltip: GlTooltipDirective,
...@@ -57,46 +58,49 @@ export default { ...@@ -57,46 +58,49 @@ export default {
</gl-link> </gl-link>
<div class="label-container"> <div class="label-container">
<gl-link v-if="isScheduled" :href="pipelineScheduleUrl" target="__blank"> <gl-link v-if="isScheduled" :href="pipelineScheduleUrl" target="__blank">
<span <gl-badge
v-gl-tooltip v-gl-tooltip
:title="__('This pipeline was triggered by a schedule.')" :title="__('This pipeline was triggered by a schedule.')"
class="badge badge-info" variant="info"
size="sm"
data-testid="pipeline-url-scheduled" data-testid="pipeline-url-scheduled"
>{{ __('Scheduled') }}</span >{{ __('Scheduled') }}</gl-badge
> >
</gl-link> </gl-link>
<span <gl-badge
v-if="pipeline.flags.latest" v-if="pipeline.flags.latest"
v-gl-tooltip v-gl-tooltip
:title="__('Latest pipeline for the most recent commit on this branch')" :title="__('Latest pipeline for the most recent commit on this branch')"
class="badge badge-success" variant="success"
size="sm"
data-testid="pipeline-url-latest" data-testid="pipeline-url-latest"
>{{ __('latest') }}</span >{{ __('latest') }}</gl-badge
> >
<span <gl-badge
v-if="pipeline.flags.yaml_errors" v-if="pipeline.flags.yaml_errors"
v-gl-tooltip v-gl-tooltip
:title="pipeline.yaml_errors" :title="pipeline.yaml_errors"
class="badge badge-danger" variant="danger"
size="sm"
data-testid="pipeline-url-yaml" data-testid="pipeline-url-yaml"
>{{ __('yaml invalid') }}</span >{{ __('yaml invalid') }}</gl-badge
> >
<span <gl-badge
v-if="pipeline.flags.failure_reason" v-if="pipeline.flags.failure_reason"
v-gl-tooltip v-gl-tooltip
:title="pipeline.failure_reason" :title="pipeline.failure_reason"
class="badge badge-danger" variant="danger"
size="sm"
data-testid="pipeline-url-failure" data-testid="pipeline-url-failure"
>{{ __('error') }}</span >{{ __('error') }}</gl-badge
> >
<gl-link <gl-link
v-if="pipeline.flags.auto_devops" v-if="pipeline.flags.auto_devops"
:id="`pipeline-url-autodevops-${pipeline.id}`" :id="`pipeline-url-autodevops-${pipeline.id}`"
tabindex="0" tabindex="0"
class="badge badge-info autodevops-badge"
data-testid="pipeline-url-autodevops" data-testid="pipeline-url-autodevops"
role="button" role="button"
>{{ __('Auto DevOps') }}</gl-link ><gl-badge variant="info" size="sm">{{ __('Auto DevOps') }}</gl-badge></gl-link
> >
<gl-popover <gl-popover
:target="`pipeline-url-autodevops-${pipeline.id}`" :target="`pipeline-url-autodevops-${pipeline.id}`"
...@@ -122,13 +126,14 @@ export default { ...@@ -122,13 +126,14 @@ export default {
__('Learn more about Auto DevOps') __('Learn more about Auto DevOps')
}}</gl-link> }}</gl-link>
</gl-popover> </gl-popover>
<span <gl-badge
v-if="pipeline.flags.stuck" v-if="pipeline.flags.stuck"
class="badge badge-warning" variant="warning"
size="sm"
data-testid="pipeline-url-stuck" data-testid="pipeline-url-stuck"
>{{ __('stuck') }}</span >{{ __('stuck') }}</gl-badge
> >
<span <gl-badge
v-if="pipeline.flags.detached_merge_request_pipeline" v-if="pipeline.flags.detached_merge_request_pipeline"
v-gl-tooltip v-gl-tooltip
:title=" :title="
...@@ -136,17 +141,19 @@ export default { ...@@ -136,17 +141,19 @@ export default {
'Pipelines for merge requests are configured. A detached pipeline runs in the context of the merge request, and not against the merged result. Learn more in the documentation for Pipelines for Merged Results.', 'Pipelines for merge requests are configured. A detached pipeline runs in the context of the merge request, and not against the merged result. Learn more in the documentation for Pipelines for Merged Results.',
) )
" "
class="badge badge-info" variant="info"
size="sm"
data-testid="pipeline-url-detached" data-testid="pipeline-url-detached"
>{{ __('detached') }}</span >{{ __('detached') }}</gl-badge
> >
<span <gl-badge
v-if="isInFork" v-if="isInFork"
v-gl-tooltip v-gl-tooltip
:title="__('Pipeline ran in fork of project')" :title="__('Pipeline ran in fork of project')"
class="badge badge-info" variant="info"
size="sm"
data-testid="pipeline-url-fork" data-testid="pipeline-url-fork"
>{{ __('fork') }}</span >{{ __('fork') }}</gl-badge
> >
</div> </div>
</div> </div>
......
---
title: Use GlBadge for badges in pipeline_url.vue
merge_request: 51058
author: Kev @KevSlashNull
type: changed
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment