ComPlat / chemotion_ELN

Electronic Lab Notebook
https://www.chemotion.net
GNU Affero General Public License v3.0
119 stars 45 forks source link

Add root container to seeded reactions #1947

Closed JanCBrammer closed 1 month ago

JanCBrammer commented 1 month ago

This PR addresses #1943.

How to test this PR?

  1. Check out main.
  2. Run bundle exec rails db:setup.
  3. Open the app and click image in one of the reactions detail modals. The app should throw (in the browser's dev console):
    TypeError: Cannot read properties of null (reading 'attachments')
    at Function.getAttachments (BaseFetcher.js:127:1)
    at Function.updateAnnotationsInContainer (BaseFetcher.js:137:1)
    at Function.updateAnnotationsInReaction (ReactionsFetcher.js:97:1)
    at ReactionsFetcher.js:81:1
    ElementActions.js:620 TypeError: Cannot read properties of undefined (reading 'type')
    at Store.handleUpdateElement (ElementStore.js:1327:1)
    at Store.handleUpdateLinkedElement (ElementStore.js:718:1)
    at AltStore.js:88:1
    at Array.every (<anonymous>)
    at AltStore.js:87:1
    at handleDispatch (AltStore.js:54:1)
    at Object.ID_4 (AltStore.js:86:1)
    at Dispatcher._invokeCallback (Dispatcher.js:198:1)
    at Dispatcher.dispatch (Dispatcher.js:174:1)
    at index.js:83:1

Now, check out this PR (branch reaction-development-seeds) and run steps 2. and 3. again. The app should no longer throw the error above.

github-actions[bot] commented 1 month ago

LCOV of commit 2cde55c during Continuous Integration #2882

Summary coverage rate:
  lines......: 64.1% (13675 of 21337 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a