+
(
isActive && 'bg-primary-dark'
)}
>
-
+
- {label}
+
+ {label}
+
);
diff --git a/platform/ui/src/components/SplitButton/SplitButton.mdx b/platform/ui/src/components/SplitButton/SplitButton.mdx
index 00804b43f..016b81c68 100644
--- a/platform/ui/src/components/SplitButton/SplitButton.mdx
+++ b/platform/ui/src/components/SplitButton/SplitButton.mdx
@@ -24,7 +24,7 @@ import { SplitButton, WindowLevelMenuItem } from '@ohif/ui';
primary: {
tooltip: 'W/L',
icon: 'tool-window-level',
- onClick: (args) => console.debug('Primary click!', args)
+ onClick: args => console.debug('Primary click!', args),
},
secondary: {
icon: 'chevron-down',
@@ -33,23 +33,43 @@ import { SplitButton, WindowLevelMenuItem } from '@ohif/ui';
tooltip: 'More Measure Tools',
},
items: [
- { id: '1', icon: 'tool-layout', label: 'Layout', onClick: (args) => console.debug('Item click!', args) },
- { id: '2', icon: 'tool-window-level', label: 'W/L', onClick: (args) => console.debug('Item click!', args) },
- { id: '3', icon: 'tool-length', label: 'Length', onClick: (args) => console.debug('Item click!', args) }
+ {
+ id: '1',
+ icon: 'tool-layout',
+ label: 'Layout',
+ onClick: args => console.debug('Item click!', args),
+ },
+ {
+ id: '2',
+ icon: 'tool-window-level',
+ label: 'W/L',
+ onClick: args => console.debug('Item click!', args),
+ },
+ {
+ id: '3',
+ icon: 'tool-length',
+ label: 'Length',
+ onClick: args => console.debug('Item click!', args),
+ },
],
- onClick: (args) => console.debug('Any click!', args)
+ onClick: args => console.debug('Any click!', args),
};
return (
-
diff --git a/platform/ui/src/components/StudyListFilter/StudyListFilter.jsx b/platform/ui/src/components/StudyListFilter/StudyListFilter.jsx
index ab71cd0fe..5b82b0c23 100644
--- a/platform/ui/src/components/StudyListFilter/StudyListFilter.jsx
+++ b/platform/ui/src/components/StudyListFilter/StudyListFilter.jsx
@@ -61,7 +61,7 @@ const StudyListFilter = ({
{
onInteraction({
diff --git a/platform/ui/src/views/Viewer/Viewer.js b/platform/ui/src/views/Viewer/Viewer.js
index ecaeadab5..706e427a2 100644
--- a/platform/ui/src/views/Viewer/Viewer.js
+++ b/platform/ui/src/views/Viewer/Viewer.js
@@ -11,7 +11,7 @@ const Viewer = () => {
{/* LEFT SIDEPANELS */}
{
- const noSortApplied = sortBy === '' || !sortBy;
- const sortModifier = sortDirection === 'descending' ? 1 : -1;
+ const canSort = studiesTotal < STUDIES_LIMIT;
+ const shouldUseDefaultSort = sortBy === '' || !sortBy;
+ const sortModifier = sortDirection === 'descending' ? 1 : -1;
+ const defaultSortValues =
+ shouldUseDefaultSort && canSort
+ ? { sortBy: 'studyDate', sortDirection: 'ascending' }
+ : {};
+ const sortedStudies = studies;
- if (noSortApplied && studiesTotal < STUDIES_LIMIT) {
+ if (canSort) {
+ studies.sort((s1, s2) => {
+ if (shouldUseDefaultSort) {
const ascendingSortModifier = -1;
- defaultSortValues = { sortBy: 'studyDate', sortDirection: 'ascending' };
return _sortStringDates(s1, s2, ascendingSortModifier);
- } else if (noSortApplied) {
- return 0;
}
const s1Prop = s1[sortBy];
@@ -96,6 +96,7 @@ function WorkList({
return 0;
});
+ }
// ~ Rows & Studies
const [expandedRows, setExpandedRows] = useState([]);