mirror of
https://github.com/Alfresco/alfresco-content-app.git
synced 2026-04-23 22:30:24 +00:00
[ACS-9765]: cr
This commit is contained in:
@@ -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({}) } }
|
||||
]
|
||||
});
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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: () => []
|
||||
}
|
||||
);
|
||||
|
||||
@@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user