[ADF-1287] compatibility with the new noUnusedLocals rule (#2170)

* support for noUnusedLocals rule

* clean diagram components

* code cleanup

* Viewer fixes

* code fixes

* code fixes
This commit is contained in:
Denys Vuika
2017-08-04 15:35:15 +01:00
committed by Mario Romano
parent 0f239a1fa3
commit 9d3962b3b5
113 changed files with 190 additions and 346 deletions

View File

@@ -93,18 +93,21 @@ export class ViewerComponent implements OnDestroy, OnChanges {
this.urlFileContent = this.urlFile;
resolve();
} else if (this.fileNodeId) {
this.apiService.getInstance().nodes.getNodeInfo(this.fileNodeId).then((data: MinimalNodeEntryEntity) => {
this.mimeType = data.content.mimeType;
this.displayName = data.name;
this.urlFileContent = this.apiService.getInstance().content.getContentUrl(data.id);
this.extension = this.getFileExtension(data.name);
this.extensionChange.emit(this.extension);
this.loaded = true;
resolve();
}, function (error) {
reject(error);
this.logService.error('This node does not exist');
});
this.apiService.getInstance().nodes.getNodeInfo(this.fileNodeId).then(
(data: MinimalNodeEntryEntity) => {
this.mimeType = data.content.mimeType;
this.displayName = data.name;
this.urlFileContent = this.apiService.getInstance().content.getContentUrl(data.id);
this.extension = this.getFileExtension(data.name);
this.extensionChange.emit(this.extension);
this.loaded = true;
resolve();
},
(error) => {
reject(error);
this.logService.error('This node does not exist');
}
);
}
});
}
@@ -285,7 +288,7 @@ export class ViewerComponent implements OnDestroy, OnChanges {
* Check if in the document there are scrollable main area and disable it
*/
private blockOtherScrollBar() {
let mainElements: any = document.getElementsByTagName('main');
let mainElements: any = this.document.getElementsByTagName('main');
for (let i = 0; i < mainElements.length; i++) {
mainElements[i].style.overflow = 'hidden';
@@ -296,7 +299,7 @@ export class ViewerComponent implements OnDestroy, OnChanges {
* Check if in the document there are scrollable main area and re-enable it
*/
private unblockOtherScrollBar() {
let mainElements: any = document.getElementsByTagName('main');
let mainElements: any = this.document.getElementsByTagName('main');
for (let i = 0; i < mainElements.length; i++) {
mainElements[i].style.overflow = '';
@@ -336,7 +339,7 @@ export class ViewerComponent implements OnDestroy, OnChanges {
*/
private hideOtherHeaderBar() {
if (this.overlayMode && !this.isParentElementHeaderBar()) {
this.otherMenu = document.querySelector('header');
this.otherMenu = this.document.querySelector('header');
if (this.otherMenu) {
this.otherMenu.hidden = true;
}

View File

@@ -18,8 +18,6 @@
import { ReflectiveInjector } from '@angular/core';
import { RenderingQueueServices } from './rendering-queue.services';
declare let jasmine: any;
describe('RenderingQueueServices', () => {
let service, injector;

View File

@@ -43,7 +43,8 @@
"es2015",
"dom"
],
"suppressImplicitAnyIndexErrors": true
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true
},
"exclude": [
"demo",