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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Make the Blankslate a BorderBox Row contextually
Aaron Contrerasd96c33bdc720
diff --git a/app/components/work_packages/share/modal_body_component.html.erb b/app/components/work_packages/share/modal_body_component.html.erbindex 91d2a4c4003..02a0e91fad4 100644--- a/app/components/work_packages/share/modal_body_component.html.erb+++ b/app/components/work_packages/share/modal_body_component.html.erb@@ -5,101 +5,101 @@render(WorkPackages::Share::InviteUserFormComponent.new(work_package: @work_package))end- if @shares.blank?- modal_content.with_row(mt: 3) do- render(Primer::Beta::Blankslate.new(border: true)) do |component|- component.with_visual_icon(icon: :people, size: :medium)- component.with_heading(tag: :h2).with_content(I18n.t('work_package.sharing.text_empty_state_header') )- component.with_description do- flex_layout do |flex|- flex.with_row(mb: 2) do- render(Primer::Beta::Text.new(color: :subtle)) { I18n.t('work_package.sharing.text_empty_state_description') }- end+ modal_content.with_row(mt: 3,+ data: { 'test-selector': 'op-share-wp-active-list',+ controller: 'work-packages--share--bulk-selection',+ application_target: 'dynamic' }) do+ render(Primer::Beta::BorderBox.new(list_id: insert_target_modifier_id)) do |border_box|+ border_box.with_header(color: :muted, 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: @shares.size))end- end- end- end- else- modal_content.with_row(mt: 3,- data: { 'test-selector': 'op-share-wp-active-list',- controller: 'work-packages--share--bulk-selection',- application_target: 'dynamic' }) do- render(Primer::Beta::BorderBox.new(list_id: insert_target_modifier_id)) do |border_box|- border_box.with_header(color: :muted, 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: @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,- dynamic_label: true,- color: :muted,- data: { 'test-selector': 'op-share-wp-filter-type' })) do |menu|- menu.with_show_button(scheme: :invisible, color: :muted, data: { 'test-selector': 'op-share-wp-filter-type-button' }) 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+ 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,+ dynamic_label: true,+ color: :muted,+ data: { 'test-selector': 'op-share-wp-filter-type' })) do |menu|+ menu.with_show_button(scheme: :invisible, color: :muted, data: { 'test-selector': 'op-share-wp-filter-type-button' }) 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")endend+ end- header_actions.with_column do- render(Primer::Alpha::ActionMenu.new(anchor_align: :end,- select_variant: :single,- dynamic_label: true,- color: :muted,- data: { 'test-selector': 'op-share-wp-filter-role' })) do |menu|- menu.with_show_button(scheme: :invisible, color: :muted, data: { 'test-selector': 'op-share-wp-filter-role-button' }) 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+ header_actions.with_column do+ render(Primer::Alpha::ActionMenu.new(anchor_align: :end,+ select_variant: :single,+ dynamic_label: true,+ color: :muted,+ data: { 'test-selector': 'op-share-wp-filter-role' })) do |menu|+ menu.with_show_button(scheme: :invisible, color: :muted, data: { 'test-selector': 'op-share-wp-filter-role-button' }) 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")endendendend+ end- header_grid.with_area(:actions,- tag: :div,- hidden: true, # Prevent flicker on initial render- data: { 'work-packages--share--bulk-selection-target': 'bulkActions' }) do- if sharing_manageable?- concat(- render(WorkPackages::Share::BulkPermissionButtonComponent.new(work_package: @work_package))- )+ header_grid.with_area(:actions,+ tag: :div,+ hidden: true, # Prevent flicker on initial render+ data: { 'work-packages--share--bulk-selection-target': 'bulkActions' }) do+ if sharing_manageable?+ concat(+ render(WorkPackages::Share::BulkPermissionButtonComponent.new(work_package: @work_package))+ )- concat(- form_with(url: work_package_shares_bulk_path,- method: :delete,- data: { 'work-packages--share--bulk-selection-target': 'bulkForm' }) do- render(Primer::Beta::Button.new(type: :submit, scheme: :invisible)) { I18n.t('work_package.sharing.remove') }- end- )- end+ concat(+ form_with(url: work_package_shares_bulk_path(@work_package),+ method: :delete,+ data: { 'work-packages--share--bulk-selection-target': 'bulkForm' }) do+ render(Primer::Beta::Button.new(type: :submit, scheme: :invisible)) { I18n.t('work_package.sharing.remove') }+ end+ )endendend+ end+ if @shares.blank?+ border_box.with_row do+ render(Primer::Beta::Blankslate.new) do |component|+ component.with_visual_icon(icon: :people, size: :medium)+ component.with_heading(tag: :h2).with_content(I18n.t('work_package.sharing.text_empty_state_header') )+ component.with_description do+ flex_layout do |flex|+ flex.with_row(mb: 2) do+ render(Primer::Beta::Text.new(color: :subtle)) { I18n.t('work_package.sharing.text_empty_state_description') }+ end+ end+ end+ end+ end+ else@shares.each do |share|render(WorkPackages::Share::ShareRowComponent.new(share: share, container: border_box))enddiff --git a/app/components/work_packages/share/modal_body_component.rb b/app/components/work_packages/share/modal_body_component.rbindex 29f237090a1..d0fe87d3d8a 100644--- a/app/components/work_packages/share/modal_body_component.rb+++ b/app/components/work_packages/share/modal_body_component.rb@@ -93,7 +93,7 @@ module WorkPackagesenddef filter_url(type_option: nil, role_option: nil)- return work_package_shares_path if type_option.nil? && role_option.nil?+ return work_package_shares_path(@work_package) if type_option.nil? && role_option.nil?args = {}filter = []@@ -103,7 +103,7 @@ module WorkPackagesargs[:filters] = filter.to_json unless filter.empty?- work_package_shares_path(args)+ work_package_shares_path(@work_package, **args)enddef apply_role_filter(_option)