Remove search terms on datatable refresh [SCI-8574] (#5533)

This commit is contained in:
ajugo 2023-06-01 09:52:58 +02:00 committed by GitHub
parent 015c481a2b
commit 31fdaf5e55
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 1 deletions

View file

@ -1,5 +1,5 @@
/* global I18n DataTableHelpers HelperModule */
/* eslint-disable no-use-before-define */
/* eslint-disable no-use-before-define no-param-reassign */
(function() {
'use strict';
@ -282,6 +282,9 @@
initRefreshFluicsButton();
window.initActionToolbar();
window.actionToolbarComponent.setBottomOffset(68);
},
stateLoadParams: function(_, state) {
state.search.search = '';
}
});
}

View file

@ -269,6 +269,9 @@ var ProtocolsIndex = (function() {
initProtocolsFilters();
initRowSelection();
},
stateLoadParams: function(_, state) {
state.search.search = '';
},
stateLoadCallback: function() {
// Load the table state for the current team
var state = localStorage.getItem(`datatables_protocols_state/${protocolsTableEl.data('team-id')}/${repositoryType}`);

View file

@ -1,4 +1,5 @@
/* global I18n DataTableHelpers DataTableCheckboxes animateSpinner HelperModule Promise */
/* eslint-disable no-param-reassign */
(function() {
'use strict';
@ -238,6 +239,9 @@
},
rowCallback: function(row) {
if (CHECKBOX_SELECTOR) CHECKBOX_SELECTOR.checkRowStatus(row);
},
stateLoadParams: function(_, state) {
state.search.search = '';
}
});
}

View file

@ -1,5 +1,6 @@
/* global I18n animateSpinner HelperModule
DataTableHelpers DataTableCheckboxes notTurbolinksPreview */
/* eslint-disable no-param-reassign */
(function() {
'use strict';
@ -140,6 +141,9 @@
}
if (CHECKBOX_SELECTOR) CHECKBOX_SELECTOR.checkRowStatus(row);
},
stateLoadParams: function(_, state) {
state.search.search = '';
}
});
});