This repository has been archived by the owner on Feb 1, 2024. It is now read-only.
Conditionally change split operation to revert #1386
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
Conditionally change the split operation on the dashboard to revert in cases when the list item was previously used to create a new facility.
Connects https://github.com/open-apparel-registry/open-apparel-registry-clients/issues/26
Demo
Notes
In production we encountered a situation where a list item was used to create a facility but then through some sequence of moderation activities was matched to a different facility. Attempts to use split function in the dashboard failed because attempting to create a new facility from the list item violated the uniqueness constraint on
Facility.created_from
.To work around this problem we now include
facility_created_by_item
in the data used to populate the dashboard split tool and conditionally offer a "revert" option in place of split and mirror that change in the API view to connect the match to the originally created facility rather than attempting to make a new facility record.## Testing InstructionsTesting
These instructions assume that you have run
./scripts/resetdb
./scripts/manage shell_plus
and set up the test conditionshell_plus
.Checklist
fixup!
commits have been squashed