pipelines_table.js 1.17 KB
Newer Older
1
import PipelinesTableRowComponent from './pipelines_table_row';
Filipa Lacerda's avatar
Filipa Lacerda committed
2

3
/**
4
 * Pipelines Table Component.
5
 *
6
 * Given an array of objects, renders a table.
7
 */
8 9 10 11 12 13
export default {
  props: {
    pipelines: {
      type: Array,
      required: true,
      default: () => ([]),
Filipa Lacerda's avatar
Filipa Lacerda committed
14 15
    },

16 17 18
    service: {
      type: Object,
      required: true,
Filipa Lacerda's avatar
Filipa Lacerda committed
19
    },
20 21 22 23 24
  },

  components: {
    'pipelines-table-row-component': PipelinesTableRowComponent,
  },
Filipa Lacerda's avatar
Filipa Lacerda committed
25

26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
  template: `
    <table class="table ci-table">
      <thead>
        <tr>
          <th class="js-pipeline-status pipeline-status">Status</th>
          <th class="js-pipeline-info pipeline-info">Pipeline</th>
          <th class="js-pipeline-commit pipeline-commit">Commit</th>
          <th class="js-pipeline-stages pipeline-stages">Stages</th>
          <th class="js-pipeline-date pipeline-date"></th>
          <th class="js-pipeline-actions pipeline-actions"></th>
        </tr>
      </thead>
      <tbody>
        <template v-for="model in pipelines"
          v-bind:model="model">
          <tr is="pipelines-table-row-component"
            :pipeline="model"
            :service="service"></tr>
        </template>
      </tbody>
    </table>
  `,
};