Skip to content

Commit

Permalink
release modal and eslint working good now
Browse files Browse the repository at this point in the history
  • Loading branch information
nir2002 committed Aug 2, 2023
1 parent 93f70d3 commit ebfedb9
Show file tree
Hide file tree
Showing 6 changed files with 7,938 additions and 8,049 deletions.
13 changes: 7 additions & 6 deletions dashboard/.eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,17 @@ module.exports = {
heap: "writable", // for analytics.js
DD_RUM: "writable", // for analytics.js
},
extends: [
"enpitech"
],
extends: ["enpitech"],
rules: {
// please dont make an error occure here we use console.error
// please don't make an error occur here we use console.error
"no-console": ["error", { allow: ["error"] }],
"no-alert": "error",
"no-debugger": "error",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-unused-vars": ["error", { "vars": "all", "args": "after-used", "ignoreRestSiblings": true }]
"@typescript-eslint/no-unused-vars": [
"error",
{ vars: "all", args: "after-used", ignoreRestSiblings: true },
],
},
root: true,
};
}
85 changes: 2 additions & 83 deletions dashboard/src/API/repositories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,7 @@ import {
useQuery,
} from "@tanstack/react-query"
import { callApi } from "./releases"
import {
// ChartList,
// ChartVersions,
HelmRepositories,
// LatestChartVersion,
// ValuesYamlText,
} from "./interfaces"
import { HelmRepositories } from "./interfaces"

// Get list of Helm repositories
export function useGetRepositories(
Expand All @@ -24,37 +18,6 @@ export function useGetRepositories(
)
}

// Add new repository
// function useAddRepository(
// options?: UseMutationOptions<void, unknown, { name: string; url: string }>
// ) {
// return useMutation<void, unknown, { name: string; url: string }>(
// ({ name, url }) => {
// const formData = new FormData()
// formData.append("name", name)
// formData.append("url", url)

// return callApi<void>("/api/helm/repositories", {
// method: "POST",
// body: formData,
// })
// },
// options
// )
// }

// Get list of charts in repository
// function useGetChartsInRepo(
// repo: string,
// options?: UseQueryOptions<ChartList>
// ) {
// return useQuery<ChartList>(
// ["helm", "repositories", repo],
// () => callApi<ChartList>(`/api/helm/repositories/${repo}`),
// options
// )
// }

// Update repository from remote
export function useUpdateRepo(
repo: string,
Expand All @@ -79,58 +42,14 @@ export function useDeleteRepo(
}, options)
}

// Find the latest available version of specified chart through all the repositories
// function useGetLatestChartVersion(
// name: string,
// options?: UseQueryOptions<LatestChartVersion>
// ) {
// return useQuery<LatestChartVersion>(
// ["helm", "repositories", "latestver", name],
// () =>
// callApi<LatestChartVersion>(
// `/api/helm/repositories/latestver?name=${name}`
// ),
// options
// )
// }

// // Get the list of versions for specified chart across the repositories
// function useGetChartVersions(
// name: string,
// options?: UseQueryOptions<ChartVersions>
// ) {
// return useQuery<ChartVersions>(
// ["helm", "repositories", "versions", name],
// () =>
// callApi<ChartVersions>(`/api/helm/repositories/versions?name=${name}`),
// options
// )
// }

// Get the original values.yaml file for the chart
// function useGetChartValues(
// chart: string,
// version: string,
// options?: UseQueryOptions<ValuesYamlText>
// ) {
// return useQuery<ValuesYamlText>(
// ["helm", "repositories", "values", chart, version],
// () =>
// callApi<ValuesYamlText>(
// `/api/helm/repositories/values?chart=${chart}&version=${version}`
// ),
// options
// )
// }

export function useChartRepoValues(
namespace: string,
version: string,
chart: string,
options?: UseQueryOptions<any>
) {
return useQuery<any>(
["values", namespace, chart],
["helm", "repositories", "values", chart, version],
() =>
callApi<any>(
`/api/helm/repositories/values?chart=${chart}&version=${version}`,
Expand Down
Loading

0 comments on commit ebfedb9

Please sign in to comment.