diff --git a/docs/content-services/components/version-upload.component.md b/docs/content-services/components/version-upload.component.md new file mode 100644 index 0000000000..377ae6926f --- /dev/null +++ b/docs/content-services/components/version-upload.component.md @@ -0,0 +1,46 @@ +--- +Title: Version Upload component +Added: v4.1.0 +Status: Experimental +Last reviewed: 2020-11-06 +--- + +# [Version Upload component](../../../lib/content-services/src/lib/version-manager/version-upload.component.ts "Defined in version-list.component.ts") + +Displays the new version's minor/major changes and the optional comment of a node in a [Version Manager component](version-manager.component.md). + +### Basic Usage + +```html + +``` + +## Class members + +### Properties + +| Name | Type | Default value | Description | +| ----------------- | -------------------------------------------------------------------------------------------------------- | ------------- | --------------------------------------------------------- | +| showUploadButton | `boolean` | true | Toggles showing/hiding the upload button. | +| showCancelButton | `boolean` | true | Toggles showing/hiding the cancel button. | +| newFileVersion | `File` | | Used to create a new version of the current node. | +| node | [`Node`](https://github.com/Alfresco/alfresco-js-api/blob/develop/src/api/content-rest-api/docs/Node.md) | | The target node. | + +### Events + +| Name | Type | Description | +| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | +| success | [`EventEmitter`](https://angular.io/api/core/EventEmitter) | Emitted when a new version is successfully uploaded | +| error | [`EventEmitter`](https://angular.io/api/core/EventEmitter) | Emitted when a new version throws an error | +| cancel | [`EventEmitter`](https://angular.io/api/core/EventEmitter) | Emitted when cancelling uploading a new version | +| versionChanged | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when the type of the new version is picked (minor/major) | +| commentChanged | [`EventEmitter`](https://angular.io/api/core/EventEmitter)`` | Emitted when the comment of the new version has changed. | + +## Details + +This component is used by the [Version Manager component](version-manager.component.md) to +load and displays the new node's version choice - minor/major & comment. + +## See also + +- [Version manager component](version-manager.component.md) diff --git a/lib/content-services/src/lib/version-manager/version-upload.component.html b/lib/content-services/src/lib/version-manager/version-upload.component.html index 7a648d1dc2..b673218464 100644 --- a/lib/content-services/src/lib/version-manager/version-upload.component.html +++ b/lib/content-services/src/lib/version-manager/version-upload.component.html @@ -1,5 +1,5 @@
- + {{ 'ADF_VERSION_LIST.ACTIONS.UPLOAD.MINOR' | translate }} @@ -11,12 +11,13 @@
- -
diff --git a/lib/content-services/src/lib/version-manager/version-upload.component.ts b/lib/content-services/src/lib/version-manager/version-upload.component.ts index 70c93216be..a74c8a1d04 100644 --- a/lib/content-services/src/lib/version-manager/version-upload.component.ts +++ b/lib/content-services/src/lib/version-manager/version-upload.component.ts @@ -38,6 +38,12 @@ export class VersionUploadComponent { @Input() newFileVersion: File; + @Input() + showUploadButton: boolean = true; + + @Input() + showCancelButton: boolean = true; + @Output() success = new EventEmitter(); @@ -47,6 +53,12 @@ export class VersionUploadComponent { @Output() cancel = new EventEmitter(); + @Output() + versionChanged = new EventEmitter(); + + @Output() + commentChanged = new EventEmitter(); + constructor(private contentService: ContentService) { } @@ -62,4 +74,12 @@ export class VersionUploadComponent { this.cancel.emit(); } + onVersionChange() { + this.versionChanged.emit(this.isMajorVersion()); + } + + onCommentChange() { + this.commentChanged.emit(this.comment); + } + }