Fix protocol.io search [SCI-8286]

- Reduce the number of displayed publications to 20 for speed
- Clear the search result each time a new key (search sentence) is used
This commit is contained in:
sboursen-scinote 2023-04-11 10:30:58 +02:00
parent 9f1b60eda4
commit 6d984d8dfc
3 changed files with 4 additions and 4 deletions

View file

@ -123,7 +123,7 @@ function applySearchCallback() {
$('form.protocols-search-bar').off('ajax:success').off('ajax:error')
.bind('ajax:success', function(evt, data) {
var listWrapper = $('.list-wrapper');
if (data.page_id > 1) {
if (data.page_id > 2) {
// Remove old load more button since we will append a new one
$('.show-more-protocols-btn').remove();
$('.list-wrapper').append(data.html);

View file

@ -18,12 +18,12 @@ module ProtocolImporters
end
# Query params available are:
# filter (optional): {public|user_public|user_private|shared_with_user}
# filter (required): {public|user_public|user_private|shared_with_user}
# Which type of protocols to filter.
# default is public and requires no auth token.
# user_public requires public token.
# user_private|shared_with_user require private auth token.
# key (optional): string
# key (required): string
# Search key to search for in protocol name, description, authors.
# default: ''
# order_field (optional): {activity|date|name|id}

View file

@ -278,7 +278,7 @@ class Constants
},
publications: {
default_query_params: {
latest: 50
latest: 20
}
}
},