Urse Daniel 4cb3a876d9
[ACA-45] Drag and Drop a New Version (#5710)
* added a new input: file

* unit test - having singleFile option and a file as input, the type of the input for uploading should be button instead of file

* added a click event for the upload button and also handle if having a file as input, the type of the input should be 'button' instead of 'file'

* handling allowed for upload also for 'update' permissions over a dropped file. also emitting a new event for updating file version if i'm dropping a single file over another file.

* unit tests for handling dropping a file over another

* added a new input (file type)

* passing a file to adf-version-upload component

* new input as file and toggle new version if having that as input + unit test

* added new input as file for new version

* added new input to allow dropping a file over another to update it's version

* added a new variable for handling dropping a file over another one and also handle a new event when we update the file version

* pass a new dropped file to the dialog

* new message

* new method to allow isDropTarget for a file instead only to folders.

* new emitter for updating a file's version

* allows updating a file's version by dropping another file over it.

* refactor allowDropFiles

* update docs for drag&drop file into another file

* update for drag&drop a file over another file functionality

* made the allowDropFiles checking optional for isDropTarget property, only checking if the value is passed to the share-data-row

Co-authored-by: Eugenio Romano <eugenio.romano@alfresco.com>
2020-05-20 11:57:17 +01:00

58 lines
2.1 KiB
Markdown

---
Title: Version Manager Component
Added: v2.0.0
Status: Experimental
Last reviewed: 2019-01-16
---
# [Version Manager Component](../../../lib/content-services/src/lib/version-manager/version-manager.component.ts "Defined in version-manager.component.ts")
Displays the version history of a node with the ability to upload a new version.
![Version Manager](../../docassets/images/version-manager.png)
`This component is still in experimental phase. It has several limitations which will be resolved soon.`
## Basic Usage
```html
<adf-version-manager
[node]="aNode"
(uploadSuccess)="customMethod($event)"
(uploadError)="customMethod2($event)">
</adf-version-manager>
```
## Class members
### Properties
| Name | Type | Default value | Description |
| ---- | ---- | ------------- | ----------- |
| allowDownload | `boolean` | true | Enable/disable downloading a version of the current node. |
| newFileVersion | `File` | | New file for updating current version. |
| node | [`Node`](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md) | | Target node to manage version history. |
| showComments | `boolean` | true | Toggles showing/hiding of comments. |
### Events
| Name | Type | Description |
| ---- | ---- | ----------- |
| uploadError | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`Node`](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md)`>` | Emitted when an error occurs during upload. |
| uploadSuccess | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`<`[`Node`](https://github.com/Alfresco/alfresco-js-api/blob/development/src/api/content-rest-api/docs/Node.md)`>` | Emitted when a file is uploaded successfully. |
## Details
### Version actions
Each version has a context menu on the right, with the following actions.
| Action | Versions | Description |
| ------ | -------- | ----------- |
| Restore | All | Revert the current version to the selected one with creating a new version of it. |
## See also
- [Version list component](version-list.component.md)
- [Document list component](document-list.component.md)