Skip to content

Commit 73275ba

Browse files
Move workflows into a tab type, with segmented controls for assignee
1 parent 1f69be7 commit 73275ba

46 files changed

Lines changed: 296 additions & 848 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

app/components/homescreen/blocks/administration.html.erb

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@
2525
<%= link_to t(:label_work_package_status), statuses_path,
2626
title: t(:label_work_package_status) %>
2727
</li>
28-
<li>
29-
<%= link_to t(:label_workflow_plural), workflows_path,
30-
title: t(:label_workflow_plural) %>
31-
32-
</li>
3328
<li>
3429
<%= link_to t("attributes.custom_values"), custom_fields_path,
3530
title: t("attributes.custom_values") %>

app/components/work_package_types/types/row_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def workflow_warning
5858
op_icon("icon3 icon-warning"),
5959
t(:text_type_no_workflow),
6060
" (",
61-
link_to(t(:button_edit), edit_workflow_path(model)),
61+
link_to(t(:button_edit), edit_type_workflow_path(model)),
6262
")"
6363
])
6464
end

app/components/workflows/blankslate_component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ See COPYRIGHT and LICENSE files for more details.
3232
blankslate.with_heading(tag: :h2).with_content(t("admin.workflows.blankslate.title"))
3333
blankslate.with_description_content(t("admin.workflows.blankslate.description"))
3434
blankslate.with_primary_action(
35-
href: helpers.status_dialog_workflow_tab_path(@type, @tab, role_ids: @roles.map(&:id)),
35+
href: helpers.status_dialog_type_workflow_tab_path(@type, @tab, role_ids: @roles.map(&:id)),
3636
scheme: :secondary,
3737
data: { controller: "async-dialog" }
3838
) do |button|

app/components/workflows/page_headers/edit_component.rb

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

app/components/workflows/page_headers/index_component.rb

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

app/components/workflows/page_headers/summary_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
module Workflows::PageHeaders
3232
class SummaryComponent < BaseComponent
3333
def page_breadcrumb
34-
{ href: workflows_path, text: t(:label_workflow_plural) }
34+
{ href: types_path, text: t(:label_type_plural) }
3535
end
3636

3737
def title

app/components/workflows/status_form_component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ See COPYRIGHT and LICENSE files for more details.
2929

3030
<%=
3131
primer_form_with(
32-
url: helpers.confirm_statuses_workflow_tab_path(@type, @tab, role_ids: @roles.map(&:id)),
32+
url: helpers.confirm_statuses_type_workflow_tab_path(@type, @tab, role_ids: @roles.map(&:id)),
3333
method: :post,
3434
id: FORM_ID,
3535
data: { turbo_frame: "workflow-table" }

app/components/workflows/status_matrix_form_component.html.erb

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,17 +74,43 @@ See COPYRIGHT and LICENSE files for more details.
7474
scheme: :secondary,
7575
leading_icon: :plus,
7676
label: t("admin.workflows.status_button"),
77-
href: helpers.status_dialog_workflow_tab_path(@type, @tab, role_ids: @roles.map(&:id), status_ids: @statuses.pluck(:id).presence),
77+
href: helpers.status_dialog_type_workflow_tab_path(@type, @tab, role_ids: @roles.map(&:id), status_ids: @statuses.pluck(:id).presence),
7878
data: { controller: "async-dialog" }
7979
) do
8080
t("admin.workflows.status_button")
8181
end
82+
83+
subheader.with_action_button(
84+
tag: :a,
85+
scheme: :secondary,
86+
leading_icon: :copy,
87+
label: t(:button_copy),
88+
href: helpers.new_type_workflow_copy_path(@type, source_role_id: @roles.first&.id),
89+
aria: { label: t(:button_copy) },
90+
title: t(:button_copy),
91+
data: { controller: "async-dialog", "admin--workflow-checkbox-state-confirmation-trigger": "click" }
92+
) do
93+
t(:button_copy)
94+
end
8295
end
8396
%>
8497

98+
<% transition_tabs = helpers.workflow_tabs(@type) %>
99+
<%= render(Primer::Alpha::SegmentedControl.new("aria-label": t("admin.workflows.tabs.aria_label"), mb: 3)) do |control| %>
100+
<% transition_tabs.each do |tab| %>
101+
<% control.with_item(
102+
tag: :a,
103+
href: tab[:path],
104+
label: helpers.tab_label(tab),
105+
selected: helpers.selected_tab(transition_tabs) == tab,
106+
data: tab[:data]
107+
) %>
108+
<% end %>
109+
<% end %>
110+
85111
<% if @statuses.any? %>
86112
<%= form_tag(
87-
workflow_tab_path(@type),
113+
type_workflow_tab_path(@type),
88114
id: form_id,
89115
method: :patch,
90116
autocomplete: "off",

app/components/workflows/status_matrix_form_component.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def form_id = FORM_ID
5252
def data_attributes
5353
{
5454
controller: "admin--workflow-role-select",
55-
"admin--workflow-role-select-base-url-value": helpers.edit_workflow_tab_path(@type, @tab),
55+
"admin--workflow-role-select-base-url-value": helpers.edit_type_workflow_tab_path(@type, @tab),
5656
"admin--workflow-role-select-current-role-ids-value": @roles.map(&:id),
5757
"admin--workflow-role-select-admin--workflow-checkbox-state-outlet": "##{form_id}"
5858
}

app/components/workflows/status_removal_danger_dialog_component.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ See COPYRIGHT and LICENSE files for more details.
3333
id: DIALOG_ID,
3434
title: t("admin.workflows.statuses_removal_dialog.title"),
3535
confirm_button_text: t("admin.workflows.statuses_removal_dialog.confirm"),
36-
form_arguments: { action: helpers.edit_workflow_tab_path(@type, @tab), method: :get, data: { turbo_frame: "workflow-table" } }
36+
form_arguments: { action: helpers.edit_type_workflow_tab_path(@type, @tab), method: :get, data: { turbo_frame: "workflow-table" } }
3737
)
3838
) do |dialog|
3939
dialog.with_confirmation_message do |message|

0 commit comments

Comments
 (0)