[ADF-2368] Version manager update (#3058)

* Add auto file renaming in FE side

* Add error handling, file type restriction

* Documentation

* Fix ts-lint error

* Test the service

* Fix fdescribe...
This commit is contained in:
Popovics András
2018-03-09 23:55:24 +01:00
committed by Eugenio Romano
parent 4ee7cc0870
commit 8859d3466e
15 changed files with 150 additions and 12 deletions

View File

@@ -2,12 +2,12 @@
Added: v2.0.0
Status: Active
---
# Upload Button Component
# Upload Button Components
## Upload Button Component
Activates a file upload.
## Basic Usage
```html
<adf-upload-button
[rootFolderId]="-my-"
@@ -43,6 +43,41 @@ Activates a file upload.
| createFolder | `EventEmitter<{}>` | Emitted when a folder is created. |
| permissionEvent | `EventEmitter<PermissionModel>` | Emitted when delete permission is missing. |
## Upload Version Button Component (Workaround)
Activates a file version upload.
Until further backend API improvements, this component is meant to be used to enrich the feature of node version uploading and to decrease the restrictions currently applied to the node version upload.
```html
<adf-upload-version-button
staticTitle="Upload new version"
[node]="node"
[rootFolderId]="node.parentId"
[versioning]="true"
(success)="onUploadSuccess($event)"
(error)="onUploadError($event)">
</adf-upload-version-button>
```
### Properties
Since UploadVersionButtonComponent extends UploadButtonComponent, the properties are the same. Note that some properties doesn't make sense in case of version upload button, thus are just simply ignored. For the version upload button the **node** (which is about to be versioned) is a mandatory input parameter.
### Events
Since UploadVersionButtonComponent extends UploadButtonComponent the properties are the same.
### Restrictions
At the moment the API only allows new version uploads for a node, if the name of the new version is exactly the same as the old version (**and most importantly the extension**). Because of it, this workaround component uploads the chosen file with the same name as what the original file had (that is the reason, the **node** is a mandatory dependency for this component).
So at the end what this component can and can not do:
**Can**:
- upload a new version from the same file extension regardless of the file name.
**Can not**:
- upload a new version which has a different file extension, than what the originally uploaded file had. (an error message is emitted on the error EventEmitter of the component).
## Details
### How to show notification message with no permission