Skip to content

Commit db6c8c2

Browse files
Merge branch 'dev' into stack-tab-in-components
2 parents ad3dbcf + 72307b8 commit db6c8c2

File tree

2 files changed

+78
-57
lines changed

2 files changed

+78
-57
lines changed

src/ui/layouts/pipelines/Pipelines/List/getHeaderCols.tsx

Lines changed: 41 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {
66
Box,
77
FlexBox,
88
icons,
9-
LinkBox,
9+
// LinkBox,
1010
Paragraph,
1111
} from '../../../../components';
1212
import { HeaderCol } from '../../../common/Table';
@@ -47,40 +47,51 @@ export const GetHeaderCols = ({
4747
activeSortingDirection,
4848
filteredPipelines,
4949
});
50+
console.log('expendedRow', expendedRow);
5051
return [
5152
{
5253
width: '3%',
5354
renderRow: (pipeline: TPipeline) => (
54-
<LinkBox
55-
style={{ padding: 0 }}
56-
onClick={(e: Event) => {
57-
e.stopPropagation();
58-
if (openPipelineIds.indexOf(pipeline.id) === -1) {
59-
setOpenPipelineIds([...openPipelineIds, pipeline.id]);
60-
} else {
61-
setOpenPipelineIds(
62-
openPipelineIds.filter((id: TId) => id !== pipeline.id),
63-
);
64-
}
65-
}}
55+
<FlexBox
56+
justifyContent="center"
57+
style={{ paddingTop: '5px', paddingBottom: '5px' }}
6658
>
67-
<FlexBox
68-
justifyContent="center"
69-
style={{ paddingTop: '5px', paddingBottom: '5px' }}
70-
>
71-
{openPipelineIds.indexOf(pipeline.id) === -1 ? (
72-
<icons.chevronDownLight
73-
color={iconColors.grey}
74-
size={iconSizes.sm}
75-
/>
76-
) : (
77-
<icons.chevronUpLight
78-
color={iconColors.grey}
79-
size={iconSizes.sm}
80-
/>
81-
)}
82-
</FlexBox>
83-
</LinkBox>
59+
{expendedRow?.length === 1 ? (
60+
<icons.chevronDown color={iconColors.grey} size={iconSizes.sm} />
61+
) : (
62+
<icons.rightArrow color={iconColors.grey} size={iconSizes.sm} />
63+
)}
64+
</FlexBox>
65+
// <LinkBox
66+
// style={{ padding: 0 }}
67+
// onClick={(e: Event) => {
68+
// e.stopPropagation();
69+
// if (openPipelineIds.indexOf(pipeline.id) === -1) {
70+
// setOpenPipelineIds([...openPipelineIds, pipeline.id]);
71+
// } else {
72+
// setOpenPipelineIds(
73+
// openPipelineIds.filter((id: TId) => id !== pipeline.id),
74+
// );
75+
// }
76+
// }}
77+
// >
78+
// <FlexBox
79+
// justifyContent="center"
80+
// style={{ paddingTop: '5px', paddingBottom: '5px' }}
81+
// >
82+
// {openPipelineIds.indexOf(pipeline.id) === -1 ? (
83+
// <icons.chevronDownLight
84+
// color={iconColors.grey}
85+
// size={iconSizes.sm}
86+
// />
87+
// ) : (
88+
// <icons.chevronUpLight
89+
// color={iconColors.grey}
90+
// size={iconSizes.sm}
91+
// />
92+
// )}
93+
// </FlexBox>
94+
// </LinkBox>
8495
),
8596
},
8697
{

src/ui/layouts/stacks/Stacks/List/getHeaderCols.tsx

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import _ from 'lodash';
2-
import React, { useState } from 'react';
2+
import React from 'react';
33
import ReactTooltip from 'react-tooltip';
44
import { iconColors, iconSizes, ID_MAX_LENGTH } from '../../../../../constants';
55
import {
@@ -11,7 +11,7 @@ import {
1111
Box,
1212
FlexBox,
1313
icons,
14-
LinkBox,
14+
// LinkBox,
1515
Paragraph,
1616
} from '../../../../components';
1717
import { HeaderCol } from '../../../common/Table';
@@ -21,7 +21,7 @@ import { useService } from './ForSorting/useServiceForSorting';
2121

2222
export const GetHeaderCols = ({
2323
expendedRow,
24-
openStackIds,
24+
// openStackIds,
2525
setOpenStackIds,
2626
filteredStacks,
2727
setFilteredStacks,
@@ -49,35 +49,45 @@ export const GetHeaderCols = ({
4949
filteredStacks,
5050
});
5151

52-
const [toggle, setToggle] = useState(false);
52+
// const [toggle, setToggle] = useState(false);
5353
return [
5454
{
5555
width: '3%',
5656
renderRow: (stack: TStack) => (
57-
<LinkBox
58-
onClick={(e: Event) => {
59-
setToggle(!toggle);
60-
e.stopPropagation();
61-
if (openStackIds.indexOf(stack.id) === -1) {
62-
setOpenStackIds([...openStackIds, stack.id]);
63-
} else {
64-
setOpenStackIds(
65-
openStackIds.filter((id: TId) => id !== stack.id),
66-
);
67-
}
68-
}}
57+
<FlexBox
58+
justifyContent="center"
59+
style={{ paddingTop: '5px', paddingBottom: '5px' }}
6960
>
70-
<FlexBox
71-
justifyContent="center"
72-
style={{ paddingTop: '5px', paddingBottom: '5px' }}
73-
>
74-
{openStackIds.indexOf(stack.id) === -1 ? (
75-
<icons.rightArrow color={iconColors.grey} size={iconSizes.sm} />
76-
) : (
77-
<icons.chevronDown color={iconColors.grey} size={iconSizes.sm} />
78-
)}
79-
</FlexBox>
80-
</LinkBox>
61+
{expendedRow.length === 1 ? (
62+
<icons.chevronDown color={iconColors.grey} size={iconSizes.sm} />
63+
) : (
64+
<icons.rightArrow color={iconColors.grey} size={iconSizes.sm} />
65+
)}
66+
</FlexBox>
67+
// <LinkBox
68+
// onClick={(e: Event) => {
69+
// setToggle(!toggle);
70+
// e.stopPropagation();
71+
// if (openStackIds.indexOf(stack.id) === -1) {
72+
// setOpenStackIds([...openStackIds, stack.id]);
73+
// } else {
74+
// setOpenStackIds(
75+
// openStackIds.filter((id: TId) => id !== stack.id),
76+
// );
77+
// }
78+
// }}
79+
// >
80+
// <FlexBox
81+
// justifyContent="center"
82+
// style={{ paddingTop: '5px', paddingBottom: '5px' }}
83+
// >
84+
// {openStackIds.indexOf(stack.id) === -1 ? (
85+
// <icons.rightArrow color={iconColors.grey} size={iconSizes.sm} />
86+
// ) : (
87+
// <icons.chevronDown color={iconColors.grey} size={iconSizes.sm} />
88+
// )}
89+
// </FlexBox>
90+
// </LinkBox>
8191
),
8292
},
8393
{

0 commit comments

Comments
 (0)