# Epic DREAM-745 - Simplify selection, creation and usage of project and work package attributes macros

Project: Stream Design System
Status: in specification
URL: https://community.openproject.org/work_packages/DREAM-745

## Detailed specification

### Motivation and background information

**As** a project manager that is working according to PM²/PMflex  
**I want to** have a gui to select project attributes to add them to textfields  
**so that** easily add project attributes to agenda items and wiki pages

### Acceptance criteria

*   Macros for project attributes and work package attributes can be creating via a GUI
    
*   The macros automatically extend to their display representation showing the actual value not a tech syntax
    
*   open: There is a way to modify the values of an attribute direclty via InplaceEditFields

### Out of scope

*   Macros should still work when I rename the attribute

| Attribute | Value |
| --- | --- |
| Mockups |  |

## Planning

| Attribute | Value |
| --- | --- |
| Roadmap |  |
| Date |  |
| Votes |  |
| List |  |
| Target versions | Product Backlog |
| Sprint |  |
| Backlog bucket |  |
| Relevance |  |

## Subitems

| ID | Type | Subject | Status | Assignee | Target versions | Project | Priority | Spent time |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| DREAM-764 | Feature | Simple selection of workPackage and project attributes for macros | specified |  | Product Backlog | Stream Design System | Medium |  |
| DREAM-765 | Feature | Automatically extend workPackage and project attribute macros | specified |  | Product Backlog | Stream Design System | Medium |  |
| DREAM-766 | Feature | Show inplaceEdit fields for rendered project attribute macros  | in specification | Henriette Darge | Product Backlog | Stream Design System | Medium |  |

## Bugs and other work packages

_No work packages_

## Details

| Attribute | Value |
| --- | --- |
| Module | Modules and project features / Text editor, Modules and project features / Project attributes, Frontend components and Primer design system / Inplace edit fields |
| Enterprise plan |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee | Henriette Darge |
| Accountable | Niels Lindenthal |
| Product manager |  |
| Designer | Parimal Satyal |
| Developers | OP Dev Dream Team |
| Requested by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| Work |  |

## Description

**As** a project manager that is working according to PM²/PMflex  
**I want to** have a gui to select project attributes to add them to textfields  
**so that** easily add project attributes to agenda items and wiki pages

# **Roadmap**

The whole proces for creating, displaying and reading macros for workPackage and project attributes gets simplified. 

## **Step 1 - Simplify the creation**

<mention class="mention" data-id="77327" data-type="work_package" data-text="###DREAM-764" data-display-id="DREAM-764">\#\#\#DREAM-764</mention>

**Acceptance criteria**

*   The &quot;+ Insert&quot; of the CkEditor menu gets two new options:
    
    *   &quot;Project attribute&quot;
        
    *   &quot;Work package attribute&quot;
        
*   Clicking &#x27;Project attribute&#x27; opens a dialog with two fields:
    
    *   Project, with an auto-complete (defaults to current project but editable)
        
    *   Project attribute, with an autocomplete (empty by default)
        
        *   This lists only active project attributes for the selected project
            
        *   It is a single select
            
    *   There are two buttons in the footer:
        
        *   Cancel (secondary)
            
        *   Add (primary)
            
*   Clicking &#x27;Work package attribute&#x27; opens a dialog with two fields:
    
    *   _\[open\] Is this possible to do this within a single dialog? Else we can split it to two dialogs._
        
    *   Work package&#x27; with an auto-complete (empty by default)
        
    *   Work package attribute, with an autocomplete (empty by default)
        
        *   This lists only work package attributes available for that work package
            
        *   It is a single select
            
    *   There are two buttons in the footer:
        
        *   Cancel (secondary)
            
        *   Add (primary)
            
*   After adding an attribute using the dialog, the macro syntax (e.g. `projectValue:id:version`) gets rendered in the current cursor position within the CkEditor as normal text.

<br>

## Step 2 - Simplify reading the macros

<mention class="mention" data-id="77328" data-type="work_package" data-text="###DREAM-765" data-display-id="DREAM-765">\#\#\#DREAM-765</mention>

**Acceptance criteria**

*   For project attribute and work package attribute macros:
    
    *   If the macro is added via the macro insert dialog, automatically resolve the syntax to an actual macro (with real values)
        
    *   If the user types manually and does not use auto-completele (or autocomplete is not available), do not resolve whilst in edit mode; only resolve on save
        
    *   _\[open\] If we are able get a list of the available project attributes for a selected project or available work package attributes for a selected WP ID:_
        
        *   As the user manually types the macro, provide code-completiion-like auto-complete (eg. typing `projectValue:{id}:` will display an autocomplete that displays available project attributes for the selected project)&nbsp;
            
            *   Once the user selects a value, resolve the syntax to the actual macro

<br>

## Step 3 - Allowing direct edits of fields inserted via a macro (tbd)

<mention class="mention" data-id="77329" data-type="work_package" data-text="###DREAM-766" data-display-id="DREAM-766">\#\#\#DREAM-766</mention>

**Acceptance criteria**

*   When saving the a CkEditor and switching it to display mode, project attribute macros get replaced by an `InplaceEditField`, allowing users with certain permissions to edit it directly
    

**Out of scope**

*   Nested inplaceEditFields don&#x27;t have to work. They can be read-only when the project attribute is rendered within another inplaceEdit field,
    
    *   e.g the angular inplace edit fields (like the WP description)
        
    *   e.g. using the macro within the project description

## **Out of scope**

  - Renaming a project attribute does not break the macro integration.

<br>
