Skip to content

Commit

Permalink
fix: browse helm charts when empty
Browse files Browse the repository at this point in the history
  • Loading branch information
mortada-codes committed Jun 22, 2023
1 parent 93e473a commit 7d7ce2c
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/components/organisms/DashboardPane/HelmReleasesList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {Typography} from 'antd';
import styled, {css} from 'styled-components';

import {useAppDispatch, useAppSelector} from '@redux/hooks';
import {setSelectedHelmRelease} from '@redux/reducers/ui';
import {setLeftMenuSelection, setSelectedHelmRelease} from '@redux/reducers/ui';

import {HelmRelease} from '@shared/models/ui';
import {Colors} from '@shared/styles';
Expand All @@ -30,9 +30,18 @@ const HelmReleasesList = ({list}: {list: HelmRelease[]}) => {
dispatch(setSelectedHelmRelease(chart));
};

const onBrowseHelmClickHandler = () => {
dispatch(setSelectedHelmRelease(null));
dispatch(setLeftMenuSelection('helm'));
};

return list.length === 0 ? (
<div style={{marginTop: 16}}>
<Typography.Text type="secondary">No Helm releases found</Typography.Text>
<Typography.Text type="secondary">
No Helm releases found - try the{' '}
<Typography.Link onClick={onBrowseHelmClickHandler}>[Helm Repository Browser]</Typography.Link> to find a chart
to install
</Typography.Text>
</div>
) : (
<ListContainer style={{marginTop: 16}} ref={ref}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const HelmReleasesPane: React.FC<InjectedPanelProps> = props => {

const {value: list = [], loading} = useAsync(async () => {
const output = await runCommandInMainThread(
listHelmReleasesCommand({filter: helmRepoSearch, namespace: selectedNamespace})
listHelmReleasesCommand({filter: helmRepoSearch, namespace: selectedNamespace?.replace('<all>', '')})
);
if (output.stderr) {
throw new Error(output.stderr);
Expand Down

0 comments on commit 7d7ce2c

Please sign in to comment.