-
Notifications
You must be signed in to change notification settings - Fork 9
Move Data Elements to another Data Class within the same model #869
Description
Depends on
Description
There is a requirement from NHS England to be able to move Data Elements between Data Classes, so long as they are within the same Data Model (to not break existing links to data types etc).
Move Option
A new menu option called "Move..." should appear in the triple-dot menu for (only) a Data Element, here:
This menu option should only appear if:
- The current user is allowed to update items - governed by the
updateinavalableActions. - There is at least one other data class to move to - no point moving to itself.
Move To Dialog
Selecting the menu item should open a new dialog. Inside, this is where the user selects an existing data class within the same data model. Ideally, this should exclude the current data class the data element sits under.
Once selected, the user should be able to click a primary action button e.g. "Move", or cancel/close the dialog to do nothing.
Update Data Element
Finally, the standard Data Element update endpoint should be invoked:
PUT /api/dataModels/{modelId}/dataClasses/{classId}/dataElements/{elementId}
{
"dataClass": "{anotherClassId}"
}For this request, no other properties need to be updated, just the dataClass parent UUID.
Once successful, the page should refresh to reflect the change and a confirmation toast message should appear.
