Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lint #455

Closed
wants to merge 2 commits into from
Closed

lint #455

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dashboard/src/API/apiService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@
}): Promise<ReleaseHealthStatus[] | null> => {
if (!release) return null;

const data = await this.fetchWithDefaults(
const data = await this.fetchWithDefaults<ReleaseHealthStatus[] | null>(
`/api/helm/releases/${release.namespace}/${release.name}/resources?health=true`
);

return data;
};

Expand All @@ -129,14 +130,14 @@

if (!params.namespace || !params.chart) return [];

const data = await this.fetchWithDefaults(
const data = await this.fetchWithDefaults<ReleaseRevision[]>(
`/api/helm/releases/${params.namespace}/${params.chart}/history`
);

return data;
};

getValues = async ({ queryKey }: any) => {

Check warning on line 140 in dashboard/src/API/apiService.ts

View workflow job for this annotation

GitHub Actions / static_and_lint

Unexpected any. Specify a different type

Check warning on line 140 in dashboard/src/API/apiService.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
const [, params] = queryKey;
const { namespace, chart, version } = params;

Expand Down
2 changes: 1 addition & 1 deletion dashboard/src/API/releases.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@
}: {
namespace: string;
chartName: string;
options?: UseQueryOptions<any>;

Check warning on line 36 in dashboard/src/API/releases.ts

View workflow job for this annotation

GitHub Actions / static_and_lint

Unexpected any. Specify a different type

Check warning on line 36 in dashboard/src/API/releases.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
}) {
return useQuery<any>(

Check warning on line 38 in dashboard/src/API/releases.ts

View workflow job for this annotation

GitHub Actions / static_and_lint

Unexpected any. Specify a different type

Check warning on line 38 in dashboard/src/API/releases.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
["manifest", namespace, chartName],
() =>
callApi<any>(`/api/helm/releases/${namespace}/${chartName}/manifests`),

Check warning on line 41 in dashboard/src/API/releases.ts

View workflow job for this annotation

GitHub Actions / static_and_lint

Unexpected any. Specify a different type

Check warning on line 41 in dashboard/src/API/releases.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
options
);
}
Expand Down Expand Up @@ -211,12 +211,12 @@
userDefinedValue?: string;
revision?: number;
version?: string;
options?: UseQueryOptions<any>;

Check warning on line 214 in dashboard/src/API/releases.ts

View workflow job for this annotation

GitHub Actions / static_and_lint

Unexpected any. Specify a different type

Check warning on line 214 in dashboard/src/API/releases.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
}) {
return useQuery<any>(

Check warning on line 216 in dashboard/src/API/releases.ts

View workflow job for this annotation

GitHub Actions / static_and_lint

Unexpected any. Specify a different type

Check warning on line 216 in dashboard/src/API/releases.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
["values", namespace, release, userDefinedValue, version],
() =>
callApi<any>(

Check warning on line 219 in dashboard/src/API/releases.ts

View workflow job for this annotation

GitHub Actions / static_and_lint

Unexpected any. Specify a different type

Check warning on line 219 in dashboard/src/API/releases.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
`/api/helm/releases/${namespace}/${release}/values?${"userDefined=true"}${
revision ? `&revision=${revision}` : ""
}`,
Expand Down Expand Up @@ -306,8 +306,8 @@
export interface Metadata {
name: string;
namespace: string;
creationTimestamp: any;

Check warning on line 309 in dashboard/src/API/releases.ts

View workflow job for this annotation

GitHub Actions / static_and_lint

Unexpected any. Specify a different type

Check warning on line 309 in dashboard/src/API/releases.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
labels: any;

Check warning on line 310 in dashboard/src/API/releases.ts

View workflow job for this annotation

GitHub Actions / static_and_lint

Unexpected any. Specify a different type

Check warning on line 310 in dashboard/src/API/releases.ts

View workflow job for this annotation

GitHub Actions / build

Unexpected any. Specify a different type
}

export interface Spec {
Expand All @@ -333,7 +333,7 @@
url: string,
options?: RequestInit
): Promise<T> {
const data = await apiService.fetchWithDefaults(url, options);
const data = await apiService.fetchWithDefaults<T>(url, options);

return data;
}
4 changes: 2 additions & 2 deletions dashboard/src/API/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const getVersionManifestFormData = ({
return formData;
};

export const useDiffData = ({
export const useDiffData = <T>({
selectedRepo,
versionsError,
currentVerManifest,
Expand All @@ -40,7 +40,7 @@ export const useDiffData = ({
selectedRepo: string;
versionsError: string;
currentVerManifest: string;
selectedVerData: Promise<any>;
selectedVerData: Promise<T>;
chart: string;
}) => {
return useQuery(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from "react";
import { Release } from "../../data/types";
import { Release, ReleaseHealthStatus } from "../../data/types";
import { BsArrowUpCircleFill, BsPlusCircleFill } from "react-icons/bs";
import { getAge } from "../../timeUtils";
import StatusLabel, {
Expand Down Expand Up @@ -34,7 +34,7 @@ export default function InstalledPackageCard({
cacheTime: 0,
});

const { data: statusData } = useQuery<any>({
const { data: statusData } = useQuery<ReleaseHealthStatus[] | null>({
queryKey: ["resourceStatus", release],
queryFn: () => apiService.getResourceStatus({ release }),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Template: ComponentStory<typeof InstalledPackagesList> = (args) => (
export const Default = Template.bind({});

Default.args = {
installedReleases: [
filteredReleases: [
{
id: "",
name: "",
Expand Down
4 changes: 2 additions & 2 deletions dashboard/src/components/revision/RevisionDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import RevisionDiff from "./RevisionDiff";
import RevisionResource from "./RevisionResource";
import Tabs from "../Tabs";
import { useMutation } from "@tanstack/react-query";
import { UseQueryResult, useMutation } from "@tanstack/react-query";

Check failure on line 26 in dashboard/src/components/revision/RevisionDetails.tsx

View workflow job for this annotation

GitHub Actions / static_and_lint

UseQueryResult not found in '@tanstack/react-query'

Check failure on line 26 in dashboard/src/components/revision/RevisionDetails.tsx

View workflow job for this annotation

GitHub Actions / build

UseQueryResult not found in '@tanstack/react-query'
import Modal, { ModalButtonStyle } from "../modal/Modal";
import Spinner from "../Spinner";
import useAlertError from "../../hooks/useAlertError";
Expand Down Expand Up @@ -398,7 +398,7 @@
);
};

const RollbackModalContent = ({ dataResponse }: { dataResponse: any }) => {
const RollbackModalContent = ({ dataResponse }: { dataResponse: UseQueryResult<string, unknown> }) => {
const {
data,
isLoading,
Expand Down
4 changes: 2 additions & 2 deletions dashboard/src/hooks/useNavigateWithSearchParams.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { useLocation, useNavigate } from "react-router-dom";
import { NavigateOptions, useLocation, useNavigate } from "react-router-dom";

Check failure on line 1 in dashboard/src/hooks/useNavigateWithSearchParams.ts

View workflow job for this annotation

GitHub Actions / static_and_lint

NavigateOptions not found in 'react-router-dom'

Check failure on line 1 in dashboard/src/hooks/useNavigateWithSearchParams.ts

View workflow job for this annotation

GitHub Actions / build

NavigateOptions not found in 'react-router-dom'

const useNavigateWithSearchParams = () => {
const navigate = useNavigate();
const { search } = useLocation();
const navigateWithSearchParams = (url: string, ...restArgs: any[]) => {
const navigateWithSearchParams = (url: string, ...restArgs: NavigateOptions[]) => {
navigate(url + search, ...restArgs);
};

Expand Down
16,516 changes: 8,258 additions & 8,258 deletions dashboard/yarn.lock

Large diffs are not rendered by default.

Loading