-
Notifications
You must be signed in to change notification settings - Fork 137
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
Prevent multiple calls to concept set list when loading cohort editor #2888
Conversation
@@ -298,7 +298,7 @@ define([ | |||
table.clear(); | |||
|
|||
// Rebuild table from data source specified in binding | |||
if (data.length > 0) | |||
if (data && data.length > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is unrelated to the referenced issue. This fixes an error whereby the data
object is not defined and so calling .length causes an error in the browser.
await refreshToken(); | ||
if (config.userAuthenticationEnabled) { | ||
await refreshToken(); | ||
} | ||
return result; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is also unrelated to the referenced issue. This addition fixes a bug that prevents running Atlas when security is disabled.
Suggestion (sorry I didn't try this myself): I noticed you have set up subscriptions (make sure you dispose them) to check if the showModal observable changes, and it is true, to do the concept set fetch.... I think the problem is that inside the modal component, we place the concept set component that does the fetch and it's just the lifecycle of the component that wants to do it: we instantiate 5 components so we will fetch the 5 concept sets. To prevent the instantiation of the component could we put an The end effect shoudl be the same as what you have (ie: the if: binding observes the showModal and will control the load) but without creating addiitional manual subscriptions that you need to clean up. |
That's correct - I need to clean up the subscription for sure.
In theory that makes sense and would work well. What I recall from the code base is that the component for displaying the concept set is used in a number of places. So, my thinking was that by extending the component to be "modal aware" through its exposed parameter list, it would make modifying other things in Atlas a bit easier so that we only need to worry about where it is used modally vs. having to think about decorating those code blocks where it is used modally. They are functionally equivalent in my mind so I don't have a strong opinion either way.
Agreed - in the meantime, I will update this PR to clean up the subscription but if we want to go with the |
@chrisknoll I've updated this PR to use the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for making the requested changes.
Aims to fix #2887 by extending the concept set browser to only load the repository concept set list when the modal is activated.