mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-2149] Update ng-packagr to 2.0.0 (#2935)
* ng-packagr version 2.0.0 core fixes * fix content services jsdoc * fix process service jsdoc * last update new build 2.0.0 * fix comment jsdoc
This commit is contained in:
@@ -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 {
|
||||
|
@@ -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 [
|
||||
|
@@ -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',
|
||||
|
@@ -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 {
|
||||
|
@@ -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<any> {
|
||||
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<ExternalContentLink> {
|
||||
let apiService: AlfrescoApi = this.apiService.getInstance();
|
||||
|
@@ -109,7 +109,6 @@ export class FormService {
|
||||
|
||||
/**
|
||||
* Create a Form with a fields for each metadata properties
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
createFormFromANode(formName: string): Observable<any> {
|
||||
return Observable.create(observer => {
|
||||
@@ -131,7 +130,6 @@ export class FormService {
|
||||
|
||||
/**
|
||||
* Create a Form
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
createForm(formName: string): Observable<any> {
|
||||
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<any>}
|
||||
*/
|
||||
addFieldsToAForm(formId: string, formModel: FormDefinitionModel): Observable<any> {
|
||||
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<any>}
|
||||
*/
|
||||
searchFrom(name: string): Observable<any> {
|
||||
let opts = {
|
||||
@@ -184,7 +180,6 @@ export class FormService {
|
||||
|
||||
/**
|
||||
* Get All the forms
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
getForms(): Observable<any> {
|
||||
let opts = {
|
||||
@@ -198,7 +193,6 @@ export class FormService {
|
||||
|
||||
/**
|
||||
* Get Process Definitions
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
getProcessDefinitions(): Observable<any> {
|
||||
return Observable.fromPromise(this.processApi.getProcessDefinitions({}))
|
||||
@@ -214,7 +208,6 @@ export class FormService {
|
||||
|
||||
/**
|
||||
* Get All the Tasks
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
getTasks(): Observable<any> {
|
||||
return Observable.fromPromise(this.taskApi.listTasks({}))
|
||||
@@ -225,7 +218,6 @@ export class FormService {
|
||||
/**
|
||||
* Get Task
|
||||
* @param taskId Task Id
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
getTask(taskId: string): Observable<any> {
|
||||
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<any>}
|
||||
*/
|
||||
saveTaskForm(taskId: string, formValues: FormValues): Observable<any> {
|
||||
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<any>}
|
||||
*/
|
||||
completeTaskForm(taskId: string, formValues: FormValues, outcome?: string): Observable<any> {
|
||||
let data: any = {values: formValues};
|
||||
@@ -267,7 +257,6 @@ export class FormService {
|
||||
/**
|
||||
* Get Form related to a taskId
|
||||
* @param taskId Task Id
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
getTaskForm(taskId: string): Observable<any> {
|
||||
return Observable.fromPromise(this.taskApi.getTaskForm(taskId))
|
||||
@@ -278,7 +267,6 @@ export class FormService {
|
||||
/**
|
||||
* Get Form Definition
|
||||
* @param formId Form Id
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
getFormDefinitionById(formId: string): Observable<any> {
|
||||
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<T>|Promise<ErrorObservable>}
|
||||
*/
|
||||
getFormDefinitionByName(name: string): Observable<any> {
|
||||
let opts = {
|
||||
@@ -306,7 +293,6 @@ export class FormService {
|
||||
/**
|
||||
* Get start form instance for a given processId
|
||||
* @param processId Process definition ID
|
||||
* @returns {Observable<any>}
|
||||
*/
|
||||
getStartFormInstance(processId: string): Observable<any> {
|
||||
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<any>}
|
||||
*/
|
||||
getStartFormDefinition(processId: string): Observable<any> {
|
||||
return Observable.fromPromise(
|
||||
|
@@ -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<NodeMetadata> {
|
||||
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<any> {
|
||||
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<any> {
|
||||
let body = {
|
||||
|
@@ -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;
|
||||
|
29
lib/core/ng-package.json
Normal file
29
lib/core/ng-package.json
Normal file
@@ -0,0 +1,29 @@
|
||||
{
|
||||
"$schema": "./node_modules/ng-packagr/ng-package.schema.json",
|
||||
"workingDirectory" : "./ng_work",
|
||||
"src": "./core/",
|
||||
"dest": "../dist/core/",
|
||||
"lib": {
|
||||
"licensePath": "../config/assets/license_header_add.txt",
|
||||
"comments" : "none",
|
||||
"entryFile": "./public-api.ts",
|
||||
"flatModuleFile": "adf-core",
|
||||
"umdModuleIds": {
|
||||
"alfresco-js-api": "alfresco-js-api",
|
||||
"minimatch": "minimatch",
|
||||
"@angular/platform-browser/animations": "@angular/platform-browser/animations",
|
||||
"@angular/material": "@angular/material",
|
||||
"@mat-datetimepicker/core": "@mat-datetimepicker/core",
|
||||
"@mat-datetimepicker/moment": "@mat-datetimepicker/moment",
|
||||
"@angular/flex-layout": "@angular/flex-layout",
|
||||
"@angular/material-moment-adapter": "@angular/material-moment-adapter",
|
||||
"@angular/animations": "@angular/animations",
|
||||
"@angular/cdk/platform": "@angular/cdk/platform",
|
||||
"@angular/material/core": "@angular/material/core",
|
||||
"moment": "moment",
|
||||
"moment-es6": "moment-es6",
|
||||
"moment/src/moment": "moment/src/moment",
|
||||
"@ngx-translate/core": "@ngx-translate/core"
|
||||
}
|
||||
}
|
||||
}
|
@@ -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<R>|Observable<T>}
|
||||
*/
|
||||
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<any>}
|
||||
*/
|
||||
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<R>|Observable<T>}
|
||||
*/
|
||||
logout() {
|
||||
return Observable.fromPromise(this.callApiLogout())
|
||||
@@ -127,7 +122,6 @@ export class AuthenticationService {
|
||||
|
||||
/**
|
||||
*
|
||||
* @returns {*|Observable<string>|Observable<any>|Promise<T>}
|
||||
*/
|
||||
private callApiLogout(): Promise<any> {
|
||||
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<any> {
|
||||
this.logService.error('Error when logging in', error);
|
||||
|
@@ -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<any>} URL address.
|
||||
*/
|
||||
getNodeContent(nodeId: string): Observable<any> {
|
||||
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;
|
||||
|
@@ -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}` +
|
||||
|
@@ -73,7 +73,6 @@ export class PeopleProcessService {
|
||||
/**
|
||||
* Throw the error
|
||||
* @param error
|
||||
* @returns {ErrorObservable}
|
||||
*/
|
||||
private handleError(error: Response) {
|
||||
this.logService.error(error);
|
||||
|
@@ -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 {
|
||||
|
@@ -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;
|
||||
|
@@ -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<any>} 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;
|
||||
}
|
||||
|
@@ -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
|
||||
|
@@ -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
|
||||
|
@@ -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 {
|
||||
|
||||
|
@@ -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) {
|
||||
|
@@ -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) {
|
||||
|
@@ -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)) {
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user