Welcome to mirror list, hosted at ThFree Co, Russian Federation.

pipeline_schedules_table.vue « table « components « pipeline_schedules « ci « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 368cfb9c10d9e13786a9bc31d90bef0b8cd3abe6 (plain)
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<script>
import { GlTable } from '@gitlab/ui';
import { s__ } from '~/locale';
import PipelineScheduleActions from './cells/pipeline_schedule_actions.vue';
import PipelineScheduleLastPipeline from './cells/pipeline_schedule_last_pipeline.vue';
import PipelineScheduleNextRun from './cells/pipeline_schedule_next_run.vue';
import PipelineScheduleOwner from './cells/pipeline_schedule_owner.vue';
import PipelineScheduleTarget from './cells/pipeline_schedule_target.vue';

export default {
  i18n: {
    emptyText: s__('PipelineSchedules|No pipeline schedules'),
  },
  fields: [
    {
      key: 'description',
      label: s__('PipelineSchedules|Description'),
      thClass: 'gl-border-t-none!',
      columnClass: 'gl-w-40p',
    },
    {
      key: 'target',
      label: s__('PipelineSchedules|Target'),
      thClass: 'gl-border-t-none!',
      columnClass: 'gl-w-10p',
    },
    {
      key: 'pipeline',
      label: s__('PipelineSchedules|Last Pipeline'),
      thClass: 'gl-border-t-none!',
      columnClass: 'gl-w-10p',
    },
    {
      key: 'next',
      label: s__('PipelineSchedules|Next Run'),
      thClass: 'gl-border-t-none!',
      columnClass: 'gl-w-15p',
    },
    {
      key: 'owner',
      label: s__('PipelineSchedules|Owner'),
      thClass: 'gl-border-t-none!',
      columnClass: 'gl-w-10p',
    },
    {
      key: 'actions',
      label: '',
      thClass: 'gl-border-t-none!',
      columnClass: 'gl-w-15p',
    },
  ],
  components: {
    GlTable,
    PipelineScheduleActions,
    PipelineScheduleLastPipeline,
    PipelineScheduleNextRun,
    PipelineScheduleOwner,
    PipelineScheduleTarget,
  },
  props: {
    schedules: {
      type: Array,
      required: true,
    },
    currentUser: {
      type: Object,
      required: true,
    },
  },
};
</script>

<template>
  <gl-table
    :fields="$options.fields"
    :items="schedules"
    :tbody-tr-attr="{ 'data-testid': 'pipeline-schedule-table-row' }"
    :empty-text="$options.i18n.emptyText"
    show-empty
    stacked="md"
  >
    <template #table-colgroup="{ fields }">
      <col v-for="field in fields" :key="field.key" :class="field.columnClass" />
    </template>

    <template #cell(description)="{ item }">
      <span data-testid="pipeline-schedule-description">
        {{ item.description }}
      </span>
    </template>

    <template #cell(target)="{ item }">
      <pipeline-schedule-target :schedule="item" />
    </template>

    <template #cell(pipeline)="{ item }">
      <pipeline-schedule-last-pipeline :schedule="item" />
    </template>

    <template #cell(next)="{ item }">
      <pipeline-schedule-next-run :schedule="item" />
    </template>

    <template #cell(owner)="{ item }">
      <pipeline-schedule-owner :schedule="item" />
    </template>

    <template #cell(actions)="{ item }">
      <pipeline-schedule-actions
        :schedule="item"
        :current-user="currentUser"
        @showTakeOwnershipModal="$emit('showTakeOwnershipModal', $event)"
        @showDeleteModal="$emit('showDeleteModal', $event)"
        @playPipelineSchedule="$emit('playPipelineSchedule', $event)"
      />
    </template>
  </gl-table>
</template>