Skip to content

Commit ec5c618

Browse files
committed
feat(FOROME-1305): rework attribute selection
1 parent d8e8368 commit ec5c618

File tree

11 files changed

+33
-41
lines changed

11 files changed

+33
-41
lines changed

src/components/input-search/input-search.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ interface IInputSearchProps {
1515
canClearInput?: boolean
1616
}
1717

18-
// eslint-disable-next-line react/display-name
1918
export const InputSearch = memo(
2019
({ ...rest }: IInputSearchProps): ReactElement => {
2120
const { className, big = false, canClearInput = true, ...tempRest } = rest

src/components/popup-card/popup-card.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable react/display-name */
21
import React from 'react'
32
import cn, { Argument } from 'classnames'
43

src/components/prediction-power-indicator/prediction-power-indicator.styles.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import styled from 'styled-components'
22

33
import { theme } from '@theme'
44

5-
const getSize = (size: 'sm' | 'md'): number => (size === 'sm' ? 6 : 8)
5+
const getSize = (size: 'sm' | 'md'): number => (size === 'sm' ? 6 : 12)
66

77
const colors = [theme('colors.grey.blue'), '#fde66b', '#98e18b', '#19af00']
88

@@ -30,9 +30,9 @@ export const PredictionPowerPoint = styled.span<{
3030
vertical-align: middle;
3131
line-height: 0;
3232
overflow: hidden;
33-
border-radius: 4px;
33+
border-radius: 13px;
3434
35-
width: ${props => getSize(props.size)}px;
36-
height: ${props => getSize(props.size)}px;
35+
width: 3px;
36+
height: ${({ size }) => getSize(size)}px;
3737
background-color: ${props => colors[props.colorIndex]};
3838
`

src/components/units-list/units-list-group/units-list-group.module.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929
}
3030

3131
&__title {
32-
flex: 1 0 auto
32+
@apply typography-m;
33+
34+
font-weight: 500;
35+
color: theme("colors.grey.blue");
36+
flex: 1 0 auto;
3337
}
3438
}

src/components/units-list/units-list-group/units-list-group.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export const UnitsListGroup = ({
4444
<PredictionPowerIndicator className="mr-2" value={power} />
4545
)}
4646
<span className={styles.groupHeader__title}>{name}</span>
47-
<DropdownArrow isOpen={!isCollapsed} />
47+
<DropdownArrow isOpen={!isCollapsed} dark />
4848
</div>
4949
{!isCollapsed &&
5050
attributes.map(unit => (

src/components/units-list/units-list-unit/units-list-unit.module.css

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,19 @@
66
display: flex;
77
align-items: center;
88

9-
&__add-button {
10-
flex: 0 0 auto;
11-
width: 16px;
12-
height: 16px;
13-
margin-right: theme("spacing[1.5]");
14-
display: flex;
15-
align-items: center;
16-
justify-content: center;
17-
color: theme("colors.white");
18-
background: theme("colors.blue.bright");
19-
font-size: 16px;
20-
border-radius: 8px;
21-
overflow: hidden;
22-
cursor: pointer;
23-
24-
&:hover {
25-
background: theme("colors.blue.dark");
26-
}
9+
&:hover {
10+
color: theme("colors.grey.blue");
2711
}
2812

2913
&__title {
30-
flex: 1 0 auto;
14+
margin-right: 10px;
3115
color: theme("colors.black");
3216
cursor: pointer;
3317

3418
@apply typography-s;
3519

20+
font-weight: 500;
21+
3622
&:hover {
3723
color: theme("colors.blue.dark");
3824
}
@@ -41,7 +27,7 @@
4127
color: theme("colors.white");
4228

4329
&:hover {
44-
color: theme("colors.white");
30+
color: theme("colors.grey.blue");
4531
}
4632
}
4733
}

src/components/units-list/units-list-unit/units-list-unit.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ReactElement, useCallback, useState } from 'react'
44
import cn, { Argument } from 'classnames'
55

66
import { TUnit } from '@store/stat-units'
7+
import { DropdownArrow } from '@ui/dropdown-arrow'
78
import { PredictionPowerIndicator } from '@components/prediction-power-indicator'
89
import { AttributeKinds } from '@service-providers/common'
910
import { UnitChart } from '../unit-chart'
@@ -36,17 +37,14 @@ export const UnitsListUnit = ({
3637
unit.histogram &&
3738
unit.histogram.length > 0))
3839

39-
const onClickUnitName = useCallback(
40+
const openCharts = useCallback(
4041
() => setChartVisible(!!hasChart && !isChartVisible),
4142
[hasChart, isChartVisible],
4243
)
4344

4445
return (
4546
<div className={cn(styles.unit, className)}>
4647
<div className={styles.unitTitle}>
47-
<button className={styles.unitTitle__addButton} onClick={onSelect}>
48-
+
49-
</button>
5048
{unit.power && (
5149
<PredictionPowerIndicator
5250
className={styles.unitTitle__power}
@@ -57,12 +55,13 @@ export const UnitsListUnit = ({
5755
<UnitsListUnitName
5856
tooltip={tooltip}
5957
name={name}
60-
onClick={onClickUnitName}
58+
onClick={onSelect}
6159
className={cn(
6260
styles.unitTitle__title,
6361
isDark && styles.unitTitle__title_dark,
6462
)}
6563
/>
64+
<DropdownArrow size="sm" isOpen={isChartVisible} onClick={openCharts} />
6665
</div>
6766
{hasChart && isChartVisible && <UnitChart className="mt-2" unit={unit} />}
6867
</div>

src/pages/filter/dtree/components/query-builder/ui/next-step/content-code/content-code.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ interface IContentCodeProps {
99
codeResult: string
1010
}
1111

12-
// eslint-disable-next-line react/display-name
1312
export const ContentCode = memo(
1413
({ codeCondition, codeResult }: IContentCodeProps): ReactElement => (
1514
<div className={styles.contentCode}>

src/pages/main/components/sidebar/datasets-list/datasets-list.utils.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { IDirInfoDatasetDescriptor } from '@service-providers/vault-level/vault-
44

55
export const datasetNameByKey =
66
(level: number = 0) =>
7-
// eslint-disable-next-line react/display-name
87
(key: string) => {
98
const { dirInfoData } = dirinfoStore
109

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.arrow {
2-
border-left: 1px solid;
3-
border-bottom: 1px solid;
4-
width: 6px;
5-
height: 6px;
2+
border-left: 2px solid;
3+
border-bottom: 2px solid;
4+
width: 8px;
5+
height: 8px;
66
transform-origin: 35% 65%;
77
transform: rotate(-45deg);
88
transition: transform 0.15s ease-in-out;
@@ -12,8 +12,12 @@
1212
transform: rotate(135deg);
1313
}
1414

15+
&_black {
16+
color: theme("colors.blue.darkHover");
17+
}
18+
1519
&_sm {
16-
width: 4px;
17-
height: 4px;
20+
width: 6px;
21+
height: 6px;
1822
}
1923
}

src/ui/dropdown-arrow/dropdown-arrow.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ import cn from 'classnames'
66
interface IDropdownArrowProps extends Omit<HTMLProps<HTMLSpanElement>, 'size'> {
77
size?: 'md' | 'sm'
88
isOpen?: boolean
9+
dark?: boolean
910
}
1011

1112
export const DropdownArrow = ({
1213
className,
1314
size = 'md',
1415
isOpen,
16+
dark,
1517
...htmlProps
1618
}: IDropdownArrowProps): ReactElement => {
1719
return (
@@ -20,6 +22,7 @@ export const DropdownArrow = ({
2022
styles.arrow,
2123
isOpen && styles.arrow_open,
2224
styles[`arrow_${size}`],
25+
dark && styles.arrow_black,
2326
className,
2427
)}
2528
{...htmlProps}

0 commit comments

Comments
 (0)