From a8605543f81d056aecbdea668ffc085a38c611b0 Mon Sep 17 00:00:00 2001 From: Yasa-Nataliya Date: Thu, 7 Sep 2023 14:45:29 +0530 Subject: [PATCH] [ACS-5645]linting fixes --- .../content-metadata.component.ts | 56 +++++++++---------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts index e9a0df903fa..77dd9a997c7 100644 --- a/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts +++ b/lib/content-services/src/lib/content-metadata/components/content-metadata/content-metadata.component.ts @@ -15,17 +15,20 @@ * limitations under the License. */ -import { ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild, ViewEncapsulation } from '@angular/core'; import { - Category, - CategoryEntry, - CategoryLinkBody, - CategoryPaging, - Node, - TagBody, - TagEntry, - TagPaging -} from '@alfresco/js-api'; + ChangeDetectorRef, + Component, + EventEmitter, + Input, + OnChanges, + OnDestroy, + OnInit, + Output, + SimpleChanges, + ViewChild, + ViewEncapsulation +} from '@angular/core'; +import { Category, CategoryEntry, CategoryLinkBody, CategoryPaging, Node, TagBody, TagEntry, TagPaging } from '@alfresco/js-api'; import { forkJoin, Observable, of, Subject, zip } from 'rxjs'; import { AppConfigService, @@ -144,8 +147,6 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy { @Input() editableTags = false; - - private _assignedTags: string[] = []; private assignedTagsEntries: TagEntry[]; private _editable = false; @@ -186,7 +187,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy { private categoryService: CategoryService, private cdr: ChangeDetectorRef, private contentService: ContentService, - private notificationService: NotificationService + private notificationService: NotificationService ) { this.copyToClipboardAction = this.appConfig.get('content-metadata.copy-to-clipboard-action'); this.multiValueSeparator = this.appConfig.get('content-metadata.multi-value-pipe-separator') || DEFAULT_SEPARATOR; @@ -195,20 +196,15 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy { ngOnInit() { this.cardViewContentUpdateService.itemUpdated$ - .pipe( - debounceTime(500), - takeUntil(this.onDestroy$)) - .subscribe( - (updatedNode: UpdateNotification) => { - this.hasMetadataChanged = true; - this.targetProperty = updatedNode.target; - this.updateChanges(updatedNode.changed); - } - ); + .pipe(debounceTime(500), takeUntil(this.onDestroy$)) + .subscribe((updatedNode: UpdateNotification) => { + this.hasMetadataChanged = true; + this.targetProperty = updatedNode.target; + this.updateChanges(updatedNode.changed); + }); - this.cardViewContentUpdateService.updatedAspect$.pipe( - debounceTime(500), - takeUntil(this.onDestroy$)) + this.cardViewContentUpdateService.updatedAspect$ + .pipe(debounceTime(500), takeUntil(this.onDestroy$)) .subscribe((node) => this.loadProperties(node)); this.loadProperties(this.node); @@ -238,8 +234,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy { try { statusCode = JSON.parse(error.message).error.statusCode; - } catch { - } + } catch {} let message = `METADATA.ERRORS.${statusCode}`; @@ -363,7 +358,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy { } showSnackbar(message: string): void { - this.notificationService.showError(message) + this.notificationService.showError(message); } toggleEdit(event: MouseEvent, group: CardViewGroup, buttonType: ButtonType): void { @@ -456,7 +451,8 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy { } keyDown(event: KeyboardEvent) { - if (event.keyCode === 37 || event.keyCode === 39) { // ArrowLeft && ArrowRight + if (event.keyCode === 37 || event.keyCode === 39) { + // ArrowLeft && ArrowRight event.stopPropagation(); } }