Giter Site home page Giter Site logo

Comments (5)

mmabrahamson avatar mmabrahamson commented on May 27, 2024

It looks like the delay is primarily caused by the SQL call to get the config data for the EDS API Plugin. that config data tells it whether it should set the dropdown to default or not, and then paints the dropdown and selects accordingly. I agree there doesn't seem to be a great shortcut for this. In the past, this was shortcutted via a jStorage library caching settings after the first load, but it caused headaches with admin settings that weren't getting properly updated when admin settings were changed.

In testing this change, I'm finding there's still a brief delay before the disable happens, long enough for someone moving quickly to click it and then get frustrated. I also absolutely agree that the delay is frustrating. I think we're running into a number of issues though:

Delay on the plugin JS being loaded and running.
Delay on the plugin checking the SQL settings.
Delay on painting the dropdown once SQL responds (this one is minimal).

Before I pull the PR for this one in, I'm looking to see if there's anything else that could be done to speed this all up, and I'm open to suggestions!

from edsapi-koha-plugin.

kidclamp avatar kidclamp commented on May 27, 2024

In the coverflow plugin we have an update_coverflow_js function:
https://github.com/bywatersolutions/koha-plugin-coverflow/blob/master/Koha/Plugin/Com/ByWaterSolutions/CoverFlow.pm#L355

We call it when the plugin settings are updated:
https://github.com/bywatersolutions/koha-plugin-coverflow/blob/master/Koha/Plugin/Com/ByWaterSolutions/CoverFlow.pm#L175

Could you do the same here? Build the dropdown when the options are saved in the admin interface, then simply pass the prebuilt dropdown into the JS so it is available when the page loads?

from edsapi-koha-plugin.

mmabrahamson avatar mmabrahamson commented on May 27, 2024

Thanks! I like this solution presented in the coverflow plugin. I'm putting this on my priority list to try and address for 20.05 forward. I'll update when more progress has been made on this!

from edsapi-koha-plugin.

mmabrahamson avatar mmabrahamson commented on May 27, 2024

PR #101 is attempting to fix this issue by removing the need to query the table for configuration on every load. It's working great locally but would love some more eyes on it if you have a 20.05 instance you can test against. Thanks for all the conversation around this! Once the PR is merged I'll close this issue.

from edsapi-koha-plugin.

mmabrahamson avatar mmabrahamson commented on May 27, 2024

PR #101 is merged to master and should resolve this issue.

from edsapi-koha-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.