Open kallewesterling opened 2 months 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:
python manage.py migrate
before testing the code.POST
request to contexts/<context_id>/detach
, without a payload. The response is just a status code.POST
request to contexts/<context_id>/attach
, with payload {goal_id: <goal_id>}
.The response is just a status code.GET
request to cases/<assurance_case_id>/sandbox
without a payload. The JSON response will have the format {contexts: [<all Context elements in Sandbox>]}
In the following days, I will be adding support to the rest of the case elements.
@cptanalatriste just a quick update from me on my changes:
detach
a context
elementexisting elements
(orphaned elements) when editing a node. This is a different action to creating a new child elementorphan
to attach
(this list is filtered based on what can be added to the parent node)delete all
orphans that they see in the list aboveI've tried to make this versatile for all types but will need to review once you have completed them.
Oh, I really like how this looks!
@RichGriff , just updated the branch with the endpoints for attaching Evidence:
POST
request to evidence/<evidence_id>/detach
, with payload {property_claim_id: <parent_property_claim_id>}
. The response is just a status code.POST
request to evidence/<evidence_id >/attach
, with payload {property_claim_id: <new_property_claim_id>}
. The response is just a status code.GET
request to cases/<assurance_case_id>/sandbox
without a payload. The JSON response will have the format {contexts: [<all Context elements in Sandbox>], evidence: [<all Evidence elements in Sandbox>]}
In the following days, I will be adding support to the rest of the case elements.
@RichGriff, just updated the branch with the endpoints for attaching Property Claims:
POST
request to propertyclaims/<property_claim_id>/detach
, with payload {goal_id: <parent_goal_id>, property_claim_id: <parent_property_claim_id>, strategy_id: <parent_strategy_id>}
. You only need to include the ID of the parent element you want to detach (e.g. for detaching from a goal use {goal_id: 123}
). The response is just a status code.POST
request to propertyclaims/<property_claim_id>/attach
, with payload {goal_id: <parent_goal_id>, property_claim_id: <parent_property_claim_id>, strategy_id: <parent_strategy_id>}
. You only need to include the ID of the parent element you want to attach. The response is just a status code.GET
request to cases/<assurance_case_id>/sandbox
without a payload. The JSON response will have the format {contexts: [<all Context elements in Sandbox>], evidence: [<all Evidence elements in Sandbox>], property_claims: [<all Property Claim elements in the Sandbox>] }
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.
@RichGriff, the backend endpoints for this issue are all available in staging
. Regarding Strategies:
POST
request to strategies/<strategy_id>/detach
, without payload. The response is just a status code.POST
request to strategies/<strategy_id>/attach
, with payload {goal_id: <parent_goal_id>}
. The response is just a status code.GET
request to cases/<assurance_case_id>/sandbox
without a payload. The JSON response will have the format {contexts: [<all Context elements in Sandbox>], evidence: [<all Evidence elements in Sandbox>], property_claims: [<all Property Claim elements in the Sandbox>] , strategies: [<all Strategy elements in the Sandbox>]}
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.
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 attachP1
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.
@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.
@chrisdburr , please provide the new text for the model when deleting.
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