All files / app/assets/javascripts/projects/compare/components revision_card.vue

100% Statements 4/4
100% Branches 0/0
100% Functions 1/1
100% Lines 4/4

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  2x 2x 2x                                                                             21x                                              
<script>
import { GlCard } from '@gitlab/ui';
import RepoDropdown from './repo_dropdown.vue';
import RevisionDropdown from './revision_dropdown.vue';
 
export default {
  components: {
    RepoDropdown,
    RevisionDropdown,
    GlCard,
  },
  props: {
    refsProjectPath: {
      type: String,
      required: true,
    },
    revisionText: {
      type: String,
      required: true,
    },
    paramsName: {
      type: String,
      required: true,
    },
    paramsBranch: {
      type: String,
      required: false,
      default: null,
    },
    projects: {
      type: Array,
      required: false,
      default: null,
    },
    selectedProject: {
      type: Object,
      required: true,
    },
  },
};
</script>
 
<template>
  <gl-card header-class="gl-py-2 gl-px-3 gl-font-weight-bold" body-class="gl-px-3">
    <template #header>
      {{ s__(`CompareRevisions|${revisionText}`) }}
    </template>
    <div class="gl-sm-display-flex gl-align-items-center">
      <repo-dropdown
        class="gl-sm-w-half"
        :params-name="paramsName"
        :projects="projects"
        :selected-project="selectedProject"
        v-on="$listeners"
      />
      <revision-dropdown
        class="gl-sm-w-half gl-mt-3 gl-sm-mt-0"
        :refs-project-path="refsProjectPath"
        :params-name="paramsName"
        :params-branch="paramsBranch"
        v-on="$listeners"
      />
    </div>
  </gl-card>
</template>