# Epic OP-9987 - Add and remove links to files in Nextcloud in the work packages details view  

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

## Detailed specification

### Motivation and background information

### Acceptance criteria

### Out of scope

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

## Planning

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

## Subitems

| ID | Type | Subject | Status | Assignee | Target versions | Project | Priority | Spent time |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| OP-10893 | Feature | Delete/Unlink modal | closed |  | 12.3.0 | OpenProject | Medium |  |
| OP-10871 | Feature | Include nextcloud and attachments empty status drag and drop area | closed |  | 12.5.0 | OpenProject | Medium |  |
| OP-10872 | Feature | Make attachment lists and file link lists drop zones | closed |  | 12.5.0 | OpenProject | Medium |  |
| OP-10873 | Feature | Upload or link Nextcloud files from within the work package creation form | closed |  | 12.5.0 | OpenProject | Medium |  |
| OP-10889 | Feature | File picker | closed |  | 12.5.0 | OpenProject | Medium |  |
| OP-10890 | Feature | Location picker | closed |  | 12.5.0 | OpenProject | Medium |  |
| OP-10891 | Feature | Upload files to Nextcloud from within OpenProject | closed |  | 12.5.0 | OpenProject | Medium |  |
| OP-10892 | Feature | Link existing Nextcloud files from within OpenProject | closed |  | 12.5.0 | OpenProject | Medium |  |
| OP-10074 | Feature | Form for copying a work package shall also lists file links (file links without container) | on hold |  | Wish List | OpenProject | Medium |  |
| OP-11900 | Feature | Hover actions in the file/location picker | specified |  | Wish List | OpenProject | Medium |  |

## Bugs and other work packages

| ID | Type | Subject | Status | Assignee | Target versions | Module |
| --- | --- | --- | --- | --- | --- | --- |
| OP-11521 | Bug | Concept and navigation changes on the file picker modal | closed |  | 12.5.0 |  |

## Details

| Attribute | Value |
| --- | --- |
| Module |  |
| Enterprise plan |  |
| Labels |  |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable | Wieland Lindenthal |
| Product manager |  |
| Designer | Marc Alcobé |
| Developers |  |
| Requested by |  |
| Interest by |  |

## Estimates and progress

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

## Description

### Use cases:

  - Make uploading and linking files from an empty status (FEATURE <mention class="mention" data-id="43576" data-type="work_package" data-text="#43576">\#43576</mention>).
  - Create a link between a work package and an existing file in Nextcloud (FEATURE <mention class="mention" data-id="43657" data-type="work_package" data-text="#43657">\#43657</mention>).
      - Chose a file from Nextcloud via a *file picker (FEATURE <mention class="mention" data-id="43654" data-type="work_package" data-text="#43654">\#43654</mention>)*
      - Create a *file link* between the work package and the file
  - Upload a file from within a work package in OpenProject (FEATURE <mention class="mention" data-id="43656" data-type="work_package" data-text="#43656">\#43656</mention>).
      - Chose a location in Nextcloud via a *location picker (FEATURE* <mention class="mention" data-id="43655" data-type="work_package" data-text="#43655">\#43655</mention>*)*
      - Save the file in Nextcloud
      - Create a *file link* between the work package and the file
  - Delete *file links* from a work package without deleting the files in Nextcloud (related to feature <mention class="mention" data-id="43663" data-type="work_package" data-text="#43663">\#43663</mention>).
  - Allow users to drag and drop files in both attachments and Nextcloud (FEATURE <mention class="mention" data-id="43577" data-type="work_package" data-text="#43577">\#43577</mention>).
  - Make the previous use cases available through work package copy and creation (FEATURE <mention class="mention" data-id="43578" data-type="work_package" data-text="#43578">\#43578</mention> and <mention class="mention" data-id="41524" data-type="work_package" data-text="#41524">\#41524</mention>).

### Generic visuals

<img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37295/content"><img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37296/content"><img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37298/content"><img class="op-uc-image op-uc-image_inline" src="/api/v3/attachments/37299/content">

### 

### Implementation chunks:

  - File picker for selecting link targets (files and directories). Queries Nextcloud with the user's access token (probably via WebDAV). Tunneled through OpenProject backend.
  - Location picker for upload targets (a target is always a directory). Queries Nextcloud with the user's access token (probably via WebDAV). Tunneled through OpenProject backend.
  - If possible, direct upload of files to Nextcloud without tunneling through OpenProject server. This requires some sort of one-time upload tokens, which can get exposed to the OpenProject frontend. Fallback could be tunneling all uploaded files through OpenProject.
  - Remove file links from OpenProject when files get deleted in Nextcloud (either some sort of callback triggered by Nextcloud or through polling when user opens the *Files* tab).

### Implementation decisions:

  - The file name we present in OpenProject is the name of the file that the file's owner sees. Apparently in Nextcloud a file can have multiple names and paths every time a file gets shared. To have a "canonical" name for all OpenProject users we will always show the file name that the file's owner sees.
  - OpenProject updates the "cached" file name in OpenProject when a user open the *Files* tab.

### Out of scope:

  - Syncing of access rights to the files in Nextcloud according to the roles and privileges of members in a OpenProject project. That will get partly tackled later with shared project folders (<mention class="mention" data-id="41400" data-type="work_package" data-text="#41400">\#41400</mention>)
  - Linking between a OpenProject project (instead of work packages) and files in Nextcloud. That is feasible and intended to built in a later stage. The outlook could be a possible replacement for the current "Documents" module.
