Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Merge branch 'dev' into implementation/50254-filtering-on-share-modal

Aaron Contreras9cb3724acc2a
diff --cc app/components/work_packages/share/modal_body_component.html.erb
index c7de0443bff,d4bb73dc914..7a854d61943
--- a/app/components/work_packages/share/modal_body_component.html.erb
+++ b/app/components/work_packages/share/modal_body_component.html.erb
@@@ -24,57 -24,11 +24,57 @@@
data: { 'test-selector': 'op-share-wp-active-list',
controller: 'work-packages--share--bulk-selection',
application_target: 'dynamic' }) do
- invited_user_list do |border_box|
- border_box.with_header(color: :subtle, pt: 2, pb: 2, data: { 'test-selector': 'op-share-wp-header' }) do
+ border_box_with_id(insert_target_modifier_id) do |border_box|
+ border_box.with_header(color: :subtle, data: { 'test-selector': 'op-share-wp-header' }) do
grid_layout('op-share-wp-modal-body--header', tag: :div, align_items: :center) do |header_grid|
header_grid.with_area(:counter, tag: :div) do
- render(WorkPackages::Share::CounterComponent.new(work_package: @work_package, count: shared_principals.size))
+ render(WorkPackages::Share::CounterComponent.new(work_package: @work_package, count: @shares.size))
+ end
+
+ header_grid.with_area(:actions,
+ tag: :div,
+ data: { 'work-packages--share--bulk-selection-target': 'defaultActions' }) do
+ flex_layout do |header_actions|
+ header_actions.with_column(mr: 2) do
+ render(Primer::Alpha::ActionMenu.new(anchor_align: :end,
+ select_variant: :single,
+ color: :subtle,
+ data: { 'test-selector': 'op-share-wp-filter-type' })) do |menu|
+ menu.with_show_button(scheme: :invisible, color: :subtle) do |button|
+ button.with_trailing_action_icon(icon: "triangle-down")
+ I18n.t('work_package.sharing.filter.type')
+ end
+ type_filter_options.each do |option|
+ menu.with_item(label: option[:label],
+ href: filter_url(type_option: option),
+ method: :get,
+ tag: :a,
+ active: type_filter_option_active?(option),
+ role: "menuitem")
+ end
+ end
+ end
+
+ header_actions.with_column do
+ render(Primer::Alpha::ActionMenu.new(anchor_align: :end,
+ select_variant: :single,
+ color: :subtle,
+ data: { 'test-selector': 'op-share-wp-filter-role' })) do |menu|
+ menu.with_show_button(scheme: :invisible, color: :subtle) do |button|
+ button.with_trailing_action_icon(icon: "triangle-down")
+ I18n.t('work_package.sharing.filter.role')
+ end
+ options.each do |option|
+ menu.with_item(label: option[:label],
+ href: filter_url(role_option: option),
+ method: :get,
+ tag: :a,
+ active: role_filter_option_active?(option),
+ role: "menuitem")
+ end
+ end
+ end
+ end
end
header_grid.with_area(:actions,