Skip to content

Commit

Permalink
fix: fix diagnosis tree check handler;
Browse files Browse the repository at this point in the history
style: improve style
  • Loading branch information
volishevko committed Dec 18, 2024
1 parent eca406a commit f82e0a7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
3 changes: 2 additions & 1 deletion sources/services/gallery/gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -1254,7 +1254,8 @@ class GalleryService {
// update form controls values(true/false for checkboxes, etc)
_updateFiltersFormControls(data) {
if (Array.isArray(data)) {
data.forEach((item) => {
// For treetable elements sorting from highest level to lowest
[...data].sort((a, b) => a.diagnosisLevel > b.diagnosisLevel).forEach((item) => {
filterService.updateFiltersFormControl(item);
});
}
Expand Down
6 changes: 4 additions & 2 deletions sources/styles/pages.less
Original file line number Diff line number Diff line change
Expand Up @@ -1049,17 +1049,19 @@
overflow: hidden;
white-space: nowrap;
padding-left: 5px;
padding-right: 5px;
text-overflow: ellipsis;
border-right: 1px solid #E8EBF0;;
box-sizing: border-box;
max-width: max-content;
}
.applied-filters-item-hierarchy-item:not(:last-child) {
flex: 1;
min-width: 51px;
padding-right: 5px;
}
.applied-filters-item-hierarchy-item:last-child {
flex: 3;
flex: 10;
}
.applied-filters-item-hierarchy-item:first-child {
text-transform: uppercase;
Expand All @@ -1070,7 +1072,7 @@
background-color: transparent;
}
.applied-filters-item-hierarchy-item:hover {
flex: 3;
flex: 10;
}
}
.applied-filters-item-hierarchy_container:hover .applied-filters-item-hierarchy-item:not(:hover) {
Expand Down
20 changes: 20 additions & 0 deletions sources/views/subviews/gallery/parts/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,26 @@ function getTreeCheckboxUI(data, collapsed, expandedFilters) {
nextSiblingId = this.getNextSiblingId(currentId);
}
}
const allCheckedItems = this.getChecked();
allCheckedItems.forEach((checkedItemId) => {
const checkedItem = this.getItem(checkedItemId);
const parentForCheckedItem = this.getItem(this.getParentId(checkedItemId));
if (!parentForCheckedItem.checked) {
filtersChangedData.push({
view: data.type,
datatype: checkedItem.datatype,
key: labelId,
filterName: data.name,
value: getTreeOptionValueById(checkedItem.id),
status: "equals",
treeCheckboxFlag: true,
diagnosisLevel: checkedItem.level,
optionId: checkedItem.id,
viewId: `treeTable-${data.id}`,
remove: false,
});
}
});
}
this.getTopParentView().$scope.app.callEvent("filtersChanged", [filtersChangedData]);
}
Expand Down

0 comments on commit f82e0a7

Please sign in to comment.