diff --git a/web/src/AppProps.ts b/web/src/AppProps.ts index 3da5c381b..1d58aab2c 100644 --- a/web/src/AppProps.ts +++ b/web/src/AppProps.ts @@ -1,6 +1,7 @@ import type React from 'react' import type * as History from 'history' import type { PermissionOptionsMenuButtonProps } from 'components/Permissions/PermissionsOptionsMenuButton' +import type { Unknown } from 'utils/Utils' import type { LangLocale } from './framework/strings/languageLoader' /** @@ -66,16 +67,16 @@ export interface AppPathProps { * Platform integration. */ export interface AppPropsHook { - usePermission(permissionRequest: any, deps?: Array): Array - useGetSchemaYaml(params: any, deps?: Array): Record - useGetToken(): any - useAppStore(): any - useGitSyncStore(): any - useSaveToGitDialog(props: { onSuccess: any; onClose: any; onProgessOverlayClose: any }): any - useGetListOfBranchesWithStatus(props: any): any + usePermission(permissionRequest: Unknown, deps?: Array): Array + useGetSchemaYaml(params: Unknown, deps?: Array): Record + useGetToken(): Unknown + useAppStore(): Unknown + useGitSyncStore(): Unknown + useSaveToGitDialog(props: { onSuccess: Unknown; onClose: Unknown; onProgessOverlayClose: Unknown }): Unknown + useGetListOfBranchesWithStatus(props: Unknown): Unknown useAnyEnterpriseLicense(): boolean useCurrentEnterpriseLicense(): boolean - useLicenseStore(): any + useLicenseStore(): Unknown } // eslint-disable-line @typescript-eslint/no-empty-interface /** @@ -87,7 +88,7 @@ export interface AppPropsComponent { RbacButton: React.FC RbacOptionsMenuButton: React.FC GitSyncStoreProvider: React.FC - GitContextForm: React.FC + GitContextForm: React.FC NavigationCheck: React.FC<{ when?: boolean textProps?: { diff --git a/web/src/RouteDestinations.tsx b/web/src/RouteDestinations.tsx index 21fc2022d..3d7efed37 100644 --- a/web/src/RouteDestinations.tsx +++ b/web/src/RouteDestinations.tsx @@ -6,7 +6,9 @@ import { SignUp } from 'pages/SignUp/SignUp' import { routePath } from './RouteUtils' import { RoutePath } from './RouteDefinitions' -export const RouteDestinations: React.FC<{ standalone: boolean }> = React.memo(({ standalone }) => { +export const RouteDestinations: React.FC<{ standalone: boolean }> = React.memo(function RouteDestinations({ + standalone +}) { const Destinations: React.FC = useCallback( () => ( diff --git a/web/src/components/NameIdDescriptionTags/NameIdDescriptionTags.tsx b/web/src/components/NameIdDescriptionTags/NameIdDescriptionTags.tsx index de652f09f..65a4252ad 100644 --- a/web/src/components/NameIdDescriptionTags/NameIdDescriptionTags.tsx +++ b/web/src/components/NameIdDescriptionTags/NameIdDescriptionTags.tsx @@ -6,6 +6,7 @@ import { Classes, IInputGroupProps, ITagInputProps } from '@blueprintjs/core' import cx from 'classnames' import type { FormikProps } from 'formik' import { useStrings } from 'framework/strings' +import type { Unknown } from 'utils/Utils' import type { DescriptionComponentProps, DescriptionProps, @@ -23,7 +24,7 @@ export interface NameIdDescriptionTagsProps { tagsProps?: Partial & { isOption?: boolean } - formikProps: FormikProps + formikProps: FormikProps className?: string tooltipProps?: DataTooltipInterface } diff --git a/web/src/components/NameIdDescriptionTags/NameIdDescriptionTagsConstants.ts b/web/src/components/NameIdDescriptionTags/NameIdDescriptionTagsConstants.ts index 2ab0a40bf..a0edc3996 100644 --- a/web/src/components/NameIdDescriptionTags/NameIdDescriptionTagsConstants.ts +++ b/web/src/components/NameIdDescriptionTags/NameIdDescriptionTagsConstants.ts @@ -2,6 +2,7 @@ import type { TagInputProps } from '@harness/uicore' import type { ITagInputProps, IInputGroupProps } from '@blueprintjs/core' import type { InputWithIdentifierProps } from '@harness/uicore/dist/components/InputWithIdentifier/InputWithIdentifier' import type { FormikProps } from 'formik' +import type { Unknown } from 'utils/Utils' export interface DescriptionProps { placeholder?: string @@ -34,7 +35,7 @@ export interface NameIdDescriptionTagsDeprecatedProps { identifierProps?: Omit descriptionProps?: DescriptionProps tagInputProps?: TagInputProps - formikProps: FormikProps + formikProps: FormikProps className?: string } @@ -43,5 +44,5 @@ export interface NameIdDescriptionProps { inputGroupProps?: IInputGroupProps descriptionProps?: DescriptionProps className?: string - formikProps: Omit, 'tags'> + formikProps: Omit, 'tags'> } diff --git a/web/src/components/Permissions/PermissionsButton.tsx b/web/src/components/Permissions/PermissionsButton.tsx index 71c11acde..5deea6a5e 100644 --- a/web/src/components/Permissions/PermissionsButton.tsx +++ b/web/src/components/Permissions/PermissionsButton.tsx @@ -1,9 +1,10 @@ import React from 'react' import { Button, ButtonProps } from '@harness/uicore' import { useAppContext } from 'AppContext' +import type { Unknown } from 'utils/Utils' interface PermissionButtonProps extends ButtonProps { - permission?: any + permission?: Unknown } export const PermissionsButton: React.FC = (props: PermissionButtonProps) => { diff --git a/web/src/components/Permissions/PermissionsOptionsMenuButton.tsx b/web/src/components/Permissions/PermissionsOptionsMenuButton.tsx index ffe56efb7..5dc043e39 100644 --- a/web/src/components/Permissions/PermissionsOptionsMenuButton.tsx +++ b/web/src/components/Permissions/PermissionsOptionsMenuButton.tsx @@ -2,11 +2,12 @@ import React, { AnchorHTMLAttributes, ReactElement } from 'react' import type { IMenuItemProps } from '@blueprintjs/core' import { OptionsMenuButton, OptionsMenuButtonProps } from 'components/OptionsMenuButton/OptionsMenuButton' import { useAppContext } from 'AppContext' +import type { Unknown } from 'utils/Utils' type Item = ((IMenuItemProps | PermissionsMenuItemProps) & AnchorHTMLAttributes) | '-' interface PermissionsMenuItemProps extends IMenuItemProps { - permission?: any + permission?: Unknown } export interface PermissionOptionsMenuButtonProps extends OptionsMenuButtonProps { diff --git a/web/src/hooks/useQueryParams.ts b/web/src/hooks/useQueryParams.ts index d93f8c403..49a7aa3ce 100644 --- a/web/src/hooks/useQueryParams.ts +++ b/web/src/hooks/useQueryParams.ts @@ -2,9 +2,10 @@ import React from 'react' import { useLocation } from 'react-router-dom' import qs from 'qs' import type { IParseOptions } from 'qs' +import type { Unknown } from 'utils/Utils' export interface UseQueryParamsOptions extends IParseOptions { - processQueryParams?(data: any): T + processQueryParams?(data: Unknown): T } export function useQueryParams(options?: UseQueryParamsOptions): T { @@ -18,7 +19,7 @@ export function useQueryParams(options?: UseQueryParamsOptions): } return params - }, [search, options, options?.processQueryParams]) + }, [search, options]) return queryParams as unknown as T } diff --git a/web/src/hooks/useStandalonePermission.ts b/web/src/hooks/useStandalonePermission.ts index 22625b0ed..c3dbd760f 100644 --- a/web/src/hooks/useStandalonePermission.ts +++ b/web/src/hooks/useStandalonePermission.ts @@ -1,3 +1,5 @@ -export function useStandalonePermission(_permissionsRequest?: any, _deps: Array = []): Array { +import type { Unknown } from 'utils/Utils' + +export function useStandalonePermission(_permissionsRequest?: Unknown, _deps: Array = []): Array { return [true, true] } diff --git a/web/src/pages/SignIn/SignIn.tsx b/web/src/pages/SignIn/SignIn.tsx index ac3ea20d8..3e07d60cb 100644 --- a/web/src/pages/SignIn/SignIn.tsx +++ b/web/src/pages/SignIn/SignIn.tsx @@ -1,4 +1,4 @@ -import { useHistory } from 'react-router-dom' +// import { useHistory } from 'react-router-dom' import React, { useCallback, useState } from 'react' // import { get } from 'lodash-es' import { Button, Container, Layout, Text, TextInput } from '@harness/uicore' @@ -9,7 +9,7 @@ import { useOnLogin } from 'services/pm' export const SignIn: React.FC = () => { const { getString } = useStrings() - const history = useHistory() + // const history = useHistory() const [username, setUsername] = useState('') const [password, setPassword] = useState('') // const [, setToken] = useAPIToken() @@ -30,7 +30,7 @@ export const SignIn: React.FC = () => { // eslint-disable-next-line no-console console.error({ error }) }) - }, [mutate, username, password, history]) + }, [mutate, username, password]) return ( diff --git a/web/src/utils/Enums.ts b/web/src/utils/Enums.ts deleted file mode 100644 index 5c7ef9357..000000000 --- a/web/src/utils/Enums.ts +++ /dev/null @@ -1,11 +0,0 @@ -export enum Sort { - DESC = 'DESC', - ASC = 'ASC' -} - -export enum SortFields { - LastUpdatedAt = 'updated', - AZ09 = 'AZ09', - ZA90 = 'ZA90', - Name = 'name' -} diff --git a/web/src/utils/Utils.ts b/web/src/utils/Utils.ts index 917be8d01..f2dc3661a 100644 --- a/web/src/utils/Utils.ts +++ b/web/src/utils/Utils.ts @@ -5,6 +5,8 @@ import moment from 'moment' import { useEffect } from 'react' import { useAppContext } from 'AppContext' +export type Unknown = any // eslint-disable-line @typescript-eslint/no-explicit-any + /** This utility shows a toaster without being bound to any component. * It's useful to show cross-page/component messages */ export function showToaster(message: string, props?: Partial): IToaster { @@ -99,7 +101,7 @@ export const useAnyTrialLicense = (): boolean => { return !!anyTrialEntitlements } -export const useGetTrialInfo = (): any => { +export const useGetTrialInfo = (): Unknown => { const { hooks: { useLicenseStore = () => ({}) } } = useAppContext()