From 7a5f959924a8d2f7b1cb7fec757c767e2741db46 Mon Sep 17 00:00:00 2001 From: VitoAlbano Date: Sun, 9 Jun 2024 00:44:09 +0100 Subject: [PATCH] Fixed linting for packages --- .../src/lib/version-manager/version-list.component.ts | 3 +-- .../card-view-textitem.component.spec.ts | 10 +++++----- .../dialogs/confirm-dialog/confirm.dialog.module.ts | 11 ++--------- .../layout-container.component.spec.ts | 2 +- lib/core/src/lib/pipes/date-time.pipe.spec.ts | 2 +- .../src/lib/form/components/form-cloud.component.ts | 4 ++-- 6 files changed, 12 insertions(+), 20 deletions(-) diff --git a/lib/content-services/src/lib/version-manager/version-list.component.ts b/lib/content-services/src/lib/version-manager/version-list.component.ts index 3094faf3255..5e46f99dac3 100644 --- a/lib/content-services/src/lib/version-manager/version-list.component.ts +++ b/lib/content-services/src/lib/version-manager/version-list.component.ts @@ -15,11 +15,10 @@ * limitations under the License. */ -import { AlfrescoApiService } from '@alfresco/adf-core'; +import { AlfrescoApiService, ConfirmDialogComponent } from '@alfresco/adf-core'; import { Component, Input, OnChanges, ViewEncapsulation, EventEmitter, Output, OnInit, OnDestroy, ViewChild } from '@angular/core'; import { VersionsApi, Node, VersionEntry, NodesApi, NodeEntry, ContentApi, ContentPagingQuery } from '@alfresco/js-api'; import { MatDialog } from '@angular/material/dialog'; -import { ConfirmDialogComponent } from '@alfresco/adf-core'; import { ContentVersionService } from './content-version.service'; import { ContentService } from '../common'; import { InfiniteScrollDatasource } from '../infinite-scroll-datasource'; diff --git a/lib/core/src/lib/card-view/components/card-view-textitem/card-view-textitem.component.spec.ts b/lib/core/src/lib/card-view/components/card-view-textitem/card-view-textitem.component.spec.ts index ca04a44ccd3..5716dbca002 100644 --- a/lib/core/src/lib/card-view/components/card-view-textitem/card-view-textitem.component.spec.ts +++ b/lib/core/src/lib/card-view/components/card-view-textitem/card-view-textitem.component.spec.ts @@ -41,7 +41,8 @@ describe('CardViewTextItemComponent', () => { const expectedErrorMessages = [{ message: 'Something went wrong' } as CardViewItemValidator]; - const getTextField = (key: string): HTMLInputElement => fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${key}"]`)).nativeElement; + const getTextField = (key: string): HTMLInputElement => + fixture.debugElement.query(By.css(`[data-automation-id="card-textitem-value-${key}"]`)).nativeElement; const updateTextField = (key: string, value) => { const editInput = getTextField(key); @@ -56,9 +57,8 @@ describe('CardViewTextItemComponent', () => { return textItemInput.value; }; - const getErrorElements = (key: string, includeItems = false): DebugElement[] => { - return fixture.debugElement.queryAll(By.css(`[data-automation-id="card-textitem-error-${key}"]${includeItems ? ' li' : ''}`)); - }; + const getErrorElements = (key: string, includeItems = false): DebugElement[] => + fixture.debugElement.queryAll(By.css(`[data-automation-id="card-textitem-error-${key}"]${includeItems ? ' li' : ''}`)); const getTextFieldError = (key: string): string => { const textItemInputErrors = getErrorElements(key, true); @@ -327,7 +327,7 @@ describe('CardViewTextItemComponent', () => { multivalued: true }; - component.editable =true; + component.editable = true; component.property = new CardViewTextItemModel(cardViewTextItemObject); component.displayLabelForChips = false; component.ngOnChanges({ property: new SimpleChange(null, null, true) }); diff --git a/lib/core/src/lib/dialogs/confirm-dialog/confirm.dialog.module.ts b/lib/core/src/lib/dialogs/confirm-dialog/confirm.dialog.module.ts index f03a1505c5e..437530f874f 100644 --- a/lib/core/src/lib/dialogs/confirm-dialog/confirm.dialog.module.ts +++ b/lib/core/src/lib/dialogs/confirm-dialog/confirm.dialog.module.ts @@ -1,6 +1,6 @@ /*! * @license - * Copyright © 2005-2023 Hyland Software, Inc. and its affiliates. All rights reserved. + * Copyright © 2005-2024 Hyland Software, Inc. and its affiliates. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,14 +24,7 @@ import { MatDialogModule } from '@angular/material/dialog'; import { MatButtonModule } from '@angular/material/button'; @NgModule({ declarations: [ConfirmDialogComponent], - imports: [ - CommonModule, - FormsModule, - ReactiveFormsModule, - TranslateModule, - MatDialogModule, - MatButtonModule - ], + imports: [CommonModule, FormsModule, ReactiveFormsModule, TranslateModule, MatDialogModule, MatButtonModule], exports: [ConfirmDialogComponent] }) export class ConfirmDialogModule {} diff --git a/lib/core/src/lib/layout/components/layout-container/layout-container.component.spec.ts b/lib/core/src/lib/layout/components/layout-container/layout-container.component.spec.ts index 6c993a2e7df..dc87e7c9f81 100644 --- a/lib/core/src/lib/layout/components/layout-container/layout-container.component.spec.ts +++ b/lib/core/src/lib/layout/components/layout-container/layout-container.component.spec.ts @@ -32,7 +32,7 @@ describe('LayoutContainerComponent', () => { const checkContentAnimationState = (value: string, marginProperty: string, marginValue: number) => { expect(layoutContainerComponent.contentAnimationState).toEqual({ - value: value, + value, params: { [marginProperty]: marginValue } }); }; diff --git a/lib/core/src/lib/pipes/date-time.pipe.spec.ts b/lib/core/src/lib/pipes/date-time.pipe.spec.ts index 8feb3a4eaab..cb3143b77dc 100644 --- a/lib/core/src/lib/pipes/date-time.pipe.spec.ts +++ b/lib/core/src/lib/pipes/date-time.pipe.spec.ts @@ -19,7 +19,7 @@ import { DateTimePipe } from './date-time.pipe'; import { addMinutes, isValid } from 'date-fns'; describe('DateTimePipe', () => { - let pipe = new DateTimePipe(); + const pipe = new DateTimePipe(); it('should transform string input to date format', () => { const value = '2023-08-24 12:00:00'; diff --git a/lib/process-services-cloud/src/lib/form/components/form-cloud.component.ts b/lib/process-services-cloud/src/lib/form/components/form-cloud.component.ts index c004bdca89f..224a5a43045 100644 --- a/lib/process-services-cloud/src/lib/form/components/form-cloud.component.ts +++ b/lib/process-services-cloud/src/lib/form/components/form-cloud.component.ts @@ -31,13 +31,13 @@ import { FormModel, ContentLinkModel, UploadWidgetContentLinkModel, - FormEvent + FormEvent, + ConfirmDialogComponent } from '@alfresco/adf-core'; import { FormCloudService } from '../services/form-cloud.service'; import { TaskVariableCloud } from '../models/task-variable-cloud.model'; import { TaskDetailsCloudModel } from '../../task/start-task/models/task-details-cloud.model'; import { MatDialog } from '@angular/material/dialog'; -import { ConfirmDialogComponent } from '@alfresco/adf-core'; import { v4 as uuidGeneration } from 'uuid'; import { FormCloudDisplayMode, FormCloudDisplayModeConfiguration } from '../../services/form-fields.interfaces'; import { DisplayModeService } from '../public-api';