Skip to content

Commit 8d4e9f8

Browse files
author
GaelleA
committed
feat(facet): FLUI-144 add category icon in toggle facet
1 parent 755a811 commit 8d4e9f8

File tree

6 files changed

+47
-30
lines changed

6 files changed

+47
-30
lines changed

packages/ui/Release.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
### 10.13.2 2024-11-13
2+
- feat: FLUI-144 Add category icon in toggle facet
3+
14
### 10.13.1 2024-11-12
2-
- feat: SJIP-281 Add category icon in facet and quick filter
5+
- feat: SJIP-281 Add category icon in checkbox facet and quick filter
36

47
### 10.13.0 2024-11-06
58
- feat: CLIN-2923 Improve Pro Label by adding tooltip option

packages/ui/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/ui/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ferlab/ui",
3-
"version": "10.13.1",
3+
"version": "10.13.2",
44
"description": "Core components for scientific research data portals",
55
"publishConfig": {
66
"access": "public"

packages/ui/src/components/filters/CheckboxFilter/CheckboxFilter.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React, { Fragment, useEffect, useState } from 'react';
2-
import { FileImageOutlined } from '@ant-design/icons';
32
import { Button, Checkbox, Divider, Dropdown, Input, Space, Switch, Tag, Typography } from 'antd';
43
import cx from 'classnames';
54
import get from 'lodash/get';
Lines changed: 31 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,50 @@
11
.radioGroup {
2-
display: flex;
3-
flex-direction: column;
4-
width: 100%;
2+
display: flex;
3+
flex-direction: column;
4+
width: 100%;
55
}
66
.radioGroup :global(.ant-radio-wrapper):last-child {
7-
margin-bottom: 0;
7+
margin-bottom: 0;
88
}
99
.radioGroup > * {
10-
margin-bottom: 0.8rem;
11-
width: 100%;
10+
margin-bottom: 0.8rem;
11+
width: 100%;
1212
}
1313
.radioGroup > label {
14-
display: flex;
14+
display: flex;
1515
}
1616
.radioGroup > label > span:last-child {
17-
display: flex;
18-
justify-content: space-between;
19-
width: 100%;
20-
padding-right: 0px;
17+
display: flex;
18+
justify-content: space-between;
19+
width: 100%;
20+
padding-right: 0px;
2121
}
2222

2323
.clearButton {
24-
padding: 0 7px;
25-
height: auto;
26-
color: var(--toggle-filter-sc-button-color);
24+
padding: 0 7px;
25+
height: auto;
26+
color: var(--toggle-filter-sc-button-color);
2727
}
2828

2929
.actions {
30-
border-top: 1px solid var(--filter-actions-border-color);
31-
display: flex;
32-
justify-content: flex-end;
33-
margin-top: 17px;
34-
padding-top: 13px;
30+
border-top: 1px solid var(--filter-actions-border-color);
31+
display: flex;
32+
justify-content: flex-end;
33+
margin-top: 17px;
34+
padding-top: 13px;
3535
}
3636

3737
.noResultsText {
38-
background: var(--filter-no-results-text-background-color);
39-
color: var(--filter-no-results-text-color);
40-
font-size: 14px;
41-
line-height: 22px;
42-
padding: 8px 16px;
43-
width: 100%;
38+
background: var(--filter-no-results-text-background-color);
39+
color: var(--filter-no-results-text-color);
40+
font-size: 14px;
41+
line-height: 22px;
42+
padding: 8px 16px;
43+
width: 100%;
44+
}
45+
46+
.categoryIcon {
47+
display: flex;
48+
justify-content: flex-end;
49+
margin: -8px 0 8px;
4450
}

packages/ui/src/components/filters/ToggleFilter.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { Button, Radio, Space, Tag } from 'antd';
33
import { isEmpty } from 'lodash';
44
import get from 'lodash/get';
55

6+
import StackLayout from '../../layout/StackLayout';
67
import { numberFormat } from '../../utils/numberUtils';
78
import { removeUnderscoreAndCapitalize } from '../../utils/stringUtils';
89

@@ -48,12 +49,20 @@ const ToggleFilter = ({
4849
};
4950
});
5051

52+
const showCategoryIcon = filterGroup.config?.categoryIcon;
53+
5154
return isEmpty(options) ? (
5255
<Space className={styles.noResultsText} direction="vertical">
5356
{get(dictionary, 'messages.errorNoData', 'No values found for this request')}
5457
</Space>
5558
) : (
5659
<>
60+
{showCategoryIcon && (
61+
<StackLayout className={styles.categoryIcon}>
62+
<Space>{showCategoryIcon}</Space>
63+
</StackLayout>
64+
)}
65+
5766
<Radio.Group
5867
className={styles.radioGroup}
5968
onChange={(e) => {

0 commit comments

Comments
 (0)