# Feature BNE-3 - Slash command: Link existing work package (size: small-block)

Project: Stream BlockNote extensions
Status: closed
URL: https://community.openproject.org/work_packages/BNE-3

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | 17.0.0 |
| Sprint |  |
| Backlog bucket |  |
| Votes |  |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

| ID | Subject | Status | Decision |
| --- | --- | --- | --- |
| BNE-19 | How can we dynamically update the content if the underlying data changes? | rejected |  |
| BNE-48 | What should the markdown representation be for a rich-linked workpackage? | rejected |  |
| BNE-49 | How can we  implement dark theme for extensions? | decided | Use BlockNotes dark mode colors |

## Features and Chunks

| ID | Subject | Type | Status | Assignee | Target versions | Spent time |
| --- | --- | --- | --- | --- | --- | --- |
| BNE-6 | Style the rich-link workpackage macro (light theme) | Feature | closed |  | 17.0.0 |  |
| BNE-7 | Adjust the data required and persisted by the Block on BlockNote | Implementation | closed |  | 17.0.0 |  |
| BNE-46 | Add capability for translations to the rich-link workpackage macro | Feature | closed |  | 17.0.0 |  |
| BNE-51 | Add status color and type color to work package api | Implementation | rejected |  |  |  |
| BNE-52 | Style the rich-link workpackage macro (dark theme) | Feature | closed |  | 17.0.0 |  |
| BNE-55 | Persist status and type colors of rich link workpackage blocks | Implementation | rejected |  |  |  |
| BNE-57 | Adapt styles and information when user has no permission to see the work package | Feature | closed |  | 17.0.0 |  |
| BNE-58 | Add high contrast color variants for status and type to BlockNote work package link block | Feature | closed |  | 17.0.0 |  |

## Bugs and other work packages

| ID | Type | Subject | Status | Assignee | Target versions | Spent time | Module |
| --- | --- | --- | --- | --- | --- | --- | --- |
| BNE-54 | Bug | It should not be possible to type in our custom BlockNote blocks | closed |  | 17.0.0 |  |  |
| BNE-53 | Bug | Custom slash menu items on BlockNote disappear after a few characters | closed |  | 17.0.0 |  | Modules and project features / Documents |
| BNE-45 | Bug | BlockNote on mobile: input and results are invisible in OpenProject work package search in dark mode | rejected |  | 17.0.0 |  | Modules and project features / Text editor / BlockNoteJS / OpenProject Extensions |
| BNE-65 | Bug | Documents: work package block highlighted after adding | closed |  | Product Backlog |  | Modules and project features / Text editor / BlockNoteJS / OpenProject Extensions |

## Technical Details

| Attribute | Value |
| --- | --- |
| Module | Modules and project features / Documents |
| Feature Flag |  |
| Requires doc change | Yes |
| Enterprise plan |  |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Bruno Pagno |
| Designer | Parimal Satyal |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Estimates and progress

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

## Description

**As** a User  
**I want to** link to workpackages in my text with a rich representation  
**so that** I can get high level workpackage information at a glance from my document

**Acceptance criteria**

  - Invoke via Slash command
    
      - User can type a combination of the three levels to drill down to the command
        
          - Namespace OpenProject (required when used in 3rd party apps like XWiki)
            
              - `openproject`
            
              - `op`
        
          - Namespace Object type work package
            
              - `work package`
            
              - `workpackage`
            
              - `wp`
        
          - Function name
            
              - `link`
        
          - Examples of valid inputs
            
              - `op link`
            
              - `wp link`
            
              - `openproject link`
            
              - `workpackage link`
            
              - `work package link`
            
              - ...

  - ~~It's possible to add work package block by pasting a URL that links to a work package~~ (not part of 17.0) =\> <mention class="mention" data-id="68818" data-type="work_package" data-text="#68818">\#68818</mention>

  - the Block and search are styled according to designs =\> <mention class="mention" data-id="67473" data-type="work_package" data-text="#67473">\#67473</mention>, <mention class="mention" data-id="68978" data-type="work_package" data-text="#68978">\#68978</mention>

  - workpackages are restricted by the users permission. Without permission, a ghost embed is shown instead. => <mention class="mention" data-id="69192" data-type="work_package" data-text="#69192">#69192</mention>

**Technical notes**

  - In the BlockNote document structure the block should hold the following (meta) data
    
      - ~~href: URL (as pasted by the user. Might contain project context, or board, or what not)~~
    
      - ~~canonical\_url: conanical URL (what is that? ask Jens)~~
    
      - ~~type: work\_package\_link~~
    
      - ~~size: small-block~~
    
      - work\_package\_id: the ID
    
    (It can be that a user is only allowed to see the document but not the details about a work package. So we do not want to leak information about the work package in the yDoc for security reasons. Therefore, for now, we decided to only save the ID).
