mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-26 17:24:56 +00:00
add callback for VersionManagerComponent and VersionUploadComponent (#3008)
This commit is contained in:
parent
224dd17042
commit
dc1a17686e
@ -13,14 +13,25 @@ Displays the version history of a node with the ability to upload a new version.
|
|||||||
## Basic Usage
|
## Basic Usage
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<adf-version-manager [node]="aMinimalNodeEntryEntity"></adf-version-manager>
|
<adf-version-manager
|
||||||
|
[node]="aMinimalNodeEntryEntity"
|
||||||
|
(uploadSuccess)="customMethod($event)"
|
||||||
|
(uploadError)="customMethod2($event)">
|
||||||
|
</adf-version-manager>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Properties
|
### Properties
|
||||||
|
|
||||||
| Name | Type | Default value | Description |
|
| Name | Type | Description |
|
||||||
| ---- | ---- | ------------- | ----------- |
|
| ---- | ---- | ----------- |
|
||||||
| node | `MinimalNodeEntryEntity` | | The node whose version history you want to manage. |
|
| node | [MinimalNodeEntryEntity](https://github.com/Alfresco/alfresco-js-api/blob/master/src/alfresco-core-rest-api/docs/NodeMinimalEntry.md) | The node you want to manage the version history of. |
|
||||||
|
|
||||||
|
### Events
|
||||||
|
|
||||||
|
| Name | Description |
|
||||||
|
| --- | --- |
|
||||||
|
| uploadSuccess | Raised when the file is uploaded |
|
||||||
|
| uploadError | Emitted when an error occurs.|
|
||||||
|
|
||||||
## Details
|
## Details
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<div class="adf-new-version-uploader-container" fxLayout="row" fxLayoutAlign="end center">
|
<div class="adf-new-version-uploader-container" fxLayout="row" fxLayoutAlign="end center">
|
||||||
<adf-version-upload [node]="node"></adf-version-upload>
|
<adf-version-upload [node]="node" (success)="onUploadSuccess($event)" (error)="onUploadError($event)"></adf-version-upload>
|
||||||
</div>
|
</div>
|
||||||
<div class="adf-version-list-container">
|
<div class="adf-version-list-container">
|
||||||
<adf-version-list [id]="node.id"></adf-version-list>
|
<adf-version-list [id]="node.id"></adf-version-list>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, Input, ViewEncapsulation } from '@angular/core';
|
import { Component, Input, ViewEncapsulation, Output, EventEmitter } from '@angular/core';
|
||||||
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -26,7 +26,21 @@ import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
|||||||
})
|
})
|
||||||
export class VersionManagerComponent {
|
export class VersionManagerComponent {
|
||||||
|
|
||||||
/** The node whose version history you want to manage. */
|
|
||||||
@Input()
|
@Input()
|
||||||
node: MinimalNodeEntryEntity;
|
node: MinimalNodeEntryEntity;
|
||||||
|
|
||||||
|
@Output()
|
||||||
|
uploadSuccess: EventEmitter<any> = new EventEmitter();
|
||||||
|
|
||||||
|
@Output()
|
||||||
|
uploadError: EventEmitter<any> = new EventEmitter();
|
||||||
|
|
||||||
|
onUploadSuccess(event): void {
|
||||||
|
this.uploadSuccess.emit(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
onUploadError(event): any {
|
||||||
|
this.uploadError.emit(event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,5 +4,7 @@
|
|||||||
staticTitle="Upload new version"
|
staticTitle="Upload new version"
|
||||||
[rootFolderId]="node.parentId"
|
[rootFolderId]="node.parentId"
|
||||||
tooltip="Restriction: upload file with the same name to create a new version of it"
|
tooltip="Restriction: upload file with the same name to create a new version of it"
|
||||||
[versioning]="true">
|
[versioning]="true"
|
||||||
|
(success)="onUploadSuccess($event)"
|
||||||
|
(error)="onUploadError($event)">
|
||||||
</adf-upload-button>
|
</adf-upload-button>
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { Component, Input, ViewEncapsulation } from '@angular/core';
|
import { Component, Input, ViewEncapsulation, Output, EventEmitter } from '@angular/core';
|
||||||
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -30,4 +30,20 @@ export class VersionUploadComponent {
|
|||||||
|
|
||||||
@Input()
|
@Input()
|
||||||
node: MinimalNodeEntryEntity;
|
node: MinimalNodeEntryEntity;
|
||||||
|
|
||||||
|
@Output()
|
||||||
|
success: EventEmitter<any> = new EventEmitter();
|
||||||
|
|
||||||
|
@Output()
|
||||||
|
error: EventEmitter<any> = new EventEmitter();
|
||||||
|
|
||||||
|
onUploadSuccess(event): void {
|
||||||
|
this.success.emit(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
onUploadError(event): void {
|
||||||
|
this.error.emit(event);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user