|
74 | 74 | <td v-if="isTerminalCollection() && columnEnabled('duration')" class="table-fit"> |
75 | 75 | <span>{{ duration(flow.started_at || flow.created_at, flow.closed_at || flow.updated_at) }}</span> |
76 | 76 | </td> |
77 | | - |
78 | | - <td v-if="columnEnabled('actions')" class="table-fit text-right"> |
79 | | - <router-link |
80 | | - class="btn btn-outline-secondary btn-sm" |
81 | | - :title="detailActionTitle(flow)" |
82 | | - :to="detailRoute(flow)" |
83 | | - > |
84 | | - {{ detailActionLabel(flow) }} |
85 | | - </router-link> |
86 | | - |
87 | | - <div |
88 | | - v-if="showDetailActionUnavailableState(flow)" |
89 | | - class="small text-muted mt-1" |
90 | | - :title="detailActionTitle(flow)" |
91 | | - > |
92 | | - {{ detailActionUnavailableLabel(flow) }} |
93 | | - </div> |
94 | | - </td> |
95 | 77 | </tr> |
96 | 78 | </template> |
97 | 79 |
|
|
145 | 127 | } |
146 | 128 | }, |
147 | 129 |
|
148 | | - detailAction(flow) { |
149 | | - return flow && flow.detail_action |
150 | | - ? flow.detail_action |
151 | | - : null |
152 | | - }, |
153 | | -
|
154 | | - detailActionLabel(flow) { |
155 | | - const action = this.detailAction(flow) |
156 | | -
|
157 | | - return action && action.label |
158 | | - ? action.label |
159 | | - : 'Run Detail' |
160 | | - }, |
161 | | -
|
162 | | - detailActionTitle(flow) { |
163 | | - const action = this.detailAction(flow) |
164 | | -
|
165 | | - return action && action.description |
166 | | - ? action.description |
167 | | - : 'Open the selected run detail.' |
168 | | - }, |
169 | | -
|
170 | | - showDetailActionUnavailableState(flow) { |
171 | | - const action = this.detailAction(flow) |
172 | | -
|
173 | | - return action |
174 | | - ? action.history_available === false |
175 | | - : !this.hasTypedHistory(flow) |
176 | | - }, |
177 | | -
|
178 | | - detailActionUnavailableLabel(flow) { |
179 | | - const action = this.detailAction(flow) |
180 | | -
|
181 | | - return action && action.unavailable_label |
182 | | - ? action.unavailable_label |
183 | | - : 'No typed history' |
184 | | - }, |
185 | | -
|
186 | | - hasTypedHistory(flow) { |
187 | | - return flow |
188 | | - && flow.history_event_count !== null |
189 | | - && flow.history_event_count !== undefined |
190 | | - && Number(flow.history_event_count) > 0 |
191 | | - }, |
192 | | -
|
193 | 130 | isTerminalCollection() { |
194 | 131 | return ['completed', 'failed', 'cancelled', 'terminated'].includes(this.$route.params.type) |
195 | 132 | }, |
|
0 commit comments