Metadata
- Source
- SJRK-418
- Type
- Bug
- Priority
- Major
- Status
- Closed
- Resolution
- Fixed
- Assignee
- N/A
- Reporter
- Gregor Moss
- Created
2020-11-04T15:01:43.052-0500 - Updated
2020-11-12T15:16:07.669-0500 - Versions
- N/A
- Fixed Versions
- N/A
- Component
-
- Storytelling Tool UI
Description
In the SJRK-289 development branch, a bug has been introduced that causes media blocks (i.e. all but text blocks) to break when a text value is altered (e.g. heading, alt text, description). This seems to go away when the uploadState-to-visibility model relay is commented out, but that relay is needed to hide and show elements related to file uploading.
To reproduce
- Check out the SJRK-289 branch at commit dc3674af113dffeb2df5c4001e58bb4027cf97f4
- Start the server via docker-compose or run the Node server directly in your environment, making sure the database server is running
- Go to http://localhost:8081/storyEdit.html
- Click "Add an image block"
- Click on the "Block heading" input field of the new image block
- Type in any value
- Click away or defocus from the input field
Expected
The value remains in the field and nothing untoward happens, especially nothing to do with the file upload
Actual
The block's file upload progress indicator and error message text (without an accompanying error message) are shown, and the image placeholder is hidden. Please see the attached screenshot for an example of the result. This also breaks the blockUi by setting its storyId field to "null" (its initial state) and sets the uploadState to a value other than "ready", which prevents navigating to the story preview.
Comments
-
Gregor Moss commented
2020-11-04T18:27:37.908-0500 The solution to the bug was in the definition of the uploadState model relay, as mentioned in the description. Two changes are necessary to get it to work as intended:
- The input for the relay transform should have used "defaultInput" instead of "defaultInputPath", as the "*Path" options of transforms are not meant to be used in model relays. This is outlined in this note in the Model Relay docs: https://docs.fluidproject.org/infusion/development/modelrelay#general-notes-on-model-relay-rules
- The input value must be "{that}.model.uploadState" rather than the EL Path, as that key expects a value and not a path, as detailed in the docs for the valueMapper transform: https://docs.fluidproject.org/infusion/development/modeltransformationapi#mapping-based-on-input-value-fluidtransformsvaluemapper
Credit to @@Justin Obara for finding this solution, and thanks to @@Antranig Basman for clarifying the circumstances around the first part.