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

Display issues with jump to search #345

Closed
alexskr opened this issue Nov 9, 2024 · 4 comments
Closed

Display issues with jump to search #345

alexskr opened this issue Nov 9, 2024 · 4 comments

Comments

@alexskr
Copy link
Member

alexskr commented Nov 9, 2024

We are seeing the following issues with AgroPortal <-> BioPortal code alignment:

  1. console errors/warnings:
You are loading Turbo from a <script> element inside the <body> element. This is probably not what you meant to do!

Load your application’s JavaScript bundle inside the <head> element instead. <script> elements in <body> are evaluated with each page change.

For more information, see: https://turbo.hotwired.dev/handbook/building#working-with-script-elements

——
Suppress this warning by adding a "data-turbo-suppress-warning" attribute to: <body class="ontologies show d-flex flex-column h-100">
  <header>
		<nav class="navbar navbar-expand-lg navbar-dark navbar-custom fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="/"><img src="/assets/logos/bioportal-logo-c4574d9e6b15ce60a7f10c4ebe794011e56d8440e6f77f99e563d99035fdc235.png"></a>
<button name="button" type="button" class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#topNavigationToggler" aria-controls="topNavigationToggler" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span>
jquery.min.js:2 The specified value "!" does not conform to the required format.  The format is "#rrggbb" where rr, gg, bb are two-digit hexadecimal numbers.
Utils.js:74 Uncaught TypeError: Cannot read properties of undefined (reading 'replace')
    at Object.escapeIdentifierForId (Utils.js:74:27)
    at OntologyPropertyRelationsCallback.callback (PropertyRelationsExpander.js:120:48)
    at Object.success (FetchFromApi.js:368:37)
    at c (jquery.min.js:2:28447)
    at Object.fireWith [as resolveWith] (jquery.min.js:2:29192)
    at l (jquery.min.js:2:80176)
Uncaught TypeError: Cannot read properties of undefined (reading 'top')
    at HTMLDocument.<anonymous> (VM3662 application-c048fc53b75f6687932ec2de4c81629ee1f775816e6894f530ffdebd45cc6f98.js:1:7268)
    at HTMLDocument.dispatch (vendor-815ed6ab16f1c1c75652503bf420d5b61fb87d534a64268bd971c99f654cbb03.js:2:28337)
    at m.handle (vendor-815ed6ab16f1c1c75652503bf420d5b61fb87d534a64268bd971c99f654cbb03.js:2:26404)
    at Object.trigger (vendor-815ed6ab16f1c1c75652503bf420d5b61fb87d534a64268bd971c99f654cbb03.js:3:18028)
    at e.event.trigger (vendor-815ed6ab16f1c1c75652503bf420d5b61fb87d534a64268bd971c99f654cbb03.js:4:7902)
    at e.event.trigger (VM3737 jquery-migrate-1.2.1.min.js:2:6732)
    at e.event.trigger (VM3737 jquery-migrate-1.2.1.min.js:2:6732)
    at e.event.trigger (VM3737 jquery-migrate-1.2.1.min.js:2:6732)
    at e.event.trigger (VM3737 jquery-migrate-1.2.1.min.js:2:6732)
    at e.event.trigger (VM3737 jquery-migrate-1.2.1.min.js:2:6732)
...
  1. Jump to box issues:
    when using jump to box multiple times we observer the following:
image
  1. DataTable warning popup:
BioPortal
@alexskr alexskr changed the title AgroPortal - BioPortal alignment: issues to resolve: AgroPortal - BioPortal alignment: errors and display issues Nov 9, 2024
@syphax-bouazzouni
Copy link
Contributor

Two possible solution to this:

  1. Option 1: Change this line https://github.com/ncbo/bioportal_web_ui/blob/sync-agroportal/app/javascript/controllers/class_search_auto_complete_controller.js#L29 to not use Turbo.visit but instead use document.location, the drawback is that this refreshes the page and is no longer an SPA style.
  2. Option 2: Prevent here https://github.com/ncbo/bioportal_web_ui/blob/sync-agroportal/app/javascript/mixins/useSimpleTree.js#L2, the simple component from mounting/initializing if it is already done, having something like this:
export function useSimpleTree(element, afterClick, afterAjaxError, beforeAjax) {
    if (!jQuery(element).data('simpleTree')) {
        return jQuery(element).simpleTree({
            autoclose: false,
            drag: false,
            animate: true,
            timeout: 20000,
            afterClick: afterClick,
            afterAjaxError: afterAjaxError,
            beforeAjax: beforeAjax
        });
    }
}

@syphax-bouazzouni
Copy link
Contributor

You can open a separate issue for the notes table.

@alexskr alexskr changed the title AgroPortal - BioPortal alignment: errors and display issues AgroPortal - BioPortal alignment: display issues with jump to search Nov 9, 2024
@alexskr
Copy link
Member Author

alexskr commented Nov 9, 2024

@syphax-bouazzouni, option 2 didn't resolve the issue with the jump to search box and tree display issues.
first option didn't seem to do the trick either

@jvendetti jvendetti changed the title AgroPortal - BioPortal alignment: display issues with jump to search Display issues with jump to search Nov 15, 2024
@alexskr
Copy link
Member Author

alexskr commented Nov 15, 2024

resolved in 550ef26
and #347

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

No branches or pull requests

4 participants