Previews

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
<%= render(Primer::Beta::NavList.new(aria: { label: "Workflow results" })) do |list| %>
<% list.with_group do |group| %>
<% group.with_heading(title: "Workflows") %>
<% group.with_item(label: "Build and Test", href: "/workflows/1") do |item| %>
<%= item.with_trailing_action(icon: :sync, aria: { label: "Build and test: re-run workflow" }, name: "build_and_test_button") %>
<% end %>
<% group.with_item(label: "Publish", href: "/workflows/2") do |item| %>
<%= item.with_trailing_action(icon: :sync, aria: { label: "Publish: re-run workflow" }, name: "publish_button") %>
<% end %>
<% end %>
<% end %>
<script type="text/javascript" data-eval="true">
const breadButton = document.querySelector("[name=build_and_test_button]")
breadButton.addEventListener("click", () => alert("The 'Build and Test' workflow will be re-run."))
const cheeseButton = document.querySelector("[name=publish_button]")
cheeseButton.addEventListener("click", () => alert("The 'Publish' workflow will be re-run."))
</script>