Skip to content

Commit a080c24

Browse files
authored
Merge pull request #18861 from ncounter/refactoring-click-popover-click
Refactoring workflow run list view
2 parents 9ab1366 + 235eb48 commit a080c24

File tree

3 files changed

+24
-27
lines changed

3 files changed

+24
-27
lines changed
Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,22 @@
1-
.col-auto.text-start
2-
%i{ title: status_title, class: status_icon }
3-
.col.text-start
4-
= link_to "#{hook_event.humanize} event", token_workflow_run_path(token_id, workflow_run)
5-
- if hook_action
6-
%span.ms-2.badge.text-bg-primary= hook_action.humanize
7-
.col.text-start
8-
- if event_source_name
9-
- popover_content = render partial: 'webui/workflow_runs/event_links', locals: { hook_event: hook_event,
10-
formatted_event_source_name: formatted_event_source_name,
11-
event_source_name: event_source_name,
12-
event_source_url: event_source_url }
13-
= link_to formatted_event_source_name, 'javascript:;', { class: 'link-secondary', tabindex: '0',
14-
data: { 'bs-toggle': 'popover', 'bs-html': 'true', 'bs-trigger': 'focus',
15-
'bs-content': popover_content } }
16-
- else
17-
Unknown source
18-
.col.text-end
19-
= workflow_run.created_at
1+
.list-group-item.list-group-item-action
2+
.row.flex-nowrap
3+
.col-auto
4+
%i{ title: status_title, class: status_icon }
5+
.col.col-with-icon
6+
.d-flex.justify-content-between
7+
.px-1
8+
= link_to "#{hook_event.humanize} event:", token_workflow_run_path(token_id, workflow_run)
9+
- if hook_action
10+
%strong= hook_action.humanize
11+
%span= formatted_event_source_name || "Unknown source"
12+
%span
13+
- if event_source_name
14+
- field_to_filter_by = hook_event.in?(['pull_request', 'Merge Request Hook']) ? 'pr_mr' : 'commit_sha'
15+
= link_to event_source_url, { class: 'link-secondary mx-1',
16+
title: "Go to Event Source #{formatted_event_source_name}",
17+
target: '_blank' } do
18+
%i.fa.fa-xs.fa-link.text-secondary
19+
= link_to "?#{field_to_filter_by}=#{event_source_name}", { class: 'link-secondary mx-1', title: "Filter by this Event Source" } do
20+
%i.fa.fa-xs.fa-filter.text-secondary
21+
.px-1
22+
%span= workflow_run.created_at

src/api/app/views/webui/workflow_runs/_event_links.html.haml

Lines changed: 0 additions & 4 deletions
This file was deleted.

src/api/app/views/webui/workflow_runs/index.html.haml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,8 @@
2121
- else
2222
.text-center
2323
%span.ms-3= page_entries_info(@workflow_runs)
24-
.pt-3#workflow-runs
24+
.p-3#workflow-runs
2525
- @workflow_runs.each do |workflow_run|
2626
.border-bottom.py-2{ id: "workflow-run-heading#{workflow_run.id}" }
27-
.mb-0
28-
.row
29-
= render(WorkflowRunRowComponent.new(workflow_run: workflow_run, token_id: @token.id))
27+
= render(WorkflowRunRowComponent.new(workflow_run: workflow_run, token_id: @token.id))
3028
= paginate @workflow_runs, views_prefix: 'webui'

0 commit comments

Comments
 (0)