From dc901c0b5509f54d1977c9b3cee77874552c0491 Mon Sep 17 00:00:00 2001 From: Nicolas Molina Date: Wed, 18 Dec 2024 15:31:16 -0400 Subject: [PATCH] chore(edit-content): apply format --- .../services/relationship-field.service.spec.ts | 10 +++++++++- .../services/relationship-field.service.ts | 17 ++++++++++------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/services/relationship-field.service.spec.ts b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/services/relationship-field.service.spec.ts index 03c63adefbe..6d42e16978d 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/services/relationship-field.service.spec.ts +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/services/relationship-field.service.spec.ts @@ -8,7 +8,12 @@ import { of } from 'rxjs'; import { formatDate } from '@angular/common'; -import { DotContentSearchService, DotFieldService, DotLanguagesService } from '@dotcms/data-access'; +import { + DotContentSearchService, + DotFieldService, + DotHttpErrorManagerService, + DotLanguagesService +} from '@dotcms/data-access'; import { DotCMSContentlet, DotCMSContentTypeField } from '@dotcms/dotcms-models'; import { RelationshipFieldService } from './relationship-field.service'; @@ -26,6 +31,9 @@ describe('RelationshipFieldService', () => { const createService = createServiceFactory({ service: RelationshipFieldService, providers: [ + mockProvider(DotHttpErrorManagerService, { + handle: () => of(null) + }), mockProvider(DotFieldService), mockProvider(DotContentSearchService), mockProvider(DotLanguagesService, { diff --git a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/services/relationship-field.service.ts b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/services/relationship-field.service.ts index 8fc6f3592ce..09a92f001b3 100644 --- a/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/services/relationship-field.service.ts +++ b/core-web/libs/edit-content/src/lib/fields/dot-edit-content-relationship-field/services/relationship-field.service.ts @@ -6,8 +6,12 @@ import { Injectable, inject } from '@angular/core'; import { catchError, map, pluck } from 'rxjs/operators'; - -import { DotContentSearchService, DotFieldService, DotHttpErrorManagerService, DotLanguagesService } from '@dotcms/data-access'; +import { + DotContentSearchService, + DotFieldService, + DotHttpErrorManagerService, + DotLanguagesService +} from '@dotcms/data-access'; import { DotCMSContentlet, DotCMSContentTypeField } from '@dotcms/dotcms-models'; import { RelationshipFieldItem } from '@dotcms/edit-content/fields/dot-edit-content-relationship-field/models/relationship.models'; @@ -17,7 +21,6 @@ import { } from '../dot-edit-content-relationship-field.constants'; import { Column } from '../models/column.model'; - type LanguagesMap = Record; @Injectable({ @@ -49,7 +52,9 @@ export class RelationshipFieldService { * @param contentTypeId The content type ID * @returns Observable of [Column[], RelationshipFieldItem[]] */ - getColumnsAndContent(contentTypeId: string): Observable<[Column[], RelationshipFieldItem[]] | null> { + getColumnsAndContent( + contentTypeId: string + ): Observable<[Column[], RelationshipFieldItem[]] | null> { return forkJoin([ this.getColumns(contentTypeId), this.getContent(contentTypeId), @@ -60,9 +65,7 @@ export class RelationshipFieldService { this.#matchColumnsWithContent(columns, content, languages) ]), catchError((error: HttpErrorResponse) => { - return this.#httpErrorManagerService.handle(error).pipe( - map(() => null) - ); + return this.#httpErrorManagerService.handle(error).pipe(map(() => null)); }) ); }