alan-turing-institute / AssurancePlatform

Project to facilitate creation of Assurance Cases
MIT License
23 stars 7 forks source link

[User Story]: Implement Commenting Feature for Enhanced Collaboration on Assurance Case Elements #437

Closed kallewesterling closed 1 month ago

kallewesterling commented 6 months ago

Role

As an assurance case editor

Desired Feature

I want to be able to comment on individual assurance case elements

Benefit

So that I can collaborate more effectively with team members by discussing specific aspects directly within the platform

Acceptance Criteria

GIVEN I am viewing an assurance case, WHEN I select an assurance case element, THEN I should have the option to add a comment to that element. AND comments should be visible to all users with access to the assurance case.

GIVEN comments have been added to an element, WHEN another user views the element, THEN they should be able to see existing comments and add their own. AND users should have the ability to reply to comments, creating threaded discussions.

Dependencies

Technical Notes

Definition of Done

RichGriff commented 1 month ago

I have created the logic for viewing/editing comments on each element.

Image

Endpoints for requesting creating and updating - @cptanalatriste these are just placeholders can update to match your logic.

/api/${entity}/${id}/comment

/api/${entity}/${id}/comment/${newCommentId}

Entity = the current element so will be 'contexts'.

If we can get the created/updated comment back that would be great, so i can then update the collection and the assurance case.

cptanalatriste commented 1 month ago

@RichGriff noted, I'll start working on those. Will update you with my progress

cptanalatriste commented 1 month ago

Hi @RichGriff , I have a preliminary version working on staging. Here are some sample requests for creating element comments (for retrieval, just change POST for GET). Note that, in the current version, you need to include the element type and the ID in the JSON payload:

Image Image Image Image Image

RichGriff commented 1 month ago

@cptanalatriste morning carlos thats great i can take a look.

Just a quick question, wondering why we need to pass the type and id when this info is in the request url?

RichGriff commented 1 month ago

Commenting on elements is now in staging

@chrisdburr can you please review

cptanalatriste commented 1 month ago

@cptanalatriste morning carlos thats great i can take a look.

Just a quick question, wondering why we need to pass the type and id when this info is in the request url?

@RichGriff , it was because I was reusing the feature already available for commenting on Assurance Cases, as quick way of putting something into staging. I can update the API and avoid there redundancy.

chrisdburr commented 1 month ago

Commenting on elements is now in staging

@chrisdburr can you please review

Yep. @cptanalatriste, I've just shared a case with you. Please can you respond to each of the comments with some dummy text when you get a chance.

chrisdburr commented 1 month ago

All good with the UI, @RichGriff.

However there is a bug with the level of permissions: #627

RichGriff commented 1 month ago

@chrisdburr no problem will take a look at the bug

chrisdburr commented 1 month ago

Tested with @RichGriff during live session. All good.