mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-08-07 17:48:54 +00:00
[AAE-10778] Fix lint issues
This commit is contained in:
@@ -46,7 +46,7 @@ import { versionCompatibilityFactory } from './version-compatibility/version-com
|
||||
import { VersionCompatibilityService } from './version-compatibility/version-compatibility.service';
|
||||
import { ContentPipeModule } from './pipes/content-pipe.module';
|
||||
import { NodeCommentsModule } from './node-comments/node-comments.module';
|
||||
import { AlfrescoViewerModule } from "./viewer";
|
||||
import { AlfrescoViewerModule } from './viewer';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
|
@@ -25,8 +25,8 @@ import { ExtensionsModule } from '@alfresco/adf-extensions';
|
||||
|
||||
import { MaterialModule } from '../material.module';
|
||||
import { A11yModule } from '@angular/cdk/a11y';
|
||||
import { AlfrescoViewerComponent } from "./components/alfresco-viewer.component";
|
||||
import { CoreModule } from "@alfresco/adf-core";
|
||||
import { AlfrescoViewerComponent } from './components/alfresco-viewer.component';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
@@ -41,10 +41,10 @@ import { CoreModule } from "@alfresco/adf-core";
|
||||
ExtensionsModule
|
||||
],
|
||||
declarations: [
|
||||
AlfrescoViewerComponent,
|
||||
AlfrescoViewerComponent
|
||||
],
|
||||
exports: [
|
||||
AlfrescoViewerComponent,
|
||||
AlfrescoViewerComponent
|
||||
]
|
||||
})
|
||||
export class AlfrescoViewerModule {
|
||||
|
@@ -74,5 +74,4 @@
|
||||
border-right: 1px solid var(--theme-border-color);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -25,16 +25,16 @@ import { NoopAnimationsModule } from '@angular/platform-browser/animations';
|
||||
import { AppExtensionService, ViewerExtensionRef } from '@alfresco/adf-extensions';
|
||||
import { MatButtonModule } from '@angular/material/button';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { NodeEntry, VersionEntry } from "@alfresco/js-api";
|
||||
import { AlfrescoViewerComponent, RenditionViewerService } from "@alfresco/adf-content-services";
|
||||
import { NodeEntry, VersionEntry } from '@alfresco/js-api';
|
||||
import { AlfrescoViewerComponent, RenditionViewerService } from '@alfresco/adf-content-services';
|
||||
import {
|
||||
AlfrescoApiService,
|
||||
CoreTestingModule,
|
||||
setupTestBed,
|
||||
EventMock,
|
||||
FileModel, UploadService
|
||||
} from "@alfresco/adf-core";
|
||||
import { throwError } from "rxjs";
|
||||
} from '@alfresco/adf-core';
|
||||
import { throwError } from 'rxjs';
|
||||
import { Component } from '@angular/core';
|
||||
|
||||
@Component({
|
||||
@@ -176,8 +176,6 @@ describe('AlfrescoViewerComponent', () => {
|
||||
element = fixture.nativeElement;
|
||||
component = fixture.componentInstance;
|
||||
|
||||
console.log(element);
|
||||
console.log(component);
|
||||
uploadService = TestBed.inject(UploadService);
|
||||
alfrescoApiService = TestBed.inject(AlfrescoApiService);
|
||||
dialog = TestBed.inject(MatDialog);
|
||||
|
@@ -37,8 +37,8 @@ import {
|
||||
ViewerSidebarComponent,
|
||||
ViewerToolbarComponent,
|
||||
ViewUtilService
|
||||
} from "@alfresco/adf-core";
|
||||
import { fromEvent, Subject } from "rxjs";
|
||||
} from '@alfresco/adf-core';
|
||||
import { fromEvent, Subject } from 'rxjs';
|
||||
import {
|
||||
ContentApi,
|
||||
Node,
|
||||
@@ -49,10 +49,10 @@ import {
|
||||
Version,
|
||||
VersionEntry,
|
||||
VersionsApi
|
||||
} from "@alfresco/js-api";
|
||||
import { RenditionViewerService } from "../services/rendition-viewer.service";
|
||||
import { MatDialog } from "@angular/material/dialog";
|
||||
import { filter, skipWhile, takeUntil } from "rxjs/operators";
|
||||
} from '@alfresco/js-api';
|
||||
import { RenditionViewerService } from '../services/rendition-viewer.service';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { filter, skipWhile, takeUntil } from 'rxjs/operators';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-alfresco-viewer',
|
||||
@@ -269,7 +269,7 @@ export class AlfrescoViewerComponent {
|
||||
this.generateCacheBusterNumber();
|
||||
this.isLoading = true;
|
||||
|
||||
await this.setUpNodeFile(node)
|
||||
await this.setUpNodeFile(node);
|
||||
this.isLoading = false;
|
||||
}
|
||||
}
|
||||
@@ -371,12 +371,12 @@ export class AlfrescoViewerComponent {
|
||||
}
|
||||
}
|
||||
|
||||
private async getSharedLinkRendition(sharedId: string): Promise<{ url: string, viewerType: string }> {
|
||||
private async getSharedLinkRendition(sharedId: string): Promise<{ url: string; viewerType: string }> {
|
||||
try {
|
||||
const rendition: RenditionEntry = await this.sharedLinksApi.getSharedLinkRendition(sharedId, 'pdf');
|
||||
if (rendition.entry.status.toString() === 'CREATED') {
|
||||
const urlFileContent = this.contentApi.getSharedLinkRenditionUrl(sharedId, 'pdf');
|
||||
return {url: urlFileContent, viewerType: 'pdf'}
|
||||
return {url: urlFileContent, viewerType: 'pdf'};
|
||||
}
|
||||
} catch (error) {
|
||||
this.logService.error(error);
|
||||
@@ -384,7 +384,7 @@ export class AlfrescoViewerComponent {
|
||||
const rendition: RenditionEntry = await this.sharedLinksApi.getSharedLinkRendition(sharedId, 'imgpreview');
|
||||
if (rendition.entry.status.toString() === 'CREATED') {
|
||||
const urlFileContent = this.contentApi.getSharedLinkRenditionUrl(sharedId, 'imgpreview');
|
||||
return {url: urlFileContent, viewerType: 'image'}
|
||||
return {url: urlFileContent, viewerType: 'image'};
|
||||
|
||||
}
|
||||
} catch (renditionError) {
|
||||
|
@@ -151,7 +151,7 @@ export class RenditionViewerService {
|
||||
return new Promise<RenditionEntry>((resolve) => resolve(rendition));
|
||||
}
|
||||
|
||||
async getNodeRendition(nodeId: string, versionId?: string): Promise<{ url: string, viewerType: string }> {
|
||||
async getNodeRendition(nodeId: string, versionId?: string): Promise<{ url: string; viewerType: string }> {
|
||||
try {
|
||||
return versionId ? await this.resolveNodeRendition(nodeId, 'pdf', versionId) :
|
||||
await this.resolveNodeRendition(nodeId, 'pdf');
|
||||
@@ -161,7 +161,7 @@ export class RenditionViewerService {
|
||||
}
|
||||
}
|
||||
|
||||
private async resolveNodeRendition(nodeId: string, renditionId: string, versionId?: string): Promise<{ url: string, viewerType: string }> {
|
||||
private async resolveNodeRendition(nodeId: string, renditionId: string, versionId?: string): Promise<{ url: string; viewerType: string }> {
|
||||
renditionId = renditionId.toLowerCase();
|
||||
|
||||
const supportedRendition: RenditionPaging = versionId ? await this.versionsApi.listVersionRenditions(nodeId, versionId) :
|
||||
@@ -189,7 +189,7 @@ export class RenditionViewerService {
|
||||
private async requestCreateRendition(nodeId: string, renditionId: string, versionId: string) {
|
||||
try {
|
||||
if (versionId) {
|
||||
await this.versionsApi.createVersionRendition(nodeId, versionId, {id: renditionId})
|
||||
await this.versionsApi.createVersionRendition(nodeId, versionId, {id: renditionId});
|
||||
} else {
|
||||
await this.renditionsApi.createRendition(nodeId, {id: renditionId});
|
||||
}
|
||||
@@ -206,13 +206,13 @@ export class RenditionViewerService {
|
||||
}
|
||||
|
||||
private findRenditionById(supportedRendition: RenditionPaging, renditionId: string) {
|
||||
let rendition: RenditionEntry = supportedRendition.list.entries.find((renditionEntry: RenditionEntry) => renditionEntry.entry.id.toLowerCase() === renditionId);
|
||||
const rendition: RenditionEntry = supportedRendition.list.entries.find((renditionEntry: RenditionEntry) => renditionEntry.entry.id.toLowerCase() === renditionId);
|
||||
return rendition;
|
||||
}
|
||||
|
||||
private async waitNodeRendition(nodeId: string, renditionId: string, versionId?: string): Promise<{ url: string, viewerType: string }> {
|
||||
private async waitNodeRendition(nodeId: string, renditionId: string, versionId?: string): Promise<{ url: string; viewerType: string }> {
|
||||
let currentRetry: number = 0;
|
||||
return new Promise<{ url: string, viewerType: string }>((resolve, reject) => {
|
||||
return new Promise<{ url: string; viewerType: string }>((resolve, reject) => {
|
||||
const intervalId = setInterval(() => {
|
||||
currentRetry++;
|
||||
if (this.maxRetries >= currentRetry) {
|
||||
@@ -243,7 +243,7 @@ export class RenditionViewerService {
|
||||
});
|
||||
}
|
||||
|
||||
private async handleNodeRendition(nodeId: string, renditionId: string, versionId?: string): Promise<{ url: string, viewerType: string }> {
|
||||
private async handleNodeRendition(nodeId: string, renditionId: string, versionId?: string): Promise<{ url: string; viewerType: string }> {
|
||||
let viewerType = '';
|
||||
|
||||
if (renditionId === 'pdf') {
|
||||
|
@@ -26,7 +26,7 @@ import {
|
||||
EventEmitter, AfterViewInit, ViewChild, HostListener, OnDestroy
|
||||
} from '@angular/core';
|
||||
import { AppConfigService } from '../../app-config/app-config.service';
|
||||
import { UrlService } from "../../services/url.service";
|
||||
import { UrlService } from '../../services/url.service';
|
||||
import Cropper from 'cropperjs';
|
||||
|
||||
@Component({
|
||||
|
@@ -24,7 +24,7 @@ import { Subject } from 'rxjs';
|
||||
import { ViewUtilService } from '../services/view-util.service';
|
||||
import { AppExtensionService, ViewerExtensionRef } from '@alfresco/adf-extensions';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { Track } from "../models/viewer.model";
|
||||
import { Track } from '../models/viewer.model';
|
||||
|
||||
@Component({
|
||||
selector: 'adf-viewer-render',
|
||||
|
Reference in New Issue
Block a user