All files / app/assets/javascripts/pipelines/components/pipelines_list nav_controls.vue

100% Statements 3/3
100% Branches 2/2
100% Functions 2/2
100% Lines 3/3

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70  2x                                                                   1x         138x                                                          
<script>
import { GlButton } from '@gitlab/ui';
 
export default {
  name: 'PipelineNavControls',
  components: {
    GlButton,
  },
  props: {
    newPipelinePath: {
      type: String,
      required: false,
      default: null,
    },
 
    resetCachePath: {
      type: String,
      required: false,
      default: null,
    },
 
    ciLintPath: {
      type: String,
      required: false,
      default: null,
    },
 
    isResetCacheButtonLoading: {
      type: Boolean,
      required: false,
      default: false,
    },
  },
  methods: {
    onClickResetCache() {
      this.$emit('resetRunnersCache', this.resetCachePath);
    },
  },
};
</script>
<template>
  <div class="nav-controls">
    <gl-button
      v-if="resetCachePath"
      :loading="isResetCacheButtonLoading"
      class="js-clear-cache"
      data-testid="clear-cache-button"
      @click="onClickResetCache"
    >
      {{ s__('Pipelines|Clear runner caches') }}
    </gl-button>
 
    <gl-button v-if="ciLintPath" :href="ciLintPath" class="js-ci-lint" data-testid="ci-lint-button">
      {{ s__('Pipelines|CI lint') }}
    </gl-button>
 
    <gl-button
      v-if="newPipelinePath"
      :href="newPipelinePath"
      variant="confirm"
      category="primary"
      class="js-run-pipeline"
      data-testid="run-pipeline-button"
      data-qa-selector="run_pipeline_button"
    >
      {{ s__('Pipeline|Run pipeline') }}
    </gl-button>
  </div>
</template>