[Frontend] Add scan profile actions to security inventory
Designs:
- subgroup menu item
- bulk action menu item
- bulk apply profile (applied for all)
- bulk apply profile (not applied for any)
- bulk apply profile (mixed status)
- tooltips
- confirmation modal
Feature: Add subgroup security configuration action to security inventory
Given a subgroup
Given that when a user takes this action for a subgroup, the action will really be taken for all projects within the subgroup because subgroups cannot have scanner profiles applied directly
Question: Do we plan to support applying scanner profiles to subgroups in the future?
When the user views the security inventory for the parent group of this subgroup
Given can?(current_user, :apply_security_profiles, subgroup)\
- Then the user sees an action called "Manage security scanners for subgroup projects" in the ⋮ menu next to the subgroup
When the user selects this action, open the Edit security scanners for projects drawer with the subgroup selected
Feature: Add bulk security configuration action to security inventory
Given can?(current_user, :apply_security_profiles, subgroup)
Given can?(current_user, :apply_security_profiles, project)
Given the permission booleans for each subgroup and project are included in the API response
- Then the user sees a checkbox next to each subgroup and project to which they can apply profiles
Question: How do we clearly indicate these permissions in the UI? There will be multiple bulk actions ("Edit security attributes" and "Manage security scanners"), so if the user has permission to perform one but not the other, we can't disable the checkboxes next to each subgroup/project. Could we disable the actions in the menu depending on which subgroups/projects are selected?
Given the user has selected subgroups and projects using the checkboxes
- Then the user sees a bulk action called "Manage security scanners"
When the user selects this action, open the Edit security scanners for projects drawer with the subgroups and projects selected
Feature: Edit security scanners for projects drawer
Given a set of selected projects
-
Then the users sees a [Frontend] Component: Scan profile list (#582733) for the selected projects in a drawer called "Edit security scanners for
[project count]projects" -
Then the
profiles_page_views_countmetric is incremented
Question: Do we need to show total project count in the bulk actions and drawer header?
In order to show total project count when this selection includes projects that are indirectly selected because their subgroup is selected, we will need a way to get or calculate it. It cannot be easily calculated on the frontend by adding the counts we already show next to the subgroup name because those counts only include direct descendants and we want the bulk actions to apply to all descendants. With the data from the current query, we could instead show "for [selected count] items" or "for [subgroup count] subgroups and [project count] projects" fairly easily.
When this drawer is closed, return to the security inventory