mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
fix "ng lint" command (#5012)
* update to latest js-api * fix the "ng lint" command * fix linting issues * fix lint issues * lint fixes * code fixes * fix html * fix html * update tests * test fixes * update tests * fix tests and api * fix code
This commit is contained in:
parent
140c64b79f
commit
edc0945f39
@ -561,7 +561,9 @@
|
||||
"lint": {
|
||||
"builder": "@angular-devkit/build-angular:tslint",
|
||||
"options": {
|
||||
"tsConfig": [],
|
||||
"tsConfig": [
|
||||
"./e2e/tsconfig.e2e.json"
|
||||
],
|
||||
"exclude": [
|
||||
"**/node_modules/**/*"
|
||||
]
|
||||
|
@ -18,7 +18,7 @@
|
||||
import { Component, ViewEncapsulation } from '@angular/core';
|
||||
import { SitePaging, SiteEntry, MinimalNodeEntryEntity } from '@alfresco/js-api';
|
||||
import { ContentNodeDialogService, ShareDataRow, RowFilter } from '@alfresco/adf-content-services';
|
||||
import { DataRow, DataColumn, ThumbnailService } from '@alfresco/adf-core';
|
||||
import { ThumbnailService } from '@alfresco/adf-core';
|
||||
|
||||
@Component({
|
||||
templateUrl: './content-node-selector.component.html',
|
||||
@ -95,7 +95,7 @@ export class ContentNodeSelectorComponent {
|
||||
return showNode;
|
||||
}
|
||||
|
||||
customImageResolverExample(row: DataRow, col: DataColumn) {
|
||||
customImageResolverExample() {
|
||||
return this.thumbnailService.getMimeTypeIcon('video/quicktime');
|
||||
}
|
||||
|
||||
|
@ -55,7 +55,7 @@ export class ExtensionPresetsComponent implements OnInit, OnDestroy {
|
||||
this.onDestroy$.complete();
|
||||
}
|
||||
|
||||
trackById(index: number, obj: { id: string }) {
|
||||
trackById(_: number, obj: { id: string }) {
|
||||
return obj.id;
|
||||
}
|
||||
}
|
||||
|
@ -27,7 +27,7 @@ import { MinimalNodeEntity, NodePaging, Pagination, MinimalNodeEntryEntity, Site
|
||||
import {
|
||||
AlfrescoApiService, AuthenticationService, AppConfigService, AppConfigValues, ContentService, TranslationService,
|
||||
FileUploadEvent, FolderCreatedEvent, LogService, NotificationService,
|
||||
UploadService, DataColumn, DataRow, UserPreferencesService,
|
||||
UploadService, DataRow, UserPreferencesService,
|
||||
PaginationComponent, FormValues, DisplayMode, InfinitePaginationComponent, HighlightDirective,
|
||||
SharedLinksApiService
|
||||
} from '@alfresco/adf-core';
|
||||
@ -474,7 +474,7 @@ export class FilesComponent implements OnInit, OnChanges, OnDestroy {
|
||||
return this.contentService.hasAllowableOperations(selection[0].entry, 'update');
|
||||
}
|
||||
|
||||
getNodeNameTooltip(row: DataRow, col: DataColumn): string {
|
||||
getNodeNameTooltip(row: DataRow): string {
|
||||
if (row) {
|
||||
return row.getValue('name');
|
||||
}
|
||||
|
@ -18,35 +18,43 @@
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { Injectable } from '@angular/core';
|
||||
import {
|
||||
AppConfigService, AlfrescoApiService, EcmModelService, LogService, FormService, FormOutcomeEvent
|
||||
AlfrescoApiService,
|
||||
EcmModelService,
|
||||
LogService,
|
||||
FormService,
|
||||
FormOutcomeEvent
|
||||
} from '@alfresco/adf-core';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
@Injectable()
|
||||
export class FakeFormService extends FormService {
|
||||
|
||||
executeOutcome = new Subject<FormOutcomeEvent>();
|
||||
|
||||
constructor(appConfig: AppConfigService,
|
||||
ecmModelService: EcmModelService,
|
||||
apiService: AlfrescoApiService,
|
||||
protected logService: LogService) {
|
||||
constructor(
|
||||
ecmModelService: EcmModelService,
|
||||
apiService: AlfrescoApiService,
|
||||
protected logService: LogService
|
||||
) {
|
||||
super(ecmModelService, apiService, logService);
|
||||
}
|
||||
|
||||
public getRestFieldValues(taskId: string, fieldId: string): Observable<any> {
|
||||
public getRestFieldValues(
|
||||
taskId: string,
|
||||
fieldId: string
|
||||
): Observable<any> {
|
||||
if (fieldId === 'typeaheadField') {
|
||||
return of([
|
||||
{ 'id': '1', 'name': 'Leanne Graham' },
|
||||
{ 'id': '2', 'name': 'Ervin Howell' },
|
||||
{ 'id': '3', 'name': 'Clementine Bauch' },
|
||||
{ 'id': '4', 'name': 'Patricia Lebsack' },
|
||||
{ 'id': '5', 'name': 'Chelsey Dietrich' },
|
||||
{ 'id': '6', 'name': 'Mrs. Dennis Schulist' },
|
||||
{ 'id': '7', 'name': 'Kurtis Weissnat' },
|
||||
{ 'id': '8', 'name': 'Nicholas Runolfsdottir V' },
|
||||
{ 'id': '9', 'name': 'Glenna Reichert' },
|
||||
{ 'id': '10', 'name': 'Clementina DuBuque' }]);
|
||||
{ id: '1', name: 'Leanne Graham' },
|
||||
{ id: '2', name: 'Ervin Howell' },
|
||||
{ id: '3', name: 'Clementine Bauch' },
|
||||
{ id: '4', name: 'Patricia Lebsack' },
|
||||
{ id: '5', name: 'Chelsey Dietrich' },
|
||||
{ id: '6', name: 'Mrs. Dennis Schulist' },
|
||||
{ id: '7', name: 'Kurtis Weissnat' },
|
||||
{ id: '8', name: 'Nicholas Runolfsdottir V' },
|
||||
{ id: '9', name: 'Glenna Reichert' },
|
||||
{ id: '10', name: 'Clementina DuBuque' }
|
||||
]);
|
||||
} else {
|
||||
return super.getRestFieldValues(taskId, fieldId);
|
||||
}
|
||||
|
@ -16,7 +16,7 @@
|
||||
*/
|
||||
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CoreModule, TranslationService } from '@alfresco/adf-core';
|
||||
import { CoreModule } from '@alfresco/adf-core';
|
||||
|
||||
import { LazyLoadingRoutes } from './lazy-loading.routes';
|
||||
import { LazyLoadingComponent } from './lazy-loading.component';
|
||||
@ -30,7 +30,4 @@ import { LazyLoadingComponent } from './lazy-loading.component';
|
||||
LazyLoadingComponent
|
||||
]
|
||||
})
|
||||
export class LazyLoadingModule {
|
||||
constructor(translation: TranslationService) {
|
||||
}
|
||||
}
|
||||
export class LazyLoadingModule {}
|
||||
|
@ -85,7 +85,7 @@
|
||||
[showRememberMe]="showFooter && showRememberMe"
|
||||
(executeSubmit)="checkForm($event)"
|
||||
copyrightText="{{ 'application.copyright' | adfAppConfig }}"
|
||||
(success)="onLogin($event)"
|
||||
(success)="onLogin()"
|
||||
(error)="onError($event)">
|
||||
<div class="adf-mobile-settings">
|
||||
<p>
|
||||
|
@ -55,7 +55,7 @@ export class LoginComponent implements OnInit {
|
||||
this.alfrescoLogin.addCustomValidationError('password', 'required', 'LOGIN.MESSAGES.PASSWORD-REQUIRED');
|
||||
}
|
||||
|
||||
onLogin($event) {
|
||||
onLogin() {
|
||||
this.router.navigate(['/home']);
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
(error)="showErrorMessage($event)"
|
||||
(updated)="onUpdatedPermissions($event)">
|
||||
{{ (toggleStatus?'DEMO_PERMISSION.INHERITED_PERMISSIONS_BUTTON':'DEMO_PERMISSION.INHERIT_PERMISSION_BUTTON') | translate}}</button>
|
||||
<button mat-button color="primary" (click)="openAddPermissionDialog($event)" data-automation-id="adf-add-permission-button">Add User or Group</button>
|
||||
<button mat-button color="primary" (click)="openAddPermissionDialog()" data-automation-id="adf-add-permission-button">Add User or Group</button>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
@ -64,7 +64,7 @@ export class DemoPermissionComponent implements OnInit {
|
||||
this.displayPermissionComponent.reload();
|
||||
}
|
||||
|
||||
openAddPermissionDialog(event: Event) {
|
||||
openAddPermissionDialog() {
|
||||
this.nodePermissionDialogService
|
||||
.updateNodePermissionByDialog(this.nodeId)
|
||||
.subscribe(
|
||||
|
@ -28,7 +28,7 @@
|
||||
[appId]="appId"
|
||||
[showIcon]="showTaskFilterIcon"
|
||||
(filterClick)="onTaskFilterClick($event)"
|
||||
(success)="onSuccessTaskFilterList($event)" #activitiFilter>
|
||||
(success)="onSuccessTaskFilterList()" #activitiFilter>
|
||||
</adf-task-filters>
|
||||
</mat-expansion-panel>
|
||||
</mat-accordion>
|
||||
@ -48,7 +48,7 @@
|
||||
[sort]="taskFilter?.filter?.sort"
|
||||
[landingTaskId]="currentTaskId"
|
||||
(rowClick)="onTaskRowClick($event)"
|
||||
(success)="onSuccessTaskList($event)"
|
||||
(success)="onSuccessTaskList()"
|
||||
(row-click)="onRowClick($event)"
|
||||
(row-dblclick)="onTaskRowDblClick($event)"
|
||||
[multiselect]="multiSelectTask"
|
||||
@ -76,11 +76,11 @@
|
||||
[taskId]="currentTaskId"
|
||||
[fieldValidators]="fieldValidators"
|
||||
[showHeaderContent]="showHeaderContent"
|
||||
(formCompleted)="onFormCompleted($event)"
|
||||
(formCompleted)="onFormCompleted()"
|
||||
(formContentClicked)="onContentClick($event)"
|
||||
(taskCreated)="onTaskCreated($event)"
|
||||
(assignTask)="onAssignTask()"
|
||||
(taskDeleted)="onTaskDeleted($event)">
|
||||
(taskDeleted)="onTaskDeleted()">
|
||||
</adf-task-details>
|
||||
<mat-divider></mat-divider>
|
||||
<div *ngIf="currentTaskId">
|
||||
@ -144,7 +144,7 @@
|
||||
[showIcon]="showProcessFilterIcon"
|
||||
(filterClick)="onProcessFilterChange($event)"
|
||||
(filterSelected)="onProcessFilterChange($event)"
|
||||
(success)="onSuccessProcessFilterList($event)">
|
||||
(success)="onSuccessProcessFilterList()">
|
||||
</adf-process-instance-filters>
|
||||
</mat-expansion-panel>
|
||||
</mat-accordion>
|
||||
@ -164,7 +164,7 @@
|
||||
(rowClick)="onProcessRowClick($event)"
|
||||
(row-dblclick)="onProcessRowDblClick($event)"
|
||||
[multiselect]="multiSelectProcess"
|
||||
(success)="onSuccessProcessList($event)">
|
||||
(success)="onSuccessProcessList()">
|
||||
<!-- Custom column definition demo -->
|
||||
|
||||
<!-- <data-columns>
|
||||
@ -242,7 +242,7 @@
|
||||
[appId]="appId"
|
||||
[reportId]="report.id"
|
||||
[hideParameters]="false"
|
||||
(editReport)="onEditReport($event)"
|
||||
(editReport)="onEditReport()"
|
||||
(reportSaved)="onReportSaved($event)"
|
||||
(reportDeleted)="onReportDeleted()">
|
||||
</adf-analytics>
|
||||
|
@ -30,7 +30,6 @@ import {
|
||||
} from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import {
|
||||
ProcessInstanceFilterRepresentation,
|
||||
Pagination,
|
||||
UserProcessInstanceFilterRepresentation
|
||||
} from '@alfresco/js-api';
|
||||
@ -306,7 +305,7 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
|
||||
this.report = event;
|
||||
}
|
||||
|
||||
onSuccessTaskFilterList(event: any): void {
|
||||
onSuccessTaskFilterList(): void {
|
||||
this.applyTaskFilter(this.activitiFilter.getCurrentFilter());
|
||||
}
|
||||
|
||||
@ -329,7 +328,7 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
|
||||
this.reloadTaskFilters();
|
||||
}
|
||||
|
||||
onSuccessTaskList(event: FilterRepresentationModel) {
|
||||
onSuccessTaskList() {
|
||||
this.currentTaskId = this.taskList.getCurrentId();
|
||||
}
|
||||
|
||||
@ -343,15 +342,15 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
|
||||
this.processPage = 0;
|
||||
}
|
||||
|
||||
onSuccessProcessFilterList(event: ProcessInstanceFilterRepresentation[]): void {
|
||||
onSuccessProcessFilterList(): void {
|
||||
this.processFilter = this.activitiProcessFilter.getCurrentFilter();
|
||||
}
|
||||
|
||||
onSuccessProcessList(event: any): void {
|
||||
onSuccessProcessList(): void {
|
||||
this.currentProcessInstanceId = this.processList.getCurrentId();
|
||||
}
|
||||
|
||||
onTaskRowClick(taskId): void {
|
||||
onTaskRowClick(taskId: string): void {
|
||||
this.currentTaskId = taskId;
|
||||
}
|
||||
|
||||
@ -365,15 +364,15 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
|
||||
this.currentProcessInstanceId = processInstanceId;
|
||||
}
|
||||
|
||||
onProcessRowClick(processInstanceId): void {
|
||||
onProcessRowClick(processInstanceId: string): void {
|
||||
this.currentProcessInstanceId = processInstanceId;
|
||||
}
|
||||
|
||||
onEditReport(name: string): void {
|
||||
onEditReport(): void {
|
||||
this.analyticsReportList.reload();
|
||||
}
|
||||
|
||||
onReportSaved(reportId): void {
|
||||
onReportSaved(reportId: number): void {
|
||||
this.analyticsReportList.reload(reportId);
|
||||
}
|
||||
|
||||
@ -409,12 +408,12 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
|
||||
return this.currentTaskId === currentTaskIdNew;
|
||||
}
|
||||
|
||||
processCancelled(data: any): void {
|
||||
processCancelled(): void {
|
||||
this.currentProcessInstanceId = null;
|
||||
this.processList.reload();
|
||||
}
|
||||
|
||||
onFormCompleted(form): void {
|
||||
onFormCompleted(): void {
|
||||
this.currentTaskId = null;
|
||||
if (this.taskListPagination) {
|
||||
this.taskPage = this.taskListPagination.current - 1;
|
||||
@ -468,7 +467,7 @@ export class ProcessServiceComponent implements AfterViewInit, OnDestroy, OnInit
|
||||
this.taskList.reload();
|
||||
}
|
||||
|
||||
onTaskDeleted(data: any): void {
|
||||
onTaskDeleted(): void {
|
||||
this.taskList.reload();
|
||||
}
|
||||
|
||||
|
@ -11,6 +11,7 @@
|
||||
"experimentalDecorators": true,
|
||||
"skipLibCheck": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"target": "es5",
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"typeRoots": [
|
||||
|
@ -24,7 +24,7 @@ const JS_BIND_INPUT = function(target) {
|
||||
const input = document.createElement('input');
|
||||
input.type = 'file';
|
||||
input.style.display = 'none';
|
||||
input.addEventListener('change', function(event) {
|
||||
input.addEventListener('change', function() {
|
||||
target.scrollIntoView(true);
|
||||
|
||||
const rect = target.getBoundingClientRect();
|
||||
@ -52,7 +52,7 @@ const JS_BIND_INPUT_FOLDER = function(target) {
|
||||
input.style.display = 'none';
|
||||
input.multiple = true;
|
||||
input.webkitdirectory = true;
|
||||
input.addEventListener('change', function(event) {
|
||||
input.addEventListener('change', function() {
|
||||
target.scrollIntoView(true);
|
||||
|
||||
const rect = target.getBoundingClientRect();
|
||||
|
@ -118,7 +118,7 @@ describe('Comment Component', () => {
|
||||
await viewerPage.clickOnCommentsTab();
|
||||
|
||||
await commentsPage.addComment(comments.first);
|
||||
await commentsPage.checkUserIconIsDisplayed(0);
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
|
||||
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
|
||||
await expect(await commentsPage.getMessage(0)).toEqual(comments.first);
|
||||
@ -134,7 +134,7 @@ describe('Comment Component', () => {
|
||||
await viewerPage.clickOnCommentsTab();
|
||||
|
||||
await commentsPage.addComment(comments.multiline);
|
||||
await commentsPage.checkUserIconIsDisplayed(0);
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
|
||||
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
|
||||
await expect(await commentsPage.getMessage(0)).toEqual(comments.multiline);
|
||||
@ -142,7 +142,7 @@ describe('Comment Component', () => {
|
||||
await expect(await commentsPage.getTime(0)).toMatch(/(ago|few)/);
|
||||
|
||||
await commentsPage.addComment(comments.second);
|
||||
await commentsPage.checkUserIconIsDisplayed(0);
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
|
||||
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (2)');
|
||||
await expect(await commentsPage.getMessage(0)).toEqual(comments.second);
|
||||
@ -158,7 +158,7 @@ describe('Comment Component', () => {
|
||||
await viewerPage.clickOnCommentsTab();
|
||||
|
||||
await commentsPage.addComment(comments.codeType);
|
||||
await commentsPage.checkUserIconIsDisplayed(0);
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
|
||||
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (1)');
|
||||
await expect(await commentsPage.getMessage(0)).toEqual('First name: Last name:');
|
||||
|
@ -35,7 +35,7 @@ export class CommentsPage {
|
||||
return BrowserActions.getText(this.numberOfComments);
|
||||
}
|
||||
|
||||
async checkUserIconIsDisplayed(position): Promise<void> {
|
||||
async checkUserIconIsDisplayed(): Promise<void> {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.commentUserIcon.first());
|
||||
}
|
||||
|
||||
|
@ -48,7 +48,7 @@ export class StartProcessPage {
|
||||
return this.defaultProcessName.getAttribute('value');
|
||||
}
|
||||
|
||||
async deleteDefaultName(name) {
|
||||
async deleteDefaultName() {
|
||||
await BrowserVisibility.waitUntilElementIsVisible(this.processNameInput);
|
||||
await BrowserActions.clearWithBackSpace(this.processNameInput);
|
||||
}
|
||||
|
@ -81,7 +81,7 @@ describe('Comment component for Processes', () => {
|
||||
|
||||
addedComment = await this.alfrescoJsApi.activiti.commentsApi.getProcessInstanceComments(processInstanceId, { 'latestFirst': true });
|
||||
|
||||
await commentsPage.checkUserIconIsDisplayed(0);
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
|
||||
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedComment.total + ')');
|
||||
await expect(await commentsPage.getMessage(0)).toEqual(addedComment.data[0].message);
|
||||
@ -119,7 +119,7 @@ describe('Comment component for Processes', () => {
|
||||
|
||||
const addedTaskComment = await this.alfrescoJsApi.activiti.commentsApi.getProcessInstanceComments(processInstanceId, { 'latestFirst': true });
|
||||
|
||||
await commentsPage.checkUserIconIsDisplayed(0);
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
|
||||
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + addedTaskComment.total + ')');
|
||||
await expect(await commentsPage.getMessage(0)).toEqual(addedTaskComment.data[0].message);
|
||||
|
@ -119,8 +119,8 @@ describe('Comment component for Processes', () => {
|
||||
|
||||
const thirdTaskComment = { message: 'Third Task Comment' };
|
||||
|
||||
await commentsPage.checkUserIconIsDisplayed(0);
|
||||
await commentsPage.checkUserIconIsDisplayed(1);
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
|
||||
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + totalCommentsLatest.total + ')');
|
||||
|
||||
@ -145,9 +145,9 @@ describe('Comment component for Processes', () => {
|
||||
|
||||
const totalComments = await this.alfrescoJsApi.activiti.taskApi.getTaskComments(newTaskId, { 'latestFirst': true });
|
||||
|
||||
await commentsPage.checkUserIconIsDisplayed(0);
|
||||
await commentsPage.checkUserIconIsDisplayed(1);
|
||||
await commentsPage.checkUserIconIsDisplayed(2);
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
await commentsPage.checkUserIconIsDisplayed();
|
||||
|
||||
await expect(await commentsPage.getTotalNumberOfComments()).toEqual('Comments (' + totalComments.total + ')');
|
||||
|
||||
|
@ -163,7 +163,7 @@ describe('Start Process Component', () => {
|
||||
await processFiltersPage.clickNewProcessDropdown();
|
||||
|
||||
await startProcessPage.selectFromProcessDropdown(processModelWithoutSe);
|
||||
await startProcessPage.deleteDefaultName('My Default Name');
|
||||
await startProcessPage.deleteDefaultName();
|
||||
|
||||
await browser.sleep(1000);
|
||||
|
||||
|
@ -7,8 +7,8 @@
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"noUnusedParameters": false, // The linter is used for these.
|
||||
"noUnusedLocals": false, // The linter is used for these.
|
||||
"noUnusedParameters": true,
|
||||
"noUnusedLocals": true,
|
||||
"outDir": "./dist",
|
||||
"rootDir": ".",
|
||||
"skipLibCheck": true,
|
||||
|
@ -24,7 +24,6 @@ import {
|
||||
PresetConfig,
|
||||
ContentMetadataConfig,
|
||||
AspectOrientedConfig,
|
||||
InDifferentConfig,
|
||||
LayoutOrientedConfig
|
||||
} from '../../interfaces/content-metadata.interfaces';
|
||||
|
||||
@ -60,7 +59,7 @@ export class ContentMetadataConfigFactory {
|
||||
} else if (this.isAspectOrientedPreset(presetConfig)) {
|
||||
config = new AspectOrientedConfigService(<AspectOrientedConfig> presetConfig);
|
||||
} else {
|
||||
config = new IndifferentConfigService(<InDifferentConfig> presetConfig);
|
||||
config = new IndifferentConfigService();
|
||||
}
|
||||
|
||||
Object.freeze(config);
|
||||
|
@ -21,13 +21,11 @@ import { ContentMetadataConfig, OrganisedPropertyGroup,
|
||||
|
||||
export class IndifferentConfigService implements ContentMetadataConfig {
|
||||
|
||||
constructor(config: any) {}
|
||||
|
||||
public isGroupAllowed(groupName: string): boolean {
|
||||
isGroupAllowed(): boolean {
|
||||
return true;
|
||||
}
|
||||
|
||||
public reorganiseByConfig(propertyGroups: PropertyGroupContainer): OrganisedPropertyGroup[] {
|
||||
reorganiseByConfig(propertyGroups: PropertyGroupContainer): OrganisedPropertyGroup[] {
|
||||
return Object.keys(propertyGroups)
|
||||
.map((groupName) => {
|
||||
const propertyGroup = propertyGroups[groupName],
|
||||
@ -39,15 +37,15 @@ export class IndifferentConfigService implements ContentMetadataConfig {
|
||||
});
|
||||
}
|
||||
|
||||
public filterExcludedPreset(propertyGroups: OrganisedPropertyGroup[]): OrganisedPropertyGroup[] {
|
||||
filterExcludedPreset(propertyGroups: OrganisedPropertyGroup[]): OrganisedPropertyGroup[] {
|
||||
return propertyGroups;
|
||||
}
|
||||
|
||||
public appendAllPreset(propertyGroups: PropertyGroupContainer): OrganisedPropertyGroup[] {
|
||||
appendAllPreset(): OrganisedPropertyGroup[] {
|
||||
return[];
|
||||
}
|
||||
|
||||
public isIncludeAllEnabled(): boolean {
|
||||
isIncludeAllEnabled(): boolean {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -202,7 +202,7 @@ describe('ContentNodeDialogService', () => {
|
||||
let testContentNodeSelectorComponentData;
|
||||
|
||||
beforeEach(() => {
|
||||
spyOnDialogOpen.and.callFake((contentNodeSelectorComponent: any, config: any) => {
|
||||
spyOnDialogOpen.and.callFake((_: any, config: any) => {
|
||||
testContentNodeSelectorComponentData = config.data;
|
||||
return { componentInstance: {} };
|
||||
});
|
||||
|
@ -21,7 +21,7 @@ import { ContentService, ThumbnailService } from '@alfresco/adf-core';
|
||||
import { Subject, Observable, throwError } from 'rxjs';
|
||||
import { ShareDataRow } from '../document-list/data/share-data-row.model';
|
||||
import { Node, NodeEntry, SitePaging } from '@alfresco/js-api';
|
||||
import { DataColumn, SitesService, TranslationService, AllowableOperationsEnum } from '@alfresco/adf-core';
|
||||
import { SitesService, TranslationService, AllowableOperationsEnum } from '@alfresco/adf-core';
|
||||
import { DocumentListService } from '../document-list/services/document-list.service';
|
||||
import { ContentNodeSelectorComponent } from './content-node-selector.component';
|
||||
import { ContentNodeSelectorComponentData } from './content-node-selector.component-data.interface';
|
||||
@ -222,7 +222,7 @@ export class ContentNodeDialogService {
|
||||
this.dialog.open(ContentNodeSelectorComponent, { data, panelClass: currentPanelClass, width: chosenWidth });
|
||||
}
|
||||
|
||||
private imageResolver(row: ShareDataRow, col: DataColumn): string | null {
|
||||
private imageResolver(row: ShareDataRow): string | null {
|
||||
const entry: Node = row.node.entry;
|
||||
if (!this.contentService.hasAllowableOperations(entry, 'create')) {
|
||||
return this.thumbnailService.getMimeTypeIcon('disable/folder');
|
||||
|
@ -65,7 +65,7 @@ describe('LibraryDialogComponent', () => {
|
||||
it('should set library id automatically on title input', fakeAsync(() => {
|
||||
findSitesSpy.and.returnValue(Promise.resolve(findSitesResponse));
|
||||
spyOn(alfrescoApi.sitesApi, 'getSite').and.callFake(() => {
|
||||
return new Promise((resolve, reject) => reject());
|
||||
return Promise.reject();
|
||||
});
|
||||
|
||||
fixture.detectChanges();
|
||||
@ -80,7 +80,7 @@ describe('LibraryDialogComponent', () => {
|
||||
it('should translate library title space character to dash for library id', fakeAsync(() => {
|
||||
findSitesSpy.and.returnValue(Promise.resolve(findSitesResponse));
|
||||
spyOn(alfrescoApi.sitesApi, 'getSite').and.callFake(() => {
|
||||
return new Promise((resolve, reject) => reject());
|
||||
return Promise.reject();
|
||||
});
|
||||
|
||||
fixture.detectChanges();
|
||||
@ -95,7 +95,7 @@ describe('LibraryDialogComponent', () => {
|
||||
it('should not change custom library id on title input', fakeAsync(() => {
|
||||
findSitesSpy.and.returnValue(Promise.resolve(findSitesResponse));
|
||||
spyOn(alfrescoApi.sitesApi, 'getSite').and.callFake(() => {
|
||||
return new Promise((resolve, reject) => reject());
|
||||
return Promise.reject();
|
||||
});
|
||||
|
||||
fixture.detectChanges();
|
||||
@ -134,7 +134,7 @@ describe('LibraryDialogComponent', () => {
|
||||
Promise.resolve()
|
||||
);
|
||||
spyOn(alfrescoApi.sitesApi, 'getSite').and.callFake(() => {
|
||||
return new Promise((resolve, reject) => reject());
|
||||
return Promise.reject();
|
||||
});
|
||||
|
||||
fixture.detectChanges();
|
||||
@ -194,10 +194,10 @@ describe('LibraryDialogComponent', () => {
|
||||
findSitesSpy.and.returnValue(Promise.resolve(findSitesResponse));
|
||||
const error = { message: '{ "error": { "statusCode": 409 } }' };
|
||||
spyOn(alfrescoApi.sitesApi, 'createSite').and.callFake(() => {
|
||||
return new Promise((resolve, reject) => reject(error));
|
||||
return Promise.reject(error);
|
||||
});
|
||||
spyOn(alfrescoApi.sitesApi, 'getSite').and.callFake(() => {
|
||||
return new Promise((resolve, reject) => reject());
|
||||
return Promise.reject();
|
||||
});
|
||||
|
||||
fixture.detectChanges();
|
||||
@ -218,7 +218,7 @@ describe('LibraryDialogComponent', () => {
|
||||
it('should not translate library title if value is not a valid id', fakeAsync(() => {
|
||||
findSitesSpy.and.returnValue(Promise.resolve(findSitesResponse));
|
||||
spyOn(alfrescoApi.sitesApi, 'getSite').and.callFake(() => {
|
||||
return new Promise((resolve, reject) => reject());
|
||||
return Promise.reject();
|
||||
});
|
||||
|
||||
fixture.detectChanges();
|
||||
@ -233,7 +233,7 @@ describe('LibraryDialogComponent', () => {
|
||||
it('should translate library title partially for library id', fakeAsync(() => {
|
||||
findSitesSpy.and.returnValue(Promise.resolve(findSitesResponse));
|
||||
spyOn(alfrescoApi.sitesApi, 'getSite').and.callFake(() => {
|
||||
return new Promise((resolve, reject) => reject());
|
||||
return Promise.reject();
|
||||
});
|
||||
|
||||
fixture.detectChanges();
|
||||
@ -248,7 +248,7 @@ describe('LibraryDialogComponent', () => {
|
||||
it('should translate library title multiple space character to one dash for library id', fakeAsync(() => {
|
||||
findSitesSpy.and.returnValue(Promise.resolve(findSitesResponse));
|
||||
spyOn(alfrescoApi.sitesApi, 'getSite').and.callFake(() => {
|
||||
return new Promise((resolve, reject) => reject());
|
||||
return Promise.reject();
|
||||
});
|
||||
|
||||
fixture.detectChanges();
|
||||
@ -263,7 +263,7 @@ describe('LibraryDialogComponent', () => {
|
||||
it('should invalidate library title if is too short', fakeAsync(() => {
|
||||
findSitesSpy.and.returnValue(Promise.resolve(findSitesResponse));
|
||||
spyOn(alfrescoApi.sitesApi, 'getSite').and.callFake(() => {
|
||||
return new Promise((resolve, reject) => reject());
|
||||
return Promise.reject();
|
||||
});
|
||||
|
||||
fixture.detectChanges();
|
||||
|
@ -227,7 +227,7 @@ describe('ContentAction', () => {
|
||||
});
|
||||
|
||||
it('should find document action handler via service', () => {
|
||||
const handler = <ContentActionHandler> function (obj: any, target?: any) {
|
||||
const handler = <ContentActionHandler> function () {
|
||||
};
|
||||
const action = new ContentActionComponent(actionList, documentActions, null);
|
||||
spyOn(documentActions, 'getHandler').and.returnValue(handler);
|
||||
@ -235,7 +235,7 @@ describe('ContentAction', () => {
|
||||
});
|
||||
|
||||
it('should find folder action handler via service', () => {
|
||||
const handler = <ContentActionHandler> function (obj: any, target?: any) {
|
||||
const handler = <ContentActionHandler> function () {
|
||||
};
|
||||
const action = new ContentActionComponent(actionList, null, folderActions);
|
||||
spyOn(folderActions, 'getHandler').and.returnValue(handler);
|
||||
|
@ -852,7 +852,7 @@ describe('DocumentList', () => {
|
||||
let called = false;
|
||||
|
||||
documentList.navigationMode = DocumentListComponent.SINGLE_CLICK_NAVIGATION;
|
||||
documentList.preview.subscribe((val) => called = true);
|
||||
documentList.preview.subscribe(() => called = true);
|
||||
|
||||
documentList.onNodeClick(file);
|
||||
expect(called).toBeFalsy();
|
||||
@ -1025,7 +1025,7 @@ describe('DocumentList', () => {
|
||||
it('should emit node-click DOM event', (done) => {
|
||||
const node = new NodeMinimalEntry();
|
||||
|
||||
document.addEventListener('node-click', (customEvent: CustomEvent) => {
|
||||
document.addEventListener('node-click', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
@ -1043,7 +1043,7 @@ describe('DocumentList', () => {
|
||||
it('should emit node-dblclick DOM event', (done) => {
|
||||
const node = new NodeMinimalEntry();
|
||||
|
||||
document.addEventListener('node-dblclick', (customEvent: CustomEvent) => {
|
||||
document.addEventListener('node-dblclick', () => {
|
||||
done();
|
||||
});
|
||||
|
||||
|
@ -97,7 +97,7 @@ export class ShareDataRow implements DataRow {
|
||||
return ObjectUtils.getValue(this.obj.entry, key);
|
||||
}
|
||||
|
||||
imageErrorResolver(event: Event): any {
|
||||
imageErrorResolver(): any {
|
||||
if (this.obj.entry.content) {
|
||||
return this.thumbnailService.getMimeTypeIcon(this.obj.entry.content.mimeType);
|
||||
}
|
||||
|
@ -38,19 +38,19 @@ class FakeSanitizer extends DomSanitizer {
|
||||
return value;
|
||||
}
|
||||
|
||||
bypassSecurityTrustStyle(value: string): any {
|
||||
bypassSecurityTrustStyle(): any {
|
||||
return null;
|
||||
}
|
||||
|
||||
bypassSecurityTrustScript(value: string): any {
|
||||
bypassSecurityTrustScript(): any {
|
||||
return null;
|
||||
}
|
||||
|
||||
bypassSecurityTrustUrl(value: string): any {
|
||||
bypassSecurityTrustUrl(): any {
|
||||
return null;
|
||||
}
|
||||
|
||||
bypassSecurityTrustResourceUrl(value: string): any {
|
||||
bypassSecurityTrustResourceUrl(): any {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ describe('DocumentActionsService', () => {
|
||||
});
|
||||
|
||||
it('should register custom action handler', () => {
|
||||
const handler: ContentActionHandler = function (obj: any) {
|
||||
const handler: ContentActionHandler = function () {
|
||||
};
|
||||
service.setHandler('<key>', handler);
|
||||
expect(service.getHandler('<key>')).toBe(handler);
|
||||
@ -68,7 +68,7 @@ describe('DocumentActionsService', () => {
|
||||
});
|
||||
|
||||
it('should be case insensitive for keys', () => {
|
||||
const handler: ContentActionHandler = function (obj: any) {
|
||||
const handler: ContentActionHandler = function () {
|
||||
};
|
||||
service.setHandler('<key>', handler);
|
||||
expect(service.getHandler('<KEY>')).toBe(handler);
|
||||
@ -94,7 +94,7 @@ describe('DocumentActionsService', () => {
|
||||
});
|
||||
|
||||
it('should set new handler only by key', () => {
|
||||
const handler: ContentActionHandler = function (obj: any) {
|
||||
const handler: ContentActionHandler = function () {
|
||||
};
|
||||
expect(service.setHandler(null, handler)).toBeFalsy();
|
||||
expect(service.setHandler('', handler)).toBeFalsy();
|
||||
|
@ -89,27 +89,27 @@ export class DocumentActionsService {
|
||||
this.handlers['lock'] = this.lockNode.bind(this);
|
||||
}
|
||||
|
||||
private lockNode(node: NodeEntry, target?: any, permission?: string) {
|
||||
private lockNode(node: NodeEntry) {
|
||||
return this.contentNodeDialogService.openLockNodeDialog(node.entry);
|
||||
}
|
||||
|
||||
private downloadNode(obj: NodeEntry, target?: any, permission?: string) {
|
||||
private downloadNode(obj: NodeEntry) {
|
||||
this.nodeActionsService.downloadNode(obj);
|
||||
}
|
||||
|
||||
private copyNode(node: NodeEntry, target?: any, permission?: string) {
|
||||
private copyNode(node: NodeEntry, _target?: any, permission?: string) {
|
||||
const actionObservable = this.nodeActionsService.copyContent(node.entry, permission);
|
||||
this.prepareHandlers(actionObservable, 'content', 'copy', target, permission);
|
||||
this.prepareHandlers(actionObservable);
|
||||
return actionObservable;
|
||||
}
|
||||
|
||||
private moveNode(node: NodeEntry, target?: any, permission?: string) {
|
||||
private moveNode(node: NodeEntry, _target?: any, permission?: string) {
|
||||
const actionObservable = this.nodeActionsService.moveContent(node.entry, permission);
|
||||
this.prepareHandlers(actionObservable, 'content', 'move', target, permission);
|
||||
this.prepareHandlers(actionObservable);
|
||||
return actionObservable;
|
||||
}
|
||||
|
||||
private prepareHandlers(actionObservable, type: string, action: string, target?: any, permission?: string): void {
|
||||
private prepareHandlers(actionObservable): void {
|
||||
actionObservable.subscribe(
|
||||
(fileOperationMessage) => {
|
||||
this.success.next(fileOperationMessage);
|
||||
@ -118,7 +118,7 @@ export class DocumentActionsService {
|
||||
);
|
||||
}
|
||||
|
||||
private deleteNode(node: NodeEntry, target?: any, permission?: string): Observable<any> {
|
||||
private deleteNode(node: NodeEntry, _target?: any, permission?: string): Observable<any> {
|
||||
let handlerObservable;
|
||||
|
||||
if (this.canExecuteAction(node)) {
|
||||
|
@ -92,17 +92,17 @@ export class FolderActionsService {
|
||||
|
||||
private copyNode(nodeEntry: NodeEntry, target?: any, permission?: string) {
|
||||
const actionObservable = this.nodeActionsService.copyFolder(nodeEntry.entry, permission);
|
||||
this.prepareHandlers(actionObservable, 'folder', 'copy', target, permission);
|
||||
this.prepareHandlers(actionObservable, target);
|
||||
return actionObservable;
|
||||
}
|
||||
|
||||
private moveNode(nodeEntry: NodeEntry, target?: any, permission?: string) {
|
||||
const actionObservable = this.nodeActionsService.moveFolder(nodeEntry.entry, permission);
|
||||
this.prepareHandlers(actionObservable, 'folder', 'move', target, permission);
|
||||
this.prepareHandlers(actionObservable, target);
|
||||
return actionObservable;
|
||||
}
|
||||
|
||||
private prepareHandlers(actionObservable, type: string, action: string, target?: any, permission?: string): void {
|
||||
private prepareHandlers(actionObservable, target?: any): void {
|
||||
actionObservable.subscribe(
|
||||
(fileOperationMessage) => {
|
||||
if (target && typeof target.reload === 'function') {
|
||||
|
@ -104,7 +104,7 @@ describe('NodeActionsService', () => {
|
||||
spyOn(documentListService, 'copyNode').and.returnValue(throwError('FAKE-KO'));
|
||||
spyOn(contentDialogService, 'openCopyMoveDialog').and.returnValue(of([fakeNode]));
|
||||
|
||||
service.copyFolder(fakeNode, '!allowed').subscribe((value) => {
|
||||
service.copyFolder(fakeNode, '!allowed').subscribe(() => {
|
||||
}, (error) => {
|
||||
expect(error).toBe('FAKE-KO');
|
||||
});
|
||||
|
@ -152,7 +152,7 @@ export let errorJson = {
|
||||
this.message = event;
|
||||
}
|
||||
|
||||
elementClicked(event: any) {
|
||||
elementClicked() {
|
||||
this.message = 'element clicked';
|
||||
}
|
||||
|
||||
|
@ -57,7 +57,7 @@ export let mockError = {
|
||||
export let searchMockApi = {
|
||||
core: {
|
||||
queriesApi: {
|
||||
findNodes: (term, opts) => Promise.resolve(fakeSearch)
|
||||
findNodes: () => Promise.resolve(fakeSearch)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -57,7 +57,7 @@ describe('InheritPermissionDirective', () => {
|
||||
|
||||
it('should be able to add inherited permission', async(() => {
|
||||
spyOn(nodeService, 'getNode').and.returnValue(of(fakeNodeNoInherit));
|
||||
spyOn(nodeService, 'updateNode').and.callFake((nodeId, nodeBody) => {
|
||||
spyOn(nodeService, 'updateNode').and.callFake((_, nodeBody) => {
|
||||
if (nodeBody.permissions.isInheritanceEnabled) {
|
||||
return of(fakeNodeWithInherit);
|
||||
} else {
|
||||
@ -77,7 +77,7 @@ describe('InheritPermissionDirective', () => {
|
||||
|
||||
it('should be able to remove inherited permission', async(() => {
|
||||
spyOn(nodeService, 'getNode').and.returnValue(of(fakeNodeWithInherit));
|
||||
spyOn(nodeService, 'updateNode').and.callFake((nodeId, nodeBody) => {
|
||||
spyOn(nodeService, 'updateNode').and.callFake((_, nodeBody) => {
|
||||
if (nodeBody.permissions.isInheritanceEnabled) {
|
||||
return of(fakeNodeWithInherit);
|
||||
} else {
|
||||
|
@ -110,7 +110,7 @@ describe('NodePermissionDialogService', () => {
|
||||
|
||||
it('should return the updated node', (done) => {
|
||||
spyOn(contentService, 'getNode').and.returnValue(of(fakeForbiddenNode));
|
||||
service.updateNodePermissionByDialog('fake-node-id', 'fake-title').subscribe((node) => {
|
||||
service.updateNodePermissionByDialog('fake-node-id', 'fake-title').subscribe(() => {
|
||||
throwError('This call should fail');
|
||||
},
|
||||
(error) => {
|
||||
|
@ -51,7 +51,7 @@ describe('NodePermissionService', () => {
|
||||
TestBed.resetTestingModule();
|
||||
});
|
||||
|
||||
function returnUpdatedNode(nodeId, nodeBody) {
|
||||
function returnUpdatedNode(_, nodeBody) {
|
||||
const fakeNode: Node = new Node({});
|
||||
fakeNode.id = 'fake-updated-node';
|
||||
fakeNode.permissions = nodeBody.permissions;
|
||||
@ -185,7 +185,7 @@ describe('NodePermissionService', () => {
|
||||
}];
|
||||
|
||||
service.updateLocallySetPermissions(fakeNodeCopy, fakeDuplicateAuthority, ['Contributor'])
|
||||
.subscribe((node: Node) => {
|
||||
.subscribe(() => {
|
||||
|
||||
}, (errorMessage) => {
|
||||
expect(errorMessage).not.toBeNull();
|
||||
|
@ -514,7 +514,7 @@ describe('SearchControlComponent', () => {
|
||||
it('should set deactivate the search after element is clicked', (done) => {
|
||||
spyOn(component, 'isSearchBarActive').and.returnValue(true);
|
||||
searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results))));
|
||||
const clickDisposable = component.optionClicked.subscribe((item) => {
|
||||
const clickDisposable = component.optionClicked.subscribe(() => {
|
||||
expect(component.subscriptAnimationState.value).toBe('inactive');
|
||||
clickDisposable.unsubscribe();
|
||||
done();
|
||||
@ -533,7 +533,7 @@ describe('SearchControlComponent', () => {
|
||||
it('should NOT reset the search term after element is clicked', (done) => {
|
||||
spyOn(component, 'isSearchBarActive').and.returnValue(true);
|
||||
searchServiceSpy.and.returnValue(of(JSON.parse(JSON.stringify(results))));
|
||||
const clickDisposable = component.optionClicked.subscribe((item) => {
|
||||
const clickDisposable = component.optionClicked.subscribe(() => {
|
||||
expect(component.searchTerm).not.toBeFalsy();
|
||||
expect(component.searchTerm).toBe('TEST');
|
||||
clickDisposable.unsubscribe();
|
||||
|
@ -178,14 +178,14 @@ export class SearchTriggerDirective implements ControlValueAccessor, OnDestroy {
|
||||
let isPanelOption: boolean = false;
|
||||
if ( event ) {
|
||||
const clickTarget = event.target as HTMLElement;
|
||||
isPanelOption = !this.isNoResultOption(event) &&
|
||||
isPanelOption = !this.isNoResultOption() &&
|
||||
!!this.searchPanel.panel &&
|
||||
!!this.searchPanel.panel.nativeElement.contains(clickTarget);
|
||||
}
|
||||
return isPanelOption;
|
||||
}
|
||||
|
||||
private isNoResultOption(event: MouseEvent) {
|
||||
private isNoResultOption() {
|
||||
return this.searchPanel.results.list ? this.searchPanel.results.list.entries.length === 0 : true;
|
||||
}
|
||||
|
||||
|
@ -218,7 +218,7 @@ describe('TreeViewComponent', () => {
|
||||
beforeEach(async(() => {
|
||||
fixture = TestBed.createComponent(TreeViewComponent);
|
||||
treeService = TestBed.get(TreeViewService);
|
||||
spyOn(treeService, 'getTreeNodes').and.callFake((nodeId) => throwError('Invalid Node Id'));
|
||||
spyOn(treeService, 'getTreeNodes').and.callFake(() => throwError('Invalid Node Id'));
|
||||
fixture.componentInstance.nodeId = 'Poopoovic';
|
||||
}));
|
||||
|
||||
|
@ -67,7 +67,7 @@ export class TreeViewComponent implements OnChanges {
|
||||
|
||||
isExpandable = (node: TreeBaseNode) => node.expandable;
|
||||
|
||||
hasChild = (level: number, nodeData: TreeBaseNode) => nodeData.expandable;
|
||||
hasChild = (_: number, nodeData: TreeBaseNode) => nodeData.expandable;
|
||||
|
||||
private loadTreeNode() {
|
||||
this.treeViewService.getTreeNodes(this.nodeId)
|
||||
|
@ -18,7 +18,7 @@
|
||||
import { Component, Input, ViewEncapsulation, ViewChild, Output, EventEmitter } from '@angular/core';
|
||||
import { Node } from '@alfresco/js-api';
|
||||
import { VersionListComponent } from './version-list.component';
|
||||
import { AppConfigService, ContentService, AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { ContentService, AlfrescoApiService } from '@alfresco/adf-core';
|
||||
import { trigger, state, style, animate, transition } from '@angular/animations';
|
||||
|
||||
@Component({
|
||||
@ -68,8 +68,7 @@ export class VersionManagerComponent {
|
||||
|
||||
uploadState: string = 'close';
|
||||
|
||||
constructor(config: AppConfigService,
|
||||
private contentService: ContentService,
|
||||
constructor(private contentService: ContentService,
|
||||
private alfrescoApiService: AlfrescoApiService) {
|
||||
}
|
||||
|
||||
|
@ -81,7 +81,7 @@ describe('WebscriptComponent', () => {
|
||||
it('url should be the one configured by the input param', (done) => {
|
||||
component.scriptPath = 'sample/folder/Company%20Home';
|
||||
|
||||
component.ngOnChanges(null).then(() => {
|
||||
component.ngOnChanges().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(jasmine.Ajax.requests.mostRecent().url).toBe('http://localhost:9876/ecm/alfresco/service/sample/folder/Company%20Home');
|
||||
done();
|
||||
@ -98,7 +98,7 @@ describe('WebscriptComponent', () => {
|
||||
component.scriptPath = 'sample/folder/Company%20Home';
|
||||
component.contentType = 'TEXT';
|
||||
|
||||
component.ngOnChanges(null).then(() => {
|
||||
component.ngOnChanges().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(element.querySelector('#webscript-data-TEXT').innerHTML)
|
||||
.toBe('text test');
|
||||
@ -116,7 +116,7 @@ describe('WebscriptComponent', () => {
|
||||
component.scriptPath = 'sample/folder/Company%20Home';
|
||||
component.contentType = 'JSON';
|
||||
|
||||
component.ngOnChanges(null).then(() => {
|
||||
component.ngOnChanges().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(JSON.parse(element.querySelector('#webscript-data-JSON').innerHTML)[0].name).toBe('Name 1');
|
||||
expect(JSON.parse(element.querySelector('#webscript-data-JSON').innerHTML)[1].name).toBe('Name 2');
|
||||
@ -138,7 +138,7 @@ describe('WebscriptComponent', () => {
|
||||
component.scriptPath = 'sample/folder/Company%20Home';
|
||||
component.contentType = 'DATATABLE';
|
||||
|
||||
component.ngOnChanges(null).then(() => {
|
||||
component.ngOnChanges().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(element.querySelector('#webscript-datatable-wrapper').innerHTML).toBeDefined();
|
||||
done();
|
||||
@ -176,7 +176,7 @@ describe('WebscriptComponent', () => {
|
||||
component.scriptPath = 'sample/folder/Company%20Home';
|
||||
component.contentType = 'DATATABLE';
|
||||
|
||||
component.ngOnChanges(null).then(() => {
|
||||
component.ngOnChanges().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(element.querySelector('#webscript-datatable-wrapper').innerHTML).toBeDefined();
|
||||
done();
|
||||
|
@ -85,7 +85,7 @@ export class WebscriptComponent implements OnChanges {
|
||||
private logService: LogService) {
|
||||
}
|
||||
|
||||
ngOnChanges(changes) {
|
||||
ngOnChanges() {
|
||||
if (this.showData) {
|
||||
this.clean();
|
||||
}
|
||||
|
@ -200,7 +200,7 @@ describe('CardViewDateItemComponent', () => {
|
||||
component.onDateChanged({ value: expectedDate });
|
||||
|
||||
fixture.whenStable().then(
|
||||
(updateNotification) => {
|
||||
() => {
|
||||
expect(component.property.value).toEqual(expectedDate.toDate());
|
||||
}
|
||||
);
|
||||
@ -246,7 +246,7 @@ describe('CardViewDateItemComponent', () => {
|
||||
component.onDateClear();
|
||||
|
||||
fixture.whenStable().then(
|
||||
(updateNotification) => {
|
||||
() => {
|
||||
expect(component.property.value).toBeNull();
|
||||
}
|
||||
);
|
||||
@ -261,7 +261,7 @@ describe('CardViewDateItemComponent', () => {
|
||||
component.onDateClear();
|
||||
|
||||
fixture.whenStable().then(
|
||||
(updateNotification) => {
|
||||
() => {
|
||||
expect(component.property.default).toBeNull();
|
||||
}
|
||||
);
|
||||
@ -277,7 +277,7 @@ describe('CardViewDateItemComponent', () => {
|
||||
component.onDateClear();
|
||||
|
||||
fixture.whenStable().then(
|
||||
(updateNotification) => {
|
||||
() => {
|
||||
expect(component.property.value).toBeNull();
|
||||
expect(component.property.default).toBeNull();
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ describe('CommentListComponent', () => {
|
||||
commentList.selectedComment = commentOne;
|
||||
commentList.comments = [commentOne, commentTwo];
|
||||
|
||||
commentList.clickRow.subscribe((selectedComment) => {
|
||||
commentList.clickRow.subscribe(() => {
|
||||
fixture.detectChanges();
|
||||
const commentSelectedList = fixture.nativeElement.querySelectorAll('.adf-is-selected');
|
||||
expect(commentSelectedList.length).toBe(1);
|
||||
|
@ -61,8 +61,8 @@ export class ContextMenuHolderComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
@HostListener('window:resize', ['$event'])
|
||||
onResize(event) {
|
||||
@HostListener('window:resize')
|
||||
onResize() {
|
||||
if (this.mdMenuElement) {
|
||||
this.updatePosition();
|
||||
}
|
||||
|
@ -96,7 +96,7 @@
|
||||
role="gridcell"
|
||||
class=" adf-datatable-cell adf-datatable-cell--{{col.type || 'text'}} {{col.cssClass}}"
|
||||
[attr.title]="col.title | translate"
|
||||
[attr.data-automation-id]="getAutomationValue(row, col)"
|
||||
[attr.data-automation-id]="getAutomationValue(row)"
|
||||
[attr.aria-selected]="row.isSelected ? true : false"
|
||||
[attr.aria-label]="col.title ? (col.title | translate) : null"
|
||||
tabindex="0"
|
||||
|
@ -33,7 +33,7 @@ class FakeDataRow implements DataRow {
|
||||
isDropTarget = false;
|
||||
isSelected = true;
|
||||
|
||||
hasValue(key: any) {
|
||||
hasValue() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -374,7 +374,7 @@ describe('DataTable', () => {
|
||||
|
||||
dataTable.ngOnChanges({});
|
||||
|
||||
dataTable.rowClick.subscribe((event) => {
|
||||
dataTable.rowClick.subscribe(() => {
|
||||
expect(rows[0].isSelected).toBeFalsy();
|
||||
expect(rows[1].isSelected).toBeTruthy();
|
||||
done();
|
||||
@ -396,7 +396,7 @@ describe('DataTable', () => {
|
||||
|
||||
dataTable.ngOnChanges({});
|
||||
|
||||
dataTable.rowClick.subscribe((event) => {
|
||||
dataTable.rowClick.subscribe(() => {
|
||||
expect(rows[0].isSelected).toBeFalsy();
|
||||
expect(rows[1].isSelected).toBeTruthy();
|
||||
done();
|
||||
@ -463,7 +463,7 @@ describe('DataTable', () => {
|
||||
const rows = dataTable.data.getRows();
|
||||
dataTable.ngOnChanges({});
|
||||
|
||||
dataTable.rowClick.subscribe((event) => {
|
||||
dataTable.rowClick.subscribe(() => {
|
||||
expect(rows[0].isSelected).toBeTruthy();
|
||||
expect(rows[1].isSelected).toBeFalsy();
|
||||
done();
|
||||
@ -827,49 +827,49 @@ describe('DataTable', () => {
|
||||
it('should use special material url scheme', () => {
|
||||
const column = <DataColumn> {};
|
||||
|
||||
const row = {
|
||||
getValue: function (key: string) {
|
||||
const row: any = {
|
||||
getValue: function () {
|
||||
return 'material-icons://android';
|
||||
}
|
||||
};
|
||||
|
||||
expect(dataTable.isIconValue(<DataRow> row, column)).toBeTruthy();
|
||||
expect(dataTable.isIconValue(row, column)).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should not use special material url scheme', () => {
|
||||
const column = <DataColumn> {};
|
||||
|
||||
const row = {
|
||||
getValue: function (key: string) {
|
||||
const row: any = {
|
||||
getValue: function () {
|
||||
return 'http://www.google.com';
|
||||
}
|
||||
};
|
||||
|
||||
expect(dataTable.isIconValue(<DataRow> row, column)).toBeFalsy();
|
||||
expect(dataTable.isIconValue(row, column)).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should parse icon value', () => {
|
||||
const column = <DataColumn> {};
|
||||
|
||||
const row = {
|
||||
getValue: function (key: string) {
|
||||
const row: any = {
|
||||
getValue: function () {
|
||||
return 'material-icons://android';
|
||||
}
|
||||
};
|
||||
|
||||
expect(dataTable.asIconValue(<DataRow> row, column)).toBe('android');
|
||||
expect(dataTable.asIconValue(row, column)).toBe('android');
|
||||
});
|
||||
|
||||
it('should not parse icon value', () => {
|
||||
const column = <DataColumn> {};
|
||||
|
||||
const row = {
|
||||
getValue: function (key: string) {
|
||||
const row: any = {
|
||||
getValue: function () {
|
||||
return 'http://www.google.com';
|
||||
}
|
||||
};
|
||||
|
||||
expect(dataTable.asIconValue(<DataRow> row, column)).toBe(null);
|
||||
expect(dataTable.asIconValue(row, column)).toBe(null);
|
||||
});
|
||||
|
||||
it('should parse icon values to a valid i18n key', () => {
|
||||
@ -966,8 +966,8 @@ describe('DataTable', () => {
|
||||
});
|
||||
|
||||
const column = <DataColumn> {};
|
||||
const row = <DataRow> {
|
||||
getValue: function (key: string) {
|
||||
const row: any = {
|
||||
getValue: function () {
|
||||
return 'id';
|
||||
}
|
||||
};
|
||||
|
@ -701,7 +701,7 @@ export class DataTableComponent implements AfterContentInit, OnChanges, DoCheck,
|
||||
});
|
||||
}
|
||||
|
||||
getAutomationValue(row: DataRow, col: DataColumn) {
|
||||
getAutomationValue(row: DataRow): any {
|
||||
const name = this.getNameColumnValue();
|
||||
return name ? row.getValue(name.key) : '';
|
||||
}
|
||||
|
@ -36,7 +36,7 @@ export class ObjectDataRow implements DataRow {
|
||||
return this.getValue(key) !== undefined;
|
||||
}
|
||||
|
||||
imageErrorResolver(event: Event): string {
|
||||
imageErrorResolver(): string {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ import { TranslationMock } from '../mock/translation.service.mock';
|
||||
@Component({
|
||||
template: `
|
||||
<div id="delete-component" [adf-delete]="selection"
|
||||
(delete)="onDelete($event)">
|
||||
(delete)="onDelete()">
|
||||
</div>`
|
||||
})
|
||||
class TestComponent {
|
||||
@ -38,7 +38,7 @@ class TestComponent {
|
||||
@ViewChild(NodeDeleteDirective)
|
||||
deleteDirective: NodeDeleteDirective;
|
||||
|
||||
onDelete(event) {
|
||||
onDelete() {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -39,14 +39,14 @@ describe('UploadDirective', () => {
|
||||
it('should update drag status on dragenter', () => {
|
||||
expect(directive.isDragging).toBeFalsy();
|
||||
directive.enabled = true;
|
||||
directive.onDragEnter(null);
|
||||
directive.onDragEnter();
|
||||
expect(directive.isDragging).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should not update drag status on dragenter when disabled', () => {
|
||||
expect(directive.isDragging).toBeFalsy();
|
||||
directive.enabled = false;
|
||||
directive.onDragEnter(null);
|
||||
directive.onDragEnter();
|
||||
expect(directive.isDragging).toBeFalsy();
|
||||
});
|
||||
|
||||
@ -75,14 +75,14 @@ describe('UploadDirective', () => {
|
||||
it('should update drag status on dragleave', () => {
|
||||
directive.enabled = true;
|
||||
directive.isDragging = true;
|
||||
directive.onDragLeave(null);
|
||||
directive.onDragLeave();
|
||||
expect(directive.isDragging).toBeFalsy();
|
||||
});
|
||||
|
||||
it('should not update drag status on dragleave when disabled', () => {
|
||||
directive.enabled = false;
|
||||
directive.isDragging = true;
|
||||
directive.onDragLeave(null);
|
||||
directive.onDragLeave();
|
||||
expect(directive.isDragging).toBeTruthy();
|
||||
});
|
||||
|
||||
|
@ -108,7 +108,7 @@ export class UploadDirective implements OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
onDragEnter(event: Event) {
|
||||
onDragEnter() {
|
||||
if (this.isDropMode()) {
|
||||
this.element.classList.add(this.cssClassName);
|
||||
this.isDragging = true;
|
||||
@ -124,7 +124,7 @@ export class UploadDirective implements OnInit, OnDestroy {
|
||||
return false;
|
||||
}
|
||||
|
||||
onDragLeave(event) {
|
||||
onDragLeave() {
|
||||
if (this.isDropMode()) {
|
||||
this.element.classList.remove(this.cssClassName);
|
||||
this.isDragging = false;
|
||||
|
@ -56,7 +56,7 @@ describe('TaskAttachmentList', () => {
|
||||
{ name: 'FakeName-2', lastUpdatedByFullName: 'FakeUser-2', lastUpdated: '2017-01-03' }
|
||||
]));
|
||||
|
||||
component.ngOnChanges({});
|
||||
component.ngOnChanges();
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
|
@ -15,7 +15,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, Input, OnChanges, SimpleChanges, ViewEncapsulation } from '@angular/core';
|
||||
import { Component, Input, OnChanges, ViewEncapsulation } from '@angular/core';
|
||||
import { FormService } from './../services/form.service';
|
||||
|
||||
@Component({
|
||||
@ -33,7 +33,7 @@ export class FormListComponent implements OnChanges {
|
||||
constructor(protected formService: FormService) {
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
ngOnChanges() {
|
||||
this.getForms();
|
||||
}
|
||||
|
||||
|
@ -195,7 +195,7 @@ describe('ContentWidgetComponent', () => {
|
||||
const change = new SimpleChange(null, contentId, true);
|
||||
component.ngOnChanges({ 'id': change });
|
||||
|
||||
component.contentLoaded.subscribe((res) => {
|
||||
component.contentLoaded.subscribe(() => {
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable()
|
||||
.then(() => {
|
||||
|
@ -16,7 +16,6 @@
|
||||
*/
|
||||
|
||||
import { ValidateFormFieldEvent } from './../../../events/validate-form-field.event';
|
||||
import { ValidateFormEvent } from './../../../events/validate-form.event';
|
||||
import { FormService } from './../../../services/form.service';
|
||||
import { ContainerModel } from './container.model';
|
||||
import { FormFieldTypes } from './form-field-types';
|
||||
@ -298,7 +297,7 @@ describe('FormModel', () => {
|
||||
|
||||
let validated = false;
|
||||
|
||||
formService.validateForm.subscribe((event: ValidateFormEvent) => {
|
||||
formService.validateForm.subscribe(() => {
|
||||
validated = true;
|
||||
});
|
||||
|
||||
@ -316,7 +315,7 @@ describe('FormModel', () => {
|
||||
|
||||
let validated = false;
|
||||
|
||||
formService.validateFormField.subscribe((event: ValidateFormFieldEvent) => {
|
||||
formService.validateFormField.subscribe(() => {
|
||||
validated = true;
|
||||
});
|
||||
|
||||
@ -333,7 +332,7 @@ describe('FormModel', () => {
|
||||
|
||||
let validated = false;
|
||||
|
||||
formService.validateFormField.subscribe((event: ValidateFormFieldEvent) => {
|
||||
formService.validateFormField.subscribe(() => {
|
||||
validated = true;
|
||||
});
|
||||
|
||||
@ -385,10 +384,10 @@ describe('FormModel', () => {
|
||||
spyOn(form, 'getFormFields').and.returnValue([testField]);
|
||||
|
||||
const validator = <FormFieldValidator> {
|
||||
isSupported(field: FormFieldModel): boolean {
|
||||
isSupported(): boolean {
|
||||
return true;
|
||||
},
|
||||
validate(field: FormFieldModel): boolean {
|
||||
validate(): boolean {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
@ -60,10 +60,10 @@ describe('RowEditorComponent', () => {
|
||||
spyOn(component.table, 'validateRow').and.returnValue(
|
||||
<DynamicRowValidationSummary> {isValid: true, message: null}
|
||||
);
|
||||
component.save.subscribe((e) => {
|
||||
expect(e.table).toBe(component.table);
|
||||
expect(e.row).toBe(component.row);
|
||||
expect(e.column).toBe(component.column);
|
||||
component.save.subscribe((event) => {
|
||||
expect(event.table).toBe(component.table);
|
||||
expect(event.row).toBe(component.row);
|
||||
expect(event.column).toBe(component.column);
|
||||
done();
|
||||
});
|
||||
component.onSaveChanges();
|
||||
@ -74,7 +74,7 @@ describe('RowEditorComponent', () => {
|
||||
<DynamicRowValidationSummary> {isValid: false, message: 'error'}
|
||||
);
|
||||
let raised = false;
|
||||
component.save.subscribe((e) => raised = true);
|
||||
component.save.subscribe(() => raised = true);
|
||||
component.onSaveChanges();
|
||||
expect(raised).toBeFalsy();
|
||||
});
|
||||
|
@ -179,7 +179,7 @@ describe('RadioButtonsWidgetComponent', () => {
|
||||
expect(element.querySelector('#radio-id')).not.toBeNull();
|
||||
expect(option).not.toBeNull();
|
||||
option.click();
|
||||
widget.fieldChanged.subscribe((field) => {
|
||||
widget.fieldChanged.subscribe(() => {
|
||||
expect(element.querySelector('#radio-id')).toBeNull();
|
||||
expect(element.querySelector('#radio-id-opt-1-input')).toBeNull();
|
||||
});
|
||||
|
@ -126,7 +126,7 @@ describe('TabsWidgetComponent', () => {
|
||||
|
||||
tick(500);
|
||||
|
||||
tabWidgetComponent.formTabChanged.subscribe((res) => {
|
||||
tabWidgetComponent.formTabChanged.subscribe(() => {
|
||||
tabWidgetComponent.tabs[1].isVisible = true;
|
||||
|
||||
tick(500);
|
||||
@ -144,7 +144,7 @@ describe('TabsWidgetComponent', () => {
|
||||
|
||||
tick(500);
|
||||
|
||||
tabWidgetComponent.formTabChanged.subscribe((res) => {
|
||||
tabWidgetComponent.formTabChanged.subscribe(() => {
|
||||
tabWidgetComponent.tabs[0].isVisible = false;
|
||||
|
||||
tick(500);
|
||||
|
@ -93,7 +93,7 @@ describe('Form service', () => {
|
||||
const simpleResponseBody = { id: 1, modelType: 'test' };
|
||||
|
||||
it('should fetch and parse process definitions', (done) => {
|
||||
service.getProcessDefinitions().subscribe((result) => {
|
||||
service.getProcessDefinitions().subscribe(() => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/process-definitions')).toBeTruthy();
|
||||
expect( [ { id: '1' }, { id: '2' } ]).toEqual(JSON.parse(jasmine.Ajax.requests.mostRecent().response).data);
|
||||
done();
|
||||
@ -107,7 +107,7 @@ describe('Form service', () => {
|
||||
});
|
||||
|
||||
it('should fetch and parse tasks', (done) => {
|
||||
service.getTasks().subscribe((result) => {
|
||||
service.getTasks().subscribe(() => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/tasks/query')).toBeTruthy();
|
||||
expect( [ { id: '1' }, { id: '2' } ]).toEqual(JSON.parse(jasmine.Ajax.requests.mostRecent().response).data);
|
||||
done();
|
||||
@ -240,7 +240,7 @@ describe('Form service', () => {
|
||||
});
|
||||
processApiSpy.getProcessDefinitionStartForm.and.returnValue(Promise.resolve({ id: '1' }));
|
||||
|
||||
service.getStartFormDefinition('myprocess:1').subscribe((result) => {
|
||||
service.getStartFormDefinition('myprocess:1').subscribe(() => {
|
||||
expect(processApiSpy.getProcessDefinitionStartForm).toHaveBeenCalledWith('myprocess:1');
|
||||
done();
|
||||
});
|
||||
@ -344,7 +344,7 @@ describe('Form service', () => {
|
||||
});
|
||||
|
||||
it('should create a Form with modelType=2', (done) => {
|
||||
service.createForm('testName').subscribe((result) => {
|
||||
service.createForm('testName').subscribe(() => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('/models')).toBeTruthy();
|
||||
expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).modelType).toEqual(2);
|
||||
expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).name).toEqual('testName');
|
||||
|
@ -161,7 +161,7 @@ describe('NodeService', () => {
|
||||
testdata: 'testdata'
|
||||
};
|
||||
|
||||
service.createNodeMetadata('typeTest', EcmModelService.MODEL_NAMESPACE, data, '/Sites/swsdp/documentLibrary').subscribe((result) => {
|
||||
service.createNodeMetadata('typeTest', EcmModelService.MODEL_NAMESPACE, data, '/Sites/swsdp/documentLibrary').subscribe(() => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().url.endsWith('-root-/children')).toBeTruthy();
|
||||
expect(JSON.parse(jasmine.Ajax.requests.mostRecent().params).name).toBeDefined();
|
||||
done();
|
||||
|
@ -268,7 +268,7 @@ describe('WidgetVisibilityCloudService', () => {
|
||||
|
||||
it('should retrieve the value for the right field when it is a process variable', (done) => {
|
||||
service.getTaskProcessVariable('9999').subscribe(
|
||||
(res: TaskProcessVariableModel[]) => {
|
||||
() => {
|
||||
visibilityObjTest.rightValue = 'test_value_2';
|
||||
const rightValue = service.getRightValue(formTest, visibilityObjTest);
|
||||
|
||||
@ -286,7 +286,7 @@ describe('WidgetVisibilityCloudService', () => {
|
||||
|
||||
it('should retrieve the value for the left field when it is a process variable', (done) => {
|
||||
service.getTaskProcessVariable('9999').subscribe(
|
||||
(res: TaskProcessVariableModel[]) => {
|
||||
() => {
|
||||
visibilityObjTest.leftValue = 'TEST_VAR_2';
|
||||
visibilityObjTest.leftType = WidgetTypeEnum.field;
|
||||
const leftValue = service.getLeftValue(formTest, visibilityObjTest);
|
||||
@ -305,7 +305,7 @@ describe('WidgetVisibilityCloudService', () => {
|
||||
|
||||
it('should evaluate the visibility for the field between form value and process var', (done) => {
|
||||
service.getTaskProcessVariable('9999').subscribe(
|
||||
(res: TaskProcessVariableModel[]) => {
|
||||
() => {
|
||||
visibilityObjTest.leftType = 'LEFT_FORM_FIELD_ID';
|
||||
visibilityObjTest.operator = '!=';
|
||||
visibilityObjTest.rightValue = 'TEST_VAR_2';
|
||||
@ -324,7 +324,7 @@ describe('WidgetVisibilityCloudService', () => {
|
||||
|
||||
it('should evaluate visibility with multiple conditions', (done) => {
|
||||
service.getTaskProcessVariable('9999').subscribe(
|
||||
(res: TaskProcessVariableModel[]) => {
|
||||
() => {
|
||||
visibilityObjTest.leftType = 'field';
|
||||
visibilityObjTest.leftValue = 'TEST_VAR_2';
|
||||
visibilityObjTest.operator = '!=';
|
||||
|
@ -252,7 +252,7 @@ describe('WidgetVisibilityService', () => {
|
||||
|
||||
it('should retrieve the value for the right field when it is a process variable', (done) => {
|
||||
service.getTaskProcessVariable('9999').subscribe(
|
||||
(res: TaskProcessVariableModel[]) => {
|
||||
() => {
|
||||
visibilityObjTest.rightRestResponseId = 'TEST_VAR_2';
|
||||
const rightValue = service.getRightValue(formTest, visibilityObjTest);
|
||||
|
||||
@ -270,7 +270,7 @@ describe('WidgetVisibilityService', () => {
|
||||
|
||||
it('should retrieve the value for the left field when it is a process variable', (done) => {
|
||||
service.getTaskProcessVariable('9999').subscribe(
|
||||
(res: TaskProcessVariableModel[]) => {
|
||||
() => {
|
||||
visibilityObjTest.leftRestResponseId = 'TEST_VAR_2';
|
||||
const leftValue = service.getLeftValue(formTest, visibilityObjTest);
|
||||
|
||||
@ -288,7 +288,7 @@ describe('WidgetVisibilityService', () => {
|
||||
|
||||
it('should evaluate the visibility for the field between form value and process var', (done) => {
|
||||
service.getTaskProcessVariable('9999').subscribe(
|
||||
(res: TaskProcessVariableModel[]) => {
|
||||
() => {
|
||||
visibilityObjTest.leftFormFieldId = 'LEFT_FORM_FIELD_ID';
|
||||
visibilityObjTest.operator = '!=';
|
||||
visibilityObjTest.rightRestResponseId = 'TEST_VAR_2';
|
||||
@ -307,7 +307,7 @@ describe('WidgetVisibilityService', () => {
|
||||
|
||||
it('should evaluate visibility with multiple conditions', (done) => {
|
||||
service.getTaskProcessVariable('9999').subscribe(
|
||||
(res: TaskProcessVariableModel[]) => {
|
||||
() => {
|
||||
visibilityObjTest.leftFormFieldId = 'LEFT_FORM_FIELD_ID';
|
||||
visibilityObjTest.operator = '!=';
|
||||
visibilityObjTest.rightRestResponseId = 'TEST_VAR_2';
|
||||
|
@ -282,7 +282,7 @@ export class WidgetVisibilityService {
|
||||
this.processVarList = <TaskProcessVariableModel[]> jsonRes;
|
||||
return jsonRes;
|
||||
}),
|
||||
catchError((err) => this.handleError(err))
|
||||
catchError(() => this.handleError())
|
||||
);
|
||||
}
|
||||
|
||||
@ -298,7 +298,7 @@ export class WidgetVisibilityService {
|
||||
return !!(condition && condition.operator);
|
||||
}
|
||||
|
||||
private handleError(err) {
|
||||
private handleError() {
|
||||
this.logService.error('Error while performing a call');
|
||||
return throwError('Error while performing a call - Server error');
|
||||
}
|
||||
|
@ -18,7 +18,7 @@
|
||||
/* tslint:disable:adf-file-name */
|
||||
export class AlfrescoApiMock {
|
||||
|
||||
login(username: string, password: string) {
|
||||
login() {
|
||||
return new Promise((resolve) => {
|
||||
resolve('TICKET_4479f4d3bb155195879bfbb8d5206f433488a1b1');
|
||||
});
|
||||
|
@ -132,7 +132,7 @@ export let deleteGroupMappingApi = {
|
||||
|
||||
export let returnCallQueryParameters = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: (queryUrl, operation, context, queryParams) => {
|
||||
callCustomApi: (_queryUrl, _operation, _context, queryParams) => {
|
||||
return Promise.resolve(queryParams);
|
||||
}
|
||||
}
|
||||
@ -140,7 +140,7 @@ export let returnCallQueryParameters = {
|
||||
|
||||
export let returnCallUrl = {
|
||||
oauth2Auth: {
|
||||
callCustomApi: (queryUrl, operation, context, queryParams) => {
|
||||
callCustomApi: (queryUrl) => {
|
||||
return Promise.resolve(queryUrl);
|
||||
}
|
||||
}
|
||||
|
@ -57,7 +57,7 @@ export let mockError = {
|
||||
export let searchMockApi = {
|
||||
core: {
|
||||
queriesApi: {
|
||||
findNodes: (term, opts) => Promise.resolve(fakeSearch)
|
||||
findNodes: () => Promise.resolve(fakeSearch)
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -42,11 +42,11 @@ export class TranslationMock implements TranslationService {
|
||||
|
||||
loadTranslation() {}
|
||||
|
||||
get(key: string | Array<string>, interpolateParams?: Object): Observable<string | any> {
|
||||
get(key: string | Array<string>): Observable<string | any> {
|
||||
return of(key);
|
||||
}
|
||||
|
||||
instant(key: string | Array<string>, interpolateParams?: Object): string | any {
|
||||
instant(key: string | Array<string>): string | any {
|
||||
return key;
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ export class PaginationComponent implements OnInit, OnDestroy, PaginationCompone
|
||||
get pages(): number[] {
|
||||
return Array(this.lastPage)
|
||||
.fill('n')
|
||||
.map((item, index) => (index + 1));
|
||||
.map((_, index) => (index + 1));
|
||||
}
|
||||
|
||||
goNext() {
|
||||
|
@ -33,19 +33,19 @@ class FakeSanitizer extends DomSanitizer {
|
||||
return value;
|
||||
}
|
||||
|
||||
bypassSecurityTrustStyle(value: string): any {
|
||||
bypassSecurityTrustStyle(): any {
|
||||
return null;
|
||||
}
|
||||
|
||||
bypassSecurityTrustScript(value: string): any {
|
||||
bypassSecurityTrustScript(): any {
|
||||
return null;
|
||||
}
|
||||
|
||||
bypassSecurityTrustUrl(value: string): any {
|
||||
bypassSecurityTrustUrl(): any {
|
||||
return null;
|
||||
}
|
||||
|
||||
bypassSecurityTrustResourceUrl(value: string): any {
|
||||
bypassSecurityTrustResourceUrl(): any {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -33,7 +33,7 @@ export class AuthGuardBpm extends AuthGuardBase {
|
||||
super(authenticationService, router, appConfigService);
|
||||
}
|
||||
|
||||
checkLogin(activeRoute: ActivatedRouteSnapshot, redirectUrl: string): Observable<boolean> | Promise<boolean> | boolean {
|
||||
checkLogin(_: ActivatedRouteSnapshot, redirectUrl: string): Observable<boolean> | Promise<boolean> | boolean {
|
||||
if (this.authenticationService.isBpmLoggedIn() || this.withCredentials) {
|
||||
return true;
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ export class AuthGuardEcm extends AuthGuardBase {
|
||||
super(authenticationService, router, appConfigService);
|
||||
}
|
||||
|
||||
checkLogin(activeRoute: ActivatedRouteSnapshot, redirectUrl: string): Observable<boolean> | Promise<boolean> | boolean {
|
||||
checkLogin(_: ActivatedRouteSnapshot, redirectUrl: string): Observable<boolean> | Promise<boolean> | boolean {
|
||||
if (this.authenticationService.isEcmLoggedIn() || this.withCredentials) {
|
||||
return true;
|
||||
}
|
||||
|
@ -46,7 +46,7 @@ describe('Auth Guard SSO role service', () => {
|
||||
const router: ActivatedRouteSnapshot = new ActivatedRouteSnapshot();
|
||||
router.data = { 'roles': ['role1', 'role2'] };
|
||||
|
||||
expect(authGuard.canActivate(router, null)).toBeTruthy();
|
||||
expect(authGuard.canActivate(router)).toBeTruthy();
|
||||
}));
|
||||
|
||||
it('Should canActivate be false if the Role is not present int the JWT token', async(() => {
|
||||
@ -56,7 +56,7 @@ describe('Auth Guard SSO role service', () => {
|
||||
const router: ActivatedRouteSnapshot = new ActivatedRouteSnapshot();
|
||||
router.data = { 'roles': ['role1', 'role2'] };
|
||||
|
||||
expect(authGuard.canActivate(router, null)).toBeFalsy();
|
||||
expect(authGuard.canActivate(router)).toBeFalsy();
|
||||
}));
|
||||
|
||||
it('Should not redirect if canActivate is', async(() => {
|
||||
@ -67,7 +67,7 @@ describe('Auth Guard SSO role service', () => {
|
||||
const router: ActivatedRouteSnapshot = new ActivatedRouteSnapshot();
|
||||
router.data = { 'roles': ['role1', 'role2'] };
|
||||
|
||||
expect(authGuard.canActivate(router, null)).toBeTruthy();
|
||||
expect(authGuard.canActivate(router)).toBeTruthy();
|
||||
expect(routerService.navigate).not.toHaveBeenCalled();
|
||||
}));
|
||||
|
||||
@ -77,7 +77,7 @@ describe('Auth Guard SSO role service', () => {
|
||||
|
||||
const router: ActivatedRouteSnapshot = new ActivatedRouteSnapshot();
|
||||
|
||||
expect(authGuard.canActivate(router, null)).toBeFalsy();
|
||||
expect(authGuard.canActivate(router)).toBeFalsy();
|
||||
}));
|
||||
|
||||
it('Should canActivate return false if the realm_access is not present', async(() => {
|
||||
@ -86,7 +86,7 @@ describe('Auth Guard SSO role service', () => {
|
||||
|
||||
const router: ActivatedRouteSnapshot = new ActivatedRouteSnapshot();
|
||||
|
||||
expect(authGuard.canActivate(router, null)).toBeFalsy();
|
||||
expect(authGuard.canActivate(router)).toBeFalsy();
|
||||
}));
|
||||
|
||||
it('Should redirect to the redirectURL if canActivate is false and redirectUrl is in data', async(() => {
|
||||
@ -97,7 +97,7 @@ describe('Auth Guard SSO role service', () => {
|
||||
const router: ActivatedRouteSnapshot = new ActivatedRouteSnapshot();
|
||||
router.data = { 'roles': ['role1', 'role2'], 'redirectUrl': 'no-role-url' };
|
||||
|
||||
expect(authGuard.canActivate(router, null)).toBeFalsy();
|
||||
expect(authGuard.canActivate(router)).toBeFalsy();
|
||||
expect(routerService.navigate).toHaveBeenCalledWith(['/no-role-url']);
|
||||
}));
|
||||
|
||||
@ -109,7 +109,7 @@ describe('Auth Guard SSO role service', () => {
|
||||
const router: ActivatedRouteSnapshot = new ActivatedRouteSnapshot();
|
||||
router.data = { 'roles': ['role1', 'role2'] };
|
||||
|
||||
expect(authGuard.canActivate(router, null)).toBeFalsy();
|
||||
expect(authGuard.canActivate(router)).toBeFalsy();
|
||||
expect(routerService.navigate).not.toHaveBeenCalled();
|
||||
}));
|
||||
|
||||
@ -121,7 +121,7 @@ describe('Auth Guard SSO role service', () => {
|
||||
route.params = { appName: 'fakeapp' };
|
||||
route.data = { 'clientRoles': ['appName'], 'roles': ['role1', 'role2'] };
|
||||
|
||||
expect(authGuard.canActivate(route, null)).toBeFalsy();
|
||||
expect(authGuard.canActivate(route)).toBeFalsy();
|
||||
});
|
||||
|
||||
it('Should canActivate be false if hasRealm is false and hasClientRole is true', () => {
|
||||
@ -132,7 +132,7 @@ describe('Auth Guard SSO role service', () => {
|
||||
route.params = { appName: 'fakeapp' };
|
||||
route.data = { 'clientRoles': ['fakeapp'], 'roles': ['role1', 'role2'] };
|
||||
|
||||
expect(authGuard.canActivate(route, null)).toBeFalsy();
|
||||
expect(authGuard.canActivate(route)).toBeFalsy();
|
||||
});
|
||||
|
||||
it('Should canActivate be true if both Real Role and Client Role are present int the JWT token', () => {
|
||||
@ -147,7 +147,7 @@ describe('Auth Guard SSO role service', () => {
|
||||
route.params = { appName: 'fakeapp' };
|
||||
route.data = { 'clientRoles': ['appName'], 'roles': ['role1', 'role2'] };
|
||||
|
||||
expect(authGuard.canActivate(route, null)).toBeTruthy();
|
||||
expect(authGuard.canActivate(route)).toBeTruthy();
|
||||
});
|
||||
|
||||
it('Should canActivate be false if the Client Role is not present int the JWT token with the correct role', () => {
|
||||
@ -162,7 +162,7 @@ describe('Auth Guard SSO role service', () => {
|
||||
route.params = { appName: 'fakeapp' };
|
||||
route.data = { 'clientRoles': ['appName'], 'roles': ['role1', 'role2'] };
|
||||
|
||||
expect(authGuard.canActivate(route, null)).toBeFalsy();
|
||||
expect(authGuard.canActivate(route)).toBeFalsy();
|
||||
});
|
||||
|
||||
describe('ClientRole ', () => {
|
||||
|
@ -17,14 +17,14 @@
|
||||
|
||||
import { Injectable } from '@angular/core';
|
||||
import { JwtHelperService } from './jwt-helper.service';
|
||||
import { ActivatedRouteSnapshot, CanActivate, Router, RouterStateSnapshot } from '@angular/router';
|
||||
import { ActivatedRouteSnapshot, CanActivate, Router } from '@angular/router';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class AuthGuardSsoRoleService implements CanActivate {
|
||||
|
||||
canActivate(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): boolean {
|
||||
canActivate(route: ActivatedRouteSnapshot): boolean {
|
||||
let hasRole;
|
||||
let hasRealmRole = false;
|
||||
let hasClientRole = true;
|
||||
|
@ -66,7 +66,7 @@ export class AuthGuard extends AuthGuardBase {
|
||||
window.removeEventListener('storage', this.ticketChangeBind);
|
||||
}
|
||||
|
||||
checkLogin(activeRoute: ActivatedRouteSnapshot, redirectUrl: string): Observable<boolean> | Promise<boolean> | boolean {
|
||||
checkLogin(_: ActivatedRouteSnapshot, redirectUrl: string): Observable<boolean> | Promise<boolean> | boolean {
|
||||
if (this.authenticationService.isLoggedIn() || this.withCredentials) {
|
||||
return true;
|
||||
}
|
||||
|
@ -209,7 +209,7 @@ describe('AuthenticationService', () => {
|
||||
});
|
||||
|
||||
it('[BPM] should return an BPM ticket after the login done', (done) => {
|
||||
const disposableLogin = authService.login('fake-username', 'fake-password').subscribe((response) => {
|
||||
const disposableLogin = authService.login('fake-username', 'fake-password').subscribe(() => {
|
||||
expect(authService.isLoggedIn()).toBe(true);
|
||||
// cspell: disable-next
|
||||
expect(authService.getTicketBpm()).toEqual('Basic ZmFrZS11c2VybmFtZTpmYWtlLXBhc3N3b3Jk');
|
||||
@ -247,7 +247,7 @@ describe('AuthenticationService', () => {
|
||||
|
||||
it('[BPM] should return an error when the logout return error', (done) => {
|
||||
authService.logout().subscribe(
|
||||
(res) => {
|
||||
() => {
|
||||
},
|
||||
(err: any) => {
|
||||
expect(err).toBeDefined();
|
||||
@ -344,9 +344,8 @@ describe('AuthenticationService', () => {
|
||||
|
||||
it('[ECM] should not save the remember me cookie after failed login', (done) => {
|
||||
const disposableLogin = authService.login('fake-username', 'fake-password').subscribe(
|
||||
(res) => {
|
||||
},
|
||||
(err: any) => {
|
||||
() => {},
|
||||
() => {
|
||||
expect(cookie['ALFRESCO_REMEMBER_ME']).toBeUndefined();
|
||||
disposableLogin.unsubscribe();
|
||||
done();
|
||||
@ -401,9 +400,8 @@ describe('AuthenticationService', () => {
|
||||
|
||||
it('[ALL] should return login fail if only ECM call fail', (done) => {
|
||||
const disposableLogin = authService.login('fake-username', 'fake-password').subscribe(
|
||||
(res) => {
|
||||
},
|
||||
(err: any) => {
|
||||
() => {},
|
||||
() => {
|
||||
expect(authService.isLoggedIn()).toBe(false, 'isLoggedIn');
|
||||
expect(authService.getTicketEcm()).toBe(null, 'getTicketEcm');
|
||||
// cspell: disable-next
|
||||
@ -424,9 +422,8 @@ describe('AuthenticationService', () => {
|
||||
|
||||
it('[ALL] should return login fail if only BPM call fail', (done) => {
|
||||
const disposableLogin = authService.login('fake-username', 'fake-password').subscribe(
|
||||
(res) => {
|
||||
},
|
||||
(err: any) => {
|
||||
() => {},
|
||||
() => {
|
||||
expect(authService.isLoggedIn()).toBe(false);
|
||||
expect(authService.getTicketEcm()).toBe(null);
|
||||
expect(authService.getTicketBpm()).toBe(null);
|
||||
@ -448,9 +445,8 @@ describe('AuthenticationService', () => {
|
||||
|
||||
it('[ALL] should return ticket undefined when the credentials are wrong', (done) => {
|
||||
const disposableLogin = authService.login('fake-username', 'fake-password').subscribe(
|
||||
(res) => {
|
||||
},
|
||||
(err: any) => {
|
||||
() => {},
|
||||
() => {
|
||||
expect(authService.isLoggedIn()).toBe(false);
|
||||
expect(authService.getTicketEcm()).toBe(null);
|
||||
expect(authService.getTicketBpm()).toBe(null);
|
||||
|
@ -179,7 +179,7 @@ describe('Log Service', () => {
|
||||
appConfigService.config['logLevel'] = 'trace';
|
||||
providesLogComponent = TestBed.createComponent(ProvidesLogComponent);
|
||||
|
||||
providesLogComponent.componentInstance.logService.onMessage.subscribe((message) => {
|
||||
providesLogComponent.componentInstance.logService.onMessage.subscribe(() => {
|
||||
done();
|
||||
});
|
||||
|
||||
|
@ -89,7 +89,7 @@ describe('RenditionsService', () => {
|
||||
});
|
||||
|
||||
it('Create rendition service should call the server with the ID passed and the asked encoding', (done) => {
|
||||
service.createRendition('fake-node-id', 'pdf').subscribe((res) => {
|
||||
service.createRendition('fake-node-id', 'pdf').subscribe(() => {
|
||||
expect(jasmine.Ajax.requests.mostRecent().method).toBe('POST');
|
||||
expect(jasmine.Ajax.requests.mostRecent().url).toContain('/ecm/alfresco/api/-default-/public/alfresco/versions/1/nodes/fake-node-id/renditions');
|
||||
done();
|
||||
@ -114,8 +114,8 @@ describe('RenditionsService', () => {
|
||||
});
|
||||
|
||||
it('Get rendition service should catch the error', (done) => {
|
||||
service.getRenditionsListByNodeId('fake-node-id').subscribe((res) => {
|
||||
}, (res) => {
|
||||
service.getRenditionsListByNodeId('fake-node-id').subscribe(() => {
|
||||
}, () => {
|
||||
done();
|
||||
}
|
||||
);
|
||||
|
@ -63,7 +63,7 @@ export class SharedLinksApiService {
|
||||
* @returns The shared link just created
|
||||
*/
|
||||
createSharedLinks(nodeId: string, options: any = {}): Observable<SharedLinkEntry> {
|
||||
const promise = this.sharedLinksApi.addSharedLink({ nodeId: nodeId });
|
||||
const promise = this.sharedLinksApi.addSharedLink({ nodeId: nodeId }, options);
|
||||
|
||||
return from(promise).pipe(
|
||||
catchError((err) => of(err))
|
||||
|
@ -158,7 +158,7 @@ export class TranslateLoaderService implements TranslateLoader {
|
||||
observer.complete();
|
||||
}
|
||||
},
|
||||
(err) => {
|
||||
() => {
|
||||
observer.error('Failed to load some resources');
|
||||
});
|
||||
} else {
|
||||
|
@ -222,8 +222,7 @@ export class UploadService {
|
||||
emitter.emit({ value: data });
|
||||
}
|
||||
})
|
||||
.catch((err) => {
|
||||
});
|
||||
.catch(() => {});
|
||||
|
||||
return promise;
|
||||
}
|
||||
|
@ -89,7 +89,7 @@ describe('ErrorContentComponent', () => {
|
||||
}));
|
||||
|
||||
it('should hide secondary button if this one has no value', async(() => {
|
||||
spyOn(translateService, 'instant').and.callFake((inputString) => {
|
||||
spyOn(translateService, 'instant').and.callFake(() => {
|
||||
return '';
|
||||
});
|
||||
fixture.detectChanges();
|
||||
@ -100,7 +100,7 @@ describe('ErrorContentComponent', () => {
|
||||
}));
|
||||
|
||||
it('should render secondary button with its value from the translate file', async(() => {
|
||||
spyOn(translateService, 'instant').and.callFake((inputString) => {
|
||||
spyOn(translateService, 'instant').and.callFake(() => {
|
||||
return 'Secondary Button';
|
||||
});
|
||||
fixture.detectChanges();
|
||||
|
@ -46,19 +46,19 @@ class FakeSanitizer extends DomSanitizer {
|
||||
return value;
|
||||
}
|
||||
|
||||
bypassSecurityTrustStyle(value: string): any {
|
||||
bypassSecurityTrustStyle(): any {
|
||||
return null;
|
||||
}
|
||||
|
||||
bypassSecurityTrustScript(value: string): any {
|
||||
bypassSecurityTrustScript(): any {
|
||||
return null;
|
||||
}
|
||||
|
||||
bypassSecurityTrustUrl(value: string): any {
|
||||
bypassSecurityTrustUrl(): any {
|
||||
return null;
|
||||
}
|
||||
|
||||
bypassSecurityTrustResourceUrl(value: string): any {
|
||||
bypassSecurityTrustResourceUrl(): any {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -360,7 +360,7 @@ describe('IdentityGroupService', () => {
|
||||
|
||||
it('should be able to create group', (done) => {
|
||||
const createCustomApiSpy = spyOn(apiService, 'getInstance').and.returnValue(createGroupMappingApi);
|
||||
service.createGroup(mockIdentityGroup1).subscribe((res) => {
|
||||
service.createGroup(mockIdentityGroup1).subscribe(() => {
|
||||
expect(createCustomApiSpy).toHaveBeenCalled();
|
||||
done();
|
||||
});
|
||||
@ -390,7 +390,7 @@ describe('IdentityGroupService', () => {
|
||||
|
||||
it('should be able to update group', (done) => {
|
||||
const updateCustomApiSpy = spyOn(apiService, 'getInstance').and.returnValue(updateGroupMappingApi);
|
||||
service.updateGroup('mock-group-id', mockIdentityGroup1).subscribe((res) => {
|
||||
service.updateGroup('mock-group-id', mockIdentityGroup1).subscribe(() => {
|
||||
expect(updateCustomApiSpy).toHaveBeenCalled();
|
||||
done();
|
||||
});
|
||||
@ -420,7 +420,7 @@ describe('IdentityGroupService', () => {
|
||||
|
||||
it('should be able to delete group', (done) => {
|
||||
const deleteCustomApiSpy = spyOn(apiService, 'getInstance').and.returnValue(deleteGroupMappingApi);
|
||||
service.deleteGroup('mock-group-id').subscribe((res) => {
|
||||
service.deleteGroup('mock-group-id').subscribe(() => {
|
||||
expect(deleteCustomApiSpy).toHaveBeenCalled();
|
||||
done();
|
||||
});
|
||||
|
@ -330,7 +330,7 @@ describe('IdentityUserService', () => {
|
||||
|
||||
it('should be able to create user', (done) => {
|
||||
const createCustomApiSpy = spyOn(alfrescoApiService, 'getInstance').and.returnValue(createUserMockApi);
|
||||
service.createUser(mockIdentityUser1).subscribe((res) => {
|
||||
service.createUser(mockIdentityUser1).subscribe(() => {
|
||||
expect(createCustomApiSpy).toHaveBeenCalled();
|
||||
done();
|
||||
});
|
||||
@ -360,7 +360,7 @@ describe('IdentityUserService', () => {
|
||||
|
||||
it('should be able to update user', (done) => {
|
||||
const updateCustomApiSpy = spyOn(alfrescoApiService, 'getInstance').and.returnValue(updateUserMockApi);
|
||||
service.updateUser('mock-id-2', mockIdentityUser2).subscribe((res) => {
|
||||
service.updateUser('mock-id-2', mockIdentityUser2).subscribe(() => {
|
||||
expect(updateCustomApiSpy).toHaveBeenCalled();
|
||||
done();
|
||||
});
|
||||
@ -390,7 +390,7 @@ describe('IdentityUserService', () => {
|
||||
|
||||
it('should be able to delete group', (done) => {
|
||||
const deleteCustomApiSpy = spyOn(alfrescoApiService, 'getInstance').and.returnValue(deleteUserMockApi);
|
||||
service.deleteUser('mock-user-id').subscribe((res) => {
|
||||
service.deleteUser('mock-user-id').subscribe(() => {
|
||||
expect(deleteCustomApiSpy).toHaveBeenCalled();
|
||||
done();
|
||||
});
|
||||
@ -456,7 +456,7 @@ describe('IdentityUserService', () => {
|
||||
|
||||
it('should be able to join the group', (done) => {
|
||||
const joinGroupCustomApiSpy = spyOn(alfrescoApiService, 'getInstance').and.returnValue(joinGroupMockApi);
|
||||
service.joinGroup(mockJoinGroupRequest).subscribe((res) => {
|
||||
service.joinGroup(mockJoinGroupRequest).subscribe(() => {
|
||||
expect(joinGroupCustomApiSpy).toHaveBeenCalled();
|
||||
done();
|
||||
});
|
||||
@ -486,7 +486,7 @@ describe('IdentityUserService', () => {
|
||||
|
||||
it('should be able to leave the group', (done) => {
|
||||
const leaveGroupCustomApiSpy = spyOn(alfrescoApiService, 'getInstance').and.returnValue(leaveGroupMockApi);
|
||||
service.leaveGroup('mock-user-id', 'mock-group-id').subscribe((res) => {
|
||||
service.leaveGroup('mock-user-id', 'mock-group-id').subscribe(() => {
|
||||
expect(leaveGroupCustomApiSpy).toHaveBeenCalled();
|
||||
done();
|
||||
});
|
||||
@ -630,7 +630,7 @@ describe('IdentityUserService', () => {
|
||||
|
||||
it('should be able to assign roles to the user', (done) => {
|
||||
const assignRolesCustomApiSpy = spyOn(alfrescoApiService, 'getInstance').and.returnValue(assignRolesMockApi);
|
||||
service.assignRoles('mock-user-id', [mockIdentityRole]).subscribe((res) => {
|
||||
service.assignRoles('mock-user-id', [mockIdentityRole]).subscribe(() => {
|
||||
expect(assignRolesCustomApiSpy).toHaveBeenCalled();
|
||||
done();
|
||||
});
|
||||
@ -660,7 +660,7 @@ describe('IdentityUserService', () => {
|
||||
|
||||
it('should be able to remove roles', (done) => {
|
||||
const removeRolesCustomApiSpy = spyOn(alfrescoApiService, 'getInstance').and.returnValue(removeRolesMockApi);
|
||||
service.removeRoles('mock-user-id', [mockIdentityRole]).subscribe((res) => {
|
||||
service.removeRoles('mock-user-id', [mockIdentityRole]).subscribe(() => {
|
||||
expect(removeRolesCustomApiSpy).toHaveBeenCalled();
|
||||
done();
|
||||
});
|
||||
|
@ -39,8 +39,7 @@ export class PdfThumbComponent implements OnInit {
|
||||
private getThumb(page): Promise<string> {
|
||||
const viewport = page.getViewport(1);
|
||||
|
||||
const pageRatio = viewport.width / viewport.height;
|
||||
const canvas = this.getCanvas(pageRatio);
|
||||
const canvas = this.getCanvas();
|
||||
const scale = Math.min((canvas.height / viewport.height), (canvas.width / viewport.width));
|
||||
|
||||
return page.render({
|
||||
@ -53,7 +52,7 @@ export class PdfThumbComponent implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
private getCanvas(pageRatio): HTMLCanvasElement {
|
||||
private getCanvas(): HTMLCanvasElement {
|
||||
const canvas = document.createElement('canvas');
|
||||
canvas.width = this.page.getWidth();
|
||||
canvas.height = this.page.getHeight();
|
||||
|
@ -47,7 +47,7 @@ describe('PdfThumbListComponent', () => {
|
||||
return this._currentPageNumber;
|
||||
},
|
||||
pdfDocument: {
|
||||
getPage: (pageNum) => Promise.resolve({
|
||||
getPage: () => Promise.resolve({
|
||||
getViewport: () => ({ height: 421, width: 335 }),
|
||||
render: jasmine.createSpy('render').and.returnValue(Promise.resolve())
|
||||
})
|
||||
|
@ -43,8 +43,8 @@ export class PdfThumbListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
@ContentChild(TemplateRef)
|
||||
template: any;
|
||||
|
||||
@HostListener('window:resize', ['$event'])
|
||||
onResize(event) {
|
||||
@HostListener('window:resize')
|
||||
onResize() {
|
||||
this.calculateItems();
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ export class PdfThumbListComponent implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.pdfViewer.eventBus.off('pagechange', this.onPageChange);
|
||||
}
|
||||
|
||||
trackByFn(index: number, item: any): number {
|
||||
trackByFn(_: number, item: any): number {
|
||||
return item.id;
|
||||
}
|
||||
|
||||
|
@ -336,7 +336,7 @@ describe('Test PdfViewer component', () => {
|
||||
fixtureUrlTestPasswordComponent = TestBed.createComponent(UrlTestPasswordComponent);
|
||||
componentUrlTestPasswordComponent = fixtureUrlTestPasswordComponent.componentInstance;
|
||||
|
||||
spyOn(dialog, 'open').and.callFake((comp, context) => {
|
||||
spyOn(dialog, 'open').and.callFake((_, context) => {
|
||||
if (context.data.reason === pdfjsLib.PasswordResponses.NEED_PASSWORD) {
|
||||
return {
|
||||
afterClosed: () => of('wrong_password')
|
||||
|
@ -487,7 +487,7 @@ export class PdfViewerComponent implements OnChanges, OnDestroy {
|
||||
*
|
||||
* @param event
|
||||
*/
|
||||
onPagesLoaded(event) {
|
||||
onPagesLoaded() {
|
||||
this.isPanelDisabled = false;
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ describe('ViewerComponent', () => {
|
||||
|
||||
it('should extension file pdf be loaded', (done) => {
|
||||
component.urlFile = 'fake-test-file.pdf';
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
@ -182,7 +182,7 @@ describe('ViewerComponent', () => {
|
||||
|
||||
it('should extension file png be loaded', (done) => {
|
||||
component.urlFile = 'fake-url-file.png';
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
@ -194,7 +194,7 @@ describe('ViewerComponent', () => {
|
||||
|
||||
it('should extension file mp4 be loaded', (done) => {
|
||||
component.urlFile = 'fake-url-file.mp4';
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
@ -206,7 +206,7 @@ describe('ViewerComponent', () => {
|
||||
|
||||
it('should extension file txt be loaded', (done) => {
|
||||
component.urlFile = 'fake-test-file.txt';
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
@ -219,7 +219,7 @@ describe('ViewerComponent', () => {
|
||||
it('should display [unknown format] for unsupported extensions', (done) => {
|
||||
component.urlFile = 'fake-url-file.unsupported';
|
||||
component.mimeType = '';
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
fixture.detectChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
@ -240,7 +240,7 @@ describe('ViewerComponent', () => {
|
||||
component.urlFile = 'fake-content-img';
|
||||
component.mimeType = 'image/png';
|
||||
fixture.detectChanges();
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
@ -253,7 +253,7 @@ describe('ViewerComponent', () => {
|
||||
component.urlFile = 'fake-content-img.bin';
|
||||
component.mimeType = 'image/png';
|
||||
fixture.detectChanges();
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
@ -266,7 +266,7 @@ describe('ViewerComponent', () => {
|
||||
component.urlFile = 'fake-content-txt.bin';
|
||||
component.mimeType = 'text/plain';
|
||||
fixture.detectChanges();
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
@ -292,7 +292,7 @@ describe('ViewerComponent', () => {
|
||||
component.displayName = null;
|
||||
spyOn(alfrescoApiService, 'getInstance').and.returnValue(alfrescoApiInstanceMock);
|
||||
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(element.querySelector('adf-viewer-unknown-format')).toBeDefined();
|
||||
@ -304,7 +304,7 @@ describe('ViewerComponent', () => {
|
||||
component.urlFile = 'fake-content-video.bin';
|
||||
component.mimeType = 'video/mp4';
|
||||
fixture.detectChanges();
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
@ -317,7 +317,7 @@ describe('ViewerComponent', () => {
|
||||
component.urlFile = 'fake-content-video';
|
||||
component.mimeType = 'video/mp4';
|
||||
fixture.detectChanges();
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
@ -330,7 +330,7 @@ describe('ViewerComponent', () => {
|
||||
component.urlFile = 'fake-content-pdf';
|
||||
component.mimeType = 'application/pdf';
|
||||
fixture.detectChanges();
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
@ -343,7 +343,7 @@ describe('ViewerComponent', () => {
|
||||
it('should display a PDF file identified by mimetype when the file extension is wrong', (done) => {
|
||||
component.urlFile = 'fake-content-pdf.bin';
|
||||
component.mimeType = 'application/pdf';
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
@ -366,13 +366,13 @@ describe('ViewerComponent', () => {
|
||||
component.showViewer = true;
|
||||
|
||||
component.nodeId = 'id1';
|
||||
component.ngOnChanges({});
|
||||
component.ngOnChanges();
|
||||
tick();
|
||||
|
||||
expect(component.fileTitle).toBe('file1');
|
||||
|
||||
component.nodeId = 'id2';
|
||||
component.ngOnChanges({});
|
||||
component.ngOnChanges();
|
||||
tick();
|
||||
|
||||
expect(component.fileTitle).toBe('file2');
|
||||
@ -601,7 +601,7 @@ describe('ViewerComponent', () => {
|
||||
};
|
||||
spyOn(alfrescoApiService, 'getInstance').and.returnValue(alfrescoApiInstanceMock);
|
||||
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(component.nodeEntry).toBe(node);
|
||||
@ -642,7 +642,7 @@ describe('ViewerComponent', () => {
|
||||
component.urlFile = null;
|
||||
component.mimeType = null;
|
||||
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(element.querySelector('[data-automation-id="adf-toolbar-back"]')).toBeNull();
|
||||
@ -666,7 +666,7 @@ describe('ViewerComponent', () => {
|
||||
});
|
||||
|
||||
it('should Name File be present if is overlay mode ', (done) => {
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
fixture.detectChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
@ -733,7 +733,7 @@ describe('ViewerComponent', () => {
|
||||
component.urlFile = undefined;
|
||||
|
||||
expect(() => {
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
}).toThrow();
|
||||
});
|
||||
|
||||
@ -743,7 +743,7 @@ describe('ViewerComponent', () => {
|
||||
component.urlFile = undefined;
|
||||
|
||||
expect(() => {
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
}).not.toThrow();
|
||||
});
|
||||
|
||||
@ -752,7 +752,7 @@ describe('ViewerComponent', () => {
|
||||
component.nodeId = undefined;
|
||||
|
||||
expect(() => {
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
}).not.toThrow();
|
||||
});
|
||||
|
||||
@ -778,7 +778,7 @@ describe('ViewerComponent', () => {
|
||||
component.urlFile = null;
|
||||
component.mimeType = null;
|
||||
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(element.querySelector('adf-viewer-unknown-format')).not.toBeNull();
|
||||
@ -794,7 +794,7 @@ describe('ViewerComponent', () => {
|
||||
component.urlFile = null;
|
||||
component.mimeType = null;
|
||||
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(element.querySelector('adf-viewer-unknown-format')).not.toBeNull();
|
||||
@ -815,7 +815,7 @@ describe('ViewerComponent', () => {
|
||||
component.urlFile = null;
|
||||
component.mimeType = null;
|
||||
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
});
|
||||
|
||||
});
|
||||
@ -831,7 +831,7 @@ describe('ViewerComponent', () => {
|
||||
|
||||
component.urlFile = 'fake-url-file.png';
|
||||
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
});
|
||||
});
|
||||
|
||||
@ -841,7 +841,7 @@ describe('ViewerComponent', () => {
|
||||
component.urlFile = 'fake-test-file.pdf';
|
||||
component.displayName = 'test name';
|
||||
fixture.detectChanges();
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
@ -854,7 +854,7 @@ describe('ViewerComponent', () => {
|
||||
component.urlFile = 'fake-test-file.pdf';
|
||||
component.displayName = null;
|
||||
fixture.detectChanges();
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
@ -870,7 +870,7 @@ describe('ViewerComponent', () => {
|
||||
component.displayName = 'blob file display name';
|
||||
component.blobFile = new Blob(['This is my blob content'], { type: 'text/plain' });
|
||||
fixture.detectChanges();
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
@ -883,7 +883,7 @@ describe('ViewerComponent', () => {
|
||||
component.displayName = null;
|
||||
component.blobFile = new Blob(['This is my blob content'], { type: 'text/plain' });
|
||||
fixture.detectChanges();
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
@ -911,7 +911,7 @@ describe('ViewerComponent', () => {
|
||||
component.displayName = null;
|
||||
spyOn(alfrescoApiService, 'getInstance').and.returnValue(alfrescoApiInstanceMock);
|
||||
|
||||
component.ngOnChanges(null);
|
||||
component.ngOnChanges();
|
||||
fixture.whenStable().then(() => {
|
||||
fixture.detectChanges();
|
||||
expect(element.querySelector('#adf-viewer-display-name').textContent).toEqual(displayName);
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
import {
|
||||
Component, ContentChild, EventEmitter, HostListener, ElementRef,
|
||||
Input, OnChanges, Output, SimpleChanges, TemplateRef,
|
||||
Input, OnChanges, Output, TemplateRef,
|
||||
ViewEncapsulation, OnInit, OnDestroy
|
||||
} from '@angular/core';
|
||||
import { RenditionPaging, SharedLinkEntry, Node, RenditionEntry, NodeEntry } from '@alfresco/js-api';
|
||||
@ -278,7 +278,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
}
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
ngOnChanges() {
|
||||
if (this.showViewer) {
|
||||
if (!this.isSourceDefined()) {
|
||||
throw new Error('A content source attribute value is missing.');
|
||||
@ -299,7 +299,7 @@ export class ViewerComponent implements OnChanges, OnInit, OnDestroy {
|
||||
this.isLoading = false;
|
||||
});
|
||||
},
|
||||
(error) => {
|
||||
() => {
|
||||
this.isLoading = false;
|
||||
this.logService.error('This node does not exist');
|
||||
}
|
||||
|
@ -20,7 +20,6 @@
|
||||
import {
|
||||
Component,
|
||||
Input,
|
||||
SimpleChanges,
|
||||
OnChanges,
|
||||
SimpleChange,
|
||||
ComponentFactoryResolver
|
||||
@ -40,7 +39,7 @@ export class TestComponent implements OnChanges {
|
||||
@Input() data: any;
|
||||
public onChangesCalled = 0;
|
||||
|
||||
ngOnChanges(changes: SimpleChanges) {
|
||||
ngOnChanges() {
|
||||
this.onChangesCalled++;
|
||||
}
|
||||
}
|
||||
|
@ -77,7 +77,7 @@ export class AnalyticsReportListComponent implements OnInit {
|
||||
/**
|
||||
* Reload the component
|
||||
*/
|
||||
reload(reportId?) {
|
||||
reload(reportId?: number) {
|
||||
this.reset();
|
||||
this.getReportList(this.appId, reportId);
|
||||
}
|
||||
@ -85,7 +85,7 @@ export class AnalyticsReportListComponent implements OnInit {
|
||||
/**
|
||||
* Get the report list
|
||||
*/
|
||||
getReportList(appId: number, reportId?: string) {
|
||||
getReportList(appId: number, reportId?: number) {
|
||||
this.analyticsService.getReportList(appId).subscribe(
|
||||
(res: ReportParametersModel[]) => {
|
||||
if (res && res.length === 0) {
|
||||
@ -152,7 +152,7 @@ export class AnalyticsReportListComponent implements OnInit {
|
||||
this.reportClick.emit(report);
|
||||
}
|
||||
|
||||
public selectReportByReportId(reportId) {
|
||||
public selectReportByReportId(reportId: number) {
|
||||
const reportFound = this.reports.find((report) => report.id === reportId);
|
||||
if (reportFound) {
|
||||
this.currentReport = reportFound;
|
||||
|
@ -316,7 +316,7 @@ describe('AnalyticsReportParametersComponent', () => {
|
||||
});
|
||||
|
||||
it('Should create an empty valid form when there are no parameters definitions', () => {
|
||||
component.success.subscribe((res) => {
|
||||
component.success.subscribe(() => {
|
||||
expect(component.reportForm).toBeDefined();
|
||||
expect(component.reportForm.valid).toEqual(true);
|
||||
expect(component.reportForm.controls).toEqual({});
|
||||
|
@ -199,7 +199,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On
|
||||
});
|
||||
this.reportForm = this.formBuilder.group(formBuilderGroup);
|
||||
this.reportForm.valueChanges.subscribe((data) => this.onValueChanged(data));
|
||||
this.reportForm.statusChanges.subscribe((data) => this.onStatusChanged(data));
|
||||
this.reportForm.statusChanges.subscribe(() => this.onStatusChanged());
|
||||
}
|
||||
|
||||
public getReportParams(reportId: string) {
|
||||
@ -251,7 +251,7 @@ export class AnalyticsReportParametersComponent implements OnInit, OnChanges, On
|
||||
}
|
||||
}
|
||||
|
||||
onStatusChanged(status: any) {
|
||||
onStatusChanged() {
|
||||
if (this.reportForm && !this.reportForm.pending && this.reportForm.dirty) {
|
||||
this.formValidState = this.reportForm.valid;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user