Files
alfresco-ng2-components/docs/content-services/services/new-version-uploader.dialog.service.md
Amedeo Lepore 4457aed5b4 [AAE-6242] upload a new version of a file attached in a form (#7651)
* [AAE-6242] Create upload new version dialog to handle the upload of the new file version

* [AAE-6242] Create version manager service to open version manager dialog

* [AAE-6242] Export service and dialog

* [AAE-6242] add adf-upload button to the show the upload new file button

* [AAE-6242] open upload new version dialog

* [AAE-6242] Removed console log

* [AAE-8798] display update option name to newVersion

* [AAE-8799] Emit version manager data when new file version is uploaded

* [AAE-8799] When a new file version is uploaded open new version dialog and update current file version with the new file version

* [AAE-8799] Rename UploadNewVersionDialogComponent to VersionManagerDialogComponent and UploadNewVersionDialogData to VersionManagerDialogData

* [AAE-8799] Use default root folder id

* [AAE-8799] Add #uploadSingleFile ViewChild in order get the input reference

* [AAE-8799] Trigger adf-upload-button by clicking on the button in order to open the file chooser and upload a new file version

* [AAE-8799] Version manager dialog emits file upload error

* [AAE-8799] Format version manager dialog code

* [AAE-8799] Reject upload and permission errors

* [AAE-8799] Catch upload new version errors

* [AAE-8799] Update allowable operation type

* [AAE-8799] Rename VersionManagerDialogComponent into NewVersionUploaderDialogComponent and VersionManagerService into NewVersionUploaderService, create specific folder for new version uploader component and service

* Restore previous UploadButtonComponent version

* [AAE-8799] Use [adf-upload] directive to upload new file version

* [AAE-8799] Add mock file for new version uploader unit tests

* [AAE-8799] Override mat dialog configuration

* [AAE-8799] Add unit test related to event emitted from Dialog

* [AAE-8799] Create model to handle New Version Uploader data

* [AAE-8799] Return data on dialog close

* [AAE-8799] Add showVersionsOnly property to dialog to show only file version list

* [AAE-8799] Add dialogAction to emit dialog actions

* [AAE-8799] Return observable instead of promise

* [AAE-8799] Update new file version type

* [AAE-8799] Subscribe dialog because return an Observable

* [AAE-8799] Add license header

* [AAE-8799] Add i18n new version uploader translations

* [AAE-8799] If data.title is not provided, add a default title

* [AAE-8799] Change panelClass for manage versions visualizations, add dialog styles

* [AAE-8799] Add upload new version dialog unit test

* [AAE-8799] Add upload new version dialog unit test related to manage versions section

* [AAE-8799] Add onUploadNewFileVersion unit tests

* [AAE-8799] Test new dialog panelClass

* [AAE-8799] Create a method to set dialog title, if title isn't provided from parent component, a default title is set

* [AAE-8799] Add doc to new-version-uploader-dilog component and service

* [AAE-8799] Add new-version-uploader.dialog.service documentation
2022-05-27 09:54:09 +02:00

3.4 KiB

Title, Added, Status, Last reviewed
Title Added Status Last reviewed
New Version Uploader service v1.0.0 Active 2022-05-26

New Version Uploader service

Display a dialog that allows to upload new file version or to manage the current node versions.

Class members

Methods

  • openUploadNewVersionDialog(data: NewVersionUploaderDialogData, config: MatDialogConfig): Observable
    Opens a dialog to upload new file version or to manage current node versions
    • data: NewVersionUploaderDialogData - The data to pass to the dialog
    • config: MatDialogConfig - A configuration object that allows to override default dialog configuration
    • Returns Observable - Observable which you can subscribe in order to get information about the dialog actions or error notification in case of error condition.

Details

You can open dialog in two different ways:

Upload New Version

The dialog shows

  • a side by side comparison between the current target node (type, name, icon) and the new file that should update it's version
  • the new version's minor/major changes
  • the optional comment
  • a button to upload a new file version Upload new version image

Usage example:

import { NewVersionUploaderService } from '@alfresco/adf-content-services'

constructor(private newVersionUploaderService: NewVersionUploaderService){}

yourFunctionToOpenDialog(){
    const newVersionUploaderDialogData: NewVersionUploaderDialogData = {
        file,
        node
    };
    this.newVersionUploaderService.openUploadNewVersionDialog(newVersionUploaderDialogData).subscribe(
        (data: NewVersionUploaderData) => {
            // place your action here on operation success!
        },
        (error) => {
            // place your action here on operation error!
            })
}

Manage Versions

Setting showVersionsOnly to true the dialog displays the version history of a node, with the ability to restore, delete and view version of the current node Manage versions image

Usage example:

import { NewVersionUploaderService } from '@alfresco/adf-content-services'

constructor(private newVersionUploaderService: NewVersionUploaderService){}

yourFunctionToOpenDialog(){
    const newVersionUploaderDialogData: NewVersionUploaderDialogData = {
        file,
        node,
        showVersionsOnly: true
    };
    this.newVersionUploaderService.openUploadNewVersionDialog(newVersionUploaderDialogData).subscribe(
        (data: NewVersionUploaderData) => {
            // place your action here on operation success!
        })
}

See Also