mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Fix: deprecated helm chart filtering (#2158)
* Refactor of excludeDeprecated helm service method Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Pick first helm chart from the list on load Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Removing helm filtering in UI Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Cleaning up Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Cleaning up type definitions Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Adding sorting charts by version Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Adding tests for methods that manipute chart listing Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Cleaning up tests a bit Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com> * Adding semver coercion before comparing versions Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
1 parent
103467d31b
commit
6876d774a5
6 files changed
+246
-31
No files matched your search
@@ -3,11 +3,8 @@ import { apiBase } from "../index";
|
||||
import { stringify } from "querystring";
|
||||
import { autobind } from "../../utils";
|
||||
|
||||
interface IHelmChartList {
|
||||
[repo: string]: {
|
||||
[name: string]: HelmChart;
|
||||
};
|
||||
}
|
||||
export type RepoHelmChartList = Record<string, HelmChart[]>;
|
||||
export type HelmChartList = Record<string, RepoHelmChartList>;
|
||||
|
||||
export interface IHelmChartDetails {
|
||||
readme: string;
|
||||
@@ -22,12 +19,12 @@ const endpoint = compile(`/v2/charts/:repo?/:name?`) as (params?: {
|
||||
export const helmChartsApi = {
|
||||
list() {
|
||||
return apiBase
|
||||
.get<IHelmChartList>(endpoint())
|
||||
.get<HelmChartList>(endpoint())
|
||||
.then(data => {
|
||||
return Object
|
||||
.values(data)
|
||||
.reduce((allCharts, repoCharts) => allCharts.concat(Object.values(repoCharts)), [])
|
||||
.map(HelmChart.create);
|
||||
.map(([chart]) => HelmChart.create(chart));
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@@ -72,9 +72,6 @@ export class HelmCharts extends Component<Props> {
|
||||
(chart: HelmChart) => chart.getAppVersion(),
|
||||
(chart: HelmChart) => chart.getKeywords(),
|
||||
]}
|
||||
filterItems={[
|
||||
(items: HelmChart[]) => items.filter(item => !item.deprecated)
|
||||
]}
|
||||
customizeHeader={() => (
|
||||
<SearchInputUrl placeholder="Search Helm Charts" />
|
||||
)}
|
||||
|
||||
Reference in new issue
Block a user