Migrate to @angular-eslint/prefer-inject and @typescript-eslint/prefer-readonly (#11665)

This commit is contained in:
Denys Vuika
2026-02-18 15:38:01 +00:00
committed by GitHub
parent f8fa996b04
commit 3f542d99ba
470 changed files with 2638 additions and 2247 deletions
@@ -17,7 +17,7 @@
/* eslint-disable @angular-eslint/no-input-rename */
import { Directive, ElementRef, Renderer2, HostListener, Input, AfterViewInit } from '@angular/core';
import { Directive, ElementRef, Renderer2, HostListener, Input, AfterViewInit, inject } from '@angular/core';
import { Node } from '@alfresco/js-api';
import { ContentService } from '../common/services/content.service';
import { AllowableOperationsEnum } from '../common/models/allowable-operations.enum';
@@ -28,6 +28,11 @@ import { ContentNodeDialogService } from '../content-node-selector/content-node-
selector: '[adf-node-lock]'
})
export class NodeLockDirective implements AfterViewInit {
element = inject(ElementRef);
private readonly renderer = inject(Renderer2);
private readonly contentService = inject(ContentService);
private readonly contentNodeDialogService = inject(ContentNodeDialogService);
/** Node to lock/unlock. */
@Input('adf-node-lock')
node: Node;
@@ -38,13 +43,6 @@ export class NodeLockDirective implements AfterViewInit {
this.contentNodeDialogService.openLockNodeDialog(this.node);
}
constructor(
public element: ElementRef,
private renderer: Renderer2,
private contentService: ContentService,
private contentNodeDialogService: ContentNodeDialogService
) {}
ngAfterViewInit() {
const hasAllowableOperations = this.contentService.hasAllowableOperations(this.node, AllowableOperationsEnum.LOCK);
this.renderer.setProperty(this.element.nativeElement, 'disabled', !hasAllowableOperations);