# Feature OP-9907 - Include projects - Select all sub-projects

Project: OpenProject
Status: closed
URL: https://community.openproject.org/work_packages/OP-9907

## Planning

| Attribute | Value |
| --- | --- |
| Date | 2022-01-11 – 2022-02-25 |
| Priority | Medium |
| Target versions | 12.1.0 |
| Sprint | 12.1.0 |
| Backlog bucket |  |
| Votes |  |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module |  |
| Feature Flag |  |
| Requires doc change | Yes |
| Enterprise plan |  |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Found in mobile app version |  |
| Follow-up feedback e-mail |  |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers |  |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

**As** a team member  
**I want to** (un)select all sub-projects from projects in the include projects modal   
**so that** I don't need to select manually all the sub-projects bellow one project. And also I assure all sub-projects created afterwards in this project will be automatically added.

**Acceptance criteria**

A checkbox appears on the action bar of the modal that enables select all the sub-projects from all parent project. This selection then will force that all the sub-projects bellow a parent project selected will be checked and not able to unselect.  
By default the current project will always be selected (and in the case of include all sub-projects selected also its sub-projects).

<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/30061/content"></div></figure>

<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/30062/content"></div></figure>

When the checkbox is unselected the user is able to chose manually which projects and sub-projects can be included.

<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/30060/content"></div></figure>

For user support reasons while hovering on top of an inactive checkmark (can't be unchecked) a tooltip will be displayed explaining why:

<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/30063/content"></div></figure>

<figure class="image op-uc-figure" style="width:75%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/30064/content"></div></figure>

### Cases:

  - **Creation of a new sub-project:** when a new sub-project is created under a selected parent in the view, only in case of having the "Include all sub-projects" checkmark selected this sub-project will automatically also be selected.
  - **Administration "sub-project" setting:** when in the "Administration\>Work packages" the select all sub-projects setting is active by default the "Include all sub-projects" checkmark will be selected in the modal (the user will still able to uncheck it).
  - **Unmark "Include all sub-projects" after selecting some parents:** In case of selecting some parents while having the "Include all sub-projects" checkmark selected and then unselect it, all the sub-projects will come back to the previous selection status before the "Include all sub-projects" selection.

### Mobile:

For the mobile view the action bar will need to be divided in two lines:

<figure class="image op-uc-figure" style="width:50%;"><div class="op-uc-figure--content"><img class="op-uc-image" src="/api/v3/attachments/30065/content"></div></figure>

### Figma Links:

<https://www.figma.com/file/rddHeKCAkJo2MNI2zktSaR/Include-Projects?node-id=309%3A35574>

### Implementation notes

  - Backend:
      - Add new attribute to the query "subproject\_context: true/false" to model and API
      - Add migration, take over value of existing global subproject include into that new field
  - Frontend:
      - Link checkbox with the subproject\_context state
      - Only submit the "truly" selected projects
