From 149c5be89619e9f9b70d139e302159ec039999aa Mon Sep 17 00:00:00 2001 From: Maxime Beauchamp <15185355+baktun14@users.noreply.github.com> Date: Wed, 28 Aug 2024 17:30:11 -0400 Subject: [PATCH] chore: lint fix --- .../deployments/DeploymentDetailTopBar.tsx | 2 +- .../src/components/deployments/DeploymentList.tsx | 2 +- .../src/components/deployments/DeploymentListRow.tsx | 2 +- .../src/components/deployments/LeaseRow.tsx | 6 +----- .../src/components/new-deployment/CreateLease.tsx | 2 +- .../src/components/new-deployment/ManifestEdit.tsx | 4 ++-- .../src/components/new-deployment/TemplateList.tsx | 2 +- apps/deploy-web/src/components/sdl/RentGpusForm.tsx | 12 ++++++------ .../src/hooks/useManagedDeploymentConfirm.tsx | 1 + apps/deploy-web/src/utils/sdl/sdlImport.ts | 2 +- .../src/providers/statusEndpointHandlers/grpc.ts | 2 +- 11 files changed, 17 insertions(+), 20 deletions(-) diff --git a/apps/deploy-web/src/components/deployments/DeploymentDetailTopBar.tsx b/apps/deploy-web/src/components/deployments/DeploymentDetailTopBar.tsx index f2be1b7c4..636b0f486 100644 --- a/apps/deploy-web/src/components/deployments/DeploymentDetailTopBar.tsx +++ b/apps/deploy-web/src/components/deployments/DeploymentDetailTopBar.tsx @@ -9,13 +9,13 @@ import { event } from "nextjs-google-analytics"; import { CustomDropdownLinkItem } from "@src/components/shared/CustomDropdownLinkItem"; import { useLocalNotes } from "@src/context/LocalNoteProvider"; import { useWallet } from "@src/context/WalletProvider"; +import { useManagedDeploymentConfirm } from "@src/hooks/useManagedDeploymentConfirm"; import { usePreviousRoute } from "@src/hooks/usePreviousRoute"; import { DeploymentDto } from "@src/types/deployment"; import { AnalyticsEvents } from "@src/utils/analytics"; import { TransactionMessageData } from "@src/utils/TransactionMessageData"; import { UrlService } from "@src/utils/urlUtils"; import { DeploymentDepositModal } from "./DeploymentDepositModal"; -import { useManagedDeploymentConfirm } from "@src/hooks/useManagedDeploymentConfirm"; type Props = { address: string; diff --git a/apps/deploy-web/src/components/deployments/DeploymentList.tsx b/apps/deploy-web/src/components/deployments/DeploymentList.tsx index 7ae669dac..9427fb369 100644 --- a/apps/deploy-web/src/components/deployments/DeploymentList.tsx +++ b/apps/deploy-web/src/components/deployments/DeploymentList.tsx @@ -22,6 +22,7 @@ import { LinkTo } from "@src/components/shared/LinkTo"; import { useLocalNotes } from "@src/context/LocalNoteProvider"; import { useSettings } from "@src/context/SettingsProvider"; import { useWallet } from "@src/context/WalletProvider"; +import { useManagedDeploymentConfirm } from "@src/hooks/useManagedDeploymentConfirm"; import { useDeploymentList } from "@src/queries/useDeploymentQuery"; import { useProviderList } from "@src/queries/useProvidersQuery"; import sdlStore from "@src/store/sdlStore"; @@ -32,7 +33,6 @@ import { UrlService } from "@src/utils/urlUtils"; import Layout from "../layout/Layout"; import { Title } from "../shared/Title"; import { DeploymentListRow } from "./DeploymentListRow"; -import { useManagedDeploymentConfirm } from "@src/hooks/useManagedDeploymentConfirm"; export const DeploymentList: React.FunctionComponent = () => { const { address, signAndBroadcastTx, isWalletLoaded } = useWallet(); diff --git a/apps/deploy-web/src/components/deployments/DeploymentListRow.tsx b/apps/deploy-web/src/components/deployments/DeploymentListRow.tsx index a5e3a5c2c..f809a0cfe 100644 --- a/apps/deploy-web/src/components/deployments/DeploymentListRow.tsx +++ b/apps/deploy-web/src/components/deployments/DeploymentListRow.tsx @@ -20,6 +20,7 @@ import { useRouter } from "next/navigation"; import { event } from "nextjs-google-analytics"; import { useWallet } from "@src/context/WalletProvider"; +import { useManagedDeploymentConfirm } from "@src/hooks/useManagedDeploymentConfirm"; import { getShortText } from "@src/hooks/useShortText"; import { useDenomData } from "@src/hooks/useWalletBalance"; import { useAllLeases } from "@src/queries/useLeaseQuery"; @@ -37,7 +38,6 @@ import { PriceValue } from "../shared/PriceValue"; import { SpecDetailList } from "../shared/SpecDetailList"; import { DeploymentDepositModal } from "./DeploymentDepositModal"; import { LeaseChip } from "./LeaseChip"; -import { useManagedDeploymentConfirm } from "@src/hooks/useManagedDeploymentConfirm"; type Props = { deployment: NamedDeploymentDto; diff --git a/apps/deploy-web/src/components/deployments/LeaseRow.tsx b/apps/deploy-web/src/components/deployments/LeaseRow.tsx index 858e94aee..b584ae893 100644 --- a/apps/deploy-web/src/components/deployments/LeaseRow.tsx +++ b/apps/deploy-web/src/components/deployments/LeaseRow.tsx @@ -68,11 +68,7 @@ export const LeaseRow = React.forwardRef(({ lease, setActi } } }); - const { - data: providerStatus, - isLoading: isLoadingProviderStatus, - refetch: getProviderStatus - } = useProviderStatus(provider?.hostUri || "", { + const { isLoading: isLoadingProviderStatus, refetch: getProviderStatus } = useProviderStatus(provider?.hostUri || "", { enabled: false, retry: false }); diff --git a/apps/deploy-web/src/components/new-deployment/CreateLease.tsx b/apps/deploy-web/src/components/new-deployment/CreateLease.tsx index b7a3901b3..9a3166191 100644 --- a/apps/deploy-web/src/components/new-deployment/CreateLease.tsx +++ b/apps/deploy-web/src/components/new-deployment/CreateLease.tsx @@ -20,6 +20,7 @@ import { useSnackbar } from "notistack"; import { LocalCert } from "@src/context/CertificateProvider/CertificateProviderContext"; import { useWallet } from "@src/context/WalletProvider"; +import { useManagedDeploymentConfirm } from "@src/hooks/useManagedDeploymentConfirm"; import { useBidList } from "@src/queries/useBidQuery"; import { useDeploymentDetail } from "@src/queries/useDeploymentQuery"; import { useProviderList } from "@src/queries/useProvidersQuery"; @@ -40,7 +41,6 @@ import { ManifestErrorSnackbar } from "../shared/ManifestErrorSnackbar"; import ViewPanel from "../shared/ViewPanel"; import { BidCountdownTimer } from "./BidCountdownTimer"; import { BidGroup } from "./BidGroup"; -import { useManagedDeploymentConfirm } from "@src/hooks/useManagedDeploymentConfirm"; type Props = { dseq: string; diff --git a/apps/deploy-web/src/components/new-deployment/ManifestEdit.tsx b/apps/deploy-web/src/components/new-deployment/ManifestEdit.tsx index d04027b72..0c46b5491 100644 --- a/apps/deploy-web/src/components/new-deployment/ManifestEdit.tsx +++ b/apps/deploy-web/src/components/new-deployment/ManifestEdit.tsx @@ -15,6 +15,7 @@ import { useCertificate } from "@src/context/CertificateProvider"; import { useChainParam } from "@src/context/ChainParamProvider"; import { useSdlBuilder } from "@src/context/SdlBuilderProvider/SdlBuilderProvider"; import { useWallet } from "@src/context/WalletProvider"; +import { useManagedDeploymentConfirm } from "@src/hooks/useManagedDeploymentConfirm"; import { useManagedWalletDenom } from "@src/hooks/useManagedWalletDenom"; import { useWhen } from "@src/hooks/useWhen"; import { useDepositParams } from "@src/queries/useSettings"; @@ -26,6 +27,7 @@ import { defaultInitialDeposit, RouteStepKeys } from "@src/utils/constants"; import { deploymentData } from "@src/utils/deploymentData"; import { saveDeploymentManifestAndName } from "@src/utils/deploymentLocalDataUtils"; import { validateDeploymentData } from "@src/utils/deploymentUtils"; +import { importSimpleSdl } from "@src/utils/sdl/sdlImport"; import { cn } from "@src/utils/styleUtils"; import { Timer } from "@src/utils/timer"; import { TransactionMessageData } from "@src/utils/TransactionMessageData"; @@ -39,8 +41,6 @@ import { LinkTo } from "../shared/LinkTo"; import { PrerequisiteList } from "../shared/PrerequisiteList"; import ViewPanel from "../shared/ViewPanel"; import { SdlBuilder, SdlBuilderRefType } from "./SdlBuilder"; -import { importSimpleSdl } from "@src/utils/sdl/sdlImport"; -import { useManagedDeploymentConfirm } from "@src/hooks/useManagedDeploymentConfirm"; type Props = { onTemplateSelected: Dispatch; diff --git a/apps/deploy-web/src/components/new-deployment/TemplateList.tsx b/apps/deploy-web/src/components/new-deployment/TemplateList.tsx index d3e3cdb39..785225b00 100644 --- a/apps/deploy-web/src/components/new-deployment/TemplateList.tsx +++ b/apps/deploy-web/src/components/new-deployment/TemplateList.tsx @@ -1,7 +1,7 @@ "use client"; import React, { useEffect, useState } from "react"; import { Button, buttonVariants } from "@akashnetwork/ui/components"; -import { ArrowRight, Cpu, Linux,Page, Rocket, Wrench } from "iconoir-react"; +import { ArrowRight, Cpu, Linux, Rocket, Wrench } from "iconoir-react"; import { NavArrowLeft } from "iconoir-react"; import { useAtom } from "jotai"; import Link from "next/link"; diff --git a/apps/deploy-web/src/components/sdl/RentGpusForm.tsx b/apps/deploy-web/src/components/sdl/RentGpusForm.tsx index f8b54729a..e97f04ad3 100644 --- a/apps/deploy-web/src/components/sdl/RentGpusForm.tsx +++ b/apps/deploy-web/src/components/sdl/RentGpusForm.tsx @@ -10,13 +10,19 @@ import { useAtom } from "jotai"; import { useRouter, useSearchParams } from "next/navigation"; import { event } from "nextjs-google-analytics"; +import { envConfig } from "@src/config/env.config"; import { useCertificate } from "@src/context/CertificateProvider"; import { useChainParam } from "@src/context/ChainParamProvider"; import { useSettings } from "@src/context/SettingsProvider"; import { useWallet } from "@src/context/WalletProvider"; +import { useManagedDeploymentConfirm } from "@src/hooks/useManagedDeploymentConfirm"; +import { useManagedWalletDenom } from "@src/hooks/useManagedWalletDenom"; +import { useWhen } from "@src/hooks/useWhen"; import { useGpuModels } from "@src/queries/useGpuQuery"; +import { useDepositParams } from "@src/queries/useSettings"; import sdlStore from "@src/store/sdlStore"; import { ApiTemplate, ProfileGpuModelType, RentGpusFormValuesSchema, RentGpusFormValuesType, ServiceType } from "@src/types"; +import { DepositParams } from "@src/types/deployment"; import { ProviderAttributeSchemaDetailValue } from "@src/types/providerAttributes"; import { AnalyticsEvents } from "@src/utils/analytics"; import { defaultInitialDeposit, RouteStepKeys } from "@src/utils/constants"; @@ -41,12 +47,6 @@ import { MemoryFormControl } from "./MemoryFormControl"; import { RegionSelect } from "./RegionSelect"; import { StorageFormControl } from "./StorageFormControl"; import { TokenFormControl } from "./TokenFormControl"; -import { useManagedDeploymentConfirm } from "@src/hooks/useManagedDeploymentConfirm"; -import { useWhen } from "@src/hooks/useWhen"; -import { useManagedWalletDenom } from "@src/hooks/useManagedWalletDenom"; -import { useDepositParams } from "@src/queries/useSettings"; -import { envConfig } from "@src/config/env.config"; -import { DepositParams } from "@src/types/deployment"; export const RentGpusForm: React.FunctionComponent = () => { const [error, setError] = useState(null); diff --git a/apps/deploy-web/src/hooks/useManagedDeploymentConfirm.tsx b/apps/deploy-web/src/hooks/useManagedDeploymentConfirm.tsx index 89f02f785..7c09908f8 100644 --- a/apps/deploy-web/src/hooks/useManagedDeploymentConfirm.tsx +++ b/apps/deploy-web/src/hooks/useManagedDeploymentConfirm.tsx @@ -1,4 +1,5 @@ import { usePopup } from "@akashnetwork/ui/context"; + import { LeaseSpecDetail } from "@src/components/shared/LeaseSpecDetail"; import { useWallet } from "@src/context/WalletProvider"; import { ServiceType } from "@src/types"; diff --git a/apps/deploy-web/src/utils/sdl/sdlImport.ts b/apps/deploy-web/src/utils/sdl/sdlImport.ts index 10d1f0f7f..490bbe060 100644 --- a/apps/deploy-web/src/utils/sdl/sdlImport.ts +++ b/apps/deploy-web/src/utils/sdl/sdlImport.ts @@ -1,7 +1,7 @@ import yaml from "js-yaml"; import { nanoid } from "nanoid"; -import { ExposeType, ServiceType, ProfileGpuModelType } from "@src/types"; +import { ExposeType, ProfileGpuModelType,ServiceType } from "@src/types"; import { CustomValidationError } from "../deploymentData"; import { capitalizeFirstLetter } from "../stringUtils"; import { defaultHttpOptions } from "./data"; diff --git a/apps/indexer/src/providers/statusEndpointHandlers/grpc.ts b/apps/indexer/src/providers/statusEndpointHandlers/grpc.ts index 866d2288c..f14a09b15 100644 --- a/apps/indexer/src/providers/statusEndpointHandlers/grpc.ts +++ b/apps/indexer/src/providers/statusEndpointHandlers/grpc.ts @@ -3,13 +3,13 @@ import { ResourcesMetric, Status } from "@akashnetwork/akash-api/akash/provider/ import { ProviderRPCClient } from "@akashnetwork/akash-api/akash/provider/v1/grpc-js"; import { Empty } from "@akashnetwork/akash-api/google/protobuf"; import { Provider } from "@akashnetwork/database/dbSchemas/akash"; +import minutesToMilliseconds from "date-fns/minutesToMilliseconds"; import memoize from "lodash/memoize"; import { promisify } from "util"; import { parseDecimalKubernetesString, parseSizeStr } from "@src/shared/utils/files"; import { FakeInsecureCredentials } from "./fake-insecure-credentials"; import { ProviderStatusInfo } from "./types"; -import minutesToMilliseconds from "date-fns/minutesToMilliseconds"; export async function fetchProviderStatusFromGRPC(provider: Provider, timeout: number): Promise { const data = await queryStatus(provider.hostUri, timeout);