diff --git a/lib/content-services/document-list/services/document-list.service.ts b/lib/content-services/document-list/services/document-list.service.ts index 479f47b4eb..14890826c3 100644 --- a/lib/content-services/document-list/services/document-list.service.ts +++ b/lib/content-services/document-list/services/document-list.service.ts @@ -15,7 +15,14 @@ * limitations under the License. */ -import { AlfrescoApiService, AuthenticationService, ContentService, LogService, PermissionsEnum, ThumbnailService } from '@alfresco/adf-core'; +import { + AlfrescoApiService, + AuthenticationService, + ContentService, + LogService, + PermissionsEnum, + ThumbnailService +} from '@alfresco/adf-core'; import { Injectable } from '@angular/core'; import { Response } from '@angular/http'; import { MinimalNodeEntity, MinimalNodeEntryEntity, NodePaging } from 'alfresco-js-api'; @@ -96,7 +103,6 @@ export class DocumentListService { * Create a new folder in the path. * @param name Folder name * @param parentId Parent folder ID - * @returns {any} */ createFolder(name: string, parentId: string): Observable { return Observable.fromPromise(this.apiService.getInstance().nodes.createFolder(name, '/', parentId)) @@ -107,9 +113,8 @@ export class DocumentListService { * Gets the folder node with the specified relative name path below the root node. * @param folder Path to folder. * @param opts Options. - * @returns {Observable} Folder entity. */ - getFolder(folder: string, opts?: any) { + getFolder(folder: string, opts?: any): Observable { return Observable.fromPromise(this.getNodesPromise(folder, opts)) .map(res => res) .catch(err => this.handleError(err)); @@ -132,9 +137,8 @@ export class DocumentListService { /** * Get thumbnail URL for the given document node. * @param node Node to get URL for. - * @returns {string} URL address. */ - getDocumentThumbnailUrl(node: MinimalNodeEntity) { + getDocumentThumbnailUrl(node: MinimalNodeEntity): string { return this.thumbnailService.getDocumentThumbnailUrl(node); } @@ -158,7 +162,7 @@ export class DocumentListService { * @param node Target node * @param permission Permission level to query */ - hasPermission(node: any, permission: PermissionsEnum|string): boolean { + hasPermission(node: any, permission: PermissionsEnum | string): boolean { return this.contentService.hasPermission(node, permission); } diff --git a/lib/ng-package/ng-package-content.json b/lib/content-services/ng-package.json similarity index 86% rename from lib/ng-package/ng-package-content.json rename to lib/content-services/ng-package.json index a2513c1a96..f0cbd098b4 100644 --- a/lib/ng-package/ng-package-content.json +++ b/lib/content-services/ng-package.json @@ -2,11 +2,13 @@ "$schema": "./node_modules/ng-packagr/ng-package.schema.json", "workingDirectory" : "./ng_work", "src": "../content-services/", - "dest": "../content-services/dist/", + "dest": "../dist/content-services/", "lib": { + "licensePath": "../config/assets/license_header_add.txt", + "comments" : "none", "entryFile": "./public-api.ts", "flatModuleFile": "adf-content-services", - "externals": { + "umdModuleIds": { "alfresco-js-api": "alfresco-js-api", "minimatch": "minimatch", "@angular/platform-browser/animations": "@angular/platform-browser/animations", diff --git a/lib/content-services/tag/services/tag.service.ts b/lib/content-services/tag/services/tag.service.ts index 62fec98373..d25e3a8886 100644 --- a/lib/content-services/tag/services/tag.service.ts +++ b/lib/content-services/tag/services/tag.service.ts @@ -20,9 +20,6 @@ import { EventEmitter, Injectable, Output } from '@angular/core'; import { Observable } from 'rxjs/Observable'; import 'rxjs/add/observable/throw'; -/** - * @returns {TagService} - */ @Injectable() export class TagService { diff --git a/lib/content-services/tag/tag-actions.component.ts b/lib/content-services/tag/tag-actions.component.ts index 81f52fcbf0..ba059ef80d 100644 --- a/lib/content-services/tag/tag-actions.component.ts +++ b/lib/content-services/tag/tag-actions.component.ts @@ -22,8 +22,6 @@ import { TagService } from './services/tag.service'; /** * * This component, provide a list of the tags relative a node with actions button to add or remove new tag - * - * @returns {TagComponent} . */ @Component({ diff --git a/lib/content-services/tag/tag-list.component.ts b/lib/content-services/tag/tag-list.component.ts index ff6ac69700..de041f68dc 100644 --- a/lib/content-services/tag/tag-list.component.ts +++ b/lib/content-services/tag/tag-list.component.ts @@ -21,8 +21,6 @@ import { TagService } from './services/tag.service'; /** * * This component provide a list of all the tag inside the ECM - * - * @returns {TagList} . */ @Component({ diff --git a/lib/content-services/tag/tag-node-list.component.ts b/lib/content-services/tag/tag-node-list.component.ts index 2fea66e01a..9a76bcb782 100644 --- a/lib/content-services/tag/tag-node-list.component.ts +++ b/lib/content-services/tag/tag-node-list.component.ts @@ -21,8 +21,6 @@ import { TagService } from './services/tag.service'; /** * * This component, ShowNodeTag a list of the tag on relative a node - * - * @returns {TagNodeList} . */ @Component({ diff --git a/lib/content-services/upload/components/file-uploading-list.component.ts b/lib/content-services/upload/components/file-uploading-list.component.ts index 498fd4094c..fc0151b33f 100644 --- a/lib/content-services/upload/components/file-uploading-list.component.ts +++ b/lib/content-services/upload/components/file-uploading-list.component.ts @@ -44,7 +44,7 @@ export class FileUploadingListComponent { /** * Cancel file upload * - * @param {FileModel} file File model to cancel upload for. + * @param file File model to cancel upload for. * * @memberOf FileUploadingListComponent */ @@ -88,8 +88,7 @@ export class FileUploadingListComponent { } /** - * Checks if all the files are uploaded - * @returns {boolean} - false if there is at least one file in Progress | Starting | Pending + * Checks if all the files are uploaded false if there is at least one file in Progress | Starting | Pending */ isUploadCompleted(): boolean { return !this.isUploadCancelled() && @@ -103,8 +102,7 @@ export class FileUploadingListComponent { } /** - * Check if all the files are Cancelled | Aborted | Error. - * @returns {boolean} - false if there is at least one file in uploading states + * Check if all the files are Cancelled | Aborted | Error. false if there is at least one file in uploading states */ isUploadCancelled(): boolean { return !!this.files.length && diff --git a/lib/content-services/upload/components/upload-drag-area.component.ts b/lib/content-services/upload/components/upload-drag-area.component.ts index cb2e7e7e24..fde4dfed6a 100644 --- a/lib/content-services/upload/components/upload-drag-area.component.ts +++ b/lib/content-services/upload/components/upload-drag-area.component.ts @@ -64,7 +64,7 @@ export class UploadDragAreaComponent implements NodePermissionSubject { /** * Method called when files are dropped in the drag area. * - * @param {File[]} files - files dropped in the drag area. + * @param files - files dropped in the drag area. */ onFilesDropped(files: File[]): void { if (!this.disabled && files.length) { @@ -121,7 +121,7 @@ export class UploadDragAreaComponent implements NodePermissionSubject { /** * Show undo notification bar. * - * @param {FileModel[]} latestFilesAdded - files in the upload queue enriched with status flag and xhr object. + * @param latestFilesAdded - files in the upload queue enriched with status flag and xhr object. */ showUndoNotificationBar(latestFilesAdded: FileModel[]) { let messageTranslate: any, actionTranslate: any; @@ -137,7 +137,6 @@ export class UploadDragAreaComponent implements NodePermissionSubject { * Show the error inside Notification bar * * @param Error message - * @private */ showErrorNotificationBar(errorMessage: string) { this.notificationService.openSnackMessage(errorMessage, 3000); diff --git a/lib/content-services/upload/directives/file-draggable.directive.ts b/lib/content-services/upload/directives/file-draggable.directive.ts index e29e26e7d3..bc3f283665 100644 --- a/lib/content-services/upload/directives/file-draggable.directive.ts +++ b/lib/content-services/upload/directives/file-draggable.directive.ts @@ -100,7 +100,7 @@ export class FileDraggableDirective implements OnInit, OnDestroy { /** * Change the style of the drag area when a file drag in. * - * @param {event} event - DOM event. + * @param event - DOM event. */ onDragEnter(event: Event): void { if (this.enabled && !event.defaultPrevented) { @@ -112,7 +112,7 @@ export class FileDraggableDirective implements OnInit, OnDestroy { /** * Change the style of the drag area when a file drag out. * - * @param {event} event - DOM event. + * @param event - DOM event. */ onDragLeave(event: Event): void { if (this.enabled && !event.defaultPrevented) { @@ -136,7 +136,7 @@ export class FileDraggableDirective implements OnInit, OnDestroy { /** * Prevent default and stop propagation of the DOM event. * - * @param {event} $event - DOM event. + * @param $event - DOM event. */ preventDefault(event: Event): void { event.stopPropagation(); diff --git a/lib/content-services/webscript/webscript.component.ts b/lib/content-services/webscript/webscript.component.ts index d8897c6e24..5ffb79daa1 100644 --- a/lib/content-services/webscript/webscript.component.ts +++ b/lib/content-services/webscript/webscript.component.ts @@ -38,7 +38,6 @@ import { Component, EventEmitter, Input, OnChanges, Output } from '@angular/core * * @Output - success - The event is emitted when the data are recived * - * @returns {WebscriptComponent} . */ @Component({ selector: 'adf-webscript-get', diff --git a/lib/core/directives/node-permission.directive.ts b/lib/core/directives/node-permission.directive.ts index 9370d1d43b..3b1fa58392 100644 --- a/lib/core/directives/node-permission.directive.ts +++ b/lib/core/directives/node-permission.directive.ts @@ -56,7 +56,6 @@ export class NodePermissionDirective implements OnChanges { /** * Updates disabled state for the decorated elememtn * - * @returns {boolean} True if decorated element got disabled, otherwise False * @memberof NodePermissionDirective */ updateElement(): boolean { @@ -110,9 +109,8 @@ export class NodePermissionDirective implements OnChanges { /** * Checks whether all nodes have a particular permission * - * @param {MinimalNodeEntity[]} nodes Node collection to check - * @param {string} permission Permission to check for each node - * @returns {boolean} True if all nodes have provided permission, otherwise False + * @param nodes Node collection to check + * @param permission Permission to check for each node * @memberof NodePermissionDirective */ hasPermission(nodes: MinimalNodeEntity[], permission: string): boolean { diff --git a/lib/core/form/components/form.component.ts b/lib/core/form/components/form.component.ts index a3fc6611f8..7af0e1374e 100644 --- a/lib/core/form/components/form.component.ts +++ b/lib/core/form/components/form.component.ts @@ -253,7 +253,6 @@ export class FormComponent implements OnInit, OnChanges { /** * Invoked when user clicks outcome button. * @param outcome Form outcome model - * @returns {boolean} True if outcome action was executed, otherwise false. */ onOutcomeClicked(outcome: FormOutcomeModel): boolean { if (!this.readOnly && outcome && this.form) { @@ -448,7 +447,6 @@ export class FormComponent implements OnInit, OnChanges { /** * Get custom set of outcomes for a Form Definition. * @param form Form definition model. - * @returns {FormOutcomeModel[]} Outcomes for a given form definition. */ getFormDefinitionOutcomes(form: FormModel): FormOutcomeModel[] { return [ diff --git a/lib/core/form/components/start-form.component.ts b/lib/core/form/components/start-form.component.ts index e38bf3fd32..c698cc228b 100644 --- a/lib/core/form/components/start-form.component.ts +++ b/lib/core/form/components/start-form.component.ts @@ -38,7 +38,6 @@ import { FormOutcomeModel } from './widgets/core/index'; * {formSaved} EventEmitter - This event is fired when the form is saved, it pass all the value in the form. * {formCompleted} EventEmitter - This event is fired when the form is completed, it pass all the value in the form. * - * @returns {FormComponent} . */ @Component({ selector: 'adf-start-form', diff --git a/lib/core/form/components/widgets/core/form.model.ts b/lib/core/form/components/widgets/core/form.model.ts index 12b6435e18..87834dcb43 100644 --- a/lib/core/form/components/widgets/core/form.model.ts +++ b/lib/core/form/components/widgets/core/form.model.ts @@ -173,7 +173,6 @@ export class FormModel { /** * Validates entire form and all form fields. * - * @returns {void} * @memberof FormModel */ validateForm(): void { @@ -203,8 +202,7 @@ export class FormModel { /** * Validates a specific form field, triggers form validation. * - * @param {FormFieldModel} field Form field to validate. - * @returns {void} + * @param field Form field to validate. * @memberof FormModel */ validateField(field: FormFieldModel): void { diff --git a/lib/core/form/services/activiti-alfresco.service.ts b/lib/core/form/services/activiti-alfresco.service.ts index 574bffbb83..1a34ed1c68 100644 --- a/lib/core/form/services/activiti-alfresco.service.ts +++ b/lib/core/form/services/activiti-alfresco.service.ts @@ -39,7 +39,6 @@ export class ActivitiContentService { * * @param accountId * @param folderId - * @returns {null} */ getAlfrescoNodes(accountId: string, folderId: string): Observable<[ExternalContent]> { let apiService: AlfrescoApi = this.apiService.getInstance(); @@ -54,7 +53,6 @@ export class ActivitiContentService { * * @param accountId * @param folderId - * @returns {any} */ getAlfrescoRepositories(tenantId: number, includeAccount: boolean): Observable { let apiService: AlfrescoApi = this.apiService.getInstance(); @@ -73,7 +71,6 @@ export class ActivitiContentService { * @param accountId * @param node * @param siteId - * @returns {null} */ linkAlfrescoNode(accountId: string, node: ExternalContent, siteId: string): Observable { let apiService: AlfrescoApi = this.apiService.getInstance(); diff --git a/lib/core/form/services/form.service.ts b/lib/core/form/services/form.service.ts index b455cd99b8..eae975512c 100644 --- a/lib/core/form/services/form.service.ts +++ b/lib/core/form/services/form.service.ts @@ -109,7 +109,6 @@ export class FormService { /** * Create a Form with a fields for each metadata properties - * @returns {Observable} */ createFormFromANode(formName: string): Observable { return Observable.create(observer => { @@ -131,7 +130,6 @@ export class FormService { /** * Create a Form - * @returns {Observable} */ createForm(formName: string): Observable { let dataModel = { @@ -155,7 +153,6 @@ export class FormService { /** * @deprecated in 1.7.0, use saveForm API instead * Add Fileds to A form - * @returns {Observable} */ addFieldsToAForm(formId: string, formModel: FormDefinitionModel): Observable { this.logService.log('addFieldsToAForm is deprecated in 1.7.0, use saveForm API instead'); @@ -166,7 +163,6 @@ export class FormService { /** * Search For A Form by name - * @returns {Observable} */ searchFrom(name: string): Observable { let opts = { @@ -184,7 +180,6 @@ export class FormService { /** * Get All the forms - * @returns {Observable} */ getForms(): Observable { let opts = { @@ -198,7 +193,6 @@ export class FormService { /** * Get Process Definitions - * @returns {Observable} */ getProcessDefinitions(): Observable { return Observable.fromPromise(this.processApi.getProcessDefinitions({})) @@ -214,7 +208,6 @@ export class FormService { /** * Get All the Tasks - * @returns {Observable} */ getTasks(): Observable { return Observable.fromPromise(this.taskApi.listTasks({})) @@ -225,7 +218,6 @@ export class FormService { /** * Get Task * @param taskId Task Id - * @returns {Observable} */ getTask(taskId: string): Observable { return Observable.fromPromise(this.taskApi.getTask(taskId)) @@ -237,7 +229,6 @@ export class FormService { * Save Task Form * @param taskId Task Id * @param formValues Form Values - * @returns {Observable} */ saveTaskForm(taskId: string, formValues: FormValues): Observable { let body = JSON.stringify({values: formValues}); @@ -251,7 +242,6 @@ export class FormService { * @param taskId Task Id * @param formValues Form Values * @param outcome Form Outcome - * @returns {Observable} */ completeTaskForm(taskId: string, formValues: FormValues, outcome?: string): Observable { let data: any = {values: formValues}; @@ -267,7 +257,6 @@ export class FormService { /** * Get Form related to a taskId * @param taskId Task Id - * @returns {Observable} */ getTaskForm(taskId: string): Observable { return Observable.fromPromise(this.taskApi.getTaskForm(taskId)) @@ -278,7 +267,6 @@ export class FormService { /** * Get Form Definition * @param formId Form Id - * @returns {Observable} */ getFormDefinitionById(formId: string): Observable { return Observable.fromPromise(this.editorApi.getForm(formId)) @@ -289,7 +277,6 @@ export class FormService { /** * Returns form definition by a given name. * @param name - * @returns {Promise|Promise} */ getFormDefinitionByName(name: string): Observable { let opts = { @@ -306,7 +293,6 @@ export class FormService { /** * Get start form instance for a given processId * @param processId Process definition ID - * @returns {Observable} */ getStartFormInstance(processId: string): Observable { return Observable.fromPromise( @@ -324,7 +310,6 @@ export class FormService { /** * Get start form definition for a given process * @param processId Process definition ID - * @returns {Observable} */ getStartFormDefinition(processId: string): Observable { return Observable.fromPromise( diff --git a/lib/core/form/services/node.service.ts b/lib/core/form/services/node.service.ts index a99ff72672..9a00dc4c33 100644 --- a/lib/core/form/services/node.service.ts +++ b/lib/core/form/services/node.service.ts @@ -29,7 +29,6 @@ export class NodeService { /** * Get All the metadata and the nodeType for a nodeId cleaned by the prefix * @param nodeId Node Id - * @returns NodeMetadata */ public getNodeMetadata(nodeId: string): Observable { return Observable.fromPromise(this.apiService.getInstance().nodes.getNodeInfo(nodeId)).map(this.cleanMetadataFromSemicolon); @@ -41,7 +40,6 @@ export class NodeService { * @param nodeType node type * @param nameSpace namespace node * @param data data to store - * @returns NodeMetadata */ public createNodeMetadata(nodeType: string, nameSpace: any, data: any, path: string, name?: string): Observable { let properties = {}; @@ -60,7 +58,6 @@ export class NodeService { * @param nodeType node type * @param properties namespace node * @param path path - * @returns NodeMetadata */ public createNode(name: string, nodeType: string, properties: any, path: string): Observable { let body = { diff --git a/lib/core/login/components/login.component.ts b/lib/core/login/components/login.component.ts index a07cdbf363..0787234197 100644 --- a/lib/core/login/components/login.component.ts +++ b/lib/core/login/components/login.component.ts @@ -255,7 +255,6 @@ export class LoginComponent implements OnInit { /** * Check the require parameter - * @returns {boolean} */ private checkRequiredParams(): boolean { @@ -309,7 +308,6 @@ export class LoginComponent implements OnInit { /** * The method return if a field is valid or not * @param field - * @returns {boolean} */ isErrorStyle(field: AbstractControl) { return !field.valid && field.dirty && !field.pristine; diff --git a/lib/ng-package/ng-package-core.json b/lib/core/ng-package.json similarity index 86% rename from lib/ng-package/ng-package-core.json rename to lib/core/ng-package.json index a8c7d8a51f..66164087bf 100644 --- a/lib/ng-package/ng-package-core.json +++ b/lib/core/ng-package.json @@ -1,12 +1,14 @@ { "$schema": "./node_modules/ng-packagr/ng-package.schema.json", "workingDirectory" : "./ng_work", - "src": "../core/", - "dest": "../core/dist/", + "src": "./core/", + "dest": "../dist/core/", "lib": { + "licensePath": "../config/assets/license_header_add.txt", + "comments" : "none", "entryFile": "./public-api.ts", "flatModuleFile": "adf-core", - "externals": { + "umdModuleIds": { "alfresco-js-api": "alfresco-js-api", "minimatch": "minimatch", "@angular/platform-browser/animations": "@angular/platform-browser/animations", diff --git a/lib/core/services/authentication.service.ts b/lib/core/services/authentication.service.ts index 959f3186b2..cf331b1ddd 100644 --- a/lib/core/services/authentication.service.ts +++ b/lib/core/services/authentication.service.ts @@ -48,7 +48,6 @@ export class AuthenticationService { /** * The method return true if the user is logged in - * @returns {boolean} */ isLoggedIn(): boolean { return !!this.alfrescoApi.getInstance().isLoggedIn(); @@ -58,7 +57,6 @@ export class AuthenticationService { * Method to delegate to POST login * @param username * @param password - * @returns {Observable|Observable} */ login(username: string, password: string, rememberMe: boolean = false): Observable<{ type: string, ticket: any }> { this.removeTicket(); @@ -94,7 +92,6 @@ export class AuthenticationService { /** * The method retrieve whether the "remember me" cookie was set or not * - * @returns {boolean} */ isRememberMeSet(): boolean { return (this.cookie.getItem(REMEMBER_ME_COOKIE_KEY) === null) ? false : true; @@ -104,7 +101,6 @@ export class AuthenticationService { * Initialize the alfresco Api with user and password end call the login method * @param username * @param password - * @returns {*|Observable} */ private callApiLogin(username: string, password: string) { return this.alfrescoApi.getInstance().login(username, password); @@ -113,7 +109,6 @@ export class AuthenticationService { /** * The method remove the ticket from the Storage * - * @returns {Observable|Observable} */ logout() { return Observable.fromPromise(this.callApiLogout()) @@ -127,7 +122,6 @@ export class AuthenticationService { /** * - * @returns {*|Observable|Observable|Promise} */ private callApiLogout(): Promise { if (this.alfrescoApi.getInstance()) { @@ -146,7 +140,6 @@ export class AuthenticationService { /** * The method return the ECM ticket stored in the Storage - * @returns ticket */ getTicketEcm(): string | null { return this.storage.getItem('ticket-ECM'); @@ -154,7 +147,6 @@ export class AuthenticationService { /** * The method return the BPM ticket stored in the Storage - * @returns ticket */ getTicketBpm(): string | null { return this.storage.getItem('ticket-BPM'); @@ -207,7 +199,6 @@ export class AuthenticationService { /** * The method return true if user is logged in on ecm provider * - * @returns {boolean} */ isEcmLoggedIn(): boolean { if (this.cookie.isEnabled() && !this.isRememberMeSet()) { @@ -219,7 +210,6 @@ export class AuthenticationService { /** * The method return true if user is logged in on bpm provider * - * @returns {boolean} */ isBpmLoggedIn(): boolean { if (this.cookie.isEnabled() && !this.isRememberMeSet()) { @@ -231,7 +221,6 @@ export class AuthenticationService { /** * Get the ECM username * - * @returns {string} The username value * * @memberof AuthenticationService */ @@ -242,7 +231,6 @@ export class AuthenticationService { /** * Get the BPM username * - * @returns {string} The username value * * @memberof AuthenticationService */ @@ -269,7 +257,6 @@ export class AuthenticationService { /** * The method write the error in the console browser * @param error - * @returns {ErrorObservable} */ handleError(error: any): Observable { this.logService.error('Error when logging in', error); diff --git a/lib/core/services/content.service.ts b/lib/core/services/content.service.ts index fada7fdfbc..b8edafc6ad 100644 --- a/lib/core/services/content.service.ts +++ b/lib/core/services/content.service.ts @@ -80,8 +80,8 @@ export class ContentService { /** * Invokes content download for a Blob with a file name. * - * @param {Blob} blob Content to download. - * @param {string} fileName Name of the resulting file. + * @param blob Content to download. + * @param fileName Name of the resulting file. * * @memberOf ContentService */ @@ -92,8 +92,8 @@ export class ContentService { /** * Invokes content download for a data array with a file name. * - * @param {*} data Data to download. - * @param {string} fileName Name of the resulting file. + * @param data Data to download. + * @param fileName Name of the resulting file. * * @memberOf ContentService */ @@ -104,20 +104,19 @@ export class ContentService { /** * Invokes content download for a JSON object with a file name. * - * @param {*} json JSON object to download. - * @param {any} fileName Name of the resulting file. + * @param json JSON object to download. + * @param fileName Name of the resulting file. * * @memberOf ContentService */ - downloadJSON(json: any, fileName): void { + downloadJSON(json: any, fileName: string): void { this.saveData(json, 'json', fileName); } /** * Creates a trusted object URL from the Blob. * WARNING: calling this method with untrusted user data exposes your application to XSS security risks! - * @param {Blob} blob Data to wrap into object URL - * @returns {string} Object URL content. + * @param blob Data to wrap into object URL * * @memberOf ContentService */ @@ -133,10 +132,9 @@ export class ContentService { /** * Get thumbnail URL for the given document node. * - * @param {string|MinimalNodeEntity} node Node to get URL for. - * @param {boolean} [attachment] Retrieve content as an attachment for download - * @param {string} [ticket] Custom ticket to use for authentication - * @returns {string} The URL address pointing to the content. + * @param node Node to get URL for. + * @param [attachment] Retrieve content as an attachment for download + * @param [ticket] Custom ticket to use for authentication */ getDocumentThumbnailUrl(node: any, attachment?: boolean, ticket?: string): string { @@ -150,10 +148,9 @@ export class ContentService { /** * Get content URL for the given node. * - * @param node {string|MinimalNodeEntity} nodeId or node to get URL for. - * @param {boolean} [attachment] Retrieve content as an attachment for download - * @param {string} [ticket] Custom ticket to use for authentication - * @returns {string} The URL address pointing to the content. + * @param nodeId or node to get URL for. + * @param [attachment] Retrieve content as an attachment for download + * @param [ticket] Custom ticket to use for authentication */ getContentUrl(node: any, attachment?: boolean, ticket?: string): string { @@ -168,7 +165,6 @@ export class ContentService { * Get content for the given node. * @param nodeId ID of the target node * - * @returns {Observable} URL address. */ getNodeContent(nodeId: string): Observable { return Observable.fromPromise(this.apiService.getInstance().core.nodesApi.getFileContent(nodeId).then((dataContent) => { @@ -200,7 +196,6 @@ export class ContentService { * @param node Node to check allowableOperations * @param permission Create, delete, update, updatePermissions, !create, !delete, !update, !updatePermissions * - * @returns {boolean} has permission */ hasPermission(node: any, permission: PermissionsEnum | string): boolean { let hasPermission = false; @@ -225,7 +220,6 @@ export class ContentService { * Check if the node has the properties allowableOperations * @param node Node to check allowableOperations * - * @returns {boolean} has AllowableOperations */ hasAllowableOperations(node: any): boolean { return node && node.allowableOperations ? true : false; diff --git a/lib/core/services/cookie.service.ts b/lib/core/services/cookie.service.ts index 6e031aa576..ad546a9351 100644 --- a/lib/core/services/cookie.service.ts +++ b/lib/core/services/cookie.service.ts @@ -36,7 +36,6 @@ export class CookieService { /** * Retrieves a cookie by its key. * @param key Key to identify the cookie - * @returns {string | null} */ getItem(key: string): string | null { const regexp = new RegExp('(?:' + key + '|;\s*' + key + ')=(.*?)(?:;|$)', 'g'); @@ -51,7 +50,6 @@ export class CookieService { * @param expiration Expiration date of the data * @param path "Pathname" to store the cookie * - * @returns {boolean} */ setItem(key: string, data: string, expiration: Date | null, path: string | null): void { document.cookie = `${key}=${data}` + diff --git a/lib/core/services/people-process.service.ts b/lib/core/services/people-process.service.ts index bdc20ad04a..5add1a7794 100644 --- a/lib/core/services/people-process.service.ts +++ b/lib/core/services/people-process.service.ts @@ -73,7 +73,6 @@ export class PeopleProcessService { /** * Throw the error * @param error - * @returns {ErrorObservable} */ private handleError(error: Response) { this.logService.error(error); diff --git a/lib/core/services/renditions.service.ts b/lib/core/services/renditions.service.ts index 97ab434ad3..a70611fd0d 100644 --- a/lib/core/services/renditions.service.ts +++ b/lib/core/services/renditions.service.ts @@ -29,8 +29,6 @@ import 'rxjs/add/operator/takeWhile'; * @deprecated * RenditionsService * (this service is deprecated in 2.2.0 and will be removed in future revisions) - * - * @returns {RenditionsService} . */ @Injectable() export class RenditionsService { diff --git a/lib/core/services/thumbnail.service.ts b/lib/core/services/thumbnail.service.ts index 7c4a2f99c1..1ec4237d94 100644 --- a/lib/core/services/thumbnail.service.ts +++ b/lib/core/services/thumbnail.service.ts @@ -158,7 +158,6 @@ export class ThumbnailService { /** * Get thumbnail URL for the given document node. * @param document Node to get URL for. - * @returns {string} URL address. */ public getDocumentThumbnailUrl(node: any): string { let thumbnail = this.contentService.getDocumentThumbnailUrl(node); @@ -168,7 +167,6 @@ export class ThumbnailService { /** * Get mimeType SVG * @param mimeType - * @returns {string} URL SVG address. */ public getMimeTypeIcon(mimeType: string): string { let icon = this.mimeTypeIcons[mimeType]; @@ -177,7 +175,6 @@ export class ThumbnailService { /** * Get default SVG - * @returns {string} URL SVG default. */ public getDefaultMimeTypeIcon(): string { return this.DEFAULT_ICON; diff --git a/lib/core/services/upload.service.ts b/lib/core/services/upload.service.ts index d9a5be6db5..1f6b67e156 100644 --- a/lib/core/services/upload.service.ts +++ b/lib/core/services/upload.service.ts @@ -19,7 +19,12 @@ import { EventEmitter, Injectable } from '@angular/core'; import * as minimatch_ from 'minimatch'; import { Subject } from 'rxjs/Subject'; import { AppConfigService } from '../app-config/app-config.service'; -import { FileUploadCompleteEvent, FileUploadDeleteEvent, FileUploadErrorEvent, FileUploadEvent } from '../events/file.event'; +import { + FileUploadCompleteEvent, + FileUploadDeleteEvent, + FileUploadErrorEvent, + FileUploadEvent +} from '../events/file.event'; import { FileModel, FileUploadProgress, FileUploadStatus } from '../models/file.model'; import { AlfrescoApiService } from './alfresco-api.service'; @@ -53,9 +58,6 @@ export class UploadService { /** * Checks whether the service is uploading a file. - * - * @returns {boolean} - * * @memberof UploadService */ isUploading(): boolean { @@ -64,8 +66,6 @@ export class UploadService { /** * Returns the file Queue - * - * @return {FileModel[]} - files in the upload queue. */ getQueue(): FileModel[] { return this.queue; @@ -98,7 +98,7 @@ export class UploadService { /** * Pick all the files in the queue that are not been uploaded yet and upload it into the directory folder. * - * @param {EventEmitter} emitter @deprecated emitter to invoke on file status change + * @param emitter @deprecated emitter to invoke on file status change * * @memberof UploadService */ @@ -150,8 +150,8 @@ export class UploadService { getUploadPromise(file: FileModel) { let opts: any = { - renditions: 'doclib' - }; + renditions: 'doclib' + }; if (file.options.newVersion === true) { opts.overwrite = true; @@ -175,21 +175,21 @@ export class UploadService { promise.on('progress', (progress: FileUploadProgress) => { this.onUploadProgress(file, progress); }) - .on('abort', () => { - this.onUploadAborted(file); - emitter.emit({ value: 'File aborted' }); - }) - .on('error', err => { - this.onUploadError(file, err); - emitter.emit({ value: 'Error file uploaded' }); - }) - .on('success', data => { - this.onUploadComplete(file, data); - emitter.emit({ value: data }); - }) - .catch(err => { - throw err; - }); + .on('abort', () => { + this.onUploadAborted(file); + emitter.emit({ value: 'File aborted' }); + }) + .on('error', err => { + this.onUploadError(file, err); + emitter.emit({ value: 'Error file uploaded' }); + }) + .on('success', data => { + this.onUploadComplete(file, data); + emitter.emit({ value: data }); + }) + .catch(err => { + throw err; + }); return promise; } diff --git a/lib/core/userinfo/services/bpm-user.service.ts b/lib/core/userinfo/services/bpm-user.service.ts index 392db3a292..25a644b09b 100644 --- a/lib/core/userinfo/services/bpm-user.service.ts +++ b/lib/core/userinfo/services/bpm-user.service.ts @@ -27,7 +27,6 @@ import 'rxjs/add/observable/throw'; * * BPMUserService retrieve all the information of an Ecm user. * - * @returns {BPMUserService} . */ @Injectable() export class BpmUserService { @@ -53,7 +52,6 @@ export class BpmUserService { /** * Throw the error * @param error - * @returns {ErrorObservable} */ private handleError(error: Response) { // in a real world app, we may send the error to some remote logging infrastructure diff --git a/lib/core/userinfo/services/ecm-user.service.ts b/lib/core/userinfo/services/ecm-user.service.ts index 170226d399..92a91d088e 100644 --- a/lib/core/userinfo/services/ecm-user.service.ts +++ b/lib/core/userinfo/services/ecm-user.service.ts @@ -63,7 +63,6 @@ export class EcmUserService { /** * Throw the error * @param error - * @returns {ErrorObservable} */ private handleError(error: Response) { // in a real world app, we may send the error to some remote logging infrastructure diff --git a/lib/core/utils/object-utils.ts b/lib/core/utils/object-utils.ts index e48e310ec9..930b83f1a8 100644 --- a/lib/core/utils/object-utils.ts +++ b/lib/core/utils/object-utils.ts @@ -21,7 +21,6 @@ export class ObjectUtils { * ObjectUtils.getValue({ item: { nodeType: 'cm:folder' }}, 'item.nodeType') ==> 'cm:folder' * @param target * @param key - * @returns {string} */ static getValue(target: any, key: string): any { diff --git a/lib/core/viewer/components/pdfViewer.component.ts b/lib/core/viewer/components/pdfViewer.component.ts index d5d21a6e00..eca0febfa9 100644 --- a/lib/core/viewer/components/pdfViewer.component.ts +++ b/lib/core/viewer/components/pdfViewer.component.ts @@ -28,7 +28,7 @@ declare let PDFJS: any; './pdfViewer.component.scss', './pdfViewerHost.component.scss' ], - providers: [ RenderingQueueServices ], + providers: [RenderingQueueServices], host: { 'class': 'adf-pdf-viewer' }, encapsulation: ViewEncapsulation.None }) @@ -123,8 +123,6 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { /** * return the PDFJS global object (exist to facilitate the mock of PDFJS in the test) - * - * @returns {PDFJS} */ getPDFJS() { return PDFJS; @@ -151,7 +149,7 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { } ngOnDestroy() { - if(this.documentContainer) { + if (this.documentContainer) { this.documentContainer.removeEventListener('pagechange', this.onPageChange, true); } } @@ -159,7 +157,7 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { /** * Method to scale the page current support implementation * - * @param {string} scaleMode - new scale mode + * @param scaleMode - new scale mode */ scalePage(scaleMode) { this.currentScaleMode = scaleMode; @@ -223,7 +221,7 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { /** * Update all the pages with the newScale scale * - * @param {number} newScale - new scale page + * @param newScale - new scale page */ setScaleUpdatePages(newScale: number) { if (!this.isSameScale(this.currentScale, newScale)) { @@ -240,24 +238,21 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { /** * Check if the request scale of the page is the same for avoid useless re-rendering * - * @param {number} oldScale - old scale page - * @param {number} newScale - new scale page + * @param oldScale - old scale page + * @param newScale - new scale page * - * @returns {boolean} */ - isSameScale(oldScale: number, newScale: number) { + isSameScale(oldScale: number, newScale: number): boolean { return (newScale === oldScale); } /** * Check if is a land scape view * - * @param {number} width - * @param {number} height - * - * @returns {boolean} + * @param width + * @param height */ - isLandscape(width: number, height: number) { + isLandscape(width: number, height: number): boolean { return (width > height); } @@ -282,7 +277,7 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { /** * zoom in page pdf * - * @param {number} ticks + * @param ticks */ zoomIn(ticks: number) { let newScale: any = this.currentScale; @@ -298,7 +293,7 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { /** * zoom out page pdf * - * @param {number} ticks + * @param ticks */ zoomOut(ticks: number) { let newScale: any = this.currentScale; @@ -338,7 +333,7 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { /** * load the page in input * - * @param {string} page - page to load + * @param page to load */ inputPage(page: string) { let pageInput = parseInt(page, 10); @@ -355,7 +350,7 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { /** * Page Change Event * - * @param {Event} event + * @param event */ onPageChange(event) { this.page = event.pageNumber; @@ -364,7 +359,7 @@ export class PdfViewerComponent implements OnChanges, OnDestroy { /** * Litener Keyboard Event - * @param {KeyboardEvent} event + * @param KeyboardEvent event */ @HostListener('document:keydown', ['$event']) handleKeyboardEvent(event: KeyboardEvent) { diff --git a/lib/core/viewer/components/viewer.component.ts b/lib/core/viewer/components/viewer.component.ts index 6bbeebb198..574552bb07 100644 --- a/lib/core/viewer/components/viewer.component.ts +++ b/lib/core/viewer/components/viewer.component.ts @@ -436,8 +436,7 @@ export class ViewerComponent implements OnChanges { /** * get File name from url * - * @param {string} url - url file - * @returns {string} name file + * @param url - url file */ getFilenameFromUrl(url: string): string { let anchor = url.indexOf('#'); @@ -454,8 +453,7 @@ export class ViewerComponent implements OnChanges { * http://localhost/test.jpg?cache=1000 * http://localhost/test.jpg#cache=1000 * - * @param {string} fileName - file name - * @returns {string} file name extension + * @param fileName - file name */ getFileExtension(fileName: string): string { if (fileName) { @@ -478,7 +476,7 @@ export class ViewerComponent implements OnChanges { /** * Keyboard event listener - * @param {KeyboardEvent} event + * @param event */ @HostListener('document:keyup', ['$event']) handleKeyboardEvent(event: KeyboardEvent) { diff --git a/lib/core/viewer/directives/viewer-extension.directive.ts b/lib/core/viewer/directives/viewer-extension.directive.ts index 93e22e48ce..f754c766ce 100644 --- a/lib/core/viewer/directives/viewer-extension.directive.ts +++ b/lib/core/viewer/directives/viewer-extension.directive.ts @@ -41,7 +41,7 @@ export class ViewerExtensionDirective implements AfterContentInit { } ngAfterContentInit() { - this.templateModel = {template: this.template, isVisible: false}; + this.templateModel = { template: this.template, isVisible: false }; this.viewerComponent.extensionTemplates.push(this.templateModel); @@ -58,10 +58,8 @@ export class ViewerExtensionDirective implements AfterContentInit { /** * check if the current extension in the viewer is compatible with this extension checking against supportedExtensions - * - * @returns {boolean} */ - isVisible(fileExtension) { + isVisible(fileExtension): boolean { let supportedExtension: string; if (this.supportedExtensions && (this.supportedExtensions instanceof Array)) { diff --git a/lib/core/viewer/services/rendering-queue.services.ts b/lib/core/viewer/services/rendering-queue.services.ts index 0b23f5e4c8..ec67daf46f 100644 --- a/lib/core/viewer/services/rendering-queue.services.ts +++ b/lib/core/viewer/services/rendering-queue.services.ts @@ -19,7 +19,6 @@ import { Injectable } from '@angular/core'; * * RenderingQueueServices rendering of the views for pages and thumbnails. * - * @returns {RenderingQueueServices} . */ @Injectable() export class RenderingQueueServices { @@ -43,24 +42,23 @@ export class RenderingQueueServices { isThumbnailViewEnabled: any = false; /** - * @param {PDFViewer} pdfViewer + * @param pdfViewer */ setViewer(pdfViewer) { this.pdfViewer = pdfViewer; } /** - * @param {PDFThumbnailViewer} pdfThumbnailViewer + * @param pdfThumbnailViewer */ setThumbnailViewer(pdfThumbnailViewer) { this.pdfThumbnailViewer = pdfThumbnailViewer; } /** - * @param {IRenderableView} view - * @returns {boolean} + * @param view */ - isHighestPriority(view: any) { + isHighestPriority(view: any): boolean { return this.highestPriorityPage === view.renderingId; } @@ -129,10 +127,9 @@ export class RenderingQueueServices { } /** - * @param {IRenderableView} view - * @returns {boolean} + * @param view */ - isViewFinished(view) { + isViewFinished(view): boolean { return view.renderingState === this.renderingStates.FINISHED; } @@ -140,7 +137,7 @@ export class RenderingQueueServices { * Render a page or thumbnail view. This calls the appropriate function * based on the views state. If the view is already rendered it will return * false. - * @param {IRenderableView} view + * @param view */ renderView(view: any) { let state = view.renderingState; diff --git a/lib/insights/analytics-process/components/analytics-report-list.component.ts b/lib/insights/analytics-process/components/analytics-report-list.component.ts index a0525b7fdc..503555dcbb 100644 --- a/lib/insights/analytics-process/components/analytics-report-list.component.ts +++ b/lib/insights/analytics-process/components/analytics-report-list.component.ts @@ -128,7 +128,6 @@ export class AnalyticsReportListComponent implements OnInit { /** * Check if the report list is empty - * @returns {boolean|ReportParametersModel[]} */ isReportsEmpty(): boolean { return this.reports === undefined || (this.reports && this.reports.length === 0); diff --git a/lib/insights/analytics-process/services/analytics.service.ts b/lib/insights/analytics-process/services/analytics.service.ts index 1760d36142..d936c0d419 100644 --- a/lib/insights/analytics-process/services/analytics.service.ts +++ b/lib/insights/analytics-process/services/analytics.service.ts @@ -40,7 +40,6 @@ export class AnalyticsService { /** * Retrive all the Deployed app - * @returns {Observable} */ getReportList(appId: number): Observable { return Observable.fromPromise(this.apiService.getInstance().activiti.reportApi.getReportList()) @@ -59,7 +58,6 @@ export class AnalyticsService { /** * Retrive Report by name * @param reportName - string - The name of report - * @returns {Observable} */ getReportByName(reportName: string): Observable { return Observable.fromPromise(this.apiService.getInstance().activiti.reportApi.getReportList()) diff --git a/lib/ng-package/ng-package-insights.json b/lib/insights/ng-package.json similarity index 87% rename from lib/ng-package/ng-package-insights.json rename to lib/insights/ng-package.json index 73bfa8edab..d2efff3269 100644 --- a/lib/ng-package/ng-package-insights.json +++ b/lib/insights/ng-package.json @@ -2,11 +2,13 @@ "$schema": "./node_modules/ng-packagr/ng-package.schema.json", "workingDirectory" : "./ng_work", "src": "../insights/", - "dest": "../insights/dist/", + "dest": "../dist/insights/", "lib": { + "licensePath": "../config/assets/license_header_add.txt", + "comments" : "none", "entryFile": "./public-api.ts", "flatModuleFile": "adf-insights", - "externals": { + "umdModuleIds": { "alfresco-js-api": "alfresco-js-api", "minimatch": "minimatch", "@angular/platform-browser/animations": "@angular/platform-browser/animations", diff --git a/lib/package.json b/lib/package.json index 330dc4b77a..a465bb7393 100644 --- a/lib/package.json +++ b/lib/package.json @@ -26,12 +26,12 @@ "copy-app-schema": "cp core/app-config/schema.json core/dist/app.config.schema.json", "new-build": "npm run build-bundles && npm run build-style-new && npm run copy-i18n && npm run copy-assets && npm run copy-app-schema", "build-bundles": "npm run build-core && npm run link-core && npm run build-content && npm run link-content && npm run build-process && npm run build-insights", - "link-core": "mkdir -p ./node_modules/@alfresco/adf-core/ && cp -R ./core/dist/* ./node_modules/@alfresco/adf-core/", - "link-content": "mkdir -p ./node_modules/@alfresco/adf-content-services/ && cp -R ./content-services/dist/* ./node_modules/@alfresco/adf-content-services/", - "build-core": "ng-packagr -p ./ng-package/ng-package-core.json", - "build-content": "ng-packagr -p ./ng-package/ng-package-content.json", - "build-process": "ng-packagr -p ./ng-package/ng-package-process.json", - "build-insights": "ng-packagr -p ./ng-package/ng-package-insights.json", + "link-core": "mkdir -p ./node_modules/@alfresco/adf-core/ && cp -R ./dist/core/* ./node_modules/@alfresco/adf-core/", + "link-content": "mkdir -p ./node_modules/@alfresco/adf-content-services/ && cp -R ./dist/content-services/* ./node_modules/@alfresco/adf-content-services/", + "build-core": "ng-packagr -p ./core/package.json", + "build-content": "ng-packagr -p ./content-services/package.json", + "build-process": "ng-packagr -p ./process-services/package.json", + "build-insights": "ng-packagr -p ./insights/package.json", "test-export": "node config/test-export.js", "webpack": "node node_modules/webpack/bin/webpack.js" }, @@ -76,7 +76,7 @@ "minimatch": "3.0.4", "moment": "2.18.1", "moment-es6": "^1.0.0", - "ng-packagr": "2.0.0-rc.4", + "ng-packagr": "2.0.0", "ng2-charts": "1.6.0", "pdfjs-dist": "2.0.265", "raphael": "2.2.7", @@ -143,6 +143,7 @@ "traceur": "0.0.91", "ts-loader": "3.3.0", "ts-node": "2.0.0", + "tsickle": "^0.26.0", "tslint": "5.9.1", "tslint-loader": "3.5.3", "typescript": "2.6.1", diff --git a/lib/process-services/app-list/apps-list.component.ts b/lib/process-services/app-list/apps-list.component.ts index fb3e83aec6..c80a1b0dde 100644 --- a/lib/process-services/app-list/apps-list.component.ts +++ b/lib/process-services/app-list/apps-list.component.ts @@ -124,7 +124,6 @@ export class AppsListComponent implements OnInit { /** * Return true if the appId is the current app * @param appId - * @returns {boolean} */ isSelected(appId: number): boolean { return (this.currentApp !== undefined && appId === this.currentApp.id); @@ -153,7 +152,6 @@ export class AppsListComponent implements OnInit { /** * Check if the value of the layoutType property is an allowed value - * @returns {boolean} */ isValidType(): boolean { if (this.layoutType && (this.layoutType === AppsListComponent.LAYOUT_LIST || this.layoutType === AppsListComponent.LAYOUT_GRID)) { @@ -171,7 +169,6 @@ export class AppsListComponent implements OnInit { /** * Return true if the layout type is LIST - * @returns {boolean} */ isList(): boolean { return this.layoutType === AppsListComponent.LAYOUT_LIST; @@ -179,7 +176,6 @@ export class AppsListComponent implements OnInit { /** * Return true if the layout type is GRID - * @returns {boolean} */ isGrid(): boolean { return this.layoutType === AppsListComponent.LAYOUT_GRID; diff --git a/lib/ng-package/ng-package-process.json b/lib/process-services/ng-package.json similarity index 87% rename from lib/ng-package/ng-package-process.json rename to lib/process-services/ng-package.json index 52783e606a..693d094909 100644 --- a/lib/ng-package/ng-package-process.json +++ b/lib/process-services/ng-package.json @@ -2,10 +2,12 @@ "$schema": "./node_modules/ng-packagr/ng-package.schema.json", "workingDirectory": "./ng_work", "src": "../process-services/", - "dest": "../process-services/dist/", + "dest": "../dist/process-services/", "lib": { + "licensePath": "../config/assets/license_header_add.txt", + "comments" : "none", "entryFile": "./public-api.ts", - "externals": { + "umdModuleIds": { "alfresco-js-api": "alfresco-js-api", "flatModuleFile": "adf-process-services", "minimatch": "minimatch", diff --git a/lib/process-services/process-list/components/process-filters.component.ts b/lib/process-services/process-list/components/process-filters.component.ts index 90fd669419..9a6b8eb9c2 100644 --- a/lib/process-services/process-list/components/process-filters.component.ts +++ b/lib/process-services/process-list/components/process-filters.component.ts @@ -186,7 +186,6 @@ export class ProcessFiltersComponent implements OnInit, OnChanges { /** * Return the current task - * @returns {ProcessInstanceFilterRepresentation} */ getCurrentFilter(): ProcessInstanceFilterRepresentation { return this.currentFilter; @@ -194,7 +193,6 @@ export class ProcessFiltersComponent implements OnInit, OnChanges { /** * Check if the filter list is empty - * @returns {boolean} */ isFilterListEmpty(): boolean { return this.filters === undefined || (this.filters && this.filters.length === 0); diff --git a/lib/process-services/process-list/components/process-list.component.ts b/lib/process-services/process-list/components/process-list.component.ts index bc96d8e55a..f5c3c01b0d 100644 --- a/lib/process-services/process-list/components/process-list.component.ts +++ b/lib/process-services/process-list/components/process-list.component.ts @@ -15,10 +15,34 @@ * limitations under the License. */ -import { DataColumn, DataRowEvent, DataSorting, DataTableAdapter, ObjectDataColumn, ObjectDataRow, ObjectDataTableAdapter } from '@alfresco/adf-core'; -import { AppConfigService, DataColumnListComponent, PaginatedComponent, PaginationComponent, PaginationQueryParams, UserPreferencesService } from '@alfresco/adf-core'; +import { + DataColumn, + DataRowEvent, + DataSorting, + DataTableAdapter, + ObjectDataColumn, + ObjectDataRow, + ObjectDataTableAdapter +} from '@alfresco/adf-core'; +import { + AppConfigService, + DataColumnListComponent, + PaginatedComponent, + PaginationComponent, + PaginationQueryParams, + UserPreferencesService +} from '@alfresco/adf-core'; import { DatePipe } from '@angular/common'; -import { AfterContentInit, Component, ContentChild, EventEmitter, Input, OnChanges, Output, SimpleChanges } from '@angular/core'; +import { + AfterContentInit, + Component, + ContentChild, + EventEmitter, + Input, + OnChanges, + Output, + SimpleChanges +} from '@angular/core'; import { ProcessFilterParamRepresentationModel } from '../models/filter-process.model'; import { processPresetsDefaultModel } from '../models/process-preset.model'; import { ProcessService } from '../services/process.service'; @@ -200,7 +224,6 @@ export class ProcessInstanceListComponent implements OnChanges, AfterContentInit /** * Create an array of ObjectDataRow * @param instances - * @returns {ObjectDataRow[]} */ private createDataRow(instances: any[]): ObjectDataRow[] { let instancesRows: ObjectDataRow[] = []; @@ -255,7 +278,6 @@ export class ProcessInstanceListComponent implements OnChanges, AfterContentInit /** * Return the current id - * @returns {string} */ getCurrentId(): string { return this.currentInstanceId; @@ -263,7 +285,6 @@ export class ProcessInstanceListComponent implements OnChanges, AfterContentInit /** * Check if the list is empty - * @returns {ObjectDataTableAdapter|boolean} */ isListEmpty(): boolean { return this.data === undefined || @@ -295,9 +316,8 @@ export class ProcessInstanceListComponent implements OnChanges, AfterContentInit /** * Optimize name field * @param instances - * @returns {any[]} */ - private optimizeNames(instances: any[]) { + private optimizeNames(instances: any[]): any[] { instances = instances.map(t => { t.obj.name = this.getProcessNameOrDescription(t.obj, 'medium'); return t; diff --git a/lib/process-services/process-list/models/filter-process.model.ts b/lib/process-services/process-list/models/filter-process.model.ts index 5a2cf67243..3464bd229a 100644 --- a/lib/process-services/process-list/models/filter-process.model.ts +++ b/lib/process-services/process-list/models/filter-process.model.ts @@ -44,11 +44,7 @@ export class FilterProcessRepresentationModel implements UserProcessInstanceFilt } /** - * * This object represent the parameters of a process filter. - * - * - * @returns {ProcessFilterParamRepresentationModel} . */ export class ProcessFilterParamRepresentationModel implements ProcessFilterRequestRepresentation { diff --git a/lib/process-services/process-list/services/process-filter.service.ts b/lib/process-services/process-list/services/process-filter.service.ts index 12dde7113b..4a87eebd19 100644 --- a/lib/process-services/process-list/services/process-filter.service.ts +++ b/lib/process-services/process-list/services/process-filter.service.ts @@ -44,7 +44,6 @@ export class ProcessFilterService { * Retrieve the process filter by id * @param filterId - number - The id of the filter * @param appId - string - optional - The id of app - * @returns {Observable} */ getProcessFilterById(filterId: number, appId?: number): Observable { return Observable.fromPromise(this.callApiProcessFilters(appId)) @@ -57,7 +56,6 @@ export class ProcessFilterService { * Retrieve the process filter by name * @param filterName - string - The name of the filter * @param appId - string - optional - The id of app - * @returns {Observable} */ getProcessFilterByName(filterName: string, appId?: number): Observable { return Observable.fromPromise(this.callApiProcessFilters(appId)) @@ -69,7 +67,6 @@ export class ProcessFilterService { /** * Create and return the default filters * @param appId - * @returns {FilterProcessRepresentationModel[]} */ public createDefaultFilters(appId: number): Observable { let runningFilter = this.getRunningFilterInstance(appId); @@ -123,7 +120,6 @@ export class ProcessFilterService { /** * Return a static Completed filter instance * @param appId - * @returns {FilterProcessRepresentationModel} */ private getCompletedFilterInstance(appId: number): FilterProcessRepresentationModel { return new FilterProcessRepresentationModel({ @@ -138,7 +134,6 @@ export class ProcessFilterService { /** * Return a static All filter instance * @param appId - * @returns {FilterProcessRepresentationModel} */ private getAllFilterInstance(appId: number): FilterProcessRepresentationModel { return new FilterProcessRepresentationModel({ @@ -153,7 +148,6 @@ export class ProcessFilterService { /** * Add a filter * @param filter - FilterProcessRepresentationModel - * @returns {FilterProcessRepresentationModel} */ addProcessFilter(filter: FilterProcessRepresentationModel): Observable { return Observable.fromPromise(this.alfrescoApiService.getInstance().activiti.userFiltersApi.createUserProcessInstanceFilter(filter)) diff --git a/lib/process-services/task-list/components/task-details.component.ts b/lib/process-services/task-list/components/task-details.component.ts index 29729c46f6..0fc8b8718c 100644 --- a/lib/process-services/task-list/components/task-details.component.ts +++ b/lib/process-services/task-list/components/task-details.component.ts @@ -16,8 +16,16 @@ */ import { PeopleProcessService, UserProcessModel } from '@alfresco/adf-core'; -import { AuthenticationService, CardViewUpdateService, ClickNotification, LogService, UpdateNotification, FormRenderingService } from '@alfresco/adf-core'; -import { Component, +import { + AuthenticationService, + CardViewUpdateService, + ClickNotification, + LogService, + UpdateNotification, + FormRenderingService +} from '@alfresco/adf-core'; +import { + Component, EventEmitter, Input, OnChanges, @@ -209,12 +217,11 @@ export class TaskDetailsComponent implements OnInit, OnChanges { /** * Check if the task has a form - * @returns {TaskDetailsModel|string|boolean} */ - hasFormKey() { + hasFormKey(): TaskDetailsModel | string | boolean { return (this.taskDetails - && this.taskDetails.formKey - && this.taskDetails.formKey !== 'null'); + && this.taskDetails.formKey + && this.taskDetails.formKey !== 'null'); } isTaskActive() { @@ -339,7 +346,7 @@ export class TaskDetailsComponent implements OnInit, OnChanges { } onFormError(error: any): void { - this.errorDialogRef = this.dialog.open(this.errorDialog, {width: '500px'}); + this.errorDialogRef = this.dialog.open(this.errorDialog, { width: '500px' }); this.error.emit(error); } diff --git a/lib/process-services/task-list/components/task-filters.component.ts b/lib/process-services/task-list/components/task-filters.component.ts index 267e60821c..be2f858088 100644 --- a/lib/process-services/task-list/components/task-filters.component.ts +++ b/lib/process-services/task-list/components/task-filters.component.ts @@ -216,7 +216,6 @@ export class TaskFiltersComponent implements OnInit, OnChanges { /** * Return the current task - * @returns {FilterRepresentationModel} */ getCurrentFilter(): FilterRepresentationModel { return this.currentFilter; @@ -224,7 +223,6 @@ export class TaskFiltersComponent implements OnInit, OnChanges { /** * Check if the filter list is empty - * @returns {boolean} */ isFilterListEmpty(): boolean { return this.filters === undefined || (this.filters && this.filters.length === 0); diff --git a/lib/process-services/task-list/components/task-list.component.ts b/lib/process-services/task-list/components/task-list.component.ts index b93263ca46..fb61f45fb9 100644 --- a/lib/process-services/task-list/components/task-list.component.ts +++ b/lib/process-services/task-list/components/task-list.component.ts @@ -15,9 +15,26 @@ * limitations under the License. */ -import { DataColumn, DataRowEvent, DataTableAdapter, ObjectDataColumn, ObjectDataRow, ObjectDataTableAdapter } from '@alfresco/adf-core'; +import { + DataColumn, + DataRowEvent, + DataTableAdapter, + ObjectDataColumn, + ObjectDataRow, + ObjectDataTableAdapter +} from '@alfresco/adf-core'; import { AppConfigService, DataColumnListComponent, PaginationComponent } from '@alfresco/adf-core'; -import { AfterContentInit, Component, ContentChild, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core'; +import { + AfterContentInit, + Component, + ContentChild, + EventEmitter, + Input, + OnChanges, + OnInit, + Output, + SimpleChanges +} from '@angular/core'; import { Observable } from 'rxjs/Observable'; import { TaskQueryRequestRepresentationModel } from '../models/filter.model'; import { TaskListModel } from '../models/task-list.model'; @@ -128,7 +145,6 @@ export class TaskListComponent implements OnChanges, OnInit, AfterContentInit { * When enabled the component reloads data from it's current source instead of the server side. * This allows generating and displaying custom data sets (i.e. filtered out content). * - * @type {boolean} * @memberOf TaskListComponent */ hasCustomDataSource: boolean = false; @@ -218,14 +234,13 @@ export class TaskListComponent implements OnChanges, OnInit, AfterContentInit { private loadTasksByState(): Observable { return this.requestNode.state === 'all' - ? this.taskListService.findAllTasksWithoutState(this.requestNode) - : this.taskListService.findTasksByState(this.requestNode); + ? this.taskListService.findAllTasksWithoutState(this.requestNode) + : this.taskListService.findTasksByState(this.requestNode); } /** * Create an array of ObjectDataRow * @param instances - * @returns {ObjectDataRow[]} */ private createDataRow(instances: any[]): ObjectDataRow[] { let instancesRows: ObjectDataRow[] = []; @@ -280,7 +295,6 @@ export class TaskListComponent implements OnChanges, OnInit, AfterContentInit { /** * Return the current id - * @returns {string} */ getCurrentId(): string { return this.currentInstanceId; @@ -289,15 +303,13 @@ export class TaskListComponent implements OnChanges, OnInit, AfterContentInit { /** * Check if the taskId is the same of the selected task * @param taskId - * @returns {boolean} */ - isEqualToCurrentId(taskId: string) { + isEqualToCurrentId(taskId: string): boolean { return this.currentInstanceId === taskId ? true : false; } /** * Check if the list is empty - * @returns {ObjectDataTableAdapter|boolean} */ isListEmpty(): boolean { return this.data === undefined || @@ -330,9 +342,8 @@ export class TaskListComponent implements OnChanges, OnInit, AfterContentInit { /** * Optimize name field * @param istances - * @returns {any[]} */ - private optimizeNames(istances: any[]) { + private optimizeNames(istances: any[]): any[] { istances = istances.map(t => { t.obj.name = t.obj.name || 'No name'; return t; diff --git a/lib/process-services/task-list/models/form.model.ts b/lib/process-services/task-list/models/form.model.ts index 0c52227fe1..e0ca1dcc1d 100644 --- a/lib/process-services/task-list/models/form.model.ts +++ b/lib/process-services/task-list/models/form.model.ts @@ -16,11 +16,7 @@ */ /** - * * This object represent of the Form. - * - * - * @returns {Form} . */ export class Form { diff --git a/lib/process-services/task-list/models/start-task.model.ts b/lib/process-services/task-list/models/start-task.model.ts index dfe1199f9a..6dd86d259f 100644 --- a/lib/process-services/task-list/models/start-task.model.ts +++ b/lib/process-services/task-list/models/start-task.model.ts @@ -16,11 +16,7 @@ */ /** - * * This object represent of the StartTaskModel. - * - * - * @returns {StartTaskModel} . */ import { UserProcessModel } from '@alfresco/adf-core'; diff --git a/lib/process-services/task-list/models/task-details.model.ts b/lib/process-services/task-list/models/task-details.model.ts index 7e3bb47973..ed7a3699e7 100644 --- a/lib/process-services/task-list/models/task-details.model.ts +++ b/lib/process-services/task-list/models/task-details.model.ts @@ -16,11 +16,7 @@ */ /** - * * This object represent the details of a task. - * - * - * @returns {TaskDetailsModel} . */ import { UserProcessModel } from '@alfresco/adf-core'; import { TaskRepresentation } from 'alfresco-js-api'; diff --git a/lib/process-services/task-list/models/user-event.model.ts b/lib/process-services/task-list/models/user-event.model.ts index 1837a25af8..e1ce3369e2 100644 --- a/lib/process-services/task-list/models/user-event.model.ts +++ b/lib/process-services/task-list/models/user-event.model.ts @@ -16,11 +16,7 @@ */ /** - * * This object represent the User Event. - * - * - * @returns {UserEventModel} . */ export class UserEventModel { type: string = ''; diff --git a/lib/process-services/task-list/services/task-filter.service.ts b/lib/process-services/task-list/services/task-filter.service.ts index dc892c25f9..5b70e4b6fa 100644 --- a/lib/process-services/task-list/services/task-filter.service.ts +++ b/lib/process-services/task-list/services/task-filter.service.ts @@ -37,7 +37,6 @@ export class TaskFilterService { /** * Create and return the default filters * @param appId - * @returns {FilterRepresentationModel[]} */ public createDefaultFilters(appId: number): Observable { let involvedTasksFilter = this.getInvolvedTasksFilterInstance(appId); @@ -87,7 +86,6 @@ export class TaskFilterService { /** * Retrieve all the Tasks filters - * @returns {Observable} */ getTaskListFilters(appId?: number): Observable { return Observable.fromPromise(this.callApiTaskFilters(appId)) @@ -105,7 +103,6 @@ export class TaskFilterService { * Retrieve the Tasks filter by id * @param filterId - number - The id of the filter * @param appId - string - optional - The id of app - * @returns {Observable} */ getTaskFilterById(filterId: number, appId?: number): Observable { return Observable.fromPromise(this.callApiTaskFilters(appId)) @@ -117,7 +114,6 @@ export class TaskFilterService { /** * Retrieve the Tasks filter by name * @param taskName - string - The name of the filter - * @returns {Observable} */ getTaskFilterByName(taskName: string, appId?: number): Observable { return Observable.fromPromise(this.callApiTaskFilters(appId)) @@ -129,7 +125,6 @@ export class TaskFilterService { /** * Add a filter * @param filter - FilterRepresentationModel - * @returns {FilterRepresentationModel} */ addFilter(filter: FilterRepresentationModel): Observable { return Observable.fromPromise(this.apiService.getInstance().activiti.userFiltersApi.createUserTaskFilter(filter)) @@ -150,7 +145,6 @@ export class TaskFilterService { /** * Return a static Involved filter instance * @param appId - * @returns {FilterRepresentationModel} */ getInvolvedTasksFilterInstance(appId: number): FilterRepresentationModel { return new FilterRepresentationModel({ @@ -165,7 +159,6 @@ export class TaskFilterService { /** * Return a static My task filter instance * @param appId - * @returns {FilterRepresentationModel} */ getMyTasksFilterInstance(appId: number): FilterRepresentationModel { return new FilterRepresentationModel({ @@ -180,7 +173,6 @@ export class TaskFilterService { /** * Return a static Queued filter instance * @param appId - * @returns {FilterRepresentationModel} */ getQueuedTasksFilterInstance(appId: number): FilterRepresentationModel { return new FilterRepresentationModel({ @@ -195,7 +187,6 @@ export class TaskFilterService { /** * Return a static Completed filter instance * @param appId - * @returns {FilterRepresentationModel} */ getCompletedTasksFilterInstance(appId: number): FilterRepresentationModel { return new FilterRepresentationModel({ diff --git a/lib/process-services/task-list/services/tasklist.service.ts b/lib/process-services/task-list/services/tasklist.service.ts index 66061ec257..c39b769ba4 100644 --- a/lib/process-services/task-list/services/tasklist.service.ts +++ b/lib/process-services/task-list/services/tasklist.service.ts @@ -43,7 +43,6 @@ export class TaskListService { * Return all the filters in the list where the task id belong * @param taskId - string * @param filter - FilterRepresentationModel [] - * @returns {FilterRepresentationModel} */ getFilterForTaskById(taskId: string, filterList: FilterRepresentationModel[]): Observable { return Observable.from(filterList) @@ -54,7 +53,6 @@ export class TaskListService { /** * Return the search node for query task based on the given filter * @param filter - FilterRepresentationModel - * @returns {TaskQueryRequestRepresentationModel} */ private generateTaskRequestNodeFromFilter(filter: FilterRepresentationModel): TaskQueryRequestRepresentationModel { let requestNode = { @@ -70,7 +68,6 @@ export class TaskListService { * Check if a taskId is filtered with the given filter * @param taskId - string * @param filter - FilterRepresentationModel - * @returns {FilterRepresentationModel} */ isTaskRelatedToFilter(taskId: string, filter: FilterRepresentationModel): Observable { let requestNodeForFilter = this.generateTaskRequestNodeFromFilter(filter); @@ -83,7 +80,6 @@ export class TaskListService { /** * Retrieve all the tasks filtered by filterModel * @param filter - TaskFilterRepresentationModel - * @returns {any} */ getTasks(requestNode: TaskQueryRequestRepresentationModel): Observable { return Observable.fromPromise(this.callApiTasksFiltered(requestNode)) @@ -96,7 +92,6 @@ export class TaskListService { /** * Retrieve tasks filtered by filterModel and state * @param filter - TaskFilterRepresentationModel - * @returns {any} */ findTasksByState(requestNode: TaskQueryRequestRepresentationModel, state?: string): Observable { if (state) { @@ -108,7 +103,6 @@ export class TaskListService { /** * Retrieve all tasks filtered by filterModel and state * @param filter - TaskFilterRepresentationModel - * @returns {any} */ findAllTaskByState(requestNode: TaskQueryRequestRepresentationModel, state?: string): Observable { if (state) { @@ -123,7 +117,6 @@ export class TaskListService { /** * Retrieve all tasks filtered by filterModel irrespective of state * @param filter - TaskFilterRepresentationModel - * @returns {any} */ findAllTasksWithoutState(requestNode: TaskQueryRequestRepresentationModel): Observable { return Observable.forkJoin( @@ -142,7 +135,6 @@ export class TaskListService { /** * Retrieve all the task details * @param id - taskId - * @returns {} */ getTaskDetails(taskId: string): Observable { return Observable.fromPromise(this.callApiTaskDetails(taskId)) @@ -155,7 +147,6 @@ export class TaskListService { /** * Retrieve all the task's checklist * @param id - taskId - * @returns {TaskDetailsModel} */ getTaskChecklist(id: string): Observable { return Observable.fromPromise(this.callApiTaskChecklist(id)) @@ -171,7 +162,6 @@ export class TaskListService { /** * Retrieve all the form shared with this user - * @returns {TaskDetailsModel} */ getFormList(): Observable
{ let opts = { @@ -197,7 +187,6 @@ export class TaskListService { /** * Add a task * @param task - TaskDetailsModel - * @returns {TaskDetailsModel} */ addTask(task: TaskDetailsModel): Observable { return Observable.fromPromise(this.callApiAddTask(task)) @@ -219,7 +208,6 @@ export class TaskListService { /** * Make the task completed * @param id - taskId - * @returns {TaskDetailsModel} */ completeTask(taskId: string) { return Observable.fromPromise(this.apiService.getInstance().activiti.taskApi.completeTask(taskId)) @@ -230,7 +218,6 @@ export class TaskListService { /** * Return the total number of the tasks by filter * @param requestNode - TaskFilterRepresentationModel - * @returns {any} */ public getTotalTasks(requestNode: TaskQueryRequestRepresentationModel): Observable { requestNode.size = 0; @@ -243,7 +230,6 @@ export class TaskListService { /** * Create a new standalone task * @param task - TaskDetailsModel - * @returns {TaskDetailsModel} */ createNewTask(task: TaskDetailsModel): Observable { return Observable.fromPromise(this.callApiCreateTask(task)) @@ -257,7 +243,6 @@ export class TaskListService { * Assign task to user/group * @param taskId - string * @param requestNode - any - * @returns {TaskDetailsModel} */ assignTask(taskId: string, requestNode: any): Observable { let assignee = {assignee: requestNode.id}; diff --git a/scripts/npm-publish.sh b/scripts/npm-publish.sh index 1fab5cee86..60613f7b00 100755 --- a/scripts/npm-publish.sh +++ b/scripts/npm-publish.sh @@ -152,7 +152,7 @@ fi for PACKAGE in ${projects[@]} do - DESTDIR="$DIR/../lib/${PACKAGE}/dist" + DESTDIR="$DIR/../lib/dist/${PACKAGE}" echo "====== MOVE DIR: ${DESTDIR} ===== " cd ${DESTDIR}