Skip to content

Commit

Permalink
Fix(SavedSearch): Force user to validate criteria before saved search
Browse files Browse the repository at this point in the history
  • Loading branch information
stonebuzz authored and cedric-anne committed Jan 16, 2025
1 parent 0a73477 commit 08df0af
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions js/modules/Search/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,19 @@ window.GLPI.Search.Table = class Table extends GenericView {
super(element_id);

this.shiftSelectAllCheckbox();
this.toggleSavedSearch(true);
}

toggleSavedSearch(isDisable) {
if (isDisable) {
$('.bookmark_record')
.attr('title', __('Submit current search before saving it'))
.prop('disabled', true);
} else {
$('.bookmark_record')
.attr('title', __('Save current search'))
.prop('disabled', false);
}
}

getElement() {
Expand Down Expand Up @@ -199,6 +212,7 @@ window.GLPI.Search.Table = class Table extends GenericView {
this.getElement().trigger('search_refresh', [this.getElement()]);
this.hideLoadingSpinner();
this.shiftSelectAllCheckbox();
this.toggleSavedSearch(false);
}, () => {
handle_search_failure();
});
Expand Down

0 comments on commit 08df0af

Please sign in to comment.