Content
Updated by Pavel Balashou almost 2 years ago
**As** a user in Nextcloud using the integration with OpenProject
**I want to** create a work package within Nextcloud
**so that** that I can link files or folders to it.
This allows me to kick off some workflow having files as the original trigger point.
_**Example:**_
_I created a contract document and I want to request a in depth legal review and have the review process tracked in OpenProject._
#### **Acceptance criteria**
* Within the multi-select "Link to work package" modal there is a button "Create work package".
* Within the **OpenProject** tab of the Nextcloud **Files** there is a button "Create work package". Also there is a button in the empty screen version of the tab.
* Clicking one of those buttons will open a modal.
* In the modal
* an iFrame gets loaded with the following URL: `<openproject-host>/work_packages/new?layout=iframe`
* That iFrame will contain a page provided by OpenProject that allows for creating a work package.
* Code is listening for messages from the iFrame
* `work_package_creation_success` with the work package ID and URL.
* Create links for each fileID with that work package ID
* Close the modal.
* If the **OpenProject** tab is open, then the list of linked work packages is refreshed so that the new work package is listed.
* `work_package_creation_cancellation` `work_package_creation_cancelation`
* Close the modal without creating any links to a work package
* The Content Security Policy (CSP) of Nextcloud needs to be relaxed to allow loading iFrames from OpenProject and sending messages back and forth from Nextcloud to the loaded page in the iFrame.
* [https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-src) has to be configured to contain the OpenProject host.
* Examples for modifying the CSP in Nextcloud:
* [https://github.com/nextcloud/integration\_excalidraw/blob/main/lib/Listener/AddContentSecurityPolicyListener.php](https://github.com/nextcloud/integration_excalidraw/blob/main/lib/Listener/AddContentSecurityPolicyListener.php)
* https://github.com/nextcloud/integration\_excalidraw/blob/main/lib/AppInfo/Application.php#L47
#### **Out of scope:**
* Passing/matching themes: We are aware that Nextcloud can run in different themes, e.g. light and dork themes. OpenProject currently only supports light mode. So the modal needs to be in light mode, even if Nextcloud is in dark mode.
#### **Visuals:**
https://www.figma.com/file/gtLQfPe09X7XugAH8L7dTy/Nextcloud-Integration?type=design&node-id=5066-128331&mode=design&t=py9SdUVini1sjpkT-4
**I want to** create a work package within Nextcloud
**so that** that I can link files or folders to it.
This allows me to kick off some workflow having files as the original trigger point.
_**Example:**_
_I created a contract document and I want to request a in depth legal review and have the review process tracked in OpenProject._
#### **Acceptance criteria**
* Within the multi-select "Link to work package" modal there is a button "Create work package".
* Within the **OpenProject** tab of the Nextcloud **Files** there is a button "Create work package". Also there is a button in the empty screen version of the tab.
* Clicking one of those buttons will open a modal.
* In the modal
* an iFrame gets loaded with the following URL: `<openproject-host>/work_packages/new?layout=iframe`
* That iFrame will contain a page provided by OpenProject that allows for creating a work package.
* Code is listening for messages from the iFrame
* `work_package_creation_success` with the work package ID and URL.
* Create links for each fileID with that work package ID
* Close the modal.
* If the **OpenProject** tab is open, then the list of linked work packages is refreshed so that the new work package is listed.
* `work_package_creation_cancellation`
* Close the modal without creating any links to a work package
* The Content Security Policy (CSP) of Nextcloud needs to be relaxed to allow loading iFrames from OpenProject and sending messages back and forth from Nextcloud to the loaded page in the iFrame.
* [https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-src](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/frame-src) has to be configured to contain the OpenProject host.
* Examples for modifying the CSP in Nextcloud:
* [https://github.com/nextcloud/integration\_excalidraw/blob/main/lib/Listener/AddContentSecurityPolicyListener.php](https://github.com/nextcloud/integration_excalidraw/blob/main/lib/Listener/AddContentSecurityPolicyListener.php)
* https://github.com/nextcloud/integration\_excalidraw/blob/main/lib/AppInfo/Application.php#L47
#### **Out of scope:**
* Passing/matching themes: We are aware that Nextcloud can run in different themes, e.g. light and dork themes. OpenProject currently only supports light mode. So the modal needs to be in light mode, even if Nextcloud is in dark mode.
#### **Visuals:**
https://www.figma.com/file/gtLQfPe09X7XugAH8L7dTy/Nextcloud-Integration?type=design&node-id=5066-128331&mode=design&t=py9SdUVini1sjpkT-4