alan-turing-institute / AssurancePlatform

Project to facilitate creation of Assurance Cases
MIT License
17 stars 6 forks source link

[User Story]: Preserve Child Elements on Parent Deletion #439

Open kallewesterling opened 2 months ago

kallewesterling commented 2 months ago

Role

As an assurance case editor

Desired Feature

I want child elements to remain in the assurance case even if their parent element is deleted, allowing them to "float" until reconnected appropriately

Benefit

So that I can manage the structure of the assurance case more flexibly without losing data inadvertently when modifying higher-level elements

Acceptance Criteria

GIVEN a parent element is deleted, WHEN I navigate to the assurance case view, THEN the child elements of the deleted parent should still be visible and unlinked in the assurance case. AND I should be able to reconnect these floating elements to other valid parent elements within the assurance case according to the defined linking rules (e.g., a property claim can only be connected to a strategy or another property claim).

Dependencies

Technical Notes

Definition of Done

cptanalatriste commented 1 week ago

@RichGriff , in the development branch now there's a working version of the new endpoints for this issue. At the moment, it only works on Context elements:

In the following days, I will be adding support to the rest of the case elements.

RichGriff commented 1 week ago

@cptanalatriste just a quick update from me on my changes:

https://github.com/alan-turing-institute/AssurancePlatform/assets/28445922/6bfedc21-3d61-4f24-9f30-1beb597d11a6

I've tried to make this versatile for all types but will need to review once you have completed them.

kallewesterling commented 1 week ago

Oh, I really like how this looks!

cptanalatriste commented 6 days ago

@RichGriff , just updated the branch with the endpoints for attaching Evidence:

In the following days, I will be adding support to the rest of the case elements.

cptanalatriste commented 3 days ago

@RichGriff, just updated the branch with the endpoints for attaching Property Claims:

IMPORTANT: Attaching/Detaching property claims do not break the connections between that property claim and its child elements. This means that if you detach a property claim with the structure P1 -> P.1.1 -> E1, moving P1 to the sandbox will actually move the whole branch. Also, if you attach P1 to another element, you will also be attaching the whole branch.

@chrisdburr is this the expected behaviour?

In the following days, I will be adding support to the rest of the case elements.

cptanalatriste commented 2 days ago

@RichGriff, the backend endpoints for this issue are all available in staging. Regarding Strategies:

IMPORTANT: Attaching/Detaching strategies do not break the connections between that strategy and its child elements. This means that if you detach a strategy with the structure S1 -> P.1-> E1, moving P1 to the sandbox will actually move the whole branch. Also, if you attach S1 to another element, you will also be attaching the whole branch.

chrisdburr commented 1 day ago

IMPORTANT: Attaching/Detaching property claims do not break the connections between that property claim and its child elements. This means that if you detach a property claim with the structure P1 -> P.1.1 -> E1, moving P1 to the sandbox will actually move the whole branch. Also, if you attach P1 to another element, you will also be attaching the whole branch.

@chrisdburr is this the expected behaviour?

@cptanalatriste, yes that's what I'd expect to happen. After all, the evidence and sub property claims only make sense in relation to their linked parent.

cptanalatriste commented 1 day ago

@RichGriff after this PR https://github.com/alan-turing-institute/AssurancePlatform/pull/538 , when retrieving sandbox contents now we also include the child elements of strategies and property claims (as you pointed out, before only IDs where included).

I just merged the PR into develop, so it should be available in staging shortly.

cptanalatriste commented 30 minutes ago

@chrisdburr , please provide the new text for the model when deleting.