A local-first personal finance app
Maintenance: CreateAccount and CreateEncryptionKey to tsx (#1755)
Michael Clarkf6e2d3b1f3dc
diff --git a/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx b/packages/desktop-client/src/components/autocomplete/Autocomplete.tsxindex 7f8365474f..8a903955df 100644--- a/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx+++ b/packages/desktop-client/src/components/autocomplete/Autocomplete.tsx@@ -398,7 +398,7 @@ function SingleAutocomplete({},onBlur: e => {// Should this be e.nativeEvent- e.preventDownshiftDefault = true;+ e['preventDownshiftDefault'] = true;inputProps.onBlur?.(e);if (!closeOnBlur) return;diff --git a/packages/desktop-client/src/components/common/Input.tsx b/packages/desktop-client/src/components/common/Input.tsxindex 6e0cbbcda9..c02b9bd86c 100644--- a/packages/desktop-client/src/components/common/Input.tsx+++ b/packages/desktop-client/src/components/common/Input.tsx@@ -2,7 +2,7 @@ import React, {useRef,type KeyboardEvent,type Ref,- type HTMLProps,+ type InputHTMLAttributes,} from 'react';import mergeRefs from 'react-merge-refs';@@ -21,7 +21,7 @@ export const defaultInputStyle = {border: '1px solid ' + theme.formInputBorder,};-type InputProps = HTMLProps<HTMLInputElement> & {+type InputProps = InputHTMLAttributes<HTMLInputElement> & {style?: CSSProperties;inputRef?: Ref<HTMLInputElement>;onEnter?: (event: KeyboardEvent<HTMLInputElement>) => void;diff --git a/packages/desktop-client/src/components/modals/CreateAccount.js b/packages/desktop-client/src/components/modals/CreateAccount.tsxsimilarity index 100%rename from packages/desktop-client/src/components/modals/CreateAccount.jsrename to packages/desktop-client/src/components/modals/CreateAccount.tsxdiff --git a/packages/desktop-client/src/components/modals/CreateEncryptionKey.js b/packages/desktop-client/src/components/modals/CreateEncryptionKey.tsxsimilarity index 95%rename from packages/desktop-client/src/components/modals/CreateEncryptionKey.jsrename to packages/desktop-client/src/components/modals/CreateEncryptionKey.tsxindex 9ead88f342..eb1f647183 100644--- a/packages/desktop-client/src/components/modals/CreateEncryptionKey.js+++ b/packages/desktop-client/src/components/modals/CreateEncryptionKey.tsx@@ -5,7 +5,9 @@ import { css } from 'glamor';import { send } from 'loot-core/src/platform/client/fetch';import { getCreateKeyError } from 'loot-core/src/shared/errors';+import { type BoundActions } from '../../hooks/useActions';import { theme } from '../../style';+import { type CommonModalProps } from '../../types/modals';import { ButtonWithLoading } from '../common/Button';import ExternalLink from '../common/ExternalLink';import InitialFocus from '../common/InitialFocus';@@ -15,11 +17,19 @@ import Paragraph from '../common/Paragraph';import Text from '../common/Text';import View from '../common/View';+type CreateEncryptionKeyProps = {+ modalProps: CommonModalProps;+ actions: BoundActions;+ options: {+ recreate?: boolean;+ };+};+export default function CreateEncryptionKey({modalProps,actions,options = {},-}) {+}: CreateEncryptionKeyProps) {let [password, setPassword] = useState('');let [loading, setLoading] = useState(false);let [error, setError] = useState('');diff --git a/packages/desktop-client/src/components/modals/countries.js b/packages/desktop-client/src/components/modals/countries.tssimilarity index 100%rename from packages/desktop-client/src/components/modals/countries.jsrename to packages/desktop-client/src/components/modals/countries.tsdiff --git a/packages/loot-core/src/types/handlers.d.ts b/packages/loot-core/src/types/handlers.d.tsindex 802e0d3bec..2537c02796 100644--- a/packages/loot-core/src/types/handlers.d.ts+++ b/packages/loot-core/src/types/handlers.d.ts@@ -1,6 +1,7 @@import type { BudgetHandlers } from '../server/budget/types/handlers';import type { FiltersHandlers } from '../server/filters/types/handlers';import type { NotesHandlers } from '../server/notes/types/handlers';+import type { RulesHandlers } from '../server/rules/types/handlers';import type { SchedulesHandlers } from '../server/schedules/types/handlers';import type { ToolsHandlers } from '../server/tools/types/handlers';@@ -13,5 +14,6 @@ export interface HandlersBudgetHandlers,FiltersHandlers,NotesHandlers,+ RulesHandlers,SchedulesHandlers,ToolsHandlers {}diff --git a/packages/loot-core/src/types/server-handlers.d.ts b/packages/loot-core/src/types/server-handlers.d.tsindex 6d67305435..ceaa91df30 100644--- a/packages/loot-core/src/types/server-handlers.d.ts+++ b/packages/loot-core/src/types/server-handlers.d.ts@@ -233,7 +233,9 @@ export interface ServerHandlers {'sync-repair': () => Promise<unknown>;- 'key-make': (arg: { password }) => Promise<unknown>;+ 'key-make': (arg: {+ password;+ }) => Promise<{ error?: { reason: string; meta?: unknown } }>;'key-test': (arg: {fileId;diff --git a/upcoming-release-notes/1755.md b/upcoming-release-notes/1755.mdnew file mode 100644index 0000000000..9a27e1ed88--- /dev/null+++ b/upcoming-release-notes/1755.md@@ -0,0 +1,6 @@+---+category: Maintenance+authors: [MikesGlitch]+---++Convert CreateAccount and CreateEncryptionKey components to TypeScript.