Merge pull request #3180 from aignatov-bio/ai-sci-5512-fix-datetime-selector-for-filters

Fix datetime for projects and experiments filters [SCI-5512]
This commit is contained in:
aignatov-bio 2021-02-22 13:25:00 +01:00 committed by GitHub
commit 84d61252d8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 14 deletions

View file

@ -591,6 +591,14 @@
}); });
} }
function selectDate($field) {
var datePicker = $field.data('DateTimePicker');
if (datePicker && datePicker.date()) {
return datePicker.date()._d.toUTCString();
}
return null;
}
function initProjectsFilters() { function initProjectsFilters() {
var $filterDropdown = filterDropdown.init(); var $filterDropdown = filterDropdown.init();
let $projectsFilter = $('.projects-index .projects-filters'); let $projectsFilter = $('.projects-index .projects-filters');
@ -631,12 +639,12 @@
}); });
$filterDropdown.on('filter:apply', function() { $filterDropdown.on('filter:apply', function() {
createdOnFromFilter = $createdOnFromFilter.val(); createdOnFromFilter = selectDate($createdOnFromFilter);
createdOnToFilter = $createdOnToFilter.val(); createdOnToFilter = selectDate($createdOnToFilter);
membersFilter = dropdownSelector.getValues($('.members-filter')); membersFilter = dropdownSelector.getValues($('.members-filter'));
lookInsideFolders = $foldersCB.prop('checked') ? 'true' : ''; lookInsideFolders = $foldersCB.prop('checked') ? 'true' : '';
archivedOnFromFilter = $archivedOnFromFilter.val(); archivedOnFromFilter = selectDate($archivedOnFromFilter);
archivedOnToFilter = $archivedOnToFilter.val(); archivedOnToFilter = selectDate($archivedOnToFilter);
projectsViewSearch = $textFilter.val(); projectsViewSearch = $textFilter.val();
appliedFiltersMark(); appliedFiltersMark();

View file

@ -109,6 +109,14 @@
}); });
} }
function selectDate($field) {
var datePicker = $field.data('DateTimePicker');
if (datePicker && datePicker.date()) {
return datePicker.date()._d.toUTCString();
}
return null;
}
function initExperimentsFilters() { function initExperimentsFilters() {
var $filterDropdown = filterDropdown.init(); var $filterDropdown = filterDropdown.init();
@ -133,12 +141,12 @@
} }
$filterDropdown.on('filter:apply', function() { $filterDropdown.on('filter:apply', function() {
startedOnFromFilter = $startedOnFromFilter.val(); startedOnFromFilter = selectDate($startedOnFromFilter);
startedOnToFilter = $startedOnToFilter.val(); startedOnToFilter = selectDate($startedOnToFilter);
modifiedOnFromFilter = $modifiedOnFromFilter.val(); modifiedOnFromFilter = selectDate($modifiedOnFromFilter);
modifiedOnToFilter = $modifiedOnToFilter.val(); modifiedOnToFilter = selectDate($modifiedOnToFilter);
archivedOnFromFilter = $archivedOnFromFilter.val(); archivedOnFromFilter = selectDate($archivedOnFromFilter);
archivedOnToFilter = $archivedOnToFilter.val(); archivedOnToFilter = selectDate($archivedOnToFilter);
experimentsViewSearch = $textFilter.val(); experimentsViewSearch = $textFilter.val();
appliedFiltersMark(); appliedFiltersMark();
refreshCurrentView(); refreshCurrentView();

View file

@ -7,10 +7,6 @@
// New experiments page // New experiments page
.projects-show { .projects-show {
.experiments-filters {
max-height: calc(100vh - var(--navbar-height) - var(--content-header-size));
overflow: auto;
}
.experiment-actions-menu { .experiment-actions-menu {
.dropdown-menu { .dropdown-menu {
a, a,
@ -351,3 +347,12 @@
} }
} }
} }
@media (max-height: 700px) {
.projects-show {
.experiments-filters {
max-height: calc(100vh - var(--navbar-height) - var(--content-header-size));
overflow: auto;
}
}
}