From cb0a7e4d6d2b0376b19759e537cf3af42184d6e7 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 17 Oct 2021 01:31:29 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=B9=20Fix=20warnings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/authorization/AuthorizationLoginBox.tsx | 4 +--- .../src/components/authorization/AuthorizationLoginButton.tsx | 2 +- frontend/src/components/elements/DescriptionBox.tsx | 4 ++-- frontend/src/hooks/useManagedViewSet.ts | 2 +- frontend/src/hooks/useViewSet.ts | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/frontend/src/components/authorization/AuthorizationLoginBox.tsx b/frontend/src/components/authorization/AuthorizationLoginBox.tsx index 05463a4..ba1603a 100644 --- a/frontend/src/components/authorization/AuthorizationLoginBox.tsx +++ b/frontend/src/components/authorization/AuthorizationLoginBox.tsx @@ -4,12 +4,10 @@ import * as React from "react" import {useAuthorizationContext} from "../../contexts/authorization" import {Validators} from "../../utils/Validators" import {IconText} from "../elements/IconText" -import {useInstanceAxios} from "../instance/useInstanceAxios" import {AuthorizationLoginButton} from "./AuthorizationLoginButton" export function AuthorizationLoginBox(): JSX.Element { - const axios = useInstanceAxios() const authorization = useAuthorizationContext() const username = useFormState("", Validators.doNotValidate) @@ -20,7 +18,7 @@ export function AuthorizationLoginBox(): JSX.Element { () => ( authorization !== undefined && authorization.state.token === undefined ), - [axios, authorization], + [authorization], ) return ( diff --git a/frontend/src/components/authorization/AuthorizationLoginButton.tsx b/frontend/src/components/authorization/AuthorizationLoginButton.tsx index 49b2462..b43b5e4 100644 --- a/frontend/src/components/authorization/AuthorizationLoginButton.tsx +++ b/frontend/src/components/authorization/AuthorizationLoginButton.tsx @@ -25,7 +25,7 @@ export function AuthorizationLoginButton({username, password, disabled = false}: () => ( !disabled && authorization !== undefined && !authorization.state.running && username !== "" && password !== "" ), - [authorization, username, password], + [disabled, authorization, username, password], ) const doLogin = diff --git a/frontend/src/components/elements/DescriptionBox.tsx b/frontend/src/components/elements/DescriptionBox.tsx index b7ddda3..0b49fd6 100644 --- a/frontend/src/components/elements/DescriptionBox.tsx +++ b/frontend/src/components/elements/DescriptionBox.tsx @@ -5,14 +5,14 @@ import * as React from "react" import ReactMarkdown from "react-markdown" -export interface DescriptionBox { +export interface DescriptionBoxProps { icon: IconDefinition, name: string, description: string, } -export function DescriptionBox({icon, name, description}: DescriptionBox): JSX.Element { +export function DescriptionBox({icon, name, description}: DescriptionBoxProps): JSX.Element { return React.useMemo( () => ( diff --git a/frontend/src/hooks/useManagedViewSet.ts b/frontend/src/hooks/useManagedViewSet.ts index 8a76f7f..e16eb64 100644 --- a/frontend/src/hooks/useManagedViewSet.ts +++ b/frontend/src/hooks/useManagedViewSet.ts @@ -633,6 +633,6 @@ export function useManagedViewSet(baseRoute: st command, } }, - [state, resources, refresh, create, command] + [state, resources, refresh, create, command, viewset], ) } diff --git a/frontend/src/hooks/useViewSet.ts b/frontend/src/hooks/useViewSet.ts index 12baa28..f9fefb8 100644 --- a/frontend/src/hooks/useViewSet.ts +++ b/frontend/src/hooks/useViewSet.ts @@ -158,6 +158,6 @@ export function useViewSet(baseRoute: string): ViewSet | und return {command, action, list, retrieve, create, update, destroy} }, - [command, action, list, retrieve, create, update, destroy], + [api, command, action, list, retrieve, create, update, destroy], ) }