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

1.1 KB
Raw Blame
<%=
  render(
    Primer::Alpha::ActionMenu.new(
      select_variant: :single,
      dynamic_label: true,
      anchor_align: :end,
      color: :subtle,
      data: { test_selector: "op-share-dialog-bulk-update-role" }
    )
  ) do |menu|
    menu.with_show_button(scheme: :invisible, color: :subtle, data: { "shares--bulk-selection-target": "bulkUpdateRoleLabel" }) do |button|
      button.with_trailing_action_icon(icon: "triangle-down")
      "Placeholder"
    end

    @available_roles.each do |role_hash|
      menu.with_item(
        label: role_hash[:label],
        href: update_path,
        method: :patch,
        active: false,
        form_arguments: {
          method: :patch,
          name: "role_ids[]",
          value: role_hash[:value],
          data: { "shares--bulk-selection-target": "bulkForm bulkUpdateRoleForm",
                  "role-name": role_hash[:label],
                  "test-selector": "op-share-dialog-bulk-update-role-permission-#{role_hash[:label]}" }
        }
      ) do |item|
        item.with_description.with_content(role_hash[:description])
      end
    end
  end
%>