[ACS-5645]linting fixes

This commit is contained in:
Yasa-Nataliya
2023-10-13 16:20:26 +05:30
committed by Anukriti Singh
parent 85a644dcc8
commit 10774c064c
@@ -15,17 +15,20 @@
* limitations under the License. * limitations under the License.
*/ */
import { ChangeDetectorRef, Component, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild, ViewEncapsulation } from '@angular/core';
import { import {
Category, ChangeDetectorRef,
CategoryEntry, Component,
CategoryLinkBody, EventEmitter,
CategoryPaging, Input,
Node, OnChanges,
TagBody, OnDestroy,
TagEntry, OnInit,
TagPaging Output,
} from '@alfresco/js-api'; 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 { forkJoin, Observable, of, Subject, zip } from 'rxjs';
import { import {
AppConfigService, AppConfigService,
@@ -150,8 +153,6 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
@Input() @Input()
editableTags = false; editableTags = false;
private _assignedTags: string[] = []; private _assignedTags: string[] = [];
private assignedTagsEntries: TagEntry[] = []; private assignedTagsEntries: TagEntry[] = [];
private _editable = false; private _editable = false;
@@ -192,7 +193,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
private categoryService: CategoryService, private categoryService: CategoryService,
private cdr: ChangeDetectorRef, private cdr: ChangeDetectorRef,
private contentService: ContentService, private contentService: ContentService,
private notificationService: NotificationService private notificationService: NotificationService
) { ) {
this.copyToClipboardAction = this.appConfig.get<boolean>('content-metadata.copy-to-clipboard-action'); this.copyToClipboardAction = this.appConfig.get<boolean>('content-metadata.copy-to-clipboard-action');
this.multiValueSeparator = this.appConfig.get<string>('content-metadata.multi-value-pipe-separator') || DEFAULT_SEPARATOR; this.multiValueSeparator = this.appConfig.get<string>('content-metadata.multi-value-pipe-separator') || DEFAULT_SEPARATOR;
@@ -201,20 +202,15 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
ngOnInit() { ngOnInit() {
this.cardViewContentUpdateService.itemUpdated$ this.cardViewContentUpdateService.itemUpdated$
.pipe( .pipe(debounceTime(500), takeUntil(this.onDestroy$))
debounceTime(500), .subscribe((updatedNode: UpdateNotification) => {
takeUntil(this.onDestroy$)) this.hasMetadataChanged = true;
.subscribe( this.targetProperty = updatedNode.target;
(updatedNode: UpdateNotification) => { this.updateChanges(updatedNode.changed);
this.hasMetadataChanged = true; });
this.targetProperty = updatedNode.target;
this.updateChanges(updatedNode.changed);
}
);
this.cardViewContentUpdateService.updatedAspect$.pipe( this.cardViewContentUpdateService.updatedAspect$
debounceTime(500), .pipe(debounceTime(500), takeUntil(this.onDestroy$))
takeUntil(this.onDestroy$))
.subscribe((node) => this.loadProperties(node)); .subscribe((node) => this.loadProperties(node));
this.loadProperties(this.node); this.loadProperties(this.node);
@@ -244,8 +240,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
try { try {
statusCode = JSON.parse(error.message).error.statusCode; statusCode = JSON.parse(error.message).error.statusCode;
} catch { } catch {}
}
let message = `METADATA.ERRORS.${statusCode}`; let message = `METADATA.ERRORS.${statusCode}`;
@@ -369,7 +364,7 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
} }
showSnackbar(message: string): void { showSnackbar(message: string): void {
this.notificationService.showError(message) this.notificationService.showError(message);
} }
toggleEdit(event: MouseEvent, group: CardViewGroup, buttonType: ButtonType): void { toggleEdit(event: MouseEvent, group: CardViewGroup, buttonType: ButtonType): void {
@@ -456,7 +451,8 @@ export class ContentMetadataComponent implements OnChanges, OnInit, OnDestroy {
} }
keyDown(event: KeyboardEvent) { keyDown(event: KeyboardEvent) {
if (event.keyCode === 37 || event.keyCode === 39) { // ArrowLeft && ArrowRight if (event.keyCode === 37 || event.keyCode === 39) {
// ArrowLeft && ArrowRight
event.stopPropagation(); event.stopPropagation();
} }
} }