-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Refresh related entries on changes #1377
base: develop
Are you sure you want to change the base?
Conversation
UI unit Tests12 tests 12 ✅ 0s ⏱️ Results for commit 2376f9a. ♻️ This comment has been updated with latest results. |
C# Unit Tests104 tests 104 ✅ 5s ⏱️ Results for commit 2376f9a. ♻️ This comment has been updated with latest results. |
@hahn-kev - Although this is marked as draft, it's fully functional except for the two flaws I mentioned in the description, one of which I'm going to fix tomorrow morning. So this isn't going to change much, and it should be suitable for a review right now. |
Prepares for the 'refreshEntries' event coming soon
Now instead of dispatching multiple `refreshEnrtry` events, when complex forms or comonents change and we need to refresh the related entries, we will dispatch only one event so that a single API call can be made to refresh all relevant entries at once.
Managed to fix the second flaw I mentioned in the description before going home for the evening, so I've updated the description to remove any mention of that second flaw (see edit history if you want to see it). So this PR has come as far as I'm going to be able to take it, unless we decide to make major structural changes to how we store entries so that we can update a selected subset. So now I'm going to take this out of draft status and mark it as ready for review. |
for the issue of not being able to update a single entry, take a look at the That said, considering we have all the pluming for I bring this up because I don't really like bringing back change detection code inside |
@rmunn only I think I like the idea of moving the related entry change detection to the backend. 😬 But, yeah...it's the first time we'll start shooting off events without exactly knowing what context we're in, so it's a new concept. |
Fixes #1333.
One flaw in this design is that the
$entries
list in viewer/src/ProjectView.svelte comes from aderived
, meaning it's read-only, so the only way to refresh an entry is to refresh the entire list. That's why I've left in aconsole.log('TODO: ...')
line: so that if we decide to merge this as-is despite this flaw, we have an annoying console message nagging at us to find a better solution. I might want to work with Tim on fixing this, since it might involve a major rewrite to how we store entries. (Or we might decide it's not worth fixing, and we're okay with refreshing the entire entries list every time an entry's list of components or complex forms is changed).Other than that, this works as desired: when you add a complex form or a component, the related entry is refreshed. When you delete a complex form or a component, the related entry is also refreshed.