Skip to content

Commit 21f589c

Browse files
committed
fix: update button sizes and improve layout in chart components
1 parent e523974 commit 21f589c

File tree

5 files changed

+34
-32
lines changed

5 files changed

+34
-32
lines changed

src/components/charts/list/AddChartSource.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const AddChartSource = ({ text }: { text?: string }) => (
2727
text,
2828
dataTestId: 'add-chart-source-button',
2929
startIcon: <Icon name="ic-add" color="B500" />,
30-
size: ComponentSizeType.xxs,
30+
size: ComponentSizeType.small,
3131
variant: ButtonVariantType.borderLess,
3232
}}
3333
/>

src/components/charts/list/ChartListPopUpRow.tsx

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,13 @@
1515
*/
1616

1717
import { useState } from 'react'
18-
import Tippy from '@tippyjs/react'
1918
import {
19+
Button,
20+
ButtonStyleType,
21+
ButtonVariantType,
22+
ComponentSizeType,
2023
DTSwitch,
21-
Progressing,
24+
Icon,
2225
RegistryIcon,
2326
RegistryType,
2427
showError,
@@ -27,7 +30,6 @@ import {
2730
} from '@devtron-labs/devtron-fe-common-lib'
2831
import { List } from '../../globalConfigurations/GlobalConfiguration'
2932
import { updateChartProviderList, updateSyncSpecificChart } from '../charts.service'
30-
import { ReactComponent as SyncIcon } from '../../../assets/icons/ic-arrows_clockwise.svg'
3133
import { ReactComponent as Helm } from '../../../assets/icons/ic-helmchart.svg'
3234
import { ChartListType } from '../charts.types'
3335
import { getNonEditableChartRepoText } from '../../common'
@@ -113,25 +115,18 @@ const ChartListPopUpRow = ({
113115
<Helm className="icon-dim-20 fcb-5 dc__vertical-align-middle " />
114116
)}
115117
</List.Logo>
116-
<div className="dc__truncate-text">{list.name}</div>
117-
<Tippy className="default-tt" arrow={false} placement="top" content="Refetch charts">
118-
<a
119-
rel="noreferrer noopener"
120-
target="_blank"
121-
className={`dc__link ${!isSpecificChartRefetchLoading ? 'cursor' : ''} ${
122-
!enabled ? 'cursor-not-allowed' : ''
123-
}`}
124-
onClick={() => enabled && refetchSpecificChart(list.id, list.isOCIRegistry)}
125-
>
126-
{isSpecificChartRefetchLoading ? (
127-
<Progressing size={16} fillColor="var(--N500)" />
128-
) : (
129-
<span>
130-
<SyncIcon className={`${enabled ? 'scn-5' : 'scn-2'}`} />
131-
</span>
132-
)}
133-
</a>
134-
</Tippy>
118+
<span className="dc__truncate-text cn-9">{list.name}</span>
119+
<Button
120+
dataTestId="chart-refetch-button"
121+
isLoading={isSpecificChartRefetchLoading}
122+
disabled={!enabled}
123+
onClick={() => refetchSpecificChart(list.id, list.isOCIRegistry)}
124+
icon={<Icon name="ic-arrows-clockwise" color={enabled ? 'N500' : 'N200'} />}
125+
ariaLabel="Refetch charts"
126+
variant={ButtonVariantType.borderLess}
127+
style={ButtonStyleType.neutral}
128+
size={ComponentSizeType.xxs}
129+
/>
135130

136131
<div className="ml-auto">
137132
<DTSwitch

src/components/charts/list/ChartsList.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export const ChartsList = ({ chartsList, isLoading }: ChartsListProps) => {
3737
// HOOKS
3838
const { open, overlayProps, popoverProps, scrollableRef, triggerProps, closePopover } = usePopover({
3939
id: 'chart-list-popover',
40+
variant: 'overlay',
4041
alignment: 'middle',
4142
width: 400,
4243
})
@@ -132,6 +133,7 @@ export const ChartsList = ({ chartsList, isLoading }: ChartsListProps) => {
132133
dataTestId="chart-store-search-box"
133134
initialSearchText={searchText}
134135
containerClassName="p-12"
136+
size={ComponentSizeType.large}
135137
handleEnter={handleSearchEnter}
136138
inputProps={{
137139
placeholder: 'Search by repository or registry',
@@ -202,14 +204,14 @@ export const ChartsList = ({ chartsList, isLoading }: ChartsListProps) => {
202204
}}
203205
>
204206
<div className="charts-list flexbox-col mh-400">
205-
<div className="flex dc__content-space px-16 pt-12 pb-11 border__primary--bottom">
206-
<h4 className="m-0 fs-14 lh-1-5 fw-6">Helm chart sources</h4>
207+
<div className="flex dc__content-space px-16 pt-10 pb-9 border__primary--bottom">
208+
<h4 className="m-0 fs-14 lh-1-5 fw-6 cn-9">Helm chart sources</h4>
207209
<div className="flex dc__gap-12">
208210
<AddChartSource text="Add" />
209211
<Button
210212
isLoading={isFetching}
211213
icon={<Icon name="ic-arrows-clockwise" color={null} />}
212-
size={ComponentSizeType.xxs}
214+
size={ComponentSizeType.small}
213215
variant={ButtonVariantType.borderLess}
214216
dataTestId="chart-store-refetch-button"
215217
ariaLabel="Refetch charts"
@@ -219,7 +221,7 @@ export const ChartsList = ({ chartsList, isLoading }: ChartsListProps) => {
219221
<Button
220222
icon={<Icon name="ic-close-large" size={16} color={null} />}
221223
onClick={closePopover}
222-
size={ComponentSizeType.xxs}
224+
size={ComponentSizeType.small}
223225
variant={ButtonVariantType.borderLess}
224226
dataTestId="chart-store-close-button"
225227
showAriaLabelInTippy={false}

src/components/charts/list/DiscoverCharts.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -677,16 +677,18 @@ const ChartListHeader = ({ charts }) => (
677677
<h3 className="chart-grid__title pl-20 pr-20 pt-16" data-testid="chart-store-chart-heading">
678678
{charts.length === 0 ? 'All Charts' : 'Select Charts'}
679679
</h3>
680-
<p className="mb-0 mt-4 pl-20" data-testid="chart-store-list-subheading">
681-
Select chart to deploy. &nbsp;
680+
<div className="flex left dc__gap-4 mt-4 pl-20">
681+
<p className="m-0" data-testid="chart-store-list-subheading">
682+
Select chart to deploy.
683+
</p>
682684
<DocLink
683685
dataTestId="chart-group-link"
684686
docLinkKey="CHART_LIST"
685687
text="Learn how to deploy charts"
686688
fontWeight="normal"
687689
size={ComponentSizeType.small}
688690
/>
689-
</p>
691+
</div>
690692
</div>
691693
)
692694

src/components/charts/list/list.scss

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
padding: 16px 20px;
2424
}
2525

26-
2726
.selected-widgets-container {
2827
overflow: auto;
2928

@@ -66,7 +65,6 @@
6665
background-size: contain;
6766
}
6867

69-
7068
.popup-button {
7169
border: unset;
7270
width: unset;
@@ -390,8 +388,13 @@
390388
}
391389

392390
.chart-list__row .list {
391+
background: transparent;
393392
height: 36px;
394393
cursor: auto;
394+
395+
&:hover {
396+
background: var(--bg-hover);
397+
}
395398
}
396399
}
397400

0 commit comments

Comments
 (0)