[ADF-863] codelyzer documentlist (#2059)

* codelyzer documentlist

* tslint error after codelizer

* fix import

* fix tag test
This commit is contained in:
Eugenio Romano
2017-07-08 13:50:06 +02:00
committed by GitHub
parent 283f824eb5
commit c6e1bdff70
72 changed files with 504 additions and 240 deletions

View File

@@ -15,16 +15,16 @@
* limitations under the License.
*/
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { ImgViewerComponent } from './imgViewer.component';
import { DebugElement, SimpleChange } from '@angular/core';
import { DebugElement, SimpleChange } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import {
AlfrescoApiService,
AlfrescoAuthenticationService,
AlfrescoSettingsService,
AlfrescoApiService,
CoreModule,
ContentService
ContentService,
CoreModule
} from 'ng2-alfresco-core';
import { ImgViewerComponent } from './imgViewer.component';
describe('Test ng2-alfresco-viewer Img viewer component ', () => {

View File

@@ -15,15 +15,15 @@
* limitations under the License.
*/
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { MediaPlayerComponent } from './mediaPlayer.component';
import { DebugElement, SimpleChange } from '@angular/core';
import { DebugElement, SimpleChange } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { ContentService } from 'ng2-alfresco-core';
import { MediaPlayerComponent } from './mediaPlayer.component';
import {
AlfrescoApiService,
AlfrescoAuthenticationService,
AlfrescoSettingsService,
AlfrescoApiService,
CoreModule
} from 'ng2-alfresco-core';

View File

@@ -15,35 +15,35 @@
* limitations under the License.
*/
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { NotSupportedFormat } from './notSupportedFormat.component';
import { PdfViewerComponent } from './pdfViewer.component';
import { DebugElement } from '@angular/core';
import { MdIconModule, MdButtonModule, MdProgressSpinnerModule } from '@angular/material';
import { Subject } from 'rxjs';
import { DebugElement } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { MdButtonModule, MdIconModule, MdProgressSpinnerModule } from '@angular/material';
import {
AlfrescoApiService,
AlfrescoAuthenticationService,
AlfrescoSettingsService,
CoreModule,
ContentService,
AlfrescoApiService,
CoreModule,
LogService,
RenditionsService
} from 'ng2-alfresco-core';
import { Subject } from 'rxjs/Subject';
import { NotSupportedFormatComponent } from './notSupportedFormat.component';
import { PdfViewerComponent } from './pdfViewer.component';
type RenditionResponse = {
interface RenditionResponse {
entry: {
status: string
}
};
};
describe('Test ng2-alfresco-viewer Not Supported Format View component', () => {
const nodeId = 'not-supported-node-id';
let component: NotSupportedFormat;
let component: NotSupportedFormatComponent;
let service: ContentService;
let fixture: ComponentFixture<NotSupportedFormat>;
let fixture: ComponentFixture<NotSupportedFormatComponent>;
let debug: DebugElement;
let element: HTMLElement;
let renditionsService: RenditionsService;
@@ -60,7 +60,7 @@ describe('Test ng2-alfresco-viewer Not Supported Format View component', () => {
MdProgressSpinnerModule
],
declarations: [
NotSupportedFormat,
NotSupportedFormatComponent,
PdfViewerComponent
],
providers: [
@@ -75,7 +75,7 @@ describe('Test ng2-alfresco-viewer Not Supported Format View component', () => {
}));
beforeEach(() => {
fixture = TestBed.createComponent(NotSupportedFormat);
fixture = TestBed.createComponent(NotSupportedFormatComponent);
service = fixture.debugElement.injector.get(ContentService);
debug = fixture.debugElement;
element = fixture.nativeElement;

View File

@@ -26,7 +26,7 @@ const DEFAULT_CONVERSION_ENCODING = 'pdf';
templateUrl: './notSupportedFormat.component.html',
styleUrls: ['./notSupportedFormat.component.css']
})
export class NotSupportedFormat implements OnInit {
export class NotSupportedFormatComponent implements OnInit {
@Input()
nameFile: string;

View File

@@ -1,5 +1,5 @@
<!-- Start Pdf Canvas -->
<div id="viewer-pdf-container" class="viewer-pdf-container" (keypress)=eventHandler() (window:resize)="onResize($event)">
<div id="viewer-pdf-container" class="viewer-pdf-container" (window:resize)="onResize($event)">
<div id="viewer-viewerPdf" class="pdfViewer">
<div id="loader-container" class="loader-container">
<div class="loader-item">

View File

@@ -15,17 +15,17 @@
* limitations under the License.
*/
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { RenderingQueueServices } from '../services/rendering-queue.services';
import { PdfViewerComponent } from './pdfViewer.component';
import { EventMock } from '../assets/event.mock';
import { DebugElement } from '@angular/core';
import { DebugElement } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import {
AlfrescoApiService,
AlfrescoAuthenticationService,
AlfrescoSettingsService,
AlfrescoApiService,
CoreModule
} from 'ng2-alfresco-core';
import { EventMock } from '../assets/event.mock';
import { RenderingQueueServices } from '../services/rendering-queue.services';
import { PdfViewerComponent } from './pdfViewer.component';
describe('Test ng2-alfresco-viewer PdfViewer component', () => {

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component, HostListener, Input } from '@angular/core';
import { Component, HostListener, Input, OnChanges } from '@angular/core';
import { LogService } from 'ng2-alfresco-core';
import { RenderingQueueServices } from '../services/rendering-queue.services';
@@ -27,7 +27,7 @@ declare let PDFJS: any;
styleUrls: ['./pdfViewer.component.css', './pdfViewerHost.component.css'],
providers: [RenderingQueueServices]
})
export class PdfViewerComponent {
export class PdfViewerComponent implements OnChanges {
@Input()
urlFile: string;
@@ -97,11 +97,11 @@ export class PdfViewerComponent {
this.currentPdfDocument.getPage(1).then(() => {
this.scalePage('auto');
resolve();
}, (error) => {
}, (error) => {
reject(error);
});
}, (error) => {
}, (error) => {
reject(error);
});
}
@@ -124,7 +124,7 @@ export class PdfViewerComponent {
window.document.addEventListener('scroll', (event) => {
this.watchScroll(event.target);
}, true);
}, true);
this.pdfViewer = new PDFJS.PDFViewer({
container: documentContainer,

View File

@@ -15,15 +15,15 @@
* limitations under the License.
*/
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { TxtViewerComponent } from './txtViewer.component';
import { DebugElement, SimpleChange } from '@angular/core';
import { DebugElement, SimpleChange } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import {
AlfrescoApiService,
AlfrescoAuthenticationService,
AlfrescoSettingsService,
AlfrescoApiService,
CoreModule
} from 'ng2-alfresco-core';
import { TxtViewerComponent } from './txtViewer.component';
describe('Test ng2-alfresco-viewer Text View component', () => {

View File

@@ -15,9 +15,9 @@
* limitations under the License.
*/
import { Component, Input } from '@angular/core';
import { SimpleChanges } from '@angular/core';
import { Http, RequestOptions, Response, ResponseContentType } from '@angular/http';
import { Component, Input, OnChanges } from '@angular/core';
import { SimpleChanges } from '@angular/core';
import { Http, RequestOptions, Response, ResponseContentType } from '@angular/http';
import 'rxjs/add/operator/toPromise';
@Component({
@@ -25,7 +25,7 @@ import 'rxjs/add/operator/toPromise';
templateUrl: './txtViewer.component.html',
styleUrls: ['./txtViewer.component.css']
})
export class TxtViewerComponent {
export class TxtViewerComponent implements OnChanges {
@Input()
urlFile: any;

View File

@@ -15,23 +15,23 @@
* limitations under the License.
*/
import { ComponentFixture, TestBed, async } from '@angular/core/testing';
import { PdfViewerComponent } from './pdfViewer.component';
import { TxtViewerComponent } from './txtViewer.component';
import { NotSupportedFormat } from './notSupportedFormat.component';
import { MediaPlayerComponent } from './mediaPlayer.component';
import { ImgViewerComponent } from './imgViewer.component';
import { RenderingQueueServices } from '../services/rendering-queue.services';
import { ViewerComponent } from './viewer.component';
import { EventMock } from '../assets/event.mock';
import { DebugElement } from '@angular/core';
import { DebugElement } from '@angular/core';
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import {
AlfrescoApiService,
AlfrescoAuthenticationService,
AlfrescoSettingsService,
AlfrescoApiService,
CoreModule,
RenditionsService
} from 'ng2-alfresco-core';
import { EventMock } from '../assets/event.mock';
import { RenderingQueueServices } from '../services/rendering-queue.services';
import { ImgViewerComponent } from './imgViewer.component';
import { MediaPlayerComponent } from './mediaPlayer.component';
import { NotSupportedFormatComponent } from './notSupportedFormat.component';
import { PdfViewerComponent } from './pdfViewer.component';
import { TxtViewerComponent } from './txtViewer.component';
import { ViewerComponent } from './viewer.component';
declare let jasmine: any;
@@ -51,7 +51,7 @@ describe('Test ng2-alfresco-viewer ViewerComponent', () => {
ViewerComponent,
PdfViewerComponent,
TxtViewerComponent,
NotSupportedFormat,
NotSupportedFormatComponent,
MediaPlayerComponent,
ImgViewerComponent
],

View File

@@ -15,7 +15,7 @@
* limitations under the License.
*/
import { Component, ElementRef, EventEmitter, HostListener, Inject, Input, Output, TemplateRef } from '@angular/core';
import { Component, ElementRef, EventEmitter, HostListener, Inject, Input, OnChanges, OnDestroy, Output, TemplateRef } from '@angular/core';
import { DOCUMENT } from '@angular/platform-browser';
import { MinimalNodeEntryEntity } from 'alfresco-js-api';
import { AlfrescoApiService, LogService } from 'ng2-alfresco-core';
@@ -25,7 +25,7 @@ import { AlfrescoApiService, LogService } from 'ng2-alfresco-core';
templateUrl: './viewer.component.html',
styleUrls: ['./viewer.component.css']
})
export class ViewerComponent {
export class ViewerComponent implements OnDestroy, OnChanges {
@Input()
urlFile: string = '';
@@ -169,7 +169,7 @@ export class ViewerComponent {
*
* @returns {boolean}
*/
private isImage(): boolean {
public isImage(): boolean {
return this.isImageExtension() || this.isImageMimeType();
}
@@ -178,7 +178,7 @@ export class ViewerComponent {
*
* @returns {boolean}
*/
private isMedia(): boolean {
public isMedia(): boolean {
return this.isMediaExtension(this.extension) || this.isMediaMimeType();
}
@@ -229,7 +229,7 @@ export class ViewerComponent {
*
* @returns {boolean}
*/
private isPdf(): boolean {
public isPdf(): boolean {
return this.extension === 'pdf' || this.mimeType === 'application/pdf';
}
@@ -238,7 +238,7 @@ export class ViewerComponent {
*
* @returns {boolean}
*/
private isText(): boolean {
public isText(): boolean {
return this.extension === 'txt' || this.mimeType === 'text/txt' || this.mimeType === 'text/plain';
}