[ACS-9765]: cr

This commit is contained in:
Anton Ramanovich
2026-03-11 20:40:55 +01:00
parent 71c020d8be
commit 48ea5f71f2
4 changed files with 9 additions and 12 deletions

View File

@@ -42,7 +42,7 @@ describe('CommentsTabComponent', () => {
imports: [NoopTranslateModule, CommentsTabComponent],
providers: [
{ provide: AlfrescoApiService, useClass: AlfrescoApiServiceMock },
{ provide: EXTERNAL_NODE_PERMISSION_COMMENTS_TAB_SERVICE, useValue: [{ canAddComments: () => canAddComment }] },
{ provide: EXTERNAL_NODE_PERMISSION_COMMENTS_TAB_SERVICE, useValue: { canAddComments: () => canAddComment }, multi: true },
{ provide: AuthenticationService, useValue: { onLogout: of({}) } }
]
});

View File

@@ -58,12 +58,9 @@ export class CommentsTabComponent implements OnInit {
ngOnInit(): void {
if (!this.node) {
this.canUpdateNode = false;
}
if (this.node.isFolder || (this.node.isFile && !isLocked({ entry: this.node }))) {
this.canUpdateNode = this.permission.check(this.node, ['update']);
if (this.externalPermissionNodeService?.length) {
this.canUpdateNode &&= this.externalPermissionNodeService.every((service) => service.canAddComments(this.node));
}
} else if (this.node.isFolder || (this.node.isFile && !isLocked({ entry: this.node }))) {
this.canUpdateNode =
this.permission.check(this.node, ['update']) && this.externalPermissionNodeService.every((service) => service.canAddComments(this.node));
}
}
}

View File

@@ -26,5 +26,9 @@ import { InjectionToken } from '@angular/core';
import { ExternalNodePermissionCommentsTabService } from '../models/external-nodes-permission-comments.interface';
export const EXTERNAL_NODE_PERMISSION_COMMENTS_TAB_SERVICE = new InjectionToken<ExternalNodePermissionCommentsTabService[]>(
'ExternalNodePermissionCommentsTabService'
'ExternalNodePermissionCommentsTabService',
{
providedIn: 'root',
factory: () => []
}
);

View File

@@ -149,9 +149,5 @@ describe('NodeUtils', () => {
it('should return [false] for node type not starting with rma:', () => {
expect(isRmaContent(prepareNode('cm:content'))).toBeFalse();
});
it('should return false when nodeType is missing', () => {
expect(isRmaContent({} as any)).toBeFalse();
});
});
});