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

handle_dropdown_popup_scroll is not defined on permissions-manage.xhtml #5653

Closed
pameyer opened this issue Mar 15, 2019 · 7 comments · Fixed by #7627
Closed

handle_dropdown_popup_scroll is not defined on permissions-manage.xhtml #5653

pameyer opened this issue Mar 15, 2019 · 7 comments · Fixed by #7627

Comments

@pameyer
Copy link
Contributor

pameyer commented Mar 15, 2019

On 1178-1a12cda

Screen Shot 2019-03-15 at 1 02 29 PM

Does not appear to prevent any functionality (was still able to modify user permissions on that page). Have not investigated sufficiently to see if it's related to #5589 , but that would be plausible. <script type="text/javascript" defer="defer" src="/javax.faces.resource/js/dv_rebind_bootstrap_ui.js.xhtml?version=4.10.1"></script> present in generated html

@mheppler
Copy link
Contributor

There was some work done on dv_rebind_bootstrap_ui.js in #3925. I will take a look at the permissions-manage pg and see what I can sort out. Good catch, @pameyer.

@mheppler
Copy link
Contributor

This function was added as part of commit ca9d9b9 for #4343, to the harvestclients, manage-groups, permissions-manage-files, provenance-popups-fragment, and role-assign pgs.

It resolves a scrolling issue with the dynamic dropdown menu for p:autoComplete components in popups on these pages.

Screen Shot 2019-03-15 at 5 15 20 PM

Found the same reference errors on permissions-manage-files and manage-groups, but not harvestclients. Not sure what's going on here exactly.

@pameyer
Copy link
Contributor Author

pameyer commented Mar 16, 2019

@mheppler Thanks for taking a look. This installation didn't have enough users that the dropdown would need to scroll (and for what it's worth, didn't have analytics enabled).

@kcondon
Copy link
Contributor

kcondon commented Apr 1, 2020

On only one test machine, build, clicking save changes on the edit groups popup does not update list view and does not close popup but does save changes if cancel, then reload page.

The browser error in Chrome was:
manage-groups.xhtml?dataverseId=1:310 Uncaught ReferenceError: handle_dropdown_popup_scroll is not defined
at manage-groups.xhtml?dataverseId=1:310
(anonymous) @ manage-groups.xhtml?dataverseId=1:3

@mheppler Also saw this error in FF, which was in the analytics code:
XML Parsing Error: mismatched tag. Expected: .
Location: https://dvn-build.hmdc.harvard.edu/manage-groups.xhtml?dataverseId=1152
Line Number 150, Column 3:

@mheppler
Copy link
Contributor

mheppler commented Apr 1, 2020

The XML parsing error is complaining about Line 150, and if you look in the browser page source for the manage groups pg on dvn-build, that line is the analytics code. The dvn-build server has the analytics code configured, and you see the XML error, demo does not have the analytics code, and there is no error.

There appears to be some javascript strangeness in the dataverse manage groups workflows, and it's probably worth investigating and resolving them all together.

@mheppler
Copy link
Contributor

mheppler commented Apr 3, 2020

Due to UI bug this new console error is related to, I have spun it off into a new issue Manage Groups - Dialog popup does not close on save, action saved by system #6792. I hope that both console errors can still be resolved together.

@mheppler
Copy link
Contributor

Rediscovered this javascript issue while looking at other javascript issues. Got a quick fix. Rather than putting the calls to this function on every page that uses it with the following code:

<script>
    handle_dropdown_popup_scroll();
</script>

I have instead moved that call to the bind_bsui_components() function that gets call when the document is ready...

    // Scrolling autoComplete dropdown in popups
    handle_dropdown_popup_scroll();

The reason you are seeing the ReferenceError in the console was because the inline code block under each autoComplete component was getting called before the javascript file was being loaded at the bottom of the page...

<script defer="defer" src="#{resource['js/dv_rebind_bootstrap_ui.js']}?version=#{systemConfig.getVersion()}"></script>

Now that the handle_dropdown_popup_scroll() function call has been moved to a more appropriate place, there are no more console ReferenceErrors, and the autoComplete dropdown menus are still displaying properly when you have a long list of options to scroll through.

Originally this code was added to the provenance code ca9d9b9 and other places where the autoComplete component is used.

Noticed a bug while I was poking at the test server. When using the entity connector dropdown on the add provenance window from the create dataset page, I used the scroll wheel on my mouse, and it caused the dropdown to move up and down on the screen while everything else stayed static:

scrollbug

This will be a good feature to revisit when working on Improve (simplify) Primefaces (Ajax) / Bootstrap interaction #7565.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants