From badc20db2eee11ad311a342eb152f33ff9b93ed0 Mon Sep 17 00:00:00 2001 From: Piotr Rogowski Date: Thu, 14 Sep 2023 21:58:19 +0200 Subject: [PATCH] Switch to Biome --- .devcontainer/devcontainer.json | 2 +- .vscode/extensions.json | 4 +- .vscode/settings.json | 29 +-- rome.json => biome.json | 16 ++ package-lock.json | 218 ++++++++++-------- package.json | 10 +- src/App.tsx | 46 ++-- src/components/AuthorName.tsx | 4 +- src/components/CommandPalette.tsx | 74 +++--- src/components/Loader.tsx | 2 +- src/components/Logs/LogCanvas.tsx | 10 +- src/components/StarButton.tsx | 14 +- src/components/StatusBar.tsx | 10 +- src/components/TopBar.tsx | 64 ++--- .../TriggerLogs/CompositeCanvas.tsx | 6 +- src/components/TriggerLogs/ToothCanvas.tsx | 6 +- src/components/Tune/Dialog.tsx | 44 ++-- src/components/Tune/Dialog/Curve.tsx | 8 +- src/components/Tune/Dialog/Curve/Table.tsx | 8 +- .../Tune/Dialog/LandscapeNotice.tsx | 4 +- src/components/Tune/Dialog/Map3D.tsx | 10 +- src/components/Tune/Dialog/SmartSelect.tsx | 8 +- src/components/Tune/Dialog/TextField.tsx | 6 +- src/components/Tune/SideBar.tsx | 26 +-- src/contexts/AuthContext.tsx | 8 +- src/hooks/useConfig.ts | 8 +- src/hooks/useDb.ts | 4 +- src/hooks/useServerStorage.ts | 6 +- src/main.tsx | 10 +- src/pages/About.tsx | 26 +-- src/pages/Diagnose.tsx | 44 ++-- src/pages/Hub.tsx | 32 +-- src/pages/Info.tsx | 54 ++--- src/pages/Logs.tsx | 68 +++--- src/pages/Tune.tsx | 10 +- src/pages/Upload.tsx | 194 ++++++++-------- src/pages/User.tsx | 18 +- src/pages/auth/Login.tsx | 46 ++-- src/pages/auth/OauthCallback.tsx | 2 +- src/pages/auth/Profile.tsx | 62 ++--- src/pages/auth/ResetPassword.tsx | 16 +- src/pages/auth/ResetPasswordConfirmation.tsx | 18 +- src/pocketbase.ts | 2 +- src/utils/logs/LogValidator.ts | 7 +- src/utils/logs/MslLogParser.ts | 2 +- src/workers/logParserWorker.ts | 2 +- 46 files changed, 652 insertions(+), 616 deletions(-) rename rome.json => biome.json (69%) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 4e95fff3..fbe7d0d5 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -19,7 +19,7 @@ "editorconfig.editorconfig", "davidanson.vscode-markdownlint", "streetsidesoftware.code-spell-checker", - "rome.rome" + "biomejs.biome" ] } }, diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 44bcaa39..7aa871cf 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,10 +1,8 @@ { - // See http://go.microsoft.com/fwlink/?LinkId=827846 - // for the documentation about the extensions.json format "recommendations": [ "editorconfig.editorconfig", "davidanson.vscode-markdownlint", "streetsidesoftware.code-spell-checker", - "rome.rome" + "biomejs.biome" ] } diff --git a/.vscode/settings.json b/.vscode/settings.json index 04dcec77..11f00587 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,8 +1,23 @@ { "typescript.tsdk": "./node_modules/typescript/lib", + "[jsonc]": { + "editor.defaultFormatter": "vscode.json-language-features" + }, + "[less]": { + "editor.defaultFormatter": "vscode.css-language-features" + }, + "[typescript]": { + "editor.defaultFormatter": "biomejs.biome" + }, + "[javascript]": { + "editor.defaultFormatter": "biomejs.biome" + }, "editor.formatOnSave": true, "cSpell.words": [ "baro", + "biomejs", + "Codespaces", + "devcontainer", "devcontainers", "FOME", "hypertuner", @@ -18,17 +33,5 @@ "typegen", "vite", "vitejs" - ], - "[jsonc]": { - "editor.defaultFormatter": "vscode.json-language-features" - }, - "[less]": { - "editor.defaultFormatter": "vscode.css-language-features" - }, - "[typescript]": { - "editor.defaultFormatter": "rome.rome" - }, - "[javascript]": { - "editor.defaultFormatter": "rome.rome" - } + ] } diff --git a/rome.json b/biome.json similarity index 69% rename from rome.json rename to biome.json index 747fcde8..8a61d3ad 100644 --- a/rome.json +++ b/biome.json @@ -1,4 +1,8 @@ { + "$schema": "https://biomejs.dev/schemas/1.1.2/schema.json", + "organizeImports": { + "enabled": true + }, "formatter": { "enabled": true, "indentStyle": "space", @@ -15,6 +19,13 @@ "trailingComma": "all" } }, + "files": { + "ignore": [ + ".devcontainer", + ".vscode", + "node_modules" + ] + }, "linter": { "enabled": true, "rules": { @@ -36,6 +47,11 @@ "nursery": { "all": true, "useExhaustiveDependencies": "off", + "useImportRestrictions": "off", + "useNamingConvention": "off", + "noExcessiveComplexity": "off" + }, + "complexity": { "noForEach": "off" } } diff --git a/package-lock.json b/package-lock.json index cb0188be..2abe8933 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,6 +34,7 @@ "vite": "^4.4.9" }, "devDependencies": { + "@biomejs/biome": "1.1.2", "@total-typescript/ts-reset": "^0.5.1", "@types/lodash.debounce": "^4.0.7", "@types/node": "^20.6.0", @@ -46,7 +47,6 @@ "less": "^4.2.0", "pocketbase-typegen": "^1.1.13", "rollup-plugin-visualizer": "^5.9.2", - "rome": "^12.1.3", "typescript": "^5.2.2", "vite-plugin-html": "^3.2.0", "vite-plugin-pwa": "^0.16.5" @@ -1797,6 +1797,123 @@ "node": ">=6.9.0" } }, + "node_modules/@biomejs/biome": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@biomejs/biome/-/biome-1.1.2.tgz", + "integrity": "sha512-JEVWchqo0Xhl86IJgOh0xESWnNRUXBUDByCBR8TA4lIPzm/6U6Tv77+MblNkZ8MvwCtP6PlBNGdQcGKKabtuHA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "biome": "bin/biome" + }, + "engines": { + "node": ">=14.*" + }, + "optionalDependencies": { + "@biomejs/cli-darwin-arm64": "1.1.2", + "@biomejs/cli-darwin-x64": "1.1.2", + "@biomejs/cli-linux-arm64": "1.1.2", + "@biomejs/cli-linux-x64": "1.1.2", + "@biomejs/cli-win32-arm64": "1.1.2", + "@biomejs/cli-win32-x64": "1.1.2" + } + }, + "node_modules/@biomejs/cli-darwin-arm64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-arm64/-/cli-darwin-arm64-1.1.2.tgz", + "integrity": "sha512-YyqWeNZchPxlvxtdo2vMBkzrwllaNS3+DZ6j01mUCVIZE9kAzF/edMV2O38L2AEtnRLU1TI1f71Jai3ThILClg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-darwin-x64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-darwin-x64/-/cli-darwin-x64-1.1.2.tgz", + "integrity": "sha512-Sofxcu50AHJyQS6Xx3OF2egQQ7Un5YFVF5/umNFa+kSNrrCu/ucmzrk8FcGS2dOSs4L2LqD6ZDWjvbcikjzLYQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-linux-arm64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-arm64/-/cli-linux-arm64-1.1.2.tgz", + "integrity": "sha512-wtaQgpoVMZEKf1GlDlFGAJP1j6gnh4L4kJN8PQPOBAdKIUZ/YSjqVp0z28vli5xCQ57xCn1gH4Xoqw2gVYu1tQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-linux-x64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-linux-x64/-/cli-linux-x64-1.1.2.tgz", + "integrity": "sha512-TYIUjCXbY+kxnJgv8GESplMagB1GdOcMV21JGRATqnhUI4BvG6sjs3gfi+sdjLBQdbHhsISXW3yfUlv07HKqhg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-win32-arm64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-arm64/-/cli-win32-arm64-1.1.2.tgz", + "integrity": "sha512-yApn85KuJ+Ty5zxbqWnaifX4ONtZG+snu12RNKi8fxSVVCXzQ/k2PfsWQbsyvCG05qshSvNKtM54cuf+vhUIsw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.*" + } + }, + "node_modules/@biomejs/cli-win32-x64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@biomejs/cli-win32-x64/-/cli-win32-x64-1.1.2.tgz", + "integrity": "sha512-qebNvIrFj2TJ+K0JVGo1HkgV2y5jis6aOZDC1SWuk53GnqjSLdR+p1v86ZByOjYr1v+tjc67EXmEepk06VVvpA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=14.*" + } + }, "node_modules/@ctrl/tinycolor": { "version": "3.6.1", "resolved": "https://registry.npmjs.org/@ctrl/tinycolor/-/tinycolor-3.6.1.tgz", @@ -2539,84 +2656,6 @@ "node": ">= 8.0.0" } }, - "node_modules/@rometools/cli-darwin-arm64": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/@rometools/cli-darwin-arm64/-/cli-darwin-arm64-12.1.3.tgz", - "integrity": "sha512-AmFTUDYjBuEGQp/Wwps+2cqUr+qhR7gyXAUnkL5psCuNCz3807TrUq/ecOoct5MIavGJTH6R4aaSL6+f+VlBEg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rometools/cli-darwin-x64": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/@rometools/cli-darwin-x64/-/cli-darwin-x64-12.1.3.tgz", - "integrity": "sha512-k8MbWna8q4LRlb005N2X+JS1UQ+s3ZLBBvwk4fP8TBxlAJXUz17jLLu/Fi+7DTTEmMhM84TWj4FDKW+rNar28g==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "darwin" - ] - }, - "node_modules/@rometools/cli-linux-arm64": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/@rometools/cli-linux-arm64/-/cli-linux-arm64-12.1.3.tgz", - "integrity": "sha512-X/uLhJ2/FNA3nu5TiyeNPqiD3OZoFfNfRvw6a3ut0jEREPvEn72NI7WPijH/gxSz55znfQ7UQ6iM4DZumUknJg==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rometools/cli-linux-x64": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/@rometools/cli-linux-x64/-/cli-linux-x64-12.1.3.tgz", - "integrity": "sha512-csP17q1eWiUXx9z6Jr/JJPibkplyKIwiWPYNzvPCGE8pHlKhwZj3YHRuu7Dm/4EOqx0XFIuqqWZUYm9bkIC8xg==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "linux" - ] - }, - "node_modules/@rometools/cli-win32-arm64": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/@rometools/cli-win32-arm64/-/cli-win32-arm64-12.1.3.tgz", - "integrity": "sha512-RymHWeod57EBOJY4P636CgUwYA6BQdkQjh56XKk4pLEHO6X1bFyMet2XL7KlHw5qOTalzuzf5jJqUs+vf3jdXQ==", - "cpu": [ - "arm64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/@rometools/cli-win32-x64": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/@rometools/cli-win32-x64/-/cli-win32-x64-12.1.3.tgz", - "integrity": "sha512-yHSKYidqJMV9nADqg78GYA+cZ0hS1twANAjiFibQdXj9aGzD+s/IzIFEIi/U/OBLvWYg/SCw0QVozi2vTlKFDQ==", - "cpu": [ - "x64" - ], - "dev": true, - "optional": true, - "os": [ - "win32" - ] - }, "node_modules/@sentry-internal/tracing": { "version": "7.68.0", "resolved": "https://registry.npmjs.org/@sentry-internal/tracing/-/tracing-7.68.0.tgz", @@ -7853,27 +7892,6 @@ "node": ">= 8" } }, - "node_modules/rome": { - "version": "12.1.3", - "resolved": "https://registry.npmjs.org/rome/-/rome-12.1.3.tgz", - "integrity": "sha512-e+ff72hxDpe/t5/Us7YRBVw3PBET7SeczTQNn6tvrWdrCaAw3qOukQQ+tDCkyFtS4yGsnhjrJbm43ctNbz27Yg==", - "dev": true, - "hasInstallScript": true, - "bin": { - "rome": "bin/rome" - }, - "engines": { - "node": ">=14.*" - }, - "optionalDependencies": { - "@rometools/cli-darwin-arm64": "12.1.3", - "@rometools/cli-darwin-x64": "12.1.3", - "@rometools/cli-linux-arm64": "12.1.3", - "@rometools/cli-linux-x64": "12.1.3", - "@rometools/cli-win32-arm64": "12.1.3", - "@rometools/cli-win32-x64": "12.1.3" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", diff --git a/package.json b/package.json index b88d77dd..61c2f87c 100644 --- a/package.json +++ b/package.json @@ -14,10 +14,10 @@ "start": "vite", "build": "tsc && vite build", "serve": "vite preview", - "lint": "tsc && npm run lint:rome", - "lint:rome": "rome ci src", - "lint:fix": "rome format --write src && rome check --apply src", - "lint:fix:unsafe": "rome check --apply-unsafe src", + "lint": "tsc && npm run lint:biome", + "lint:biome": "biome check src", + "lint:fix": "biome format --write src && biome check --apply src", + "lint:fix:unsafe": "biome check src --apply-unsafe src", "analyze": "npm run build && open stats.html", "typegen": "pocketbase-typegen --json ../cloud-backend/pb_schema.json --out src/@types/pocketbase-types.ts" }, @@ -47,6 +47,7 @@ "vite": "^4.4.9" }, "devDependencies": { + "@biomejs/biome": "1.1.2", "@total-typescript/ts-reset": "^0.5.1", "@types/lodash.debounce": "^4.0.7", "@types/node": "^20.6.0", @@ -59,7 +60,6 @@ "less": "^4.2.0", "pocketbase-typegen": "^1.1.13", "rollup-plugin-visualizer": "^5.9.2", - "rome": "^12.1.3", "typescript": "^5.2.2", "vite-plugin-html": "^3.2.0", "vite-plugin-pwa": "^0.16.5" diff --git a/src/App.tsx b/src/App.tsx index c343ca67..7e36346a 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,36 +1,36 @@ +import { INI } from '@hyper-tuner/ini'; +import { Layout, Result } from 'antd'; +import { ReactNode, Suspense, lazy, useCallback, useEffect, useState } from 'react'; +import { connect } from 'react-redux'; import { - Routes as ReactRoutes, Route, + Routes as ReactRoutes, + generatePath, useMatch, useNavigate, - generatePath, } from 'react-router-dom'; -import { Layout, Result } from 'antd'; -import { connect } from 'react-redux'; -import { INI } from '@hyper-tuner/ini'; -import { lazy, ReactNode, Suspense, useCallback, useEffect, useState } from 'react'; -import TopBar from './components/TopBar'; -import StatusBar from './components/StatusBar'; -import { Routes } from './routes'; -import store from './store'; import Loader from './components/Loader'; -import { AppState, TuneDataState, UIState } from './types/state'; +import StatusBar from './components/StatusBar'; +import TopBar from './components/TopBar'; +import { collapsedSidebarWidth, sidebarWidth } from './components/Tune/SideBar'; +import { divider } from './data/constants'; +import help from './data/help'; +import standardDialogs from './data/standardDialogs'; import useDb from './hooks/useDb'; -import Info from './pages/Info'; +import useServerStorage from './hooks/useServerStorage'; import Hub from './pages/Hub'; +import Info from './pages/Info'; import { FormRoles } from './pages/auth/Login'; -import useServerStorage from './hooks/useServerStorage'; -import TuneParser from './utils/tune/TuneParser'; -import standardDialogs from './data/standardDialogs'; -import help from './data/help'; import { iniLoadingError, tuneNotFound, tuneParsingError } from './pages/auth/notifications'; -import { divider } from './data/constants'; -import { collapsedSidebarWidth, sidebarWidth } from './components/Tune/SideBar'; +import { Routes } from './routes'; +import store from './store'; +import { AppState, TuneDataState, UIState } from './types/state'; +import TuneParser from './utils/tune/TuneParser'; -import 'uplot/dist/uPlot.min.css'; import 'react-perfect-scrollbar/dist/css/styles.css'; -import './css/App.less'; +import 'uplot/dist/uPlot.min.css'; import { TunesResponse } from './@types/pocketbase-types'; +import './css/App.less'; const Tune = lazy(() => import('./pages/Tune')); const Logs = lazy(() => import('./pages/Logs')); @@ -159,7 +159,7 @@ const App = ({ ui, tuneData }: { ui: UIState; tuneData: TuneDataState }) => { return ( - + }>{element} @@ -231,11 +231,11 @@ const App = ({ ui, tuneData }: { ui: UIState; tuneData: TuneDataState }) => { /> + } /> } diff --git a/src/components/AuthorName.tsx b/src/components/AuthorName.tsx index db9394c6..5931b441 100644 --- a/src/components/AuthorName.tsx +++ b/src/components/AuthorName.tsx @@ -1,12 +1,12 @@ -import { Space, Tooltip } from 'antd'; import { CheckCircleFilled } from '@ant-design/icons'; +import { Space, Tooltip } from 'antd'; import { UsersResponse } from '../@types/pocketbase-types'; import { Colors } from '../utils/colors'; const AuthorName = ({ author }: { author: UsersResponse }) => ( {author.verifiedAuthor === true && ( - + )} diff --git a/src/components/CommandPalette.tsx b/src/components/CommandPalette.tsx index cc6189c8..9541b85d 100644 --- a/src/components/CommandPalette.tsx +++ b/src/components/CommandPalette.tsx @@ -1,59 +1,59 @@ -import React, { - CSSProperties, - forwardRef, - Fragment, - Ref, - useMemo, - ReactNode, - useCallback, -} from 'react'; -import { - ActionId, - KBarAnimator, - KBarProvider, - KBarPortal, - KBarPositioner, - KBarSearch, - KBarResults, - useMatches, - ActionImpl, - Action, - useRegisterActions, -} from 'kbar'; -import { connect } from 'react-redux'; import { + CarOutlined, CloudUploadOutlined, + FundOutlined, + InfoCircleOutlined, LoginOutlined, - UserAddOutlined, LogoutOutlined, - InfoCircleOutlined, - FundOutlined, SettingOutlined, - CarOutlined, + UserAddOutlined, } from '@ant-design/icons'; -import { useNavigate, generatePath } from 'react-router'; import { Config as ConfigType, - Tune as TuneType, - Menus as MenusType, + GroupChildMenu as GroupChildMenuType, + GroupMenu as GroupMenuType, Menu as MenuType, + Menus as MenusType, SubMenu as SubMenuType, - GroupMenu as GroupMenuType, - GroupChildMenu as GroupChildMenuType, + Tune as TuneType, } from '@hyper-tuner/types'; -import { Routes } from '../routes'; +import { + Action, + ActionId, + ActionImpl, + KBarAnimator, + KBarPortal, + KBarPositioner, + KBarProvider, + KBarResults, + KBarSearch, + useMatches, + useRegisterActions, +} from 'kbar'; +import React, { + CSSProperties, + Fragment, + ReactNode, + Ref, + forwardRef, + useCallback, + useMemo, +} from 'react'; +import { connect } from 'react-redux'; +import { generatePath, useNavigate } from 'react-router'; import { useAuth } from '../contexts/AuthContext'; import { logOutSuccessful } from '../pages/auth/notifications'; +import { Routes } from '../routes'; import store from '../store'; -import { isMac } from '../utils/env'; import { AppState, NavigationState } from '../types/state'; +import { isMac } from '../utils/env'; +import Icon from './SideBar/Icon'; import { - buildDialogUrl, - buildGroupMenuDialogUrl, SKIP_MENUS, SKIP_SUB_MENUS, + buildDialogUrl, + buildGroupMenuDialogUrl, } from './Tune/SideBar'; -import Icon from './SideBar/Icon'; enum Sections { NAVIGATION = 'Navigation', diff --git a/src/components/Loader.tsx b/src/components/Loader.tsx index b60b56b8..064efc3b 100644 --- a/src/components/Loader.tsx +++ b/src/components/Loader.tsx @@ -1,7 +1,7 @@ import { Skeleton } from 'antd'; const Loader = () => ( -
+
); diff --git a/src/components/Logs/LogCanvas.tsx b/src/components/Logs/LogCanvas.tsx index c8d09a35..8eb0b552 100644 --- a/src/components/Logs/LogCanvas.tsx +++ b/src/components/Logs/LogCanvas.tsx @@ -1,12 +1,12 @@ -import { useCallback } from 'react'; import { Logs } from '@hyper-tuner/types'; import { Space } from 'antd'; -import UplotReact from 'uplot-react'; +import { useCallback } from 'react'; import uPlot from 'uplot'; -import { colorHsl, formatNumberMs } from '../../utils/numbers'; +import UplotReact from 'uplot-react'; import { Colors } from '../../utils/colors'; -import touchZoomPlugin from '../../utils/uPlot/touchZoomPlugin'; +import { colorHsl, formatNumberMs } from '../../utils/numbers'; import { isNumber } from '../../utils/tune/expression'; +import touchZoomPlugin from '../../utils/uPlot/touchZoomPlugin'; export interface SelectedField { name: string; @@ -174,7 +174,7 @@ const LogCanvas = ({ } return ( - + {!showSingleGraph && ( { const navigate = useNavigate(); @@ -65,8 +65,8 @@ const StarButton = ({ tuneData }: { tuneData: TuneDataState }) => { return (
{tuneData?.tuneId && ( - + )} - + {/* dummy anchor for file download */} - + download diff --git a/src/components/TriggerLogs/CompositeCanvas.tsx b/src/components/TriggerLogs/CompositeCanvas.tsx index a3df4270..53fb6566 100644 --- a/src/components/TriggerLogs/CompositeCanvas.tsx +++ b/src/components/TriggerLogs/CompositeCanvas.tsx @@ -1,9 +1,9 @@ import { useEffect, useState } from 'react'; -import UplotReact from 'uplot-react'; import uPlot from 'uplot'; -import touchZoomPlugin from '../../utils/uPlot/touchZoomPlugin'; -import { CompositeLogEntry } from '../../utils/logs/TriggerLogsParser'; +import UplotReact from 'uplot-react'; import { Colors } from '../../utils/colors'; +import { CompositeLogEntry } from '../../utils/logs/TriggerLogsParser'; +import touchZoomPlugin from '../../utils/uPlot/touchZoomPlugin'; import LogsPagination from './LogsPagination'; const scale = 2; diff --git a/src/components/TriggerLogs/ToothCanvas.tsx b/src/components/TriggerLogs/ToothCanvas.tsx index 16387f54..71cbf65d 100644 --- a/src/components/TriggerLogs/ToothCanvas.tsx +++ b/src/components/TriggerLogs/ToothCanvas.tsx @@ -1,9 +1,9 @@ import { useEffect, useState } from 'react'; -import UplotReact from 'uplot-react'; import uPlot from 'uplot'; -import touchZoomPlugin from '../../utils/uPlot/touchZoomPlugin'; -import { ToothLogEntry, EntryType } from '../../utils/logs/TriggerLogsParser'; +import UplotReact from 'uplot-react'; import { Colors } from '../../utils/colors'; +import { EntryType, ToothLogEntry } from '../../utils/logs/TriggerLogsParser'; +import touchZoomPlugin from '../../utils/uPlot/touchZoomPlugin'; import LogsPagination from './LogsPagination'; const { bars } = uPlot.paths; diff --git a/src/components/Tune/Dialog.tsx b/src/components/Tune/Dialog.tsx index 79792df8..022ac5e3 100644 --- a/src/components/Tune/Dialog.tsx +++ b/src/components/Tune/Dialog.tsx @@ -1,29 +1,29 @@ -import React, { useCallback, useEffect, useRef, useState } from 'react'; -import { connect } from 'react-redux'; -import { Form, Divider, Col, Row, Popover, Space, Result } from 'antd'; import { QuestionCircleOutlined } from '@ant-design/icons'; import { - Dialogs as DialogsType, - Dialog as DialogType, Config as ConfigType, - Field as FieldType, + ConstantTypes, Curve as CurveType, - Table as TableType, + Dialog as DialogType, + Dialogs as DialogsType, + Field as FieldType, ScalarConstant as ScalarConstantType, - ConstantTypes, + Table as TableType, Tune as TuneType, } from '@hyper-tuner/types'; -import { AppState, UIState } from '../../types/state'; -import SmartSelect from './Dialog/SmartSelect'; -import SmartNumber from './Dialog/SmartNumber'; -import TextField from './Dialog/TextField'; -import Curve from './Dialog/Curve'; -import { parseXy, parseZ } from '../../utils/tune/table'; -import Map3D from './Dialog/Map3D'; -import { evaluateExpression } from '../../utils/tune/expression'; +import { Col, Divider, Form, Popover, Result, Row, Space } from 'antd'; +import React, { useCallback, useEffect, useRef, useState } from 'react'; +import { connect } from 'react-redux'; import useBrowserStorage from '../../hooks/useBrowserStorage'; import useConfig from '../../hooks/useConfig'; +import { AppState, UIState } from '../../types/state'; +import { evaluateExpression } from '../../utils/tune/expression'; +import { parseXy, parseZ } from '../../utils/tune/table'; import Loader from '../Loader'; +import Curve from './Dialog/Curve'; +import Map3D from './Dialog/Map3D'; +import SmartNumber from './Dialog/SmartNumber'; +import SmartSelect from './Dialog/SmartSelect'; +import TextField from './Dialog/TextField'; interface DialogsAndCurves { [name: string]: DialogType | CurveType | TableType; @@ -88,11 +88,11 @@ const Dialog = ({ link && ( + {link} } - placement='right' + placement="right" > @@ -353,7 +353,7 @@ const Dialog = ({ if (!dialogConfig) { if (curveConfig) { return ( -
+
{curveConfig.title} {renderCurve(curveConfig)}
@@ -362,7 +362,7 @@ const Dialog = ({ if (tableConfig) { return ( -
+
{renderHelp(tableConfig.help)} {tableConfig.title} {renderTable(tableConfig)} @@ -370,11 +370,11 @@ const Dialog = ({ ); } - return ; + return ; } return ( -
+
{renderHelp(dialogConfig?.help)}
{panelsComponents} diff --git a/src/components/Tune/Dialog/Curve.tsx b/src/components/Tune/Dialog/Curve.tsx index e0006803..c199fc46 100644 --- a/src/components/Tune/Dialog/Curve.tsx +++ b/src/components/Tune/Dialog/Curve.tsx @@ -1,10 +1,10 @@ -import { Typography, Grid } from 'antd'; +import { Grid, Typography } from 'antd'; import { useCallback, useEffect, useRef, useState } from 'react'; -import UplotReact from 'uplot-react'; import uPlot from 'uplot'; +import UplotReact from 'uplot-react'; import { Colors } from '../../../utils/colors'; -import LandscapeNotice from './LandscapeNotice'; import Table from './Curve/Table'; +import LandscapeNotice from './LandscapeNotice'; const { useBreakpoint } = Grid; @@ -87,7 +87,7 @@ const Curve = ({ return ( <> - {help} + {help}
diff --git a/src/components/Tune/Dialog/Curve/Table.tsx b/src/components/Tune/Dialog/Curve/Table.tsx index 57b7f589..ad9ce878 100644 --- a/src/components/Tune/Dialog/Curve/Table.tsx +++ b/src/components/Tune/Dialog/Curve/Table.tsx @@ -27,7 +27,7 @@ const Table = ({ return ( @@ -39,15 +39,15 @@ const Table = ({ ); return ( -
+
- + {renderRow('y', yData)} - + {renderRow('x', xData)} diff --git a/src/components/Tune/Dialog/LandscapeNotice.tsx b/src/components/Tune/Dialog/LandscapeNotice.tsx index 03999fd2..1b65f5b9 100644 --- a/src/components/Tune/Dialog/LandscapeNotice.tsx +++ b/src/components/Tune/Dialog/LandscapeNotice.tsx @@ -1,8 +1,8 @@ -import { Result } from 'antd'; import { RotateLeftOutlined } from '@ant-design/icons'; +import { Result } from 'antd'; const LandscapeNotice = () => ( - } /> + } /> ); export default LandscapeNotice; diff --git a/src/components/Tune/Dialog/Map3D.tsx b/src/components/Tune/Dialog/Map3D.tsx index 18bc12d6..b7df8135 100644 --- a/src/components/Tune/Dialog/Map3D.tsx +++ b/src/components/Tune/Dialog/Map3D.tsx @@ -1,6 +1,6 @@ import { Grid } from 'antd'; -import LandscapeNotice from './LandscapeNotice'; import { colorHsl, formatNumber } from '../../../utils/numbers'; +import LandscapeNotice from './LandscapeNotice'; const { useBreakpoint } = Grid; @@ -33,7 +33,7 @@ const Map3D = ({ if (index === 0) { result.push( - , ); @@ -41,7 +41,7 @@ const Map3D = ({ result.push(
{`${yLabel} (${yUnits})`}{`${yLabel} (${yUnits})`}
{`${xLabel} (${xUnits})`}{`${xLabel} (${xUnits})`}
+ {`${yValue}`} @@ -57,14 +57,14 @@ const Map3D = ({ } return ( -
+
{zData.map((row, i) => ( {renderRow(i, row)} ))} - {xData.map((xValue, l) => ( diff --git a/src/components/Tune/Dialog/SmartSelect.tsx b/src/components/Tune/Dialog/SmartSelect.tsx index ba7cb9dd..71e96fb1 100644 --- a/src/components/Tune/Dialog/SmartSelect.tsx +++ b/src/components/Tune/Dialog/SmartSelect.tsx @@ -1,6 +1,6 @@ -import { Radio, Select, Switch } from 'antd'; import { CheckOutlined, CloseOutlined } from '@ant-design/icons'; import { Switches } from '@hyper-tuner/types'; +import { Radio, Select, Switch } from 'antd'; const SmartSelect = ({ values, @@ -29,8 +29,8 @@ const SmartSelect = ({ return ( {values.map((val: string, index) => ( @@ -45,7 +45,7 @@ const SmartSelect = ({ return ( debounceLoadData(target.value)} allowClear /> diff --git a/src/pages/Info.tsx b/src/pages/Info.tsx index ba77b677..d3695ee7 100644 --- a/src/pages/Info.tsx +++ b/src/pages/Info.tsx @@ -1,15 +1,15 @@ -import { connect } from 'react-redux'; -import ReactMarkdown from 'react-markdown'; -import { Button, Col, Divider, Form, Input, Row, Select } from 'antd'; import { EditOutlined } from '@ant-design/icons'; +import { Button, Col, Divider, Form, Input, Row, Select } from 'antd'; +import ReactMarkdown from 'react-markdown'; +import { connect } from 'react-redux'; import { generatePath, useNavigate } from 'react-router-dom'; -import { AppState, TuneDataState } from '../types/state'; +import { TunesAspirationOptions } from '../@types/pocketbase-types'; import Loader from '../components/Loader'; -import { Routes } from '../routes'; +import StarButton from '../components/StarButton'; import { useAuth } from '../contexts/AuthContext'; +import { Routes } from '../routes'; +import { AppState, TuneDataState } from '../types/state'; import { formatTime } from '../utils/time'; -import { TunesAspirationOptions } from '../@types/pocketbase-types'; -import StarButton from '../components/StarButton'; const { Item } = Form; const rowProps = { gutter: 10 }; @@ -37,7 +37,7 @@ const Info = ({ tuneData }: { tuneData: TuneDataState }) => { Manage - @@ -50,59 +50,59 @@ const Info = ({ tuneData }: { tuneData: TuneDataState }) => { } return ( -
+
Details
- + - + - + - + - + - + - + @@ -112,7 +112,7 @@ const Info = ({ tuneData }: { tuneData: TuneDataState }) => { @@ -140,42 +140,42 @@ const Info = ({ tuneData }: { tuneData: TuneDataState }) => { - + - + - + - + - + - + README -
+
{tuneData.readme && {`${tuneData.readme}`}}
{canManage && } diff --git a/src/pages/Logs.tsx b/src/pages/Logs.tsx index 77485c39..9fed2d8b 100644 --- a/src/pages/Logs.tsx +++ b/src/pages/Logs.tsx @@ -1,42 +1,42 @@ -import { Link, generatePath, useMatch, useNavigate } from 'react-router-dom'; -import { useCallback, useEffect, useRef, useState } from 'react'; +import { EditOutlined, FileTextOutlined, GlobalOutlined } from '@ant-design/icons'; +import { DatalogEntry, Logs as LogsType, OutputChannel } from '@hyper-tuner/types'; import { - Layout, - Tabs, + Badge, Checkbox, - Row, - Progress, - Steps, - Space, Divider, - Badge, - Typography, Grid, Input, + Layout, + Progress, + Row, + Space, + Steps, + Tabs, + Typography, } from 'antd'; -import { FileTextOutlined, EditOutlined, GlobalOutlined } from '@ant-design/icons'; import { CheckboxValueType } from 'antd/es/checkbox/Group'; -import { connect } from 'react-redux'; +import Fuse from 'fuse.js'; +import debounce from 'lodash.debounce'; import { Result as ParserResult } from 'mlg-converter/dist/types'; +import { useCallback, useEffect, useRef, useState } from 'react'; import PerfectScrollbar from 'react-perfect-scrollbar'; -import { OutputChannel, Logs as LogsType, DatalogEntry } from '@hyper-tuner/types'; -import LogParserWorker from '../workers/logParserWorker?worker'; +import { connect } from 'react-redux'; +import { Link, generatePath, useMatch, useNavigate } from 'react-router-dom'; +import Loader from '../components/Loader'; import LogCanvas, { SelectedField } from '../components/Logs/LogCanvas'; -import store from '../store'; -import { formatBytes, msToTime } from '../utils/numbers'; +import { collapsedSidebarWidth, sidebarWidth } from '../components/Tune/SideBar'; import useConfig from '../hooks/useConfig'; -import { isExpression, stripExpression } from '../utils/tune/expression'; -import { AppState, ConfigState, LogsState, TuneDataState, UIState } from '../types/state'; -import Loader from '../components/Loader'; -import { Colors } from '../utils/colors'; import useServerStorage from '../hooks/useServerStorage'; -import { Routes } from '../routes'; import { removeFilenameSuffix } from '../pocketbase'; +import { Routes } from '../routes'; +import store from '../store'; +import { AppState, ConfigState, LogsState, TuneDataState, UIState } from '../types/state'; +import { Colors } from '../utils/colors'; import { isAbortedRequest } from '../utils/error'; +import { formatBytes, msToTime } from '../utils/numbers'; +import { isExpression, stripExpression } from '../utils/tune/expression'; import { WorkerOutput } from '../workers/logParserWorker'; -import { collapsedSidebarWidth, sidebarWidth } from '../components/Tune/SideBar'; -import Fuse from 'fuse.js'; -import debounce from 'lodash.debounce'; +import LogParserWorker from '../workers/logParserWorker?worker'; const { Content } = Layout; const edgeUnknown = 'Unknown'; @@ -318,16 +318,16 @@ const Logs = ({ return ( <> - + {(loadedLogs?.logs || []).length ? ( !ui.sidebarCollapsed && ( + Fields @@ -338,7 +338,7 @@ const Logs = ({ debounceSearch1(target.value)} style={searchInputStyle} - placeholder='Search fields...' + placeholder="Search fields..." allowClear />
debounceSearch2(target.value)} style={searchInputStyle} - placeholder='Search fields...' + placeholder="Search fields..." allowClear />
@@ -398,7 +398,7 @@ const Logs = ({ { label: ( )} - +
{logs || !!(loadedLogs.logs || []).length ? ( @@ -448,12 +448,12 @@ const Logs = ({ showSingleGraph={showSingleGraph} /> ) : ( - + ({ navigation: state.navigation, diff --git a/src/pages/Upload.tsx b/src/pages/Upload.tsx index ceacb7e5..1da33a04 100644 --- a/src/pages/Upload.tsx +++ b/src/pages/Upload.tsx @@ -1,60 +1,42 @@ -import { useCallback, useEffect, useState } from 'react'; import { + CheckOutlined, + CopyOutlined, + EditOutlined, + EyeOutlined, + FileTextOutlined, + FundOutlined, + GlobalOutlined, + PlusOutlined, + SendOutlined, + SettingOutlined, + ShareAltOutlined, + ToolOutlined, +} from '@ant-design/icons'; +import { INI } from '@hyper-tuner/ini'; +import { + AutoComplete, Button, Col, Divider, + Form, Input, InputNumber, Row, Select, Space, Tabs, + Tag, Tooltip, Typography, Upload, - Form, - AutoComplete, - Tag, } from 'antd'; -import { - PlusOutlined, - ToolOutlined, - FundOutlined, - SettingOutlined, - CopyOutlined, - ShareAltOutlined, - FileTextOutlined, - EditOutlined, - CheckOutlined, - SendOutlined, - GlobalOutlined, - EyeOutlined, -} from '@ant-design/icons'; +import { UploadFile } from 'antd/lib/upload/interface'; import debounce from 'lodash.debounce'; -import { INI } from '@hyper-tuner/ini'; +import { nanoid } from 'nanoid'; import { UploadRequestOption } from 'rc-upload/lib/interface'; -import { UploadFile } from 'antd/lib/upload/interface'; -import { generatePath, useMatch, useNavigate } from 'react-router-dom'; +import { useCallback, useEffect, useState } from 'react'; import ReactMarkdown from 'react-markdown'; -import { nanoid } from 'nanoid'; -import { - emailNotVerified, - error, - restrictedPage, - signatureNotSupportedWarning, -} from './auth/notifications'; -import { useAuth } from '../contexts/AuthContext'; -import { Routes } from '../routes'; -import TuneParser from '../utils/tune/TuneParser'; -import TriggerLogsParser from '../utils/logs/TriggerLogsParser'; -import LogValidator from '../utils/logs/LogValidator'; -import useDb, { TunesRecordPartial } from '../hooks/useDb'; -import useServerStorage from '../hooks/useServerStorage'; -import { buildFullUrl } from '../utils/url'; -import Loader from '../components/Loader'; -import { requiredTextRules, requiredRules } from '../utils/form'; -import { aspirationMapper } from '../utils/tune/mappers'; -import { copyToClipboard } from '../utils/clipboard'; +import { generatePath, useMatch, useNavigate } from 'react-router-dom'; import { TunesAspirationOptions, TunesRecord, @@ -63,9 +45,27 @@ import { TunesTagsOptions, TunesVisibilityOptions, } from '../@types/pocketbase-types'; +import Loader from '../components/Loader'; +import { useAuth } from '../contexts/AuthContext'; +import useDb, { TunesRecordPartial } from '../hooks/useDb'; +import useServerStorage from '../hooks/useServerStorage'; import { removeFilenameSuffix } from '../pocketbase'; -import { bufferToFile } from '../utils/files'; +import { Routes } from '../routes'; +import { copyToClipboard } from '../utils/clipboard'; import { compress } from '../utils/compression'; +import { bufferToFile } from '../utils/files'; +import { requiredRules, requiredTextRules } from '../utils/form'; +import LogValidator from '../utils/logs/LogValidator'; +import TriggerLogsParser from '../utils/logs/TriggerLogsParser'; +import TuneParser from '../utils/tune/TuneParser'; +import { aspirationMapper } from '../utils/tune/mappers'; +import { buildFullUrl } from '../utils/url'; +import { + emailNotVerified, + error, + restrictedPage, + signatureNotSupportedWarning, +} from './auth/notifications'; const { Item, useForm } = Form; @@ -611,7 +611,7 @@ const UploadPage = () => { }, [routeMatch?.params.tuneId]); const UploadButton = () => ( - + Upload @@ -628,7 +628,7 @@ const UploadPage = () => { const PublishButton = () => (
- + - + @@ -700,29 +700,29 @@ const UploadPage = () => { Details - + searchAutocomplete('vehicleName', search)} backfill > - + - + + - + searchAutocomplete('engineCode', search)} backfill > - + - - + + - - + + - - Naturally aspirated Turbocharged @@ -781,75 +781,75 @@ const UploadPage = () => { - + - + searchAutocomplete('fuel', search)} backfill > - + - + searchAutocomplete('ignition', search)} backfill > - + - - + + - - + + - - + + - - + + README - (markdown) + (markdown) { key: 'preview', style: { height: descriptionEditorHeight }, children: ( -
+
{readme}
), @@ -885,12 +885,12 @@ const UploadPage = () => { Upload Logs - (.mlg, .csv, .msl) + (.mlg, .csv, .msl) file.uid).join('-') || 'logs'} - listType='picture-card' + listType="picture-card" customRequest={uploadLogs} onRemove={removeLogFile} iconRender={logIcon} @@ -899,19 +899,19 @@ const UploadPage = () => { disabled={isPublished} onPreview={noop} defaultFileList={defaultLogFilesList} - accept='.mlg,.csv,.msl' + accept=".mlg,.csv,.msl" > {logFiles.length < MaxFiles.LOG_FILES && } Upload Tooth and Composite logs - (.csv) + (.csv) file.uid).join('-') || 'toothLogs'} - listType='picture-card' + listType="picture-card" customRequest={uploadToothLogs} onRemove={removeToothLogFile} iconRender={toothLogIcon} @@ -919,26 +919,26 @@ const UploadPage = () => { maxCount={MaxFiles.TOOTH_LOG_FILES} onPreview={noop} defaultFileList={defaultToothLogFilesList} - accept='.csv' + accept=".csv" > {toothLogFiles.length < MaxFiles.TOOTH_LOG_FILES && } Upload Custom INI - (.ini) + (.ini) {!customIniFile && } @@ -949,7 +949,7 @@ const UploadPage = () => { if (isPublished) { return ( -
+
); @@ -964,7 +964,7 @@ const UploadPage = () => { } return ( -
+
{ Upload Tune - (.msq) + (.msq) {tuneFile === undefined && } diff --git a/src/pages/User.tsx b/src/pages/User.tsx index 2e1c76d4..2d2240aa 100644 --- a/src/pages/User.tsx +++ b/src/pages/User.tsx @@ -1,14 +1,14 @@ +import { ArrowRightOutlined } from '@ant-design/icons'; +import { Button, Divider, List, Pagination, Space, Typography } from 'antd'; import { useEffect, useState } from 'react'; import { generatePath, useMatch, useNavigate } from 'react-router-dom'; -import { Button, Divider, List, Pagination, Space, Typography } from 'antd'; -import { ArrowRightOutlined } from '@ant-design/icons'; +import { TunesResponse, UsersResponse } from '../@types/pocketbase-types'; +import AuthorName from '../components/AuthorName'; +import TuneTag from '../components/TuneTag'; +import useDb from '../hooks/useDb'; import { Routes } from '../routes'; import { formatTime } from '../utils/time'; -import useDb from '../hooks/useDb'; import { aspirationMapper } from '../utils/tune/mappers'; -import { TunesResponse, UsersResponse } from '../@types/pocketbase-types'; -import TuneTag from '../components/TuneTag'; -import AuthorName from '../components/AuthorName'; const tunePath = (tuneId: string) => generatePath(Routes.TUNE_TUNE, { tuneId }); @@ -42,7 +42,7 @@ const Profile = () => { }, [page]); return ( -
+
{author ? ( <> @@ -66,10 +66,10 @@ const Profile = () => { ]} className={tune.visibility} > - + + {tune.vehicleName} {tune.signature} diff --git a/src/pages/auth/Login.tsx b/src/pages/auth/Login.tsx index 11ac2bd2..25bd05a8 100644 --- a/src/pages/auth/Login.tsx +++ b/src/pages/auth/Login.tsx @@ -1,19 +1,20 @@ -import { ReactNode, useCallback, useEffect, useState } from 'react'; -import { Form, Input, Button, Divider, Space } from 'antd'; import { - MailOutlined, + FacebookOutlined, + GithubOutlined, + GoogleOutlined, LockOutlined, + MailOutlined, UnlockOutlined, - GoogleOutlined, - GithubOutlined, - FacebookOutlined, UserAddOutlined, UserOutlined, } from '@ant-design/icons'; +import { Button, Divider, Form, Input, Space } from 'antd'; +import { ReactNode, useCallback, useEffect, useState } from 'react'; import { Link, useNavigate } from 'react-router-dom'; import { OAuthProviders, useAuth } from '../../contexts/AuthContext'; import { Routes } from '../../routes'; -import validateMessages from './validateMessages'; +import { emailRules, requiredRules, usernameRules } from '../../utils/form'; +import { buildRedirectUrl } from '../../utils/url'; import { emailNotVerified, logInFailed, @@ -21,8 +22,7 @@ import { signUpFailed, signUpSuccessful, } from './notifications'; -import { emailRules, requiredRules, usernameRules } from '../../utils/form'; -import { buildRedirectUrl } from '../../utils/url'; +import validateMessages from './validateMessages'; const { Item } = Form; @@ -186,7 +186,7 @@ const Login = ({ formRole }: { formRole: FormRoles }) => { const OauthSection = () => { return isOauthEnabled ? ( <> - + {providersReady && Object.keys(oauthMethods).map( (provider) => @@ -224,8 +224,8 @@ const Login = ({ formRole }: { formRole: FormRoles }) => { const submitLogin = (
-
+
Your tunes { />, ]} > - + + {tune.vehicleName} {tune.signature} diff --git a/src/pages/auth/ResetPassword.tsx b/src/pages/auth/ResetPassword.tsx index b5e67012..2108cb48 100644 --- a/src/pages/auth/ResetPassword.tsx +++ b/src/pages/auth/ResetPassword.tsx @@ -1,12 +1,12 @@ -import { useState } from 'react'; -import { Form, Input, Button, Divider } from 'antd'; import { MailOutlined } from '@ant-design/icons'; +import { Button, Divider, Form, Input } from 'antd'; +import { useState } from 'react'; import { Link, useNavigate } from 'react-router-dom'; import { useAuth } from '../../contexts/AuthContext'; import { Routes } from '../../routes'; -import validateMessages from './validateMessages'; -import { resetFailed, resetSuccessful } from './notifications'; import { emailRules } from '../../utils/form'; +import { resetFailed, resetSuccessful } from './notifications'; +import validateMessages from './validateMessages'; const { Item } = Form; @@ -30,7 +30,7 @@ const ResetPassword = () => { }; return ( -
+
Reset password
{ validateMessages={validateMessages} form={form} > - - } placeholder='Email' autoComplete='email' /> + + } placeholder="Email" autoComplete="email" /> - diff --git a/src/pages/auth/ResetPasswordConfirmation.tsx b/src/pages/auth/ResetPasswordConfirmation.tsx index a5904f27..4badd57c 100644 --- a/src/pages/auth/ResetPasswordConfirmation.tsx +++ b/src/pages/auth/ResetPasswordConfirmation.tsx @@ -1,11 +1,11 @@ -import { Button, Divider, Form, Input } from 'antd'; import { LockOutlined } from '@ant-design/icons'; +import { Button, Divider, Form, Input } from 'antd'; import { useState } from 'react'; import { Link, useMatch, useNavigate } from 'react-router-dom'; import { useAuth } from '../../contexts/AuthContext'; import { Routes } from '../../routes'; -import { passwordUpdateFailed, passwordUpdateSuccess } from './notifications'; import { passwordRules } from '../../utils/form'; +import { passwordUpdateFailed, passwordUpdateSuccess } from './notifications'; import validateMessages from './validateMessages'; const { Item } = Form; @@ -31,26 +31,26 @@ const ResetPasswordConfirmation = () => { }; return ( -
+
Change password - + } />
+ {yUnits} / {xUnits}