From 4087345a2ab0dc002fffb608213d2c390ba66978 Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Tue, 18 Jun 2024 11:22:16 +0200 Subject: [PATCH] Merge pull request #18941 from overleaf/jpa-fix-some-ts-ignore [web] fix a few ts-ignore statements GitOrigin-RevId: 447a070a8268cffa6ef298b0fe158232c3f6fe8f --- package-lock.json | 24 +++++++++++++++++++ .../ide-react/connection/types/socket.ts | 4 ++++ .../ide-react/context/ide-react-context.tsx | 2 -- .../ide-react/context/references-context.tsx | 1 - .../dropdown/dropdown-menu-with-ref.tsx | 5 ++-- services/web/package.json | 2 ++ 6 files changed, 32 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9ec67fd6bd..90dab73f29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13028,6 +13028,16 @@ "@types/react": "*" } }, + "node_modules/@types/react-overlays": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@types/react-overlays/-/react-overlays-1.1.3.tgz", + "integrity": "sha512-oOq5NWbyfNz2w2sKvjkHdvGQSMA+VDVfI5UOfGPR0wkik2welad1RDVnVgH15jKf58jrZNBa1Ee4SVBgCGFxCg==", + "dev": true, + "dependencies": { + "@types/react": "*", + "@types/react-transition-group": "*" + } + }, "node_modules/@types/react-transition-group": { "version": "4.4.10", "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.10.tgz", @@ -44705,6 +44715,7 @@ "@types/react-dom": "^17.0.13", "@types/react-google-recaptcha": "^2.1.5", "@types/react-linkify": "^1.0.0", + "@types/react-overlays": "^1.1.3", "@types/recurly__recurly-js": "^4.22.0", "@types/sinon-chai": "^3.2.8", "@types/uuid": "^9.0.8", @@ -44797,6 +44808,7 @@ "react-google-recaptcha": "^3.1.0", "react-i18next": "^13.3.1", "react-linkify": "^1.0.0-alpha", + "react-overlays": "^0.9.3", "react-refresh": "^0.14.0", "react-resizable-panels": "^1.0.3", "requirejs": "^2.3.6", @@ -53156,6 +53168,7 @@ "@types/react-dom": "^17.0.13", "@types/react-google-recaptcha": "^2.1.5", "@types/react-linkify": "^1.0.0", + "@types/react-overlays": "^1.1.3", "@types/recurly__recurly-js": "^4.22.0", "@types/sinon-chai": "^3.2.8", "@types/uuid": "^9.0.8", @@ -53318,6 +53331,7 @@ "react-google-recaptcha": "^3.1.0", "react-i18next": "^13.3.1", "react-linkify": "^1.0.0-alpha", + "react-overlays": "^0.9.3", "react-refresh": "^0.14.0", "react-resizable-panels": "^1.0.3", "recurly": "^4.0.0", @@ -57876,6 +57890,16 @@ "@types/react": "*" } }, + "@types/react-overlays": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@types/react-overlays/-/react-overlays-1.1.3.tgz", + "integrity": "sha512-oOq5NWbyfNz2w2sKvjkHdvGQSMA+VDVfI5UOfGPR0wkik2welad1RDVnVgH15jKf58jrZNBa1Ee4SVBgCGFxCg==", + "dev": true, + "requires": { + "@types/react": "*", + "@types/react-transition-group": "*" + } + }, "@types/react-transition-group": { "version": "4.4.10", "resolved": "https://registry.npmjs.org/@types/react-transition-group/-/react-transition-group-4.4.10.tgz", diff --git a/services/web/frontend/js/features/ide-react/connection/types/socket.ts b/services/web/frontend/js/features/ide-react/connection/types/socket.ts index 4f9ec128a5..bb335bd7c3 100644 --- a/services/web/frontend/js/features/ide-react/connection/types/socket.ts +++ b/services/web/frontend/js/features/ide-react/connection/types/socket.ts @@ -23,6 +23,10 @@ export type Socket = { socket: { connected: boolean connect(): void + sessionid: string + transport?: { + name: string + } } disconnect(): void } diff --git a/services/web/frontend/js/features/ide-react/context/ide-react-context.tsx b/services/web/frontend/js/features/ide-react/context/ide-react-context.tsx index 56500bc1c4..33701d08d1 100644 --- a/services/web/frontend/js/features/ide-react/context/ide-react-context.tsx +++ b/services/web/frontend/js/features/ide-react/context/ide-react-context.tsx @@ -110,9 +110,7 @@ export const IdeReactProvider: FC = ({ children }) => { ...meta, user_id: getMeta('ol-user_id'), project_id: projectId, - // @ts-ignore client_id: socket.socket?.sessionid, - // @ts-ignore transport: socket.socket?.transport?.name, client_now: new Date(), release, diff --git a/services/web/frontend/js/features/ide-react/context/references-context.tsx b/services/web/frontend/js/features/ide-react/context/references-context.tsx index d127806680..46d1fe8849 100644 --- a/services/web/frontend/js/features/ide-react/context/references-context.tsx +++ b/services/web/frontend/js/features/ide-react/context/references-context.tsx @@ -1,4 +1,3 @@ -// @ts-ignore import { generateSHA1Hash } from '../../../shared/utils/sha1' import { createContext, diff --git a/services/web/frontend/js/shared/components/dropdown/dropdown-menu-with-ref.tsx b/services/web/frontend/js/shared/components/dropdown/dropdown-menu-with-ref.tsx index 2a137543cb..3a5d6a23f1 100644 --- a/services/web/frontend/js/shared/components/dropdown/dropdown-menu-with-ref.tsx +++ b/services/web/frontend/js/shared/components/dropdown/dropdown-menu-with-ref.tsx @@ -1,7 +1,5 @@ -import { forwardRef } from 'react' +import { forwardRef, SyntheticEvent } from 'react' import classnames from 'classnames' -// @ts-ignore -// eslint-disable-next-line import/no-extraneous-dependencies import RootCloseWrapper from 'react-overlays/lib/RootCloseWrapper' import { DropdownProps } from 'react-bootstrap' import { MergeAndOverride } from '../../../../../types/utils' @@ -16,6 +14,7 @@ type DropdownMenuWithRefProps = MergeAndOverride< // The props below are passed by react-bootstrap labelledBy?: string | undefined rootCloseEvent?: 'click' | 'mousedown' | undefined + onClose?: (e: SyntheticEvent) => void } > diff --git a/services/web/package.json b/services/web/package.json index 711735bd4e..98634d1925 100644 --- a/services/web/package.json +++ b/services/web/package.json @@ -244,6 +244,7 @@ "@types/react-dom": "^17.0.13", "@types/react-google-recaptcha": "^2.1.5", "@types/react-linkify": "^1.0.0", + "@types/react-overlays": "^1.1.3", "@types/recurly__recurly-js": "^4.22.0", "@types/sinon-chai": "^3.2.8", "@types/uuid": "^9.0.8", @@ -336,6 +337,7 @@ "react-google-recaptcha": "^3.1.0", "react-i18next": "^13.3.1", "react-linkify": "^1.0.0-alpha", + "react-overlays": "^0.9.3", "react-refresh": "^0.14.0", "react-resizable-panels": "^1.0.3", "requirejs": "^2.3.6",