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() {
var $filterDropdown = filterDropdown.init();
let $projectsFilter = $('.projects-index .projects-filters');
@ -631,12 +639,12 @@
});
$filterDropdown.on('filter:apply', function() {
createdOnFromFilter = $createdOnFromFilter.val();
createdOnToFilter = $createdOnToFilter.val();
createdOnFromFilter = selectDate($createdOnFromFilter);
createdOnToFilter = selectDate($createdOnToFilter);
membersFilter = dropdownSelector.getValues($('.members-filter'));
lookInsideFolders = $foldersCB.prop('checked') ? 'true' : '';
archivedOnFromFilter = $archivedOnFromFilter.val();
archivedOnToFilter = $archivedOnToFilter.val();
archivedOnFromFilter = selectDate($archivedOnFromFilter);
archivedOnToFilter = selectDate($archivedOnToFilter);
projectsViewSearch = $textFilter.val();
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() {
var $filterDropdown = filterDropdown.init();
@ -133,12 +141,12 @@
}
$filterDropdown.on('filter:apply', function() {
startedOnFromFilter = $startedOnFromFilter.val();
startedOnToFilter = $startedOnToFilter.val();
modifiedOnFromFilter = $modifiedOnFromFilter.val();
modifiedOnToFilter = $modifiedOnToFilter.val();
archivedOnFromFilter = $archivedOnFromFilter.val();
archivedOnToFilter = $archivedOnToFilter.val();
startedOnFromFilter = selectDate($startedOnFromFilter);
startedOnToFilter = selectDate($startedOnToFilter);
modifiedOnFromFilter = selectDate($modifiedOnFromFilter);
modifiedOnToFilter = selectDate($modifiedOnToFilter);
archivedOnFromFilter = selectDate($archivedOnFromFilter);
archivedOnToFilter = selectDate($archivedOnToFilter);
experimentsViewSearch = $textFilter.val();
appliedFiltersMark();
refreshCurrentView();

View file

@ -7,10 +7,6 @@
// New experiments page
.projects-show {
.experiments-filters {
max-height: calc(100vh - var(--navbar-height) - var(--content-header-size));
overflow: auto;
}
.experiment-actions-menu {
.dropdown-menu {
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;
}
}
}