Limit amounts of techs shown per page#1007
Conversation
…r, minor bugfixes
…shboard' into cwvtech-category-dashboard
Co-authored-by: Rick Viscomi <rviscomi@users.noreply.github.com>
…summary, improve landing page card interaction
|
@sarahfossheim Somehow I get a long list of technologies again instead of pagination. Regarding filtering, I would suggest the user to use the technologies page for a scenario like this. |
|
@tunetheweb ready for review :) Linter complains about |
|
I've hit this in the past. Think I had to do this to get round it: <select id="rowsPerPage">
{% if filters.rows == "10" %}
<option value="10" selected>10</option>
{% else %}
<option value="10">10</option>
{% endif %}
{% if filters.rows == "25" %}
<option value="25" selected>25</option>
{% else %}
<option value="25">25</option>
{% endif %}
{% if filters.rows == "50" %}
<option value="50" selected>50</option>
{% else %}
<option value="50">50</option>
{% endif %}
</select>Which is a bit yucky, but was the only way I found to stop the linter complaining :-( |
|
@tunetheweb Updated it that way and it indeed stopped complaining now, agreed it looks a bit yucky though 😕 |
|
This also might work? <select id="rowsPerPage">
{% macro setSelected(arg1) %}{% if filters.rows == arg1 %}selected{% endif %}{% endmacro %}
<option value="10" {{ setSelected("10") }}>10</option>
<option value="25" {{ setSelected("25") }}>25</option>
<option value="50" {{ setSelected("50") }}>50</option>
</select>Not sure it's any less yucky though! |
|
Looks like CI is failing for other things:
|
tunetheweb
left a comment
There was a problem hiding this comment.
LGTM once we get CI sorted.
A few minor nits.
src/js/techreport/utils/data.js
Outdated
| const paginatedTechs = category?.technologies?.slice(firstTechNr, lastTechNr); | ||
|
|
||
| const technologyFormatted = paginatedTechs?.join('%2C') | ||
| .replaceAll(" ", "%20"); |
There was a problem hiding this comment.
Should we use encodeURI to handle other potential issue characters?
src/js/techreport/utils/data.js
Outdated
| const geo = filters.geo.replaceAll(" ", "%20"); | ||
| const rank = filters.rank.replaceAll(" ", "%20"); | ||
| const geoFormatted = geo.replaceAll(" ", "%20"); | ||
| const rankFormatted = rank.replaceAll(" ", "%20"); |
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
Co-authored-by: Barry Pollard <barry_pollard@hotmail.com>
…into cwvtech-paginated
Issue
Currently we can select an infinite amount of techs on the comparison page, and some categories have ca 300 technologies in them as well. When rendering the data for this many technologies, the page ends up loading slowly (and the visualizations hard to read).
Fix:
Main change
As a result, the following functionality also had to be added
selectedparameter in the URLselectedparameter of the URLAlso included