Skip to content
This repository was archived by the owner on Apr 18, 2024. It is now read-only.

Commit 5b1d692

Browse files
authored
feat: LSDV: 5016 Outliner manual group sort order arrow (#1343)
* feat: lsdv-5016: Shorten display name, add sort arrow button * fix manuel label
1 parent 8b919e7 commit 5b1d692

File tree

2 files changed

+44
-23
lines changed

2 files changed

+44
-23
lines changed

src/components/SidePanels/OutlinerPanel/ViewControls.styl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
background-color #fff
1313
box-shadow 0 1px 0 rgba(#000, 0.1)
1414

15+
&__sort
16+
display flex
17+
1518
&__label
1619
width 100%
1720
display flex

src/components/SidePanels/OutlinerPanel/ViewControls.tsx

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -39,21 +39,21 @@ export const ViewControls: FC<ViewControlsProps> = ({
3939
onFilterChange,
4040
}) => {
4141
const context = useContext(SidePanelsContext);
42-
const getGrouppingLabels = useCallback((value: GroupingOptions): LabelInfo => {
42+
const getGroupingLabels = useCallback((value: GroupingOptions): LabelInfo => {
4343
switch(value) {
4444
case 'manual': return {
4545
label: 'Group Manually',
46-
selectedLabel: 'Manual Grouping',
46+
selectedLabel: isFF(FF_DEV_3873) ? 'Manual': 'Manual Grouping',
4747
icon: <IconList/>,
4848
};
4949
case 'label': return {
5050
label: 'Group by Label',
51-
selectedLabel: 'Grouped by Label',
51+
selectedLabel: isFF(FF_DEV_3873) ? 'Label': 'Grouped by Label',
5252
icon: <IconTagAlt/>,
5353
};
5454
case 'type': return {
5555
label: 'Group by Tool',
56-
selectedLabel: 'Grouped by Tool',
56+
selectedLabel: isFF(FF_DEV_3873) ? 'Tool': 'Grouped by Tool',
5757
icon: <IconCursor/>,
5858
};
5959
}
@@ -80,32 +80,50 @@ export const ViewControls: FC<ViewControlsProps> = ({
8080
value={grouping}
8181
options={['manual', 'type', 'label']}
8282
onChange={value => onGroupingChange(value)}
83-
readableValueForKey={getGrouppingLabels}
83+
readableValueForKey={getGroupingLabels}
8484
/>
8585
{grouping === 'manual' && (
86-
<Grouping
87-
value={ordering}
88-
direction={orderingDirection}
89-
options={['score', 'date']}
90-
onChange={value => onOrderingChange(value)}
91-
readableValueForKey={getOrderingLabels}
92-
allowClickSelected
93-
/>
86+
<Elem name="sort">
87+
<Grouping
88+
value={ordering}
89+
direction={orderingDirection}
90+
options={['score', 'date']}
91+
onChange={value => onOrderingChange(value)}
92+
readableValueForKey={getOrderingLabels}
93+
allowClickSelected
94+
/>
95+
{isFF(FF_DEV_3873) && (
96+
<Button
97+
type="text"
98+
icon={
99+
orderingDirection === 'asc' ? (
100+
<IconSortUp style={{ color: '#898098' }} />
101+
) : (
102+
<IconSortDown style={{ color: '#898098' }} />
103+
)
104+
}
105+
style={{ padding: 0, whiteSpace: 'nowrap' }}
106+
onClick={() => onOrderingChange(ordering)}
107+
/>
108+
)}
109+
</Elem>
94110
)}
95111
{isFF(FF_DEV_3873) && (
96112
<Filter
97113
onChange={onFilterChange}
98114
filterData={regions?.regions}
99-
availableFilters={[{
100-
label: 'Annotation results',
101-
path: 'labelName',
102-
type: 'String',
103-
},
104-
{
105-
label: 'Confidence score',
106-
path: 'score',
107-
type: 'Number',
108-
}]}
115+
availableFilters={[
116+
{
117+
label: 'Annotation results',
118+
path: 'labelName',
119+
type: 'String',
120+
},
121+
{
122+
label: 'Confidence score',
123+
path: 'score',
124+
type: 'Number',
125+
},
126+
]}
109127
/>
110128
)}
111129
</Block>

0 commit comments

Comments
 (0)