Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Resolve redundant nav menu on first submit click without any change #34658
Resolve redundant nav menu on first submit click without any change #34658
Changes from 4 commits
7884a8f
bc6e2cf
7e8f6c6
bff1adc
1a5d3ab
b1c40bc
65d72b5
d2cf66d
f0f42f5
fc86704
be0ac93
517530d
055e2b5
73e8ad1
e351a11
d6381f4
8be4ffa
75a6181
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Is this still in use anywhere?
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.
not anymore. looks like we can remove it.
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.
removed here 75a6181
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.
@orangejenny I am running across an issue where
self._getChildren()
returns me an empty [] when I run search due to which error display doesn't work correctly. On looking at the code this method populates children usingthis.children
which returns empty to me. Any idea how can I debug this ? I am quite blocked on figuring out when and wherethis.children
gets its value from.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.
You probably know
this.children
is populated by Marionette, it's part of this being aCollectionView
. The view lifecycle is event driven, so it can be tricky to debug, but there are callbacks for the various events. Check out the CollectionView docs and the more general View lifecycle docs. (Make sure you're in the right version of docs - a search engine took me to the v2 docs, but we're on v4 and this area has changed a good deal.)I poked around on this branch, just adding console statements in
executeSearch
,performSubmit
, etc. and adding a few handlers to theQueryListView
likeonBeforeDestroy
that just contained console statements. Seems theQueryListView
is getting destroyed as part of themenu:query
response (because it callslistMenus
which eventually callsshowMenu
and then this code callsshow
on the main and sidebar regions, andshow
causes the view to get destroyed and a new one created). I believe that's whychildren
is empty when this code runs. But I'm not immediately sure how to fix it. You might be able to do something like movingdisplayErrors
intoonRender
oronRenderChildren
.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.
Thanks, that gives me a bunch of context to proceed on this.
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.
To close the loop, I tried putting
displayErrors
intoonRender
oronRenderChildren
but it has unintended side-effect of us showing errors the very first time we show the query screen without user doing any interaction. As such I am not sure how to fix it but we can potentially explore 2 ways -urlObject
that bypassesdisplayErrors
show
on page if the response type is same as last response type. This might mean us storing last response type inurlObject
or session storage.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.
I like the idea of having some sort of explicit signal indicating whether there has been a user-initiated submission. Can we get that information from the formplayer response? Is that what you're suggesting with the response type idea?
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.
Not really, as FP doesn't really know whether a request is a result of user clicking search or something else. It's possible though that Web Apps can pass a flag to FP that FP preserves in the response but would think that Web Apps should be able to tell that independently without needing this flag to be set on FP.
-> Is that what you're suggesting with the response type idea?
No, I was suggesting to not re-render pages on Web Apps if the new response type is same as the last i.e. if we are on a case list screen and FP replies with a response that corresponds to the case list screen, we should not need to re-render the pages/views completely by calling
show
on ui elements but should be able to just update the date on those UI elements.