https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=32494

            Bug ID: 32494
           Summary: Potentially expensive API calls made for conditional
                    template rendering
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: ERM
          Assignee: jonathan.druart+k...@gmail.com
          Reporter: matt.blenkin...@ptfs-europe.com
                CC: jonathan.druart+k...@gmail.com,
                    jonathan.fi...@ptfs-europe.com,
                    martin.renvo...@ptfs-europe.com,
                    pedro.amo...@ptfs-europe.com

Bug 32474 introduces ajax based scrolling in v-selects to reduce expensive API
calls. Within ERM there are components where an API call is made and then
sections of template are conditionally rendered depending on whether the call
returns any data. For example, LicensesList.vue requests a list of all licenses
and then renders a div containing a table if "licences.length" is true. The
table then makes the same API call again to fetch the data to populate the
table. The initial API call is therefore not relevant to the table data and if
there is a large number of licenses, this will be an expensive call to make
simply to render the table before making the same call again.

I would suggest that the initial API call needs to be paginated to return a
small amount of data to pass the licenses.length conditional check. The change
proposed in bug 32474 in fetch.js allows fetchLicenses to be called with a
parameter to paginate to just one page like this: "fetchLicenses(1)". We will
then only be fetching one page of 20 values to pass the check. 

N.B. in bug 32474 components with a v-select have already been paginated e.g.
AgreementLicenses.vue - this bug is to patch the components that have not been
modified already, such as LicensesList.vue

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list
Koha-bugs@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-bugs
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to