mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[AAE-7100] ESLint support for ADF Core and DemoShell projects (#7481)
* remove tsconfig.base as per eslint schematics * add schematics * upgrade demoshell to eslint * fix eslint issues for demoshell * integrate eslint for ADF core and fix some issues * turn into warn * fix code * workaround for Chrome clipboard issue * exclude e2e tests * exclude e2e
This commit is contained in:
@@ -23,7 +23,7 @@ import {
|
||||
ViewEncapsulation,
|
||||
ElementRef,
|
||||
Output,
|
||||
EventEmitter, AfterViewInit, ViewChild, HostListener
|
||||
EventEmitter, AfterViewInit, ViewChild, HostListener, OnDestroy
|
||||
} from '@angular/core';
|
||||
import { ContentService } from '../../services/content.service';
|
||||
import { AppConfigService } from './../../app-config/app-config.service';
|
||||
@@ -36,7 +36,7 @@ import Cropper from 'cropperjs';
|
||||
host: { 'class': 'adf-image-viewer' },
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class ImgViewerComponent implements AfterViewInit, OnChanges {
|
||||
export class ImgViewerComponent implements AfterViewInit, OnChanges, OnDestroy {
|
||||
|
||||
@Input()
|
||||
showToolbar = true;
|
||||
@@ -53,9 +53,11 @@ export class ImgViewerComponent implements AfterViewInit, OnChanges {
|
||||
@Input()
|
||||
nameFile: string;
|
||||
|
||||
// eslint-disable-next-line @angular-eslint/no-output-native
|
||||
@Output()
|
||||
error = new EventEmitter<any>();
|
||||
|
||||
// eslint-disable-next-line @angular-eslint/no-output-native
|
||||
@Output()
|
||||
submit = new EventEmitter<any>();
|
||||
|
||||
|
@@ -15,6 +15,10 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
/* eslint-disable no-underscore-dangle */
|
||||
/* eslint-disable @angular-eslint/no-output-native */
|
||||
|
||||
import {
|
||||
Component,
|
||||
TemplateRef,
|
||||
@@ -360,7 +364,7 @@ export class PdfViewerComponent implements OnChanges, OnDestroy {
|
||||
if (!this.isSameScale(this.currentScale, newScale)) {
|
||||
this.currentScale = newScale;
|
||||
|
||||
this.pdfViewer._pages.forEach(function (currentPage) {
|
||||
this.pdfViewer._pages.forEach(function(currentPage) {
|
||||
currentPage.update(newScale);
|
||||
});
|
||||
}
|
||||
@@ -539,8 +543,9 @@ export class PdfViewerComponent implements OnChanges, OnDestroy {
|
||||
}
|
||||
|
||||
private generateUuid() {
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {
|
||||
const r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);
|
||||
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
|
||||
const r = Math.random() * 16 | 0;
|
||||
const v = c === 'x' ? r : (r & 0x3 | 0x8);
|
||||
return v.toString(16);
|
||||
});
|
||||
}
|
||||
|
@@ -217,14 +217,12 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
@Output()
|
||||
invalidSharedLink = new EventEmitter();
|
||||
|
||||
TRY_TIMEOUT: number = 10000;
|
||||
|
||||
viewerType = 'unknown';
|
||||
isLoading = false;
|
||||
nodeEntry: NodeEntry;
|
||||
versionEntry: VersionEntry;
|
||||
|
||||
extensionTemplates: { template: TemplateRef<any>, isVisible: boolean }[] = [];
|
||||
extensionTemplates: { template: TemplateRef<any>; isVisible: boolean }[] = [];
|
||||
urlFileContent: string;
|
||||
otherMenu: any;
|
||||
extension: string;
|
||||
@@ -655,6 +653,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
|
||||
/**
|
||||
* Keyboard event listener
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
@HostListener('document:keyup', ['$event'])
|
||||
@@ -730,8 +729,8 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
this.viewerType = 'image';
|
||||
this.urlFileContent = this.contentApi.getSharedLinkRenditionUrl(sharedId, 'imgpreview');
|
||||
}
|
||||
} catch (error) {
|
||||
this.logService.error(error);
|
||||
} catch (renditionError) {
|
||||
this.logService.error(renditionError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user