mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[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:
committed by
Mario Romano
parent
0f239a1fa3
commit
9d3962b3b5
@@ -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;
|
||||
}
|
||||
|
@@ -18,8 +18,6 @@
|
||||
import { ReflectiveInjector } from '@angular/core';
|
||||
import { RenderingQueueServices } from './rendering-queue.services';
|
||||
|
||||
declare let jasmine: any;
|
||||
|
||||
describe('RenderingQueueServices', () => {
|
||||
|
||||
let service, injector;
|
||||
|
@@ -43,7 +43,8 @@
|
||||
"es2015",
|
||||
"dom"
|
||||
],
|
||||
"suppressImplicitAnyIndexErrors": true
|
||||
"suppressImplicitAnyIndexErrors": true,
|
||||
"noUnusedLocals": true
|
||||
},
|
||||
"exclude": [
|
||||
"demo",
|
||||
|
Reference in New Issue
Block a user