Open
Description
The StudioCodeListEditor
component must handle adding new text resources.
Currently, when no text resource is selected, search mode is chosen by default, and when the user switches to edit mode, the text field is disabled. Instead, the following flow is proposed:
Edit mode is always chosen by default, and the text field is never disabled. When the user types something and blurs the field, and no text resource is selected, a new text resource with a random ID and the given text is generated.
flowchart LR;
1[Textfield is blurred]
2{Does text resource exist?}
subgraph A1[Add new text resource]
A1A[Create a random ID]
A1B[Create a new text resource with the random ID and the given text]
A1C[Connect the new text resource to the given field]
A1A-->A1B
A1B-->A1C
end
subgraph A2[Trigger callbacks]
A2A[Call onBlurTextResource with the new text resource]
A2B[Call onBlurAny with the updated code list]
A2A-->A2B
end
3["Rerender component with the updated data (using usePropState)"]
B1[Update the text resource]
B2[Trigger callbacks]
1-->2
2-->|No|A1
A1-->A2
A2-->3
2-->|Yes|B1
B1-->B2
B2-->3
Metadata
Metadata
Assignees
Type
Projects
Status
👷 In Progress