Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong entities are added to tables #2195

Closed
TheSlimvReal opened this issue Jan 23, 2024 · 2 comments · Fixed by #2196
Closed

Wrong entities are added to tables #2195

TheSlimvReal opened this issue Jan 23, 2024 · 2 comments · Fixed by #2196
Labels
released on @master managed by CI (semantic-release) released managed by CI (semantic-release)

Comments

@TheSlimvReal
Copy link
Collaborator

Describe the bug
Through the "listen-to-update logic" we apply updates to tables once they were initially rendered. This for example adds entities to a table that are synchronized while a table is open. This is also used to remove entities from a table when they are deleted.
At the moment we are always (?) adding every entity of the given type to the currently open table.
This can sometimes be wrong when for example the notes for a specific child are shown but a new note for a different child is added. This note will still be added to the table and shown until the view is reloaded.

To Reproduce
This is only one example, others might work very differently (e.g. through sync)

Steps to reproduce the behavior:

  1. Go to 'Child Details'
  2. Click on 'Notes & Tasks'
  3. Click on the primary action button
  4. Add a subject and save (without adding the child on whose details page we currently are)
  5. The note will be shown in the notes table
  6. After leaving and re-visiting the the details page the note is not visible any more.

Expected behavior
The note should never be shown.

Additional context
Most table components use the RelatedEntitiesComponent which has logic to listen and apply entity updates of the provided entity type. Currently it adds all new entities of that type even if they might not fit the table that is actually shown.

We could fix this by providing a filter for the entities which are shown based on the logic of the table. As this logic is very straight forward (show the entities that are linked e.g. to this child) it could be quite easy to even infer this based on the provided property.
Actually, even the property can be inferred based on the schema information that is available.

@aam-digital-ci
Copy link
Collaborator

🎉 This issue has been resolved in version 3.31.1-master.6 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@aam-digital-ci aam-digital-ci added the released on @master managed by CI (semantic-release) label Feb 5, 2024
@aam-digital-ci
Copy link
Collaborator

🎉 This issue has been resolved in version 3.31.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@aam-digital-ci aam-digital-ci added the released managed by CI (semantic-release) label Feb 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released on @master managed by CI (semantic-release) released managed by CI (semantic-release)
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants