fix comment replies
This commit is contained in:
parent
edff375476
commit
4a228e5a51
1 changed files with 16 additions and 0 deletions
|
|
@ -41,11 +41,16 @@ function CommentListWithTabs() {
|
||||||
const spaceRules = space?.membership?.permissions;
|
const spaceRules = space?.membership?.permissions;
|
||||||
const spaceAbility = useSpaceAbility(spaceRules);
|
const spaceAbility = useSpaceAbility(spaceRules);
|
||||||
|
|
||||||
|
|
||||||
const canComment: boolean = spaceAbility.can(
|
const canComment: boolean = spaceAbility.can(
|
||||||
SpaceCaslAction.Manage,
|
SpaceCaslAction.Manage,
|
||||||
SpaceCaslSubject.Page
|
SpaceCaslSubject.Page
|
||||||
);
|
);
|
||||||
|
|
||||||
|
console.log(spaceAbility)
|
||||||
|
|
||||||
|
console.log('can comment', canComment);
|
||||||
|
|
||||||
// Separate active and resolved comments
|
// Separate active and resolved comments
|
||||||
const { activeComments, resolvedComments } = useMemo(() => {
|
const { activeComments, resolvedComments } = useMemo(() => {
|
||||||
if (!comments?.items) {
|
if (!comments?.items) {
|
||||||
|
|
@ -179,6 +184,17 @@ function CommentListWithTabs() {
|
||||||
userSpaceRole={space?.membership?.role}
|
userSpaceRole={space?.membership?.role}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{canComment && (
|
||||||
|
<>
|
||||||
|
<Divider my={4} />
|
||||||
|
<CommentEditorWithActions
|
||||||
|
commentId={comment.id}
|
||||||
|
onSave={handleAddReply}
|
||||||
|
isLoading={isLoading}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Paper>
|
</Paper>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue