From 21c75708745e4d9f1b8a0cbd69e0356ec7fca454 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 11 Nov 2022 00:01:19 +0100 Subject: [PATCH 001/406] change main readme --- README.md | 178 +----------------------------------------------------- 1 file changed, 1 insertion(+), 177 deletions(-) diff --git a/README.md b/README.md index b24c814c8fde..4e326cb5948e 100644 --- a/README.md +++ b/README.md @@ -1,177 +1 @@ -
- InvenTree logo -

InvenTree

-

Open Source Inventory Management System

- - -[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/inventree/inventree) -![CI](https://github.com/inventree/inventree/actions/workflows/qc_checks.yaml/badge.svg) -![Docker Build](https://github.com/inventree/inventree/actions/workflows/docker.yaml/badge.svg) - -[![Coveralls](https://img.shields.io/coveralls/github/inventree/InvenTree)](https://coveralls.io/github/inventree/InvenTree) -[![Crowdin](https://badges.crowdin.net/inventree/localized.svg)](https://crowdin.com/project/inventree) -![Lines of code](https://img.shields.io/tokei/lines/github/inventree/InvenTree) -![GitHub commit activity](https://img.shields.io/github/commit-activity/m/inventree/inventree) -[![Docker Pulls](https://img.shields.io/docker/pulls/inventree/inventree)](https://hub.docker.com/r/inventree/inventree) - -![GitHub Org's stars](https://img.shields.io/github/stars/inventree?style=social) -[![Twitter Follow](https://img.shields.io/twitter/follow/inventreedb?style=social)](https://twitter.com/inventreedb) -[![Subreddit subscribers](https://img.shields.io/reddit/subreddit-subscribers/inventree?style=social)](https://www.reddit.com/r/InvenTree/) - - -

- View Demo - · - Documentation - · - Report Bug - · - Request Feature -

-
- - -## :star2: About the Project - -InvenTree is an open-source Inventory Management System which provides powerful low-level stock control and part tracking. The core of the InvenTree system is a Python/Django database backend which provides an admin interface (web-based) and a REST API for interaction with external interfaces and applications. - -InvenTree is designed to be lightweight and easy to use for SME or hobbyist applications, where many existing stock management solutions are bloated and cumbersome to use. Updating stock is a single-action process and does not require a complex system of work orders or stock transactions. - -Powerful business logic works in the background to ensure that stock tracking history is maintained, and users have ready access to stock level information. - - - -### :dart: Features - -- Organize Parts and BOMs -- Manage Suppliers -- Instant Stock Knowledge -- Extend and Customize to fit your usage - - -### :compass: Roadmap - -* [x] Plugins -* [ ] Improved Importers -* [ ] Custom Workflow Processes - - -### :hammer_and_wrench: Integration - -InvenTree is designed to be **extensible**, and provides multiple options for **integration** with external applications or addition of custom plugins: - -* [InvenTree API](https://inventree.readthedocs.io/en/latest/extend/api/) -* [Python module](https://inventree.readthedocs.io/en/latest/extend/python) -* [Plugin interface](https://inventree.readthedocs.io/en/latest/extend/plugins) -* [Third party tools](https://inventree.readthedocs.io/en/latest/extend/integrate) - - -### :space_invader: Tech Stack - -
- Server - -
- -
-Database - -
- -
- Client - -
- -
-DevOps - -
- - -## :toolbox: Getting Started - -Refer to the [getting started guide](https://inventree.readthedocs.io/en/latest/start/install/) for installation and setup instructions. - - -## :iphone: Mobile App - -InvenTree is supported by a [companion mobile app](https://inventree.readthedocs.io/en/latest/app/app/) which allows users access to stock control information and functionality. - -

- Android Play Store - · - Apple App Store -

- - -## :train: Deploy - -There are several options to deploy InvenTree. - -

- Docker - · - Deploy to DO - · - Bare Metal -

- -Single line install - read [the docs](https://inventree.readthedocs.io/en/latest/start/installer/) for supported distros and details about the function: -```bash -wget -Nq https://raw.githubusercontent.com/InvenTree/InvenTree/master/contrib/install.sh && bash install.sh -``` - - -## :wave: Contributing - -Contributions are welcomed and encouraged. Please help to make this project even better! -Refer to the [contribution page in the docs ](https://inventree.readthedocs.io/en/latest/contribute/) and check out [contributing.md](CONTRIBUTING.md). - - -## :scroll: Translation - -Native language translation of the InvenTree web application is [community contributed via crowdin](https://crowdin.com/project/inventree). **Contributions are welcomed and encouraged**. - -To contribute to the translation effort, navigate to the [InvenTree crowdin project](https://crowdin.com/project/inventree), create a free account, and start making translations suggestions for your language of choice! - - -## :money_with_wings: Sponsor - -If you use InvenTree and find it to be useful, please consider making a donation toward its continued development. - -[Donate via PayPal](https://paypal.me/inventree?locale.x=en_AU) - - -## :gem: Acknowledgements - -We would like to acknowledge a few special projects: - - [PartKeepr](https://github.com/partkeepr/PartKeepr) as a valuable predecessor and inspiration - - [Readme Template](https://github.com/Louis3797/awesome-readme-template) for the template of this page - -Find a full list of used third-party libraries in [our documentation](https://inventree.readthedocs.io/en/latest/credits/). - - -## :warning: License - -Distributed under the [MIT](https://choosealicense.com/licenses/mit/) License. See [LICENSE.txt](https://github.com/inventree/InvenTree/blob/master/LICENSE) for more information. +This Fork of InvenTree is used for a new React based UI - https://github.com/inventree/InvenTree From 1f5ec3b2c95877e1165cb0479ead18c385992d4a Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 11 Nov 2022 00:35:27 +0100 Subject: [PATCH 002/406] Add vite and mantine base --- InvenTree/web/README | 12 + InvenTree/web/src/.gitignore | 24 + InvenTree/web/src/index.html | 16 + InvenTree/web/src/package.json | 32 + InvenTree/web/src/public/inventree.svg | 291 ++++ InvenTree/web/src/src/App.css | 0 InvenTree/web/src/src/App.tsx | 22 + .../web/src/src/components/ColorToggle.tsx | 22 + InvenTree/web/src/src/index.css | 0 InvenTree/web/src/src/main.tsx | 10 + InvenTree/web/src/src/vite-env.d.ts | 1 + InvenTree/web/src/tsconfig.json | 21 + InvenTree/web/src/tsconfig.node.json | 9 + InvenTree/web/src/vite.config.ts | 7 + InvenTree/web/src/yarn.lock | 1454 +++++++++++++++++ 15 files changed, 1921 insertions(+) create mode 100644 InvenTree/web/README create mode 100644 InvenTree/web/src/.gitignore create mode 100644 InvenTree/web/src/index.html create mode 100644 InvenTree/web/src/package.json create mode 100644 InvenTree/web/src/public/inventree.svg create mode 100644 InvenTree/web/src/src/App.css create mode 100644 InvenTree/web/src/src/App.tsx create mode 100644 InvenTree/web/src/src/components/ColorToggle.tsx create mode 100644 InvenTree/web/src/src/index.css create mode 100644 InvenTree/web/src/src/main.tsx create mode 100644 InvenTree/web/src/src/vite-env.d.ts create mode 100644 InvenTree/web/src/tsconfig.json create mode 100644 InvenTree/web/src/tsconfig.node.json create mode 100644 InvenTree/web/src/vite.config.ts create mode 100644 InvenTree/web/src/yarn.lock diff --git a/InvenTree/web/README b/InvenTree/web/README new file mode 100644 index 000000000000..e9547881a0e8 --- /dev/null +++ b/InvenTree/web/README @@ -0,0 +1,12 @@ +The web interface uses: + +UI: +- mantine as UI intercafe + +Tools: +- yarn for packaging + +## Setup dev enviroment +1. Install yarn +2. Install packages (from src) `yarn` +3. Run dev server with `yarn dev` diff --git a/InvenTree/web/src/.gitignore b/InvenTree/web/src/.gitignore new file mode 100644 index 000000000000..a547bf36d8d1 --- /dev/null +++ b/InvenTree/web/src/.gitignore @@ -0,0 +1,24 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +dist +dist-ssr +*.local + +# Editor directories and files +.vscode/* +!.vscode/extensions.json +.idea +.DS_Store +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? diff --git a/InvenTree/web/src/index.html b/InvenTree/web/src/index.html new file mode 100644 index 000000000000..cb1e09328f00 --- /dev/null +++ b/InvenTree/web/src/index.html @@ -0,0 +1,16 @@ + + + + + + + + InvenTree + + + +
+ + + + \ No newline at end of file diff --git a/InvenTree/web/src/package.json b/InvenTree/web/src/package.json new file mode 100644 index 000000000000..6c2693c1f23e --- /dev/null +++ b/InvenTree/web/src/package.json @@ -0,0 +1,32 @@ +{ + "name": "InvenTreeUI", + "private": true, + "version": "0.0.1", + "type": "module", + "scripts": { + "dev": "vite", + "build": "tsc && vite build", + "preview": "vite preview" + }, + "dependencies": { + "@emotion/react": "^11.10.5", + "@mantine/core": "^5.7.1", + "@mantine/dates": "^5.7.1", + "@mantine/dropzone": "^5.7.1", + "@mantine/form": "^5.7.1", + "@mantine/hooks": "^5.7.1", + "@mantine/modals": "^5.7.1", + "@mantine/notifications": "^5.7.1", + "@mantine/rte": "^5.7.1", + "dayjs": "^1.11.6", + "react": "^18.2.0", + "react-dom": "^18.2.0" + }, + "devDependencies": { + "@types/react": "^18.0.24", + "@types/react-dom": "^18.0.8", + "@vitejs/plugin-react": "^2.2.0", + "typescript": "^4.6.4", + "vite": "^3.2.3" + } +} \ No newline at end of file diff --git a/InvenTree/web/src/public/inventree.svg b/InvenTree/web/src/public/inventree.svg new file mode 100644 index 000000000000..f2bb05ffae39 --- /dev/null +++ b/InvenTree/web/src/public/inventree.svg @@ -0,0 +1,291 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/InvenTree/web/src/src/App.css b/InvenTree/web/src/src/App.css new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx new file mode 100644 index 000000000000..25eca060d68c --- /dev/null +++ b/InvenTree/web/src/src/App.tsx @@ -0,0 +1,22 @@ +import { useState } from 'react'; +import { MantineProvider, ColorSchemeProvider, ColorScheme } from '@mantine/core'; +import { useColorScheme } from '@mantine/hooks'; +import { Text } from '@mantine/core'; +import { ColorToggle } from './components/ColorToggle'; + + +export default function App() { + const preferredColorScheme = useColorScheme(); + const [colorScheme, setColorScheme] = useState(preferredColorScheme); + const toggleColorScheme = (value?: ColorScheme) => + setColorScheme(value || (colorScheme === 'dark' ? 'light' : 'dark')); + + return ( + + + Welcome to Mantine! + + + + ); +} diff --git a/InvenTree/web/src/src/components/ColorToggle.tsx b/InvenTree/web/src/src/components/ColorToggle.tsx new file mode 100644 index 000000000000..eccc12691f1f --- /dev/null +++ b/InvenTree/web/src/src/components/ColorToggle.tsx @@ -0,0 +1,22 @@ +import { useMantineColorScheme, ActionIcon, Group } from '@mantine/core'; +import { IconSun, IconMoonStars } from '@tabler/icons'; + +export function ColorToggle() { + const { colorScheme, toggleColorScheme } = useMantineColorScheme(); + + return ( + + toggleColorScheme()} + size="lg" + sx={(theme) => ({ + backgroundColor: + theme.colorScheme === 'dark' ? theme.colors.dark[6] : theme.colors.gray[0], + color: theme.colorScheme === 'dark' ? theme.colors.yellow[4] : theme.colors.blue[6], + })} + > + {colorScheme === 'dark' ? : } + + + ); +} diff --git a/InvenTree/web/src/src/index.css b/InvenTree/web/src/src/index.css new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/InvenTree/web/src/src/main.tsx b/InvenTree/web/src/src/main.tsx new file mode 100644 index 000000000000..611e848f1a3e --- /dev/null +++ b/InvenTree/web/src/src/main.tsx @@ -0,0 +1,10 @@ +import React from 'react' +import ReactDOM from 'react-dom/client' +import App from './App' +import './index.css' + +ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render( + + + +) diff --git a/InvenTree/web/src/src/vite-env.d.ts b/InvenTree/web/src/src/vite-env.d.ts new file mode 100644 index 000000000000..11f02fe2a006 --- /dev/null +++ b/InvenTree/web/src/src/vite-env.d.ts @@ -0,0 +1 @@ +/// diff --git a/InvenTree/web/src/tsconfig.json b/InvenTree/web/src/tsconfig.json new file mode 100644 index 000000000000..3d0a51a86e20 --- /dev/null +++ b/InvenTree/web/src/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "target": "ESNext", + "useDefineForClassFields": true, + "lib": ["DOM", "DOM.Iterable", "ESNext"], + "allowJs": false, + "skipLibCheck": true, + "esModuleInterop": false, + "allowSyntheticDefaultImports": true, + "strict": true, + "forceConsistentCasingInFileNames": true, + "module": "ESNext", + "moduleResolution": "Node", + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx" + }, + "include": ["src"], + "references": [{ "path": "./tsconfig.node.json" }] +} diff --git a/InvenTree/web/src/tsconfig.node.json b/InvenTree/web/src/tsconfig.node.json new file mode 100644 index 000000000000..9d31e2aed93c --- /dev/null +++ b/InvenTree/web/src/tsconfig.node.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "composite": true, + "module": "ESNext", + "moduleResolution": "Node", + "allowSyntheticDefaultImports": true + }, + "include": ["vite.config.ts"] +} diff --git a/InvenTree/web/src/vite.config.ts b/InvenTree/web/src/vite.config.ts new file mode 100644 index 000000000000..b1b5f91e5ffd --- /dev/null +++ b/InvenTree/web/src/vite.config.ts @@ -0,0 +1,7 @@ +import { defineConfig } from 'vite' +import react from '@vitejs/plugin-react' + +// https://vitejs.dev/config/ +export default defineConfig({ + plugins: [react()] +}) diff --git a/InvenTree/web/src/yarn.lock b/InvenTree/web/src/yarn.lock new file mode 100644 index 000000000000..96573ad84c63 --- /dev/null +++ b/InvenTree/web/src/yarn.lock @@ -0,0 +1,1454 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@ampproject/remapping@^2.1.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" + integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== + dependencies: + "@jridgewell/gen-mapping" "^0.1.0" + "@jridgewell/trace-mapping" "^0.3.9" + +"@babel/code-frame@^7.0.0", "@babel/code-frame@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" + integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== + dependencies: + "@babel/highlight" "^7.18.6" + +"@babel/compat-data@^7.20.0": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.1.tgz#f2e6ef7790d8c8dbf03d379502dcc246dcce0b30" + integrity sha512-EWZ4mE2diW3QALKvDMiXnbZpRvlj+nayZ112nK93SnhqOtpdsbVD4W+2tEoT3YNBAG9RBR0ISY758ZkOgsn6pQ== + +"@babel/core@^7.19.6": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.2.tgz#8dc9b1620a673f92d3624bd926dc49a52cf25b92" + integrity sha512-w7DbG8DtMrJcFOi4VrLm+8QM4az8Mo+PuLBKLp2zrYRCow8W/f9xiXm5sN53C8HksCyDQwCKha9JiDoIyPjT2g== + dependencies: + "@ampproject/remapping" "^2.1.0" + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.20.2" + "@babel/helper-compilation-targets" "^7.20.0" + "@babel/helper-module-transforms" "^7.20.2" + "@babel/helpers" "^7.20.1" + "@babel/parser" "^7.20.2" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.20.1" + "@babel/types" "^7.20.2" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.1" + semver "^6.3.0" + +"@babel/generator@^7.20.1", "@babel/generator@^7.20.2": + version "7.20.4" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.4.tgz#4d9f8f0c30be75fd90a0562099a26e5839602ab8" + integrity sha512-luCf7yk/cm7yab6CAW1aiFnmEfBJplb/JojV56MYEK7ziWfGmFlTfmL9Ehwfy4gFhbjBfWO1wj7/TuSbVNEEtA== + dependencies: + "@babel/types" "^7.20.2" + "@jridgewell/gen-mapping" "^0.3.2" + jsesc "^2.5.1" + +"@babel/helper-annotate-as-pure@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb" + integrity sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-compilation-targets@^7.20.0": + version "7.20.0" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.0.tgz#6bf5374d424e1b3922822f1d9bdaa43b1a139d0a" + integrity sha512-0jp//vDGp9e8hZzBc6N/KwA5ZK3Wsm/pfm4CrY7vzegkVxc65SgSn6wYOnwHe9Js9HRQ1YTCKLGPzDtaS3RoLQ== + dependencies: + "@babel/compat-data" "^7.20.0" + "@babel/helper-validator-option" "^7.18.6" + browserslist "^4.21.3" + semver "^6.3.0" + +"@babel/helper-environment-visitor@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" + integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== + +"@babel/helper-function-name@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" + integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== + dependencies: + "@babel/template" "^7.18.10" + "@babel/types" "^7.19.0" + +"@babel/helper-hoist-variables@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" + integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-module-imports@^7.16.7", "@babel/helper-module-imports@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e" + integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-module-transforms@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.2.tgz#ac53da669501edd37e658602a21ba14c08748712" + integrity sha512-zvBKyJXRbmK07XhMuujYoJ48B5yvvmM6+wcpv6Ivj4Yg6qO7NOZOSnvZN9CRl1zz1Z4cKf8YejmCMh8clOoOeA== + dependencies: + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-module-imports" "^7.18.6" + "@babel/helper-simple-access" "^7.20.2" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/helper-validator-identifier" "^7.19.1" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.20.1" + "@babel/types" "^7.20.2" + +"@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.19.0": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629" + integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ== + +"@babel/helper-simple-access@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9" + integrity sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA== + dependencies: + "@babel/types" "^7.20.2" + +"@babel/helper-split-export-declaration@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" + integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-string-parser@^7.19.4": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" + integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== + +"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" + integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== + +"@babel/helper-validator-option@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" + integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== + +"@babel/helpers@^7.20.1": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.1.tgz#2ab7a0fcb0a03b5bf76629196ed63c2d7311f4c9" + integrity sha512-J77mUVaDTUJFZ5BpP6mMn6OIl3rEWymk2ZxDBQJUG3P+PbmyMcF3bYWvz0ma69Af1oobDqT/iAsvzhB58xhQUg== + dependencies: + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.20.1" + "@babel/types" "^7.20.0" + +"@babel/highlight@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" + integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== + dependencies: + "@babel/helper-validator-identifier" "^7.18.6" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/parser@^7.18.10", "@babel/parser@^7.20.1", "@babel/parser@^7.20.2": + version "7.20.3" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.3.tgz#5358cf62e380cf69efcb87a7bb922ff88bfac6e2" + integrity sha512-OP/s5a94frIPXwjzEcv5S/tpQfc6XhxYUnmWpgdqMWGgYCuErA3SzozaRAMQgSZWKeTJxht9aWAkUY+0UzvOFg== + +"@babel/plugin-syntax-jsx@^7.17.12", "@babel/plugin-syntax-jsx@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.18.6.tgz#a8feef63b010150abd97f1649ec296e849943ca0" + integrity sha512-6mmljtAedFGTWu2p/8WIORGwy+61PLgOMPOdazc7YoJ9ZCWUyFy3A6CpPkRKLKD1ToAesxX8KGEViAiLo9N+7Q== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-react-jsx-development@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-development/-/plugin-transform-react-jsx-development-7.18.6.tgz#dbe5c972811e49c7405b630e4d0d2e1380c0ddc5" + integrity sha512-SA6HEjwYFKF7WDjWcMcMGUimmw/nhNRDWxr+KaLSCrkD/LMDBvWRmHAYgE1HDeF8KUuI8OAu+RT6EOtKxSW2qA== + dependencies: + "@babel/plugin-transform-react-jsx" "^7.18.6" + +"@babel/plugin-transform-react-jsx-self@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.18.6.tgz#3849401bab7ae8ffa1e3e5687c94a753fc75bda7" + integrity sha512-A0LQGx4+4Jv7u/tWzoJF7alZwnBDQd6cGLh9P+Ttk4dpiL+J5p7NSNv/9tlEFFJDq3kjxOavWmbm6t0Gk+A3Ig== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-react-jsx-source@^7.19.6": + version "7.19.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.19.6.tgz#88578ae8331e5887e8ce28e4c9dc83fb29da0b86" + integrity sha512-RpAi004QyMNisst/pvSanoRdJ4q+jMCWyk9zdw/CyLB9j8RXEahodR6l2GyttDRyEVWZtbN+TpLiHJ3t34LbsQ== + dependencies: + "@babel/helper-plugin-utils" "^7.19.0" + +"@babel/plugin-transform-react-jsx@^7.18.6", "@babel/plugin-transform-react-jsx@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.19.0.tgz#b3cbb7c3a00b92ec8ae1027910e331ba5c500eb9" + integrity sha512-UVEvX3tXie3Szm3emi1+G63jyw1w5IcMY0FSKM+CRnKRI5Mr1YbCNgsSTwoTwKphQEG9P+QqmuRFneJPZuHNhg== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-module-imports" "^7.18.6" + "@babel/helper-plugin-utils" "^7.19.0" + "@babel/plugin-syntax-jsx" "^7.18.6" + "@babel/types" "^7.19.0" + +"@babel/runtime@^7.10.2", "@babel/runtime@^7.12.5", "@babel/runtime@^7.13.10", "@babel/runtime@^7.18.3", "@babel/runtime@^7.5.5", "@babel/runtime@^7.8.7": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.1.tgz#1148bb33ab252b165a06698fde7576092a78b4a9" + integrity sha512-mrzLkl6U9YLF8qpqI7TB82PESyEGjm/0Ly91jG575eVxMMlb8fYfOXFZIJ8XfLrJZQbm7dlKry2bJmXBUEkdFg== + dependencies: + regenerator-runtime "^0.13.10" + +"@babel/template@^7.18.10": + version "7.18.10" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.18.10.tgz#6f9134835970d1dbf0835c0d100c9f38de0c5e71" + integrity sha512-TI+rCtooWHr3QJ27kJxfjutghu44DLnasDMwpDqCXVTal9RLp3RSYNh4NdBrRP2cQAoG9A8juOQl6P6oZG4JxA== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/parser" "^7.18.10" + "@babel/types" "^7.18.10" + +"@babel/traverse@^7.20.1": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.1.tgz#9b15ccbf882f6d107eeeecf263fbcdd208777ec8" + integrity sha512-d3tN8fkVJwFLkHkBN479SOsw4DMZnz8cdbL/gvuDuzy3TS6Nfw80HuQqhw1pITbIruHyh7d1fMA47kWzmcUEGA== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.20.1" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.19.0" + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/parser" "^7.20.1" + "@babel/types" "^7.20.0" + debug "^4.1.0" + globals "^11.1.0" + +"@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.19.0", "@babel/types@^7.20.0", "@babel/types@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.2.tgz#67ac09266606190f496322dbaff360fdaa5e7842" + integrity sha512-FnnvsNWgZCr232sqtXggapvlkk/tuwR/qhGzcmxI0GXLCjmPYQPzio2FbdlWuY6y1sHFfQKk+rRbUZ9VStQMog== + dependencies: + "@babel/helper-string-parser" "^7.19.4" + "@babel/helper-validator-identifier" "^7.19.1" + to-fast-properties "^2.0.0" + +"@emotion/babel-plugin@^11.10.5": + version "11.10.5" + resolved "https://registry.yarnpkg.com/@emotion/babel-plugin/-/babel-plugin-11.10.5.tgz#65fa6e1790ddc9e23cc22658a4c5dea423c55c3c" + integrity sha512-xE7/hyLHJac7D2Ve9dKroBBZqBT7WuPQmWcq7HSGb84sUuP4mlOWoB8dvVfD9yk5DHkU1m6RW7xSoDtnQHNQeA== + dependencies: + "@babel/helper-module-imports" "^7.16.7" + "@babel/plugin-syntax-jsx" "^7.17.12" + "@babel/runtime" "^7.18.3" + "@emotion/hash" "^0.9.0" + "@emotion/memoize" "^0.8.0" + "@emotion/serialize" "^1.1.1" + babel-plugin-macros "^3.1.0" + convert-source-map "^1.5.0" + escape-string-regexp "^4.0.0" + find-root "^1.1.0" + source-map "^0.5.7" + stylis "4.1.3" + +"@emotion/cache@^11.10.5": + version "11.10.5" + resolved "https://registry.yarnpkg.com/@emotion/cache/-/cache-11.10.5.tgz#c142da9351f94e47527ed458f7bbbbe40bb13c12" + integrity sha512-dGYHWyzTdmK+f2+EnIGBpkz1lKc4Zbj2KHd4cX3Wi8/OWr5pKslNjc3yABKH4adRGCvSX4VDC0i04mrrq0aiRA== + dependencies: + "@emotion/memoize" "^0.8.0" + "@emotion/sheet" "^1.2.1" + "@emotion/utils" "^1.2.0" + "@emotion/weak-memoize" "^0.3.0" + stylis "4.1.3" + +"@emotion/hash@^0.9.0": + version "0.9.0" + resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.9.0.tgz#c5153d50401ee3c027a57a177bc269b16d889cb7" + integrity sha512-14FtKiHhy2QoPIzdTcvh//8OyBlknNs2nXRwIhG904opCby3l+9Xaf/wuPvICBF0rc1ZCNBd3nKe9cd2mecVkQ== + +"@emotion/memoize@^0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@emotion/memoize/-/memoize-0.8.0.tgz#f580f9beb67176fa57aae70b08ed510e1b18980f" + integrity sha512-G/YwXTkv7Den9mXDO7AhLWkE3q+I92B+VqAE+dYG4NGPaHZGvt3G8Q0p9vmE+sq7rTGphUbAvmQ9YpbfMQGGlA== + +"@emotion/react@^11.10.5": + version "11.10.5" + resolved "https://registry.yarnpkg.com/@emotion/react/-/react-11.10.5.tgz#95fff612a5de1efa9c0d535384d3cfa115fe175d" + integrity sha512-TZs6235tCJ/7iF6/rvTaOH4oxQg2gMAcdHemjwLKIjKz4rRuYe1HJ2TQJKnAcRAfOUDdU8XoDadCe1rl72iv8A== + dependencies: + "@babel/runtime" "^7.18.3" + "@emotion/babel-plugin" "^11.10.5" + "@emotion/cache" "^11.10.5" + "@emotion/serialize" "^1.1.1" + "@emotion/use-insertion-effect-with-fallbacks" "^1.0.0" + "@emotion/utils" "^1.2.0" + "@emotion/weak-memoize" "^0.3.0" + hoist-non-react-statics "^3.3.1" + +"@emotion/serialize@^1.1.1": + version "1.1.1" + resolved "https://registry.yarnpkg.com/@emotion/serialize/-/serialize-1.1.1.tgz#0595701b1902feded8a96d293b26be3f5c1a5cf0" + integrity sha512-Zl/0LFggN7+L1liljxXdsVSVlg6E/Z/olVWpfxUTxOAmi8NU7YoeWeLfi1RmnB2TATHoaWwIBRoL+FvAJiTUQA== + dependencies: + "@emotion/hash" "^0.9.0" + "@emotion/memoize" "^0.8.0" + "@emotion/unitless" "^0.8.0" + "@emotion/utils" "^1.2.0" + csstype "^3.0.2" + +"@emotion/sheet@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@emotion/sheet/-/sheet-1.2.1.tgz#0767e0305230e894897cadb6c8df2c51e61a6c2c" + integrity sha512-zxRBwl93sHMsOj4zs+OslQKg/uhF38MB+OMKoCrVuS0nyTkqnau+BM3WGEoOptg9Oz45T/aIGs1qbVAsEFo3nA== + +"@emotion/unitless@^0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@emotion/unitless/-/unitless-0.8.0.tgz#a4a36e9cbdc6903737cd20d38033241e1b8833db" + integrity sha512-VINS5vEYAscRl2ZUDiT3uMPlrFQupiKgHz5AA4bCH1miKBg4qtwkim1qPmJj/4WG6TreYMY111rEFsjupcOKHw== + +"@emotion/use-insertion-effect-with-fallbacks@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.0.0.tgz#ffadaec35dbb7885bd54de3fa267ab2f860294df" + integrity sha512-1eEgUGmkaljiBnRMTdksDV1W4kUnmwgp7X9G8B++9GYwl1lUdqSndSriIrTJ0N7LQaoauY9JJ2yhiOYK5+NI4A== + +"@emotion/utils@^1.2.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/@emotion/utils/-/utils-1.2.0.tgz#9716eaccbc6b5ded2ea5a90d65562609aab0f561" + integrity sha512-sn3WH53Kzpw8oQ5mgMmIzzyAaH2ZqFEbozVVBSYp538E06OSE6ytOp7pRAjNQR+Q/orwqdQYJSe2m3hCOeznkw== + +"@emotion/weak-memoize@^0.3.0": + version "0.3.0" + resolved "https://registry.yarnpkg.com/@emotion/weak-memoize/-/weak-memoize-0.3.0.tgz#ea89004119dc42db2e1dba0f97d553f7372f6fcb" + integrity sha512-AHPmaAx+RYfZz0eYu6Gviiagpmiyw98ySSlQvCUhVGDRtDFe4DBS0x1bSjdF3gqUDYOczB+yYvBTtEylYSdRhg== + +"@esbuild/android-arm@0.15.13": + version "0.15.13" + resolved "https://registry.yarnpkg.com/@esbuild/android-arm/-/android-arm-0.15.13.tgz#ce11237a13ee76d5eae3908e47ba4ddd380af86a" + integrity sha512-RY2fVI8O0iFUNvZirXaQ1vMvK0xhCcl0gqRj74Z6yEiO1zAUa7hbsdwZM1kzqbxHK7LFyMizipfXT3JME+12Hw== + +"@esbuild/linux-loong64@0.15.13": + version "0.15.13" + resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.15.13.tgz#64e8825bf0ce769dac94ee39d92ebe6272020dfc" + integrity sha512-+BoyIm4I8uJmH/QDIH0fu7MG0AEx9OXEDXnqptXCwKOlOqZiS4iraH1Nr7/ObLMokW3sOCeBNyD68ATcV9b9Ag== + +"@floating-ui/core@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.0.1.tgz#00e64d74e911602c8533957af0cce5af6b2e93c8" + integrity sha512-bO37brCPfteXQfFY0DyNDGB3+IMe4j150KFQcgJ5aBP295p9nBGeHEs/p0czrRbtlHq4Px/yoPXO/+dOCcF4uA== + +"@floating-ui/dom@^1.0.0": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.0.4.tgz#cc0f2a03db7193b1b932b90d09c5c81235682a60" + integrity sha512-maYJRv+sAXTy4K9mzdv0JPyNW5YPVHrqtY90tEdI6XNpuLOP26Ci2pfwPsKBA/Wh4Z3FX5sUrtUFTdMYj9v+ug== + dependencies: + "@floating-ui/core" "^1.0.1" + +"@floating-ui/react-dom-interactions@^0.10.1": + version "0.10.3" + resolved "https://registry.yarnpkg.com/@floating-ui/react-dom-interactions/-/react-dom-interactions-0.10.3.tgz#1d988aad169bf752b54c688db942f12e4fed61c5" + integrity sha512-UEHqdnzyoiWNU5az/tAljr9iXFzN18DcvpMqW+/cXz4FEhDEB1ogLtWldOWCujLerPBnSRocADALafelOReMpw== + dependencies: + "@floating-ui/react-dom" "^1.0.0" + aria-hidden "^1.1.3" + +"@floating-ui/react-dom@^1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-1.0.0.tgz#e0975966694433f1f0abffeee5d8e6bb69b7d16e" + integrity sha512-uiOalFKPG937UCLm42RxjESTWUVpbbatvlphQAU6bsv+ence6IoVG8JOUZcy8eW81NkU+Idiwvx10WFLmR4MIg== + dependencies: + "@floating-ui/dom" "^1.0.0" + +"@jridgewell/gen-mapping@^0.1.0": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" + integrity sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w== + dependencies: + "@jridgewell/set-array" "^1.0.0" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@jridgewell/gen-mapping@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" + integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== + dependencies: + "@jridgewell/set-array" "^1.0.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/resolve-uri@3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" + integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== + +"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== + +"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.14" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" + integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== + +"@jridgewell/trace-mapping@^0.3.9": + version "0.3.17" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" + integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== + dependencies: + "@jridgewell/resolve-uri" "3.1.0" + "@jridgewell/sourcemap-codec" "1.4.14" + +"@mantine/core@^5.7.1": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@mantine/core/-/core-5.7.1.tgz#2fdbff0c0034a46d9f68bde560ce547e2f83e248" + integrity sha512-fGfEqz5TsJ28Ts1g+qkDgdWg7h+wolmBD8xRJVvIy8/W5cEjiCXVyIK5iEX76y15G2ALzneCc6J4V9yvioaXSA== + dependencies: + "@floating-ui/react-dom-interactions" "^0.10.1" + "@mantine/styles" "5.7.1" + "@mantine/utils" "5.7.1" + "@radix-ui/react-scroll-area" "1.0.0" + react-textarea-autosize "8.3.4" + +"@mantine/dates@^5.7.1": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@mantine/dates/-/dates-5.7.1.tgz#269cd812bee7d8ea2d14eb59df85c4c8fd32c301" + integrity sha512-5MHrRFqaF5qGaL0YEOEzaWMXnqYOy2eG6K2Dj5cU5n6ooMI0JEqDrfuP+YcXsd28OysgH97kmvZmIZpumAUdVg== + dependencies: + "@mantine/utils" "5.7.1" + +"@mantine/dropzone@^5.7.1": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@mantine/dropzone/-/dropzone-5.7.1.tgz#2582bcf1f1a84b340c036bb104cc0432e83cb603" + integrity sha512-i23qpvzP6/ktVQx+9QqDfuUtTooR28XKhekT/lWTTOKGTgGZDWjJGXNHDxO7YhD0XQkLm9dDy1ayAuP3hOIadg== + dependencies: + "@mantine/utils" "5.7.1" + react-dropzone "14.2.3" + +"@mantine/form@^5.7.1": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@mantine/form/-/form-5.7.1.tgz#6f43471edf10c56bc31c18f7feba28bb865c3cea" + integrity sha512-8k+4x0m474a0d+wUiRAcZpJmQ0Z1KPjsn+ZhTXJh4Y+H35tzB3dMY7Q1EkJztIybrzOmU+ZpCFZtzSpScV6nOA== + dependencies: + fast-deep-equal "^3.1.3" + klona "^2.0.5" + +"@mantine/hooks@^5.7.1": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@mantine/hooks/-/hooks-5.7.1.tgz#4924f33687957802541b6f1d49d7bffa56a49d8f" + integrity sha512-I50Xa9ddiptAv2jtxmcVwuIj9s2lFMbSCXKwFwDKzxJQwWt45Hv4el4znmGuN/FluE2D/pJhje0FAP5NhMpgNw== + +"@mantine/modals@^5.7.1": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@mantine/modals/-/modals-5.7.1.tgz#40a8ba4d3e2ec9458791582430d867b94fc9ca12" + integrity sha512-5hBdLiSE9dCscxLXCy9ovqfOrdzfaBZsoKdtKvCOjwZu9hCwrzlL6xi6R7xkHc3YYEmzH8BATRAfVS50GyNsYw== + dependencies: + "@mantine/utils" "5.7.1" + +"@mantine/notifications@^5.7.1": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@mantine/notifications/-/notifications-5.7.1.tgz#e01750fdd7e33af28f52bc7efa0536c4cf9afb68" + integrity sha512-6q9/WSRkp130iRP9Z1H8On2l/TlLLvqwHXv+atK8qIoE8ciZ0TrCwg7Bvm+B3Xsx9RiCajjV7n7RSyjYy0Vyjw== + dependencies: + "@mantine/utils" "5.7.1" + react-transition-group "4.4.2" + +"@mantine/rte@^5.7.1": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@mantine/rte/-/rte-5.7.1.tgz#e1bd4f3d8bbdfbeeda8c09c809fd925915087a3b" + integrity sha512-Tga3SNpxcNDjnF6LYmscyiOy+S8vFV+D3Q5s5p+oh6vFX5wX0dX3ESFNYMu6yRW62SHmSWcgtO6bxwECfkOrYQ== + dependencies: + "@tabler/icons" "^1.68.0" + quill-mention "^3.0.8" + react-quill "2.0.0" + +"@mantine/styles@5.7.1": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@mantine/styles/-/styles-5.7.1.tgz#b5901b60e27bf06f209e9dfbcef95273f4e2d17b" + integrity sha512-WVnbl7Zz6b0WWBqYBDV3P61icQ8RSBMR/cHu0YLOyYNpjnuNP4zF+mMgRK3jYsXi/h7++z3ReK7NagBI/iwTSg== + dependencies: + clsx "1.1.1" + csstype "3.0.9" + +"@mantine/utils@5.7.1": + version "5.7.1" + resolved "https://registry.yarnpkg.com/@mantine/utils/-/utils-5.7.1.tgz#d6890be0650cdd499afd2d954713901672d15711" + integrity sha512-YHn6BDI2kkmLY6Zdv8MnFaolKbD+sJyCBG1GY0yO6aHiz8/vTxiaTJv7mhro7Pc1XzclDzVJvd9kAd6lzumAyg== + +"@radix-ui/number@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/number/-/number-1.0.0.tgz#4c536161d0de750b3f5d55860fc3de46264f897b" + integrity sha512-Ofwh/1HX69ZfJRiRBMTy7rgjAzHmwe4kW9C9Y99HTRUcYLUuVT0KESFj15rPjRgKJs20GPq8Bm5aEDJ8DuA3vA== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/primitive@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/primitive/-/primitive-1.0.0.tgz#e1d8ef30b10ea10e69c76e896f608d9276352253" + integrity sha512-3e7rn8FDMin4CgeL7Z/49smCA3rFYY3Ha2rUQ7HRWFadS5iCRw08ZgVT1LaNTCNqgvrUiyczLflrVrF0SRQtNA== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-compose-refs@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-compose-refs/-/react-compose-refs-1.0.0.tgz#37595b1f16ec7f228d698590e78eeed18ff218ae" + integrity sha512-0KaSv6sx787/hK3eF53iOkiSLwAGlFMx5lotrqD2pTjB18KbybKoEIgkNZTKC60YECDQTKGTRcDBILwZVqVKvA== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-context@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-context/-/react-context-1.0.0.tgz#f38e30c5859a9fb5e9aa9a9da452ee3ed9e0aee0" + integrity sha512-1pVM9RfOQ+n/N5PJK33kRSKsr1glNxomxONs5c49MliinBY6Yw2Q995qfBUUo0/Mbg05B/sGA0gkgPI7kmSHBg== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-direction@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-direction/-/react-direction-1.0.0.tgz#a2e0b552352459ecf96342c79949dd833c1e6e45" + integrity sha512-2HV05lGUgYcA6xgLQ4BKPDmtL+QbIZYH5fCOTAOOcJ5O0QbWS3i9lKaurLzliYUDhORI2Qr3pyjhJh44lKA3rQ== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-presence@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-presence/-/react-presence-1.0.0.tgz#814fe46df11f9a468808a6010e3f3ca7e0b2e84a" + integrity sha512-A+6XEvN01NfVWiKu38ybawfHsBjWum42MRPnEuqPsBZ4eV7e/7K321B5VgYMPv3Xx5An6o1/l9ZuDBgmcmWK3w== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-compose-refs" "1.0.0" + "@radix-ui/react-use-layout-effect" "1.0.0" + +"@radix-ui/react-primitive@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-primitive/-/react-primitive-1.0.0.tgz#376cd72b0fcd5e0e04d252ed33eb1b1f025af2b0" + integrity sha512-EyXe6mnRlHZ8b6f4ilTDrXmkLShICIuOTTj0GX4w1rp+wSxf3+TD05u1UOITC8VsJ2a9nwHvdXtOXEOl0Cw/zQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-slot" "1.0.0" + +"@radix-ui/react-scroll-area@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-scroll-area/-/react-scroll-area-1.0.0.tgz#10d0262a52266af528798f36947145f7e3a3a52c" + integrity sha512-3SNFukAjS5remgtpAVR9m3Zgo23ZojBZ8V3TCyR3A+56x2mtVqKlPV4+e8rScZUFMuvtbjIdQCmsJBFBazKZig== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/number" "1.0.0" + "@radix-ui/primitive" "1.0.0" + "@radix-ui/react-compose-refs" "1.0.0" + "@radix-ui/react-context" "1.0.0" + "@radix-ui/react-direction" "1.0.0" + "@radix-ui/react-presence" "1.0.0" + "@radix-ui/react-primitive" "1.0.0" + "@radix-ui/react-use-callback-ref" "1.0.0" + "@radix-ui/react-use-layout-effect" "1.0.0" + +"@radix-ui/react-slot@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-slot/-/react-slot-1.0.0.tgz#7fa805b99891dea1e862d8f8fbe07f4d6d0fd698" + integrity sha512-3mrKauI/tWXo1Ll+gN5dHcxDPdm/Df1ufcDLCecn+pnCIVcdWE7CujXo8QaXOWRJyZyQWWbpB8eFwHzWXlv5mQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-compose-refs" "1.0.0" + +"@radix-ui/react-use-callback-ref@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-callback-ref/-/react-use-callback-ref-1.0.0.tgz#9e7b8b6b4946fe3cbe8f748c82a2cce54e7b6a90" + integrity sha512-GZtyzoHz95Rhs6S63D2t/eqvdFCm7I+yHMLVQheKM7nBD8mbZIt+ct1jz4536MDnaOGKIxynJ8eHTkVGVVkoTg== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-use-layout-effect@1.0.0": + version "1.0.0" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-layout-effect/-/react-use-layout-effect-1.0.0.tgz#2fc19e97223a81de64cd3ba1dc42ceffd82374dc" + integrity sha512-6Tpkq+R6LOlmQb1R5NNETLG0B4YP0wc+klfXafpUCj6JGyaUc8il7/kUZ7m59rGbXGczE9Bs+iz2qloqsZBduQ== + dependencies: + "@babel/runtime" "^7.13.10" + +"@tabler/icons@^1.68.0": + version "1.111.0" + resolved "https://registry.yarnpkg.com/@tabler/icons/-/icons-1.111.0.tgz#0538fdd8b5de7072ae60fc5d2f13a9a636d2d0e3" + integrity sha512-TZWYiMT5ccqfHxRE0Qtgvl+sGsMbNkrv7cJMt/tm8TN9l/CDXx/o7d8uAwUN+3PAlSFfF5e/rD1bi1WJs2xNIA== + +"@types/parse-json@^4.0.0": + version "4.0.0" + resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" + integrity sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA== + +"@types/prop-types@*": + version "15.7.5" + resolved "https://registry.yarnpkg.com/@types/prop-types/-/prop-types-15.7.5.tgz#5f19d2b85a98e9558036f6a3cacc8819420f05cf" + integrity sha512-JCB8C6SnDoQf0cNycqd/35A7MjcnK+ZTqE7judS6o7utxUCg6imJg3QK2qzHKszlTjcj2cn+NwMB2i96ubpj7w== + +"@types/quill@^1.3.10": + version "1.3.10" + resolved "https://registry.yarnpkg.com/@types/quill/-/quill-1.3.10.tgz#dc1f7b6587f7ee94bdf5291bc92289f6f0497613" + integrity sha512-IhW3fPW+bkt9MLNlycw8u8fWb7oO7W5URC9MfZYHBlA24rex9rs23D5DETChu1zvgVdc5ka64ICjJOgQMr6Shw== + dependencies: + parchment "^1.1.2" + +"@types/react-dom@^18.0.8": + version "18.0.8" + resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-18.0.8.tgz#d2606d855186cd42cc1b11e63a71c39525441685" + integrity sha512-C3GYO0HLaOkk9dDAz3Dl4sbe4AKUGTCfFIZsz3n/82dPNN8Du533HzKatDxeUYWu24wJgMP1xICqkWk1YOLOIw== + dependencies: + "@types/react" "*" + +"@types/react@*", "@types/react@^18.0.24": + version "18.0.25" + resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.25.tgz#8b1dcd7e56fe7315535a4af25435e0bb55c8ae44" + integrity sha512-xD6c0KDT4m7n9uD4ZHi02lzskaiqcBxf4zi+tXZY98a04wvc0hi/TcCPC2FOESZi51Nd7tlUeOJY8RofL799/g== + dependencies: + "@types/prop-types" "*" + "@types/scheduler" "*" + csstype "^3.0.2" + +"@types/scheduler@*": + version "0.16.2" + resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" + integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== + +"@vitejs/plugin-react@^2.2.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@vitejs/plugin-react/-/plugin-react-2.2.0.tgz#1b9f63b8b6bc3f56258d20cd19b33f5cc761ce6e" + integrity sha512-FFpefhvExd1toVRlokZgxgy2JtnBOdp4ZDsq7ldCWaqGSGn9UhWMAVm/1lxPL14JfNS5yGz+s9yFrQY6shoStA== + dependencies: + "@babel/core" "^7.19.6" + "@babel/plugin-transform-react-jsx" "^7.19.0" + "@babel/plugin-transform-react-jsx-development" "^7.18.6" + "@babel/plugin-transform-react-jsx-self" "^7.18.6" + "@babel/plugin-transform-react-jsx-source" "^7.19.6" + magic-string "^0.26.7" + react-refresh "^0.14.0" + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +aria-hidden@^1.1.3: + version "1.2.1" + resolved "https://registry.yarnpkg.com/aria-hidden/-/aria-hidden-1.2.1.tgz#ad8c1edbde360b454eb2bf717ea02da00bfee0f8" + integrity sha512-PN344VAf9j1EAi+jyVHOJ8XidQdPVssGco39eNcsGdM4wcsILtxrKLkbuiMfLWYROK1FjRQasMWCBttrhjnr6A== + dependencies: + tslib "^2.0.0" + +attr-accept@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-2.2.2.tgz#646613809660110749e92f2c10833b70968d929b" + integrity sha512-7prDjvt9HmqiZ0cl5CRjtS84sEyhsHP2coDkaZKRKVfCDo9s7iw7ChVmar78Gu9pC4SoR/28wFu/G5JJhTnqEg== + +babel-plugin-macros@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1" + integrity sha512-Cg7TFGpIr01vOQNODXOOaGz2NpCU5gl8x1qJFbb6hbZxR7XrcE2vtbAsTAbJ7/xwJtUuJEw8K8Zr/AE0LHlesg== + dependencies: + "@babel/runtime" "^7.12.5" + cosmiconfig "^7.0.0" + resolve "^1.19.0" + +browserslist@^4.21.3: + version "4.21.4" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987" + integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw== + dependencies: + caniuse-lite "^1.0.30001400" + electron-to-chromium "^1.4.251" + node-releases "^2.0.6" + update-browserslist-db "^1.0.9" + +call-bind@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.2.tgz#b1d4e89e688119c3c9a903ad30abb2f6a919be3c" + integrity sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA== + dependencies: + function-bind "^1.1.1" + get-intrinsic "^1.0.2" + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +caniuse-lite@^1.0.30001400: + version "1.0.30001431" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001431.tgz#e7c59bd1bc518fae03a4656be442ce6c4887a795" + integrity sha512-zBUoFU0ZcxpvSt9IU66dXVT/3ctO1cy4y9cscs1szkPlcWb6pasYM144GqrUygUbT+k7cmUCW61cvskjcv0enQ== + +chalk@^2.0.0: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +clone@^2.1.1: + version "2.1.2" + resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" + integrity sha512-3Pe/CF1Nn94hyhIYpjtiLhdCoEoz0DqQ+988E9gmeEdQZlojxnOb74wctFyuwWQHzqyf9X7C7MG8juUpqBJT8w== + +clsx@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.1.1.tgz#98b3134f9abbdf23b2663491ace13c5c03a73188" + integrity sha512-6/bPho624p3S2pMyvP5kKBPXnI3ufHLObBFCfgx+LkeR5lg2XYy2hqZqUf45ypD8COn2bhgGJSUE+l5dhNBieA== + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +convert-source-map@^1.5.0, convert-source-map@^1.7.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" + integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== + +cosmiconfig@^7.0.0: + version "7.0.1" + resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-7.0.1.tgz#714d756522cace867867ccb4474c5d01bbae5d6d" + integrity sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ== + dependencies: + "@types/parse-json" "^4.0.0" + import-fresh "^3.2.1" + parse-json "^5.0.0" + path-type "^4.0.0" + yaml "^1.10.0" + +csstype@3.0.9: + version "3.0.9" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.9.tgz#6410af31b26bd0520933d02cbc64fce9ce3fbf0b" + integrity sha512-rpw6JPxK6Rfg1zLOYCSwle2GFOOsnjmDYDaBwEcwoOg4qlsIVCN789VkBZDJAGi4T07gI4YSutR43t9Zz4Lzuw== + +csstype@^3.0.2: + version "3.1.1" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.1.1.tgz#841b532c45c758ee546a11d5bd7b7b473c8c30b9" + integrity sha512-DJR/VvkAvSZW9bTouZue2sSxDwdTN92uHjqeKVm+0dAqdfNykRzQ95tay8aXMBAAPpUiq4Qcug2L7neoRh2Egw== + +dayjs@^1.11.6: + version "1.11.6" + resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.6.tgz#2e79a226314ec3ec904e3ee1dd5a4f5e5b1c7afb" + integrity sha512-zZbY5giJAinCG+7AGaw0wIhNZ6J8AhWuSXKvuc1KAyMiRsvGQWqh4L+MomvhdAYjN+lqvVCMq1I41e3YHvXkyQ== + +debug@^4.1.0: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +deep-equal@^1.0.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.1.1.tgz#b5c98c942ceffaf7cb051e24e1434a25a2e6076a" + integrity sha512-yd9c5AdiqVcR+JjcwUQb9DkhJc8ngNr0MahEBGvDiJw8puWab2yZlh+nkasOnZP+EGTAP6rRp2JzJhJZzvNF8g== + dependencies: + is-arguments "^1.0.4" + is-date-object "^1.0.1" + is-regex "^1.0.4" + object-is "^1.0.1" + object-keys "^1.1.1" + regexp.prototype.flags "^1.2.0" + +define-properties@^1.1.3: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.4.tgz#0b14d7bd7fbeb2f3572c3a7eda80ea5d57fb05b1" + integrity sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA== + dependencies: + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + +dom-helpers@^5.0.1: + version "5.2.1" + resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-5.2.1.tgz#d9400536b2bf8225ad98fe052e029451ac40e902" + integrity sha512-nRCa7CK3VTrM2NmGkIy4cbK7IZlgBE/PYMn55rrXefr5xXDP0LdtfPnblFDoVdcAfslJ7or6iqAUnx0CCGIWQA== + dependencies: + "@babel/runtime" "^7.8.7" + csstype "^3.0.2" + +electron-to-chromium@^1.4.251: + version "1.4.284" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592" + integrity sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA== + +error-ex@^1.3.1: + version "1.3.2" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.2.tgz#b4ac40648107fdcdcfae242f428bea8a14d4f1bf" + integrity sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g== + dependencies: + is-arrayish "^0.2.1" + +esbuild-android-64@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-android-64/-/esbuild-android-64-0.15.13.tgz#5f25864055dbd62e250f360b38b4c382224063af" + integrity sha512-yRorukXBlokwTip+Sy4MYskLhJsO0Kn0/Fj43s1krVblfwP+hMD37a4Wmg139GEsMLl+vh8WXp2mq/cTA9J97g== + +esbuild-android-arm64@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-android-arm64/-/esbuild-android-arm64-0.15.13.tgz#d8820f999314efbe8e0f050653a99ff2da632b0f" + integrity sha512-TKzyymLD6PiVeyYa4c5wdPw87BeAiTXNtK6amWUcXZxkV51gOk5u5qzmDaYSwiWeecSNHamFsaFjLoi32QR5/w== + +esbuild-darwin-64@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-darwin-64/-/esbuild-darwin-64-0.15.13.tgz#99ae7fdaa43947b06cd9d1a1c3c2c9f245d81fd0" + integrity sha512-WAx7c2DaOS6CrRcoYCgXgkXDliLnFv3pQLV6GeW1YcGEZq2Gnl8s9Pg7ahValZkpOa0iE/ojRVQ87sbUhF1Cbg== + +esbuild-darwin-arm64@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-darwin-arm64/-/esbuild-darwin-arm64-0.15.13.tgz#bafa1814354ad1a47adcad73de416130ef7f55e3" + integrity sha512-U6jFsPfSSxC3V1CLiQqwvDuj3GGrtQNB3P3nNC3+q99EKf94UGpsG9l4CQ83zBs1NHrk1rtCSYT0+KfK5LsD8A== + +esbuild-freebsd-64@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-64/-/esbuild-freebsd-64-0.15.13.tgz#84ef85535c5cc38b627d1c5115623b088d1de161" + integrity sha512-whItJgDiOXaDG/idy75qqevIpZjnReZkMGCgQaBWZuKHoElDJC1rh7MpoUgupMcdfOd+PgdEwNQW9DAE6i8wyA== + +esbuild-freebsd-arm64@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-freebsd-arm64/-/esbuild-freebsd-arm64-0.15.13.tgz#033f21de434ec8e0c478054b119af8056763c2d8" + integrity sha512-6pCSWt8mLUbPtygv7cufV0sZLeylaMwS5Fznj6Rsx9G2AJJsAjQ9ifA+0rQEIg7DwJmi9it+WjzNTEAzzdoM3Q== + +esbuild-linux-32@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-linux-32/-/esbuild-linux-32-0.15.13.tgz#54290ea8035cba0faf1791ce9ae6693005512535" + integrity sha512-VbZdWOEdrJiYApm2kkxoTOgsoCO1krBZ3quHdYk3g3ivWaMwNIVPIfEE0f0XQQ0u5pJtBsnk2/7OPiCFIPOe/w== + +esbuild-linux-64@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-linux-64/-/esbuild-linux-64-0.15.13.tgz#4264249281ea388ead948614b57fb1ddf7779a2c" + integrity sha512-rXmnArVNio6yANSqDQlIO4WiP+Cv7+9EuAHNnag7rByAqFVuRusLbGi2697A5dFPNXoO//IiogVwi3AdcfPC6A== + +esbuild-linux-arm64@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm64/-/esbuild-linux-arm64-0.15.13.tgz#9323c333924f97a02bdd2ae8912b36298acb312d" + integrity sha512-alEMGU4Z+d17U7KQQw2IV8tQycO6T+rOrgW8OS22Ua25x6kHxoG6Ngry6Aq6uranC+pNWNMB6aHFPh7aTQdORQ== + +esbuild-linux-arm@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-linux-arm/-/esbuild-linux-arm-0.15.13.tgz#b407f47b3ae721fe4e00e19e9f19289bef87a111" + integrity sha512-Ac6LpfmJO8WhCMQmO253xX2IU2B3wPDbl4IvR0hnqcPrdfCaUa2j/lLMGTjmQ4W5JsJIdHEdW12dG8lFS0MbxQ== + +esbuild-linux-mips64le@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-linux-mips64le/-/esbuild-linux-mips64le-0.15.13.tgz#bdf905aae5c0bcaa8f83567fe4c4c1bdc1f14447" + integrity sha512-47PgmyYEu+yN5rD/MbwS6DxP2FSGPo4Uxg5LwIdxTiyGC2XKwHhHyW7YYEDlSuXLQXEdTO7mYe8zQ74czP7W8A== + +esbuild-linux-ppc64le@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-linux-ppc64le/-/esbuild-linux-ppc64le-0.15.13.tgz#2911eae1c90ff58a3bd3259cb557235df25aa3b4" + integrity sha512-z6n28h2+PC1Ayle9DjKoBRcx/4cxHoOa2e689e2aDJSaKug3jXcQw7mM+GLg+9ydYoNzj8QxNL8ihOv/OnezhA== + +esbuild-linux-riscv64@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-linux-riscv64/-/esbuild-linux-riscv64-0.15.13.tgz#1837c660be12b1d20d2a29c7189ea703f93e9265" + integrity sha512-+Lu4zuuXuQhgLUGyZloWCqTslcCAjMZH1k3Xc9MSEJEpEFdpsSU0sRDXAnk18FKOfEjhu4YMGaykx9xjtpA6ow== + +esbuild-linux-s390x@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-linux-s390x/-/esbuild-linux-s390x-0.15.13.tgz#d52880ece229d1bd10b2d936b792914ffb07c7fc" + integrity sha512-BMeXRljruf7J0TMxD5CIXS65y7puiZkAh+s4XFV9qy16SxOuMhxhVIXYLnbdfLrsYGFzx7U9mcdpFWkkvy/Uag== + +esbuild-netbsd-64@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-netbsd-64/-/esbuild-netbsd-64-0.15.13.tgz#de14da46f1d20352b43e15d97a80a8788275e6ed" + integrity sha512-EHj9QZOTel581JPj7UO3xYbltFTYnHy+SIqJVq6yd3KkCrsHRbapiPb0Lx3EOOtybBEE9EyqbmfW1NlSDsSzvQ== + +esbuild-openbsd-64@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-openbsd-64/-/esbuild-openbsd-64-0.15.13.tgz#45e8a5fd74d92ad8f732c43582369c7990f5a0ac" + integrity sha512-nkuDlIjF/sfUhfx8SKq0+U+Fgx5K9JcPq1mUodnxI0x4kBdCv46rOGWbuJ6eof2n3wdoCLccOoJAbg9ba/bT2w== + +esbuild-sunos-64@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-sunos-64/-/esbuild-sunos-64-0.15.13.tgz#f646ac3da7aac521ee0fdbc192750c87da697806" + integrity sha512-jVeu2GfxZQ++6lRdY43CS0Tm/r4WuQQ0Pdsrxbw+aOrHQPHV0+LNOLnvbN28M7BSUGnJnHkHm2HozGgNGyeIRw== + +esbuild-windows-32@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-windows-32/-/esbuild-windows-32-0.15.13.tgz#fb4fe77c7591418880b3c9b5900adc4c094f2401" + integrity sha512-XoF2iBf0wnqo16SDq+aDGi/+QbaLFpkiRarPVssMh9KYbFNCqPLlGAWwDvxEVz+ywX6Si37J2AKm+AXq1kC0JA== + +esbuild-windows-64@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-windows-64/-/esbuild-windows-64-0.15.13.tgz#1fca8c654392c0c31bdaaed168becfea80e20660" + integrity sha512-Et6htEfGycjDrtqb2ng6nT+baesZPYQIW+HUEHK4D1ncggNrDNk3yoboYQ5KtiVrw/JaDMNttz8rrPubV/fvPQ== + +esbuild-windows-arm64@0.15.13: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.15.13.tgz#4ffd01b6b2888603f1584a2fe96b1f6a6f2b3dd8" + integrity sha512-3bv7tqntThQC9SWLRouMDmZnlOukBhOCTlkzNqzGCmrkCJI7io5LLjwJBOVY6kOUlIvdxbooNZwjtBvj+7uuVg== + +esbuild@^0.15.9: + version "0.15.13" + resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.15.13.tgz#7293480038feb2bafa91d3f6a20edab3ba6c108a" + integrity sha512-Cu3SC84oyzzhrK/YyN4iEVy2jZu5t2fz66HEOShHURcjSkOSAVL8C/gfUT+lDJxkVHpg8GZ10DD0rMHRPqMFaQ== + optionalDependencies: + "@esbuild/android-arm" "0.15.13" + "@esbuild/linux-loong64" "0.15.13" + esbuild-android-64 "0.15.13" + esbuild-android-arm64 "0.15.13" + esbuild-darwin-64 "0.15.13" + esbuild-darwin-arm64 "0.15.13" + esbuild-freebsd-64 "0.15.13" + esbuild-freebsd-arm64 "0.15.13" + esbuild-linux-32 "0.15.13" + esbuild-linux-64 "0.15.13" + esbuild-linux-arm "0.15.13" + esbuild-linux-arm64 "0.15.13" + esbuild-linux-mips64le "0.15.13" + esbuild-linux-ppc64le "0.15.13" + esbuild-linux-riscv64 "0.15.13" + esbuild-linux-s390x "0.15.13" + esbuild-netbsd-64 "0.15.13" + esbuild-openbsd-64 "0.15.13" + esbuild-sunos-64 "0.15.13" + esbuild-windows-32 "0.15.13" + esbuild-windows-64 "0.15.13" + esbuild-windows-arm64 "0.15.13" + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eventemitter3@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-2.0.3.tgz#b5e1079b59fb5e1ba2771c0a993be060a58c99ba" + integrity sha512-jLN68Dx5kyFHaePoXWPsCGW5qdyZQtLYHkxkg02/Mz6g0kYpDx4FyP6XfArhQdlOC4b8Mv+EMxPo/8La7Tzghg== + +extend@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" + integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== + +fast-deep-equal@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-diff@1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154" + integrity sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig== + +file-selector@^0.6.0: + version "0.6.0" + resolved "https://registry.yarnpkg.com/file-selector/-/file-selector-0.6.0.tgz#fa0a8d9007b829504db4d07dd4de0310b65287dc" + integrity sha512-QlZ5yJC0VxHxQQsQhXvBaC7VRJ2uaxTf+Tfpu4Z/OcVQJVpZO+DGU0rkoVW5ce2SccxugvpBJoMvUs59iILYdw== + dependencies: + tslib "^2.4.0" + +find-root@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" + integrity sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng== + +fsevents@~2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +functions-have-names@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/functions-have-names/-/functions-have-names-1.2.3.tgz#0404fe4ee2ba2f607f0e0ec3c80bae994133b834" + integrity sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ== + +gensync@^1.0.0-beta.2: + version "1.0.0-beta.2" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" + integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== + +get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: + version "1.1.3" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.3.tgz#063c84329ad93e83893c7f4f243ef63ffa351385" + integrity sha512-QJVz1Tj7MS099PevUG5jvnt9tSkXN8K14dxQlikJuPt4uD9hHAHjLyLBiLR5zELelBdD9QNRAXZzsJx0WaDL9A== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.3" + +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + +has-property-descriptors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" + integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== + dependencies: + get-intrinsic "^1.1.1" + +has-symbols@^1.0.2, has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has-tostringtag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-tostringtag/-/has-tostringtag-1.0.0.tgz#7e133818a7d394734f941e73c3d3f9291e658b25" + integrity sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ== + dependencies: + has-symbols "^1.0.2" + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +hoist-non-react-statics@^3.3.1: + version "3.3.2" + resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" + integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== + dependencies: + react-is "^16.7.0" + +import-fresh@^3.2.1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +is-arguments@^1.0.4: + version "1.1.1" + resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" + integrity sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + integrity sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg== + +is-core-module@^2.9.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" + integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== + dependencies: + has "^1.0.3" + +is-date-object@^1.0.1: + version "1.0.5" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.5.tgz#0841d5536e724c25597bf6ea62e1bd38298df31f" + integrity sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ== + dependencies: + has-tostringtag "^1.0.0" + +is-regex@^1.0.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" + integrity sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg== + dependencies: + call-bind "^1.0.2" + has-tostringtag "^1.0.0" + +"js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +json-parse-even-better-errors@^2.3.0: + version "2.3.1" + resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" + integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== + +json5@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" + integrity sha512-1hqLFMSrGHRHxav9q9gNjJ5EXznIxGVO09xQRrwplcS8qs28pZ8s8hupZAmqDwZUmVZ2Qb2jnyPOWcDH8m8dlA== + +klona@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.5.tgz#d166574d90076395d9963aa7a928fabb8d76afbc" + integrity sha512-pJiBpiXMbt7dkzXe8Ghj/u4FfXOOa98fPW+bihOJ4SjnoijweJrNThJfd3ifXpXhREjpoF2mZVH1GfS9LV3kHQ== + +lines-and-columns@^1.1.6: + version "1.2.4" + resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" + integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== + +lodash@^4.17.4: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +loose-envify@^1.1.0, loose-envify@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" + integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== + dependencies: + js-tokens "^3.0.0 || ^4.0.0" + +magic-string@^0.26.7: + version "0.26.7" + resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.26.7.tgz#caf7daf61b34e9982f8228c4527474dac8981d6f" + integrity sha512-hX9XH3ziStPoPhJxLq1syWuZMxbDvGNbVchfrdCtanC7D13888bMFow61x8axrx+GfHLtVeAx2kxL7tTGRl+Ow== + dependencies: + sourcemap-codec "^1.4.8" + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +nanoid@^3.3.4: + version "3.3.4" + resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" + integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== + +node-releases@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" + integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== + +object-assign@^4.1.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== + +object-is@^1.0.1: + version "1.1.5" + resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.5.tgz#b9deeaa5fc7f1846a0faecdceec138e5778f53ac" + integrity sha512-3cyDsyHgtmi7I7DfSSI2LDp6SK2lwvtbg0p0R1e0RvTqF5ceGx+K2dfSjm1bKDMVCFEDAQvy+o8c6a7VujOddw== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + +object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +parchment@^1.1.2, parchment@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/parchment/-/parchment-1.1.4.tgz#aeded7ab938fe921d4c34bc339ce1168bc2ffde5" + integrity sha512-J5FBQt/pM2inLzg4hEWmzQx/8h8D0CiDxaG3vyp9rKrQRSDgBlhjdP5jQGgosEajXPSQouXGHOmVdgo7QmJuOg== + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parse-json@^5.0.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-5.2.0.tgz#c76fc66dee54231c962b22bcc8a72cf2f99753cd" + integrity sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg== + dependencies: + "@babel/code-frame" "^7.0.0" + error-ex "^1.3.1" + json-parse-even-better-errors "^2.3.0" + lines-and-columns "^1.1.6" + +path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + +postcss@^8.4.18: + version "8.4.19" + resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.19.tgz#61178e2add236b17351897c8bcc0b4c8ecab56fc" + integrity sha512-h+pbPsyhlYj6N2ozBmHhHrs9DzGmbaarbLvWipMRO7RLS+v4onj26MPFXA5OBYFxyqYhUJK456SwDcY9H2/zsA== + dependencies: + nanoid "^3.3.4" + picocolors "^1.0.0" + source-map-js "^1.0.2" + +prop-types@^15.6.2, prop-types@^15.8.1: + version "15.8.1" + resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" + integrity sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg== + dependencies: + loose-envify "^1.4.0" + object-assign "^4.1.1" + react-is "^16.13.1" + +quill-delta@^3.6.2: + version "3.6.3" + resolved "https://registry.yarnpkg.com/quill-delta/-/quill-delta-3.6.3.tgz#b19fd2b89412301c60e1ff213d8d860eac0f1032" + integrity sha512-wdIGBlcX13tCHOXGMVnnTVFtGRLoP0imqxM696fIPwIf5ODIYUHIvHbZcyvGlZFiFhK5XzDC2lpjbxRhnM05Tg== + dependencies: + deep-equal "^1.0.1" + extend "^3.0.2" + fast-diff "1.1.2" + +quill-mention@^3.0.8: + version "3.1.0" + resolved "https://registry.yarnpkg.com/quill-mention/-/quill-mention-3.1.0.tgz#acf0bf21524b627e9304f63534e6d2b8c59ab4fd" + integrity sha512-uyjGK8QPJHEcjvNc3wUJy6a05Oiu+6JJ0N9SFAwjYHYThgMzlKucyD975fq28Mr1it8ZFRNiRMPa0sCiVOAEwA== + dependencies: + quill "^1.3.7" + +quill@^1.3.7: + version "1.3.7" + resolved "https://registry.yarnpkg.com/quill/-/quill-1.3.7.tgz#da5b2f3a2c470e932340cdbf3668c9f21f9286e8" + integrity sha512-hG/DVzh/TiknWtE6QmWAF/pxoZKYxfe3J/d/+ShUWkDvvkZQVTPeVmUJVu1uE6DDooC4fWTiCLh84ul89oNz5g== + dependencies: + clone "^2.1.1" + deep-equal "^1.0.1" + eventemitter3 "^2.0.3" + extend "^3.0.2" + parchment "^1.1.4" + quill-delta "^3.6.2" + +react-dom@^18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.2.0.tgz#22aaf38708db2674ed9ada224ca4aa708d821e3d" + integrity sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g== + dependencies: + loose-envify "^1.1.0" + scheduler "^0.23.0" + +react-dropzone@14.2.3: + version "14.2.3" + resolved "https://registry.yarnpkg.com/react-dropzone/-/react-dropzone-14.2.3.tgz#0acab68308fda2d54d1273a1e626264e13d4e84b" + integrity sha512-O3om8I+PkFKbxCukfIR3QAGftYXDZfOE2N1mr/7qebQJHs7U+/RSL/9xomJNpRg9kM5h9soQSdf0Gc7OHF5Fug== + dependencies: + attr-accept "^2.2.2" + file-selector "^0.6.0" + prop-types "^15.8.1" + +react-is@^16.13.1, react-is@^16.7.0: + version "16.13.1" + resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" + integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== + +react-quill@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/react-quill/-/react-quill-2.0.0.tgz#67a0100f58f96a246af240c9fa6841b363b3e017" + integrity sha512-4qQtv1FtCfLgoD3PXAur5RyxuUbPXQGOHgTlFie3jtxp43mXDtzCKaOgQ3mLyZfi1PUlyjycfivKelFhy13QUg== + dependencies: + "@types/quill" "^1.3.10" + lodash "^4.17.4" + quill "^1.3.7" + +react-refresh@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.0.tgz#4e02825378a5f227079554d4284889354e5f553e" + integrity sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ== + +react-textarea-autosize@8.3.4: + version "8.3.4" + resolved "https://registry.yarnpkg.com/react-textarea-autosize/-/react-textarea-autosize-8.3.4.tgz#270a343de7ad350534141b02c9cb78903e553524" + integrity sha512-CdtmP8Dc19xL8/R6sWvtknD/eCXkQr30dtvC4VmGInhRsfF8X/ihXCq6+9l9qbxmKRiq407/7z5fxE7cVWQNgQ== + dependencies: + "@babel/runtime" "^7.10.2" + use-composed-ref "^1.3.0" + use-latest "^1.2.1" + +react-transition-group@4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/react-transition-group/-/react-transition-group-4.4.2.tgz#8b59a56f09ced7b55cbd53c36768b922890d5470" + integrity sha512-/RNYfRAMlZwDSr6z4zNKV6xu53/e2BuaBbGhbyYIXTrmgu/bGHzmqOs7mJSJBHy9Ud+ApHx3QjrkKSp1pxvlFg== + dependencies: + "@babel/runtime" "^7.5.5" + dom-helpers "^5.0.1" + loose-envify "^1.4.0" + prop-types "^15.6.2" + +react@^18.2.0: + version "18.2.0" + resolved "https://registry.yarnpkg.com/react/-/react-18.2.0.tgz#555bd98592883255fa00de14f1151a917b5d77d5" + integrity sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ== + dependencies: + loose-envify "^1.1.0" + +regenerator-runtime@^0.13.10: + version "0.13.10" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.10.tgz#ed07b19616bcbec5da6274ebc75ae95634bfc2ee" + integrity sha512-KepLsg4dU12hryUO7bp/axHAKvwGOCV0sGloQtpagJ12ai+ojVDqkeGSiRX1zlq+kjIMZ1t7gpze+26QqtdGqw== + +regexp.prototype.flags@^1.2.0: + version "1.4.3" + resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.4.3.tgz#87cab30f80f66660181a3bb7bf5981a872b367ac" + integrity sha512-fjggEOO3slI6Wvgjwflkc4NFRCTZAu5CnNfBd5qOMYhWdn67nJBBu34/TkD++eeFmd8C9r9jfXJ27+nSiRkSUA== + dependencies: + call-bind "^1.0.2" + define-properties "^1.1.3" + functions-have-names "^1.2.2" + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve@^1.19.0, resolve@^1.22.1: + version "1.22.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== + dependencies: + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +rollup@^2.79.1: + version "2.79.1" + resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7" + integrity sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw== + optionalDependencies: + fsevents "~2.3.2" + +scheduler@^0.23.0: + version "0.23.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe" + integrity sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw== + dependencies: + loose-envify "^1.1.0" + +semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +source-map-js@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" + integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== + +source-map@^0.5.7: + version "0.5.7" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" + integrity sha512-LbrmJOMUSdEVxIKvdcJzQC+nQhe8FUZQTXQy6+I75skNgn3OoQ0DZA8YnFa7gp8tqtL3KPf1kmo0R5DoApeSGQ== + +sourcemap-codec@^1.4.8: + version "1.4.8" + resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" + integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== + +stylis@4.1.3: + version "4.1.3" + resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.1.3.tgz#fd2fbe79f5fed17c55269e16ed8da14c84d069f7" + integrity sha512-GP6WDNWf+o403jrEp9c5jibKavrtLW+/qYGhFxFrG8maXhwTBI7gLLhiBb0o7uFccWN+EOS9aMO6cGHWAO07OA== + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== + +tslib@^2.0.0, tslib@^2.4.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" + integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== + +typescript@^4.6.4: + version "4.8.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6" + integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ== + +update-browserslist-db@^1.0.9: + version "1.0.10" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3" + integrity sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ== + dependencies: + escalade "^3.1.1" + picocolors "^1.0.0" + +use-composed-ref@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/use-composed-ref/-/use-composed-ref-1.3.0.tgz#3d8104db34b7b264030a9d916c5e94fbe280dbda" + integrity sha512-GLMG0Jc/jiKov/3Ulid1wbv3r54K9HlMW29IWcDFPEqFkSO2nS0MuefWgMJpeHQ9YJeXDL3ZUF+P3jdXlZX/cQ== + +use-isomorphic-layout-effect@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/use-isomorphic-layout-effect/-/use-isomorphic-layout-effect-1.1.2.tgz#497cefb13d863d687b08477d9e5a164ad8c1a6fb" + integrity sha512-49L8yCO3iGT/ZF9QttjwLF/ZD9Iwto5LnH5LmEdk/6cFmXddqi2ulF0edxTwjj+7mqvpVVGQWvbXZdn32wRSHA== + +use-latest@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/use-latest/-/use-latest-1.2.1.tgz#d13dfb4b08c28e3e33991546a2cee53e14038cf2" + integrity sha512-xA+AVm/Wlg3e2P/JiItTziwS7FK92LWrDB0p+hgXloIMuVCeJJ8v6f0eeHyPZaJrM+usM1FkFfbNCrJGs8A/zw== + dependencies: + use-isomorphic-layout-effect "^1.1.1" + +vite@^3.2.3: + version "3.2.3" + resolved "https://registry.yarnpkg.com/vite/-/vite-3.2.3.tgz#7a68d9ef73eff7ee6dc0718ad3507adfc86944a7" + integrity sha512-h8jl1TZ76eGs3o2dIBSsvXDLb1m/Ec1iej8ZMdz+PsaFUsftZeWe2CZOI3qogEsMNaywc17gu0q6cQDzh/weCQ== + dependencies: + esbuild "^0.15.9" + postcss "^8.4.18" + resolve "^1.22.1" + rollup "^2.79.1" + optionalDependencies: + fsevents "~2.3.2" + +yaml@^1.10.0: + version "1.10.2" + resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" + integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== From bb0f530c1990b3f55b900c8e1eaaa198f2512c2f Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 11 Nov 2022 00:36:24 +0100 Subject: [PATCH 003/406] add mantine ui to the used section --- InvenTree/web/README | 3 +++ 1 file changed, 3 insertions(+) diff --git a/InvenTree/web/README b/InvenTree/web/README index e9547881a0e8..9f7035a28464 100644 --- a/InvenTree/web/README +++ b/InvenTree/web/README @@ -10,3 +10,6 @@ Tools: 1. Install yarn 2. Install packages (from src) `yarn` 3. Run dev server with `yarn dev` + +## Material used +https://github.com/mantinedev/ui.mantine.dev From 82f5b1d75738fe7e18bc7048774499ad04e21880 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sun, 13 Nov 2022 00:03:24 +0100 Subject: [PATCH 004/406] Add base site --- InvenTree/web/src/package.json | 6 +- InvenTree/web/src/src/App.tsx | 35 ++- InvenTree/web/src/src/assets/inventree.svg | 291 ++++++++++++++++++++ InvenTree/web/src/src/components/Layout.tsx | 169 ++++++++++++ InvenTree/web/src/src/pages/error.jsx | 16 ++ InvenTree/web/src/tsconfig.json | 2 +- InvenTree/web/src/yarn.lock | 34 +++ 7 files changed, 548 insertions(+), 5 deletions(-) create mode 100644 InvenTree/web/src/src/assets/inventree.svg create mode 100644 InvenTree/web/src/src/components/Layout.tsx create mode 100644 InvenTree/web/src/src/pages/error.jsx diff --git a/InvenTree/web/src/package.json b/InvenTree/web/src/package.json index 6c2693c1f23e..a8fde4f51333 100644 --- a/InvenTree/web/src/package.json +++ b/InvenTree/web/src/package.json @@ -18,9 +18,11 @@ "@mantine/modals": "^5.7.1", "@mantine/notifications": "^5.7.1", "@mantine/rte": "^5.7.1", + "@types/react-router-dom": "^5.3.3", "dayjs": "^1.11.6", "react": "^18.2.0", - "react-dom": "^18.2.0" + "react-dom": "^18.2.0", + "react-router-dom": "^6.4.3" }, "devDependencies": { "@types/react": "^18.0.24", @@ -29,4 +31,4 @@ "typescript": "^4.6.4", "vite": "^3.2.3" } -} \ No newline at end of file +} diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index 25eca060d68c..51cc9473ff83 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -3,7 +3,38 @@ import { MantineProvider, ColorSchemeProvider, ColorScheme } from '@mantine/core import { useColorScheme } from '@mantine/hooks'; import { Text } from '@mantine/core'; import { ColorToggle } from './components/ColorToggle'; +import { HeaderTabs } from './components/Layout'; +import { + createBrowserRouter, + RouterProvider, + Route, +} from "react-router-dom"; +import ErrorPage from './pages/error'; +const user = { + "name": "Matthias Mair", + "email": "code@mjmair.com", +} + +const tabs = [ + "Home", + "Orders", + "Education", + "Community", + "Forums", + "Support", + "Account", + "Helpdesk", + "Settings", + ] + + const router = createBrowserRouter([ + { + path: "/", + element:
Hello world!
, + errorElement: , + }, + ]); export default function App() { const preferredColorScheme = useColorScheme(); @@ -14,8 +45,8 @@ export default function App() { return ( - Welcome to Mantine! - + + ); diff --git a/InvenTree/web/src/src/assets/inventree.svg b/InvenTree/web/src/src/assets/inventree.svg new file mode 100644 index 000000000000..f2bb05ffae39 --- /dev/null +++ b/InvenTree/web/src/src/assets/inventree.svg @@ -0,0 +1,291 @@ + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/InvenTree/web/src/src/components/Layout.tsx b/InvenTree/web/src/src/components/Layout.tsx new file mode 100644 index 000000000000..b3426d7223e7 --- /dev/null +++ b/InvenTree/web/src/src/components/Layout.tsx @@ -0,0 +1,169 @@ +import { useState } from 'react'; +import { + createStyles, + Container, + Avatar, + UnstyledButton, + Group, + Text, + Menu, + Tabs, + Burger, + ActionIcon, +} from '@mantine/core'; +import { useDisclosure } from '@mantine/hooks'; +import { + IconAlien, + IconLogout, + IconHeart, + IconStar, + IconMessage, + IconSettings, + IconPlayerPause, + IconTrash, + IconSwitchHorizontal, + IconChevronDown, +} from '@tabler/icons'; +import { ColorToggle } from './ColorToggle'; +import InvenTreeIcon from '../assets/inventree.svg'; + +const useStyles = createStyles((theme) => ({ + header: { + paddingTop: theme.spacing.sm, + backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[6] : theme.colors.gray[0], + borderBottom: `1px solid ${ + theme.colorScheme === 'dark' ? 'transparent' : theme.colors.gray[2] + }`, + marginBottom: 120, + }, + + mainSection: { + paddingBottom: theme.spacing.sm, + }, + + user: { + color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.black, + padding: `${theme.spacing.xs}px ${theme.spacing.sm}px`, + borderRadius: theme.radius.sm, + transition: 'background-color 100ms ease', + + '&:hover': { + backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[8] : theme.white, + }, + + [theme.fn.smallerThan('xs')]: { + display: 'none', + }, + }, + + burger: { + [theme.fn.largerThan('xs')]: { + display: 'none', + }, + }, + + userActive: { + backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[8] : theme.white, + }, + + tabs: { + [theme.fn.smallerThan('sm')]: { + display: 'none', + }, + }, + + tabsList: { + borderBottom: '0 !important', + }, + + tab: { + fontWeight: 500, + height: 38, + backgroundColor: 'transparent', + + '&:hover': { + backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[1], + }, + + '&[data-active]': { + backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white, + borderColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.colors.gray[2], + }, + }, +})); + +interface HeaderTabsProps { + user: { name: string; }; + tabs: string[]; +} + +export function HeaderTabs({ user, tabs }: HeaderTabsProps) { + const { classes, theme, cx } = useStyles(); + const [opened, { toggle }] = useDisclosure(false); + const [userMenuOpened, setUserMenuOpened] = useState(false); + + const items = tabs.map((tab) => ( + + {tab} + + )); + + return ( +
+ + + InvenTree Logo + + + + + + + setUserMenuOpened(false)} + onOpen={() => setUserMenuOpened(true)} + > + + + + + {user.name} + + + + + + + }> + Notifications + + + Settings + }>Account settings + }>Logout + + + + + + + + {items} + + +
+ ); +} \ No newline at end of file diff --git a/InvenTree/web/src/src/pages/error.jsx b/InvenTree/web/src/src/pages/error.jsx new file mode 100644 index 000000000000..7a5fe129db01 --- /dev/null +++ b/InvenTree/web/src/src/pages/error.jsx @@ -0,0 +1,16 @@ +import { useRouteError } from "react-router-dom"; + +export default function ErrorPage() { + const error = useRouteError(); + console.error(error); + + return ( +
+

Error

+

Sorry, an unexpected error has occurred.

+

+ {error.statusText || error.message} +

+
+ ); +} diff --git a/InvenTree/web/src/tsconfig.json b/InvenTree/web/src/tsconfig.json index 3d0a51a86e20..8a10db24e6db 100644 --- a/InvenTree/web/src/tsconfig.json +++ b/InvenTree/web/src/tsconfig.json @@ -3,7 +3,7 @@ "target": "ESNext", "useDefineForClassFields": true, "lib": ["DOM", "DOM.Iterable", "ESNext"], - "allowJs": false, + "allowJs": true, "skipLibCheck": true, "esModuleInterop": false, "allowSyntheticDefaultImports": true, diff --git a/InvenTree/web/src/yarn.lock b/InvenTree/web/src/yarn.lock index 96573ad84c63..c2a3339867e5 100644 --- a/InvenTree/web/src/yarn.lock +++ b/InvenTree/web/src/yarn.lock @@ -579,11 +579,21 @@ dependencies: "@babel/runtime" "^7.13.10" +"@remix-run/router@1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.0.3.tgz#953b88c20ea00d0eddaffdc1b115c08474aa295d" + integrity sha512-ceuyTSs7PZ/tQqi19YZNBc5X7kj1f8p+4DIyrcIYFY9h+hd1OKm4RqtiWldR9eGEvIiJfsqwM4BsuCtRIuEw6Q== + "@tabler/icons@^1.68.0": version "1.111.0" resolved "https://registry.yarnpkg.com/@tabler/icons/-/icons-1.111.0.tgz#0538fdd8b5de7072ae60fc5d2f13a9a636d2d0e3" integrity sha512-TZWYiMT5ccqfHxRE0Qtgvl+sGsMbNkrv7cJMt/tm8TN9l/CDXx/o7d8uAwUN+3PAlSFfF5e/rD1bi1WJs2xNIA== +"@types/history@^4.7.11": + version "4.7.11" + resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.11.tgz#56588b17ae8f50c53983a524fc3cc47437969d64" + integrity sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA== + "@types/parse-json@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" @@ -608,6 +618,15 @@ dependencies: "@types/react" "*" +"@types/react-router-dom@^5.3.3": + version "5.3.3" + resolved "https://registry.yarnpkg.com/@types/react-router-dom/-/react-router-dom-5.3.3.tgz#e9d6b4a66fcdbd651a5f106c2656a30088cc1e83" + integrity sha512-kpqnYK4wcdm5UaWI3fLcELopqLrHgLqNsdpHauzlQktfkHL3npOSwtj1Uz9oKBAzs7lFtVkV8j83voAz2D8fhw== + dependencies: + "@types/history" "^4.7.11" + "@types/react" "*" + "@types/react-router" "*" + "@types/react@*", "@types/react@^18.0.24": version "18.0.25" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.25.tgz#8b1dcd7e56fe7315535a4af25435e0bb55c8ae44" @@ -1291,6 +1310,21 @@ react-refresh@^0.14.0: resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.0.tgz#4e02825378a5f227079554d4284889354e5f553e" integrity sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ== +react-router-dom@^6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.4.3.tgz#70093b5f65f85f1df9e5d4182eb7ff3a08299275" + integrity sha512-MiaYQU8CwVCaOfJdYvt84KQNjT78VF0TJrA17SIQgNHRvLnXDJO6qsFqq8F/zzB1BWZjCFIrQpu4QxcshitziQ== + dependencies: + "@remix-run/router" "1.0.3" + react-router "6.4.3" + +react-router@6.4.3: + version "6.4.3" + resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.4.3.tgz#9ed3ee4d6e95889e9b075a5d63e29acc7def0d49" + integrity sha512-BT6DoGn6aV1FVP5yfODMOiieakp3z46P1Fk0RNzJMACzE7C339sFuHebfvWtnB4pzBvXXkHP2vscJzWRuUjTtA== + dependencies: + "@remix-run/router" "1.0.3" + react-textarea-autosize@8.3.4: version "8.3.4" resolved "https://registry.yarnpkg.com/react-textarea-autosize/-/react-textarea-autosize-8.3.4.tgz#270a343de7ad350534141b02c9cb78903e553524" From 7bbfc83253f7362e3e549c074b6468b3fd9e0f02 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sun, 13 Nov 2022 22:25:53 +0100 Subject: [PATCH 005/406] Add GH action for releasing --- .github/workflows/webfrontend.yaml | 58 ++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/webfrontend.yaml diff --git a/.github/workflows/webfrontend.yaml b/.github/workflows/webfrontend.yaml new file mode 100644 index 000000000000..de957a402d50 --- /dev/null +++ b/.github/workflows/webfrontend.yaml @@ -0,0 +1,58 @@ +name: Deploy new UI to Pages + +on: + push: + branches: ["vite-base"] + + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + # Build job + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: "16" + cache: yarn + - name: Setup Pages + uses: actions/configure-pages@v2 + with: + static_site_generator: next + - name: Restore cache + uses: actions/cache@v3 + with: + path: | + .next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- + - name: Install dependencies + run: yarn install + - name: Build + run: yarn build + - name: Upload artifact + uses: actions/upload-pages-artifact@v1 + with: + path: ./InvenTree/web/src/dist + + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v1 From d06101c6010dac0b5a15087dcfb5d44d9bca83c7 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sun, 13 Nov 2022 22:34:40 +0100 Subject: [PATCH 006/406] add subpaths --- .github/workflows/webfrontend.yaml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/webfrontend.yaml b/.github/workflows/webfrontend.yaml index de957a402d50..58ca249a7dfe 100644 --- a/.github/workflows/webfrontend.yaml +++ b/.github/workflows/webfrontend.yaml @@ -15,7 +15,6 @@ concurrency: cancel-in-progress: true jobs: - # Build job build: runs-on: ubuntu-latest steps: @@ -26,10 +25,9 @@ jobs: with: node-version: "16" cache: yarn + cache-dependency-path: InvenTree/web/src - name: Setup Pages uses: actions/configure-pages@v2 - with: - static_site_generator: next - name: Restore cache uses: actions/cache@v3 with: @@ -38,9 +36,9 @@ jobs: key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- - name: Install dependencies - run: yarn install + run: cd InvenTree/web/src && yarn install - name: Build - run: yarn build + run: cd InvenTree/web/src && yarn build - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: From 60ee7eff3481e41af2c3f945d8174b500a9397d7 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sun, 13 Nov 2022 22:35:40 +0100 Subject: [PATCH 007/406] remove page setup --- .github/workflows/webfrontend.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/webfrontend.yaml b/.github/workflows/webfrontend.yaml index 58ca249a7dfe..9f39dc4e3f98 100644 --- a/.github/workflows/webfrontend.yaml +++ b/.github/workflows/webfrontend.yaml @@ -26,8 +26,6 @@ jobs: node-version: "16" cache: yarn cache-dependency-path: InvenTree/web/src - - name: Setup Pages - uses: actions/configure-pages@v2 - name: Restore cache uses: actions/cache@v3 with: From 3be32770484d0a07007064f50615b639b0e711cb Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sun, 13 Nov 2022 22:40:17 +0100 Subject: [PATCH 008/406] readd setup --- .github/workflows/webfrontend.yaml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/webfrontend.yaml b/.github/workflows/webfrontend.yaml index 9f39dc4e3f98..7f68cd2980e5 100644 --- a/.github/workflows/webfrontend.yaml +++ b/.github/workflows/webfrontend.yaml @@ -26,13 +26,15 @@ jobs: node-version: "16" cache: yarn cache-dependency-path: InvenTree/web/src + - name: Setup Pages + uses: actions/configure-pages@v2 - name: Restore cache uses: actions/cache@v3 with: path: | .next/cache - key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} - restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- + key: ${{ runner.os }}-vite-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} + restore-keys: ${{ runner.os }}-vite-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- - name: Install dependencies run: cd InvenTree/web/src && yarn install - name: Build From 49cb3b3e0a3f2eb43cde6471684f83238d40c70b Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sun, 13 Nov 2022 22:42:46 +0100 Subject: [PATCH 009/406] move everything to one job --- .github/workflows/webfrontend.yaml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/.github/workflows/webfrontend.yaml b/.github/workflows/webfrontend.yaml index 7f68cd2980e5..85086d9ece38 100644 --- a/.github/workflows/webfrontend.yaml +++ b/.github/workflows/webfrontend.yaml @@ -43,14 +43,6 @@ jobs: uses: actions/upload-pages-artifact@v1 with: path: ./InvenTree/web/src/dist - - deploy: - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - runs-on: ubuntu-latest - needs: build - steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v1 From ec3df67b0b8992231c77b6d93c7467fca4039cc7 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sun, 13 Nov 2022 22:47:21 +0100 Subject: [PATCH 010/406] add env url --- .github/workflows/webfrontend.yaml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/webfrontend.yaml b/.github/workflows/webfrontend.yaml index 85086d9ece38..5fff2f45b3f1 100644 --- a/.github/workflows/webfrontend.yaml +++ b/.github/workflows/webfrontend.yaml @@ -3,13 +3,13 @@ name: Deploy new UI to Pages on: push: branches: ["vite-base"] - workflow_dispatch: permissions: contents: read pages: write id-token: write + concurrency: group: "pages" cancel-in-progress: true @@ -17,6 +17,9 @@ concurrency: jobs: build: runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} steps: - name: Checkout uses: actions/checkout@v3 @@ -26,8 +29,6 @@ jobs: node-version: "16" cache: yarn cache-dependency-path: InvenTree/web/src - - name: Setup Pages - uses: actions/configure-pages@v2 - name: Restore cache uses: actions/cache@v3 with: @@ -39,6 +40,8 @@ jobs: run: cd InvenTree/web/src && yarn install - name: Build run: cd InvenTree/web/src && yarn build + - name: Setup Pages + uses: actions/configure-pages@v2 - name: Upload artifact uses: actions/upload-pages-artifact@v1 with: From 9abda697ff29dc4fff8a50c0d0c589e4a8bc5a57 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sun, 13 Nov 2022 23:13:18 +0100 Subject: [PATCH 011/406] remove gh action --- .github/workflows/webfrontend.yaml | 51 ------------------------------ 1 file changed, 51 deletions(-) delete mode 100644 .github/workflows/webfrontend.yaml diff --git a/.github/workflows/webfrontend.yaml b/.github/workflows/webfrontend.yaml deleted file mode 100644 index 5fff2f45b3f1..000000000000 --- a/.github/workflows/webfrontend.yaml +++ /dev/null @@ -1,51 +0,0 @@ -name: Deploy new UI to Pages - -on: - push: - branches: ["vite-base"] - workflow_dispatch: - -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: "pages" - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: "16" - cache: yarn - cache-dependency-path: InvenTree/web/src - - name: Restore cache - uses: actions/cache@v3 - with: - path: | - .next/cache - key: ${{ runner.os }}-vite-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} - restore-keys: ${{ runner.os }}-vite-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- - - name: Install dependencies - run: cd InvenTree/web/src && yarn install - - name: Build - run: cd InvenTree/web/src && yarn build - - name: Setup Pages - uses: actions/configure-pages@v2 - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - with: - path: ./InvenTree/web/src/dist - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v1 From 6445957fb0a360439cdb2a3db7c5fb0c0c820bdd Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 00:04:22 +0100 Subject: [PATCH 012/406] Add layout routing --- InvenTree/web/src/src/App.tsx | 72 ++++++++++------ .../web/src/src/components/FooterSimple.tsx | 57 +++++++++++++ .../components/{Layout.tsx => HeaderTabs.tsx} | 82 +++++++++---------- .../web/src/src/components/InvenTreeLogo.tsx | 8 ++ InvenTree/web/src/src/pages/layout.tsx | 31 +++++++ 5 files changed, 185 insertions(+), 65 deletions(-) create mode 100644 InvenTree/web/src/src/components/FooterSimple.tsx rename InvenTree/web/src/src/components/{Layout.tsx => HeaderTabs.tsx} (64%) create mode 100644 InvenTree/web/src/src/components/InvenTreeLogo.tsx create mode 100644 InvenTree/web/src/src/pages/layout.tsx diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index 51cc9473ff83..60c1c9feb2ee 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -3,38 +3,63 @@ import { MantineProvider, ColorSchemeProvider, ColorScheme } from '@mantine/core import { useColorScheme } from '@mantine/hooks'; import { Text } from '@mantine/core'; import { ColorToggle } from './components/ColorToggle'; -import { HeaderTabs } from './components/Layout'; +import { HeaderTabs } from './components/HeaderTabs'; import { createBrowserRouter, RouterProvider, Route, } from "react-router-dom"; import ErrorPage from './pages/error'; +import Layout, { Home, Part } from './pages/layout'; -const user = { - "name": "Matthias Mair", - "email": "code@mjmair.com", +const routes = { + base: 'https://demo.inventree.org/api', + home: '/', + error: '/error', +}; + +const user = { + "name": "Matthias Mair", + "email": "code@mjmair.com", } -const tabs = [ - "Home", - "Orders", - "Education", - "Community", - "Forums", - "Support", - "Account", - "Helpdesk", - "Settings", - ] +const tabs = [ + {text: "Home", name:"home"}, + {text: "Part", name:"part"}, +] + +const links = [ + { + "link": "https://inventree.org/", + "label": "Website" + }, + { + "link": "https://github.com/invenhost/InvenTree", + "label": "GitHub" + }, + { + "link": "https://demo.inventree.org/", + "label": "Demo" + } +] - const router = createBrowserRouter([ - { - path: "/", - element:
Hello world!
, - errorElement: , - }, - ]); +const router = createBrowserRouter([ + { + path: "/", + element: , + errorElement: , + children: [ + { + path: "home/", + element: , + }, + { + path: "part/", + element: , + }, + ], + }, +]); export default function App() { const preferredColorScheme = useColorScheme(); @@ -45,8 +70,7 @@ export default function App() { return ( - - + ); diff --git a/InvenTree/web/src/src/components/FooterSimple.tsx b/InvenTree/web/src/src/components/FooterSimple.tsx new file mode 100644 index 000000000000..a64062ad6f8c --- /dev/null +++ b/InvenTree/web/src/src/components/FooterSimple.tsx @@ -0,0 +1,57 @@ +import { InvenTreeLogo } from "./InvenTreeLogo"; +import { createStyles, Container, Group, Anchor } from '@mantine/core'; + +const useStyles = createStyles((theme) => ({ + footer: { + marginTop: 120, + borderTop: `1px solid ${ + theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[2] + }`, + }, + + inner: { + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + paddingTop: theme.spacing.xl, + paddingBottom: theme.spacing.xl, + + [theme.fn.smallerThan('xs')]: { + flexDirection: 'column', + }, + }, + + links: { + [theme.fn.smallerThan('xs')]: { + marginTop: theme.spacing.md, + }, + }, + })); + +export interface FooterSimpleProps { + links: { link: string; label: string }[]; + } + +export function FooterSimple({ links }: FooterSimpleProps) { + const { classes } = useStyles(); + const items = links.map((link) => ( + + color="dimmed" + key={link.label} + href={link.link} + onClick={(event) => event.preventDefault()} + size="sm" + > + {link.label} + + )); + + return ( +
+ + + {items} + +
+ ); +} diff --git a/InvenTree/web/src/src/components/Layout.tsx b/InvenTree/web/src/src/components/HeaderTabs.tsx similarity index 64% rename from InvenTree/web/src/src/components/Layout.tsx rename to InvenTree/web/src/src/components/HeaderTabs.tsx index b3426d7223e7..2f433442db0c 100644 --- a/InvenTree/web/src/src/components/Layout.tsx +++ b/InvenTree/web/src/src/components/HeaderTabs.tsx @@ -9,7 +9,6 @@ import { Menu, Tabs, Burger, - ActionIcon, } from '@mantine/core'; import { useDisclosure } from '@mantine/hooks'; import { @@ -25,7 +24,8 @@ import { IconChevronDown, } from '@tabler/icons'; import { ColorToggle } from './ColorToggle'; -import InvenTreeIcon from '../assets/inventree.svg'; +import { InvenTreeLogo } from './InvenTreeLogo'; +import { useNavigate, useParams } from 'react-router-dom'; const useStyles = createStyles((theme) => ({ header: { @@ -94,17 +94,19 @@ const useStyles = createStyles((theme) => ({ interface HeaderTabsProps { user: { name: string; }; - tabs: string[]; + tabs: { name: string; text:string;}[]; } export function HeaderTabs({ user, tabs }: HeaderTabsProps) { const { classes, theme, cx } = useStyles(); const [opened, { toggle }] = useDisclosure(false); const [userMenuOpened, setUserMenuOpened] = useState(false); + const navigate = useNavigate(); + const { tabValue } = useParams(); const items = tabs.map((tab) => ( - - {tab} + + {tab.text} )); @@ -112,42 +114,39 @@ export function HeaderTabs({ user, tabs }: HeaderTabsProps) {
- InvenTree Logo - + - - - - - setUserMenuOpened(false)} - onOpen={() => setUserMenuOpened(true)} - > - - - - - {user.name} - - - - - - - }> - Notifications - - - Settings - }>Account settings - }>Logout - - + + + setUserMenuOpened(false)} + onOpen={() => setUserMenuOpened(true)} + > + + + + + {user.name} + + + + + + + }> + Notifications + + + Settings + }>Account settings + }>Logout + + @@ -160,10 +159,11 @@ export function HeaderTabs({ user, tabs }: HeaderTabsProps) { tabsList: classes.tabsList, tab: classes.tab, }} + value={tabValue} onTabChange={(value) => navigate(`/${value}`)} > {items}
); -} \ No newline at end of file +} diff --git a/InvenTree/web/src/src/components/InvenTreeLogo.tsx b/InvenTree/web/src/src/components/InvenTreeLogo.tsx new file mode 100644 index 000000000000..365c483073ae --- /dev/null +++ b/InvenTree/web/src/src/components/InvenTreeLogo.tsx @@ -0,0 +1,8 @@ +import { ActionIcon } from '@mantine/core'; +import { NavLink } from 'react-router-dom'; +import InvenTreeIcon from '../assets/inventree.svg'; + + +export function InvenTreeLogo() { + return InvenTree Logo; +} diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx new file mode 100644 index 000000000000..497996a2bb73 --- /dev/null +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -0,0 +1,31 @@ +import { Outlet } from "react-router-dom"; +import { HeaderTabs } from "../components/HeaderTabs"; +import { Text } from "@mantine/core"; + +import { FooterSimple } from "../components/FooterSimple"; + + +export default function Layout({ user, tabs, links }: any) { + + return (<> + + + + ); +} + + +export function Home() { + + return (<> + Home + ); +} + + +export function Part() { + + return (<> + Part + ); +} From 40a791cb8649238053b8caa351f6d5057e3f041f Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sun, 13 Nov 2022 23:13:18 +0100 Subject: [PATCH 013/406] remove gh action --- .github/workflows/webfrontend.yaml | 51 ------------------------------ 1 file changed, 51 deletions(-) delete mode 100644 .github/workflows/webfrontend.yaml diff --git a/.github/workflows/webfrontend.yaml b/.github/workflows/webfrontend.yaml deleted file mode 100644 index 5fff2f45b3f1..000000000000 --- a/.github/workflows/webfrontend.yaml +++ /dev/null @@ -1,51 +0,0 @@ -name: Deploy new UI to Pages - -on: - push: - branches: ["vite-base"] - workflow_dispatch: - -permissions: - contents: read - pages: write - id-token: write - -concurrency: - group: "pages" - cancel-in-progress: true - -jobs: - build: - runs-on: ubuntu-latest - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - steps: - - name: Checkout - uses: actions/checkout@v3 - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version: "16" - cache: yarn - cache-dependency-path: InvenTree/web/src - - name: Restore cache - uses: actions/cache@v3 - with: - path: | - .next/cache - key: ${{ runner.os }}-vite-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]sx') }} - restore-keys: ${{ runner.os }}-vite-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}- - - name: Install dependencies - run: cd InvenTree/web/src && yarn install - - name: Build - run: cd InvenTree/web/src && yarn build - - name: Setup Pages - uses: actions/configure-pages@v2 - - name: Upload artifact - uses: actions/upload-pages-artifact@v1 - with: - path: ./InvenTree/web/src/dist - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v1 From 81adc1b65094dfea8ada88df8dacba9a8d69ac2b Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 00:04:22 +0100 Subject: [PATCH 014/406] Add layout routing --- InvenTree/web/src/src/App.tsx | 72 ++++++++++------ .../web/src/src/components/FooterSimple.tsx | 57 +++++++++++++ .../components/{Layout.tsx => HeaderTabs.tsx} | 82 +++++++++---------- .../web/src/src/components/InvenTreeLogo.tsx | 8 ++ InvenTree/web/src/src/pages/layout.tsx | 31 +++++++ 5 files changed, 185 insertions(+), 65 deletions(-) create mode 100644 InvenTree/web/src/src/components/FooterSimple.tsx rename InvenTree/web/src/src/components/{Layout.tsx => HeaderTabs.tsx} (64%) create mode 100644 InvenTree/web/src/src/components/InvenTreeLogo.tsx create mode 100644 InvenTree/web/src/src/pages/layout.tsx diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index 51cc9473ff83..60c1c9feb2ee 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -3,38 +3,63 @@ import { MantineProvider, ColorSchemeProvider, ColorScheme } from '@mantine/core import { useColorScheme } from '@mantine/hooks'; import { Text } from '@mantine/core'; import { ColorToggle } from './components/ColorToggle'; -import { HeaderTabs } from './components/Layout'; +import { HeaderTabs } from './components/HeaderTabs'; import { createBrowserRouter, RouterProvider, Route, } from "react-router-dom"; import ErrorPage from './pages/error'; +import Layout, { Home, Part } from './pages/layout'; -const user = { - "name": "Matthias Mair", - "email": "code@mjmair.com", +const routes = { + base: 'https://demo.inventree.org/api', + home: '/', + error: '/error', +}; + +const user = { + "name": "Matthias Mair", + "email": "code@mjmair.com", } -const tabs = [ - "Home", - "Orders", - "Education", - "Community", - "Forums", - "Support", - "Account", - "Helpdesk", - "Settings", - ] +const tabs = [ + {text: "Home", name:"home"}, + {text: "Part", name:"part"}, +] + +const links = [ + { + "link": "https://inventree.org/", + "label": "Website" + }, + { + "link": "https://github.com/invenhost/InvenTree", + "label": "GitHub" + }, + { + "link": "https://demo.inventree.org/", + "label": "Demo" + } +] - const router = createBrowserRouter([ - { - path: "/", - element:
Hello world!
, - errorElement: , - }, - ]); +const router = createBrowserRouter([ + { + path: "/", + element: , + errorElement: , + children: [ + { + path: "home/", + element: , + }, + { + path: "part/", + element: , + }, + ], + }, +]); export default function App() { const preferredColorScheme = useColorScheme(); @@ -45,8 +70,7 @@ export default function App() { return ( - - + ); diff --git a/InvenTree/web/src/src/components/FooterSimple.tsx b/InvenTree/web/src/src/components/FooterSimple.tsx new file mode 100644 index 000000000000..a64062ad6f8c --- /dev/null +++ b/InvenTree/web/src/src/components/FooterSimple.tsx @@ -0,0 +1,57 @@ +import { InvenTreeLogo } from "./InvenTreeLogo"; +import { createStyles, Container, Group, Anchor } from '@mantine/core'; + +const useStyles = createStyles((theme) => ({ + footer: { + marginTop: 120, + borderTop: `1px solid ${ + theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[2] + }`, + }, + + inner: { + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + paddingTop: theme.spacing.xl, + paddingBottom: theme.spacing.xl, + + [theme.fn.smallerThan('xs')]: { + flexDirection: 'column', + }, + }, + + links: { + [theme.fn.smallerThan('xs')]: { + marginTop: theme.spacing.md, + }, + }, + })); + +export interface FooterSimpleProps { + links: { link: string; label: string }[]; + } + +export function FooterSimple({ links }: FooterSimpleProps) { + const { classes } = useStyles(); + const items = links.map((link) => ( + + color="dimmed" + key={link.label} + href={link.link} + onClick={(event) => event.preventDefault()} + size="sm" + > + {link.label} + + )); + + return ( +
+ + + {items} + +
+ ); +} diff --git a/InvenTree/web/src/src/components/Layout.tsx b/InvenTree/web/src/src/components/HeaderTabs.tsx similarity index 64% rename from InvenTree/web/src/src/components/Layout.tsx rename to InvenTree/web/src/src/components/HeaderTabs.tsx index b3426d7223e7..2f433442db0c 100644 --- a/InvenTree/web/src/src/components/Layout.tsx +++ b/InvenTree/web/src/src/components/HeaderTabs.tsx @@ -9,7 +9,6 @@ import { Menu, Tabs, Burger, - ActionIcon, } from '@mantine/core'; import { useDisclosure } from '@mantine/hooks'; import { @@ -25,7 +24,8 @@ import { IconChevronDown, } from '@tabler/icons'; import { ColorToggle } from './ColorToggle'; -import InvenTreeIcon from '../assets/inventree.svg'; +import { InvenTreeLogo } from './InvenTreeLogo'; +import { useNavigate, useParams } from 'react-router-dom'; const useStyles = createStyles((theme) => ({ header: { @@ -94,17 +94,19 @@ const useStyles = createStyles((theme) => ({ interface HeaderTabsProps { user: { name: string; }; - tabs: string[]; + tabs: { name: string; text:string;}[]; } export function HeaderTabs({ user, tabs }: HeaderTabsProps) { const { classes, theme, cx } = useStyles(); const [opened, { toggle }] = useDisclosure(false); const [userMenuOpened, setUserMenuOpened] = useState(false); + const navigate = useNavigate(); + const { tabValue } = useParams(); const items = tabs.map((tab) => ( - - {tab} + + {tab.text} )); @@ -112,42 +114,39 @@ export function HeaderTabs({ user, tabs }: HeaderTabsProps) {
- InvenTree Logo - + - - - - - setUserMenuOpened(false)} - onOpen={() => setUserMenuOpened(true)} - > - - - - - {user.name} - - - - - - - }> - Notifications - - - Settings - }>Account settings - }>Logout - - + + + setUserMenuOpened(false)} + onOpen={() => setUserMenuOpened(true)} + > + + + + + {user.name} + + + + + + + }> + Notifications + + + Settings + }>Account settings + }>Logout + + @@ -160,10 +159,11 @@ export function HeaderTabs({ user, tabs }: HeaderTabsProps) { tabsList: classes.tabsList, tab: classes.tab, }} + value={tabValue} onTabChange={(value) => navigate(`/${value}`)} > {items}
); -} \ No newline at end of file +} diff --git a/InvenTree/web/src/src/components/InvenTreeLogo.tsx b/InvenTree/web/src/src/components/InvenTreeLogo.tsx new file mode 100644 index 000000000000..365c483073ae --- /dev/null +++ b/InvenTree/web/src/src/components/InvenTreeLogo.tsx @@ -0,0 +1,8 @@ +import { ActionIcon } from '@mantine/core'; +import { NavLink } from 'react-router-dom'; +import InvenTreeIcon from '../assets/inventree.svg'; + + +export function InvenTreeLogo() { + return InvenTree Logo; +} diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx new file mode 100644 index 000000000000..497996a2bb73 --- /dev/null +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -0,0 +1,31 @@ +import { Outlet } from "react-router-dom"; +import { HeaderTabs } from "../components/HeaderTabs"; +import { Text } from "@mantine/core"; + +import { FooterSimple } from "../components/FooterSimple"; + + +export default function Layout({ user, tabs, links }: any) { + + return (<> + + + + ); +} + + +export function Home() { + + return (<> + Home + ); +} + + +export function Part() { + + return (<> + Part + ); +} From edd2aa1a70f67f88108454c6e01c0d76e4f3598f Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 00:25:18 +0100 Subject: [PATCH 015/406] add eslint --- InvenTree/web/src/.eslintrc.cjs | 6 + InvenTree/web/src/package.json | 6 +- InvenTree/web/src/yarn.lock | 852 +++++++++++++++++++++++++++++++- 3 files changed, 859 insertions(+), 5 deletions(-) create mode 100644 InvenTree/web/src/.eslintrc.cjs diff --git a/InvenTree/web/src/.eslintrc.cjs b/InvenTree/web/src/.eslintrc.cjs new file mode 100644 index 000000000000..1756e624b3da --- /dev/null +++ b/InvenTree/web/src/.eslintrc.cjs @@ -0,0 +1,6 @@ +module.exports = { + extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'], + parser: '@typescript-eslint/parser', + plugins: ['@typescript-eslint'], + root: true, +}; diff --git a/InvenTree/web/src/package.json b/InvenTree/web/src/package.json index a8fde4f51333..7343783bbc7e 100644 --- a/InvenTree/web/src/package.json +++ b/InvenTree/web/src/package.json @@ -6,7 +6,8 @@ "scripts": { "dev": "vite", "build": "tsc && vite build", - "preview": "vite preview" + "preview": "vite preview", + "lint": "eslint src" }, "dependencies": { "@emotion/react": "^11.10.5", @@ -27,7 +28,10 @@ "devDependencies": { "@types/react": "^18.0.24", "@types/react-dom": "^18.0.8", + "@typescript-eslint/eslint-plugin": "^5.42.1", + "@typescript-eslint/parser": "^5.42.1", "@vitejs/plugin-react": "^2.2.0", + "eslint": "^8.27.0", "typescript": "^4.6.4", "vite": "^3.2.3" } diff --git a/InvenTree/web/src/yarn.lock b/InvenTree/web/src/yarn.lock index c2a3339867e5..29b5246a27ed 100644 --- a/InvenTree/web/src/yarn.lock +++ b/InvenTree/web/src/yarn.lock @@ -346,6 +346,21 @@ resolved "https://registry.yarnpkg.com/@esbuild/linux-loong64/-/linux-loong64-0.15.13.tgz#64e8825bf0ce769dac94ee39d92ebe6272020dfc" integrity sha512-+BoyIm4I8uJmH/QDIH0fu7MG0AEx9OXEDXnqptXCwKOlOqZiS4iraH1Nr7/ObLMokW3sOCeBNyD68ATcV9b9Ag== +"@eslint/eslintrc@^1.3.3": + version "1.3.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.3.3.tgz#2b044ab39fdfa75b4688184f9e573ce3c5b0ff95" + integrity sha512-uj3pT6Mg+3t39fvLrj8iuCIJ38zKO9FpGtJ4BBJebJhEwjoT+KLVNCcHT5QC9NGRIEi7fZ0ZR8YRb884auB4Lg== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.4.0" + globals "^13.15.0" + ignore "^5.2.0" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.1.2" + strip-json-comments "^3.1.1" + "@floating-ui/core@^1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.0.1.tgz#00e64d74e911602c8533957af0cce5af6b2e93c8" @@ -373,6 +388,25 @@ dependencies: "@floating-ui/dom" "^1.0.0" +"@humanwhocodes/config-array@^0.11.6": + version "0.11.7" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.7.tgz#38aec044c6c828f6ed51d5d7ae3d9b9faf6dbb0f" + integrity sha512-kBbPWzN8oVMLb0hOUYXhmxggL/1cJE6ydvjDIGi9EnAGUyA7cLVKQg+d/Dsm+KZwx2czGHrCmMVLiyg8s5JPKw== + dependencies: + "@humanwhocodes/object-schema" "^1.2.1" + debug "^4.1.1" + minimatch "^3.0.5" + +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + +"@humanwhocodes/object-schema@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== + "@jridgewell/gen-mapping@^0.1.0": version "0.1.1" resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" @@ -489,6 +523,27 @@ resolved "https://registry.yarnpkg.com/@mantine/utils/-/utils-5.7.1.tgz#d6890be0650cdd499afd2d954713901672d15711" integrity sha512-YHn6BDI2kkmLY6Zdv8MnFaolKbD+sJyCBG1GY0yO6aHiz8/vTxiaTJv7mhro7Pc1XzclDzVJvd9kAd6lzumAyg== +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + "@radix-ui/number@1.0.0": version "1.0.0" resolved "https://registry.yarnpkg.com/@radix-ui/number/-/number-1.0.0.tgz#4c536161d0de750b3f5d55860fc3de46264f897b" @@ -594,6 +649,11 @@ resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.11.tgz#56588b17ae8f50c53983a524fc3cc47437969d64" integrity sha512-qjDJRrmvBMiTx+jyLxvLfJU7UznFuokDv4f3WRuriHKERccVpFU+8XMQUAbDzoiJCsmexxRExQeMwwCdamSKDA== +"@types/json-schema@^7.0.9": + version "7.0.11" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" + integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== + "@types/parse-json@^4.0.0": version "4.0.0" resolved "https://registry.yarnpkg.com/@types/parse-json/-/parse-json-4.0.0.tgz#2f8bb441434d163b35fb8ffdccd7138927ffb8c0" @@ -627,6 +687,14 @@ "@types/react" "*" "@types/react-router" "*" +"@types/react-router@*": + version "5.1.19" + resolved "https://registry.yarnpkg.com/@types/react-router/-/react-router-5.1.19.tgz#9b404246fba7f91474d7008a3d48c17b6e075ad6" + integrity sha512-Fv/5kb2STAEMT3wHzdKQK2z8xKq38EDIGVrutYLmQVVLe+4orDFquU52hQrULnEHinMKv9FSA6lf9+uNT1ITtA== + dependencies: + "@types/history" "^4.7.11" + "@types/react" "*" + "@types/react@*", "@types/react@^18.0.24": version "18.0.25" resolved "https://registry.yarnpkg.com/@types/react/-/react-18.0.25.tgz#8b1dcd7e56fe7315535a4af25435e0bb55c8ae44" @@ -641,6 +709,94 @@ resolved "https://registry.yarnpkg.com/@types/scheduler/-/scheduler-0.16.2.tgz#1a62f89525723dde24ba1b01b092bf5df8ad4d39" integrity sha512-hppQEBDmlwhFAXKJX2KnWLYu5yMfi91yazPb2l+lbJiwW+wdo1gNeRA+3RgNSO39WYX2euey41KEwnqesU2Jew== +"@types/semver@^7.3.12": + version "7.3.13" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" + integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw== + +"@typescript-eslint/eslint-plugin@^5.42.1": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.42.1.tgz#696b9cc21dfd4749c1c8ad1307f76a36a00aa0e3" + integrity sha512-LyR6x784JCiJ1j6sH5Y0K6cdExqCCm8DJUTcwG5ThNXJj/G8o5E56u5EdG4SLy+bZAwZBswC+GYn3eGdttBVCg== + dependencies: + "@typescript-eslint/scope-manager" "5.42.1" + "@typescript-eslint/type-utils" "5.42.1" + "@typescript-eslint/utils" "5.42.1" + debug "^4.3.4" + ignore "^5.2.0" + natural-compare-lite "^1.4.0" + regexpp "^3.2.0" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/parser@^5.42.1": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.42.1.tgz#3e66156f2f74b11690b45950d8f5f28a62751d35" + integrity sha512-kAV+NiNBWVQDY9gDJDToTE/NO8BHi4f6b7zTsVAJoTkmB/zlfOpiEVBzHOKtlgTndCKe8vj9F/PuolemZSh50Q== + dependencies: + "@typescript-eslint/scope-manager" "5.42.1" + "@typescript-eslint/types" "5.42.1" + "@typescript-eslint/typescript-estree" "5.42.1" + debug "^4.3.4" + +"@typescript-eslint/scope-manager@5.42.1": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.42.1.tgz#05e5e1351485637d466464237e5259b49f609b18" + integrity sha512-QAZY/CBP1Emx4rzxurgqj3rUinfsh/6mvuKbLNMfJMMKYLRBfweus8brgXF8f64ABkIZ3zdj2/rYYtF8eiuksQ== + dependencies: + "@typescript-eslint/types" "5.42.1" + "@typescript-eslint/visitor-keys" "5.42.1" + +"@typescript-eslint/type-utils@5.42.1": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.42.1.tgz#21328feb2d4b193c5852b35aabd241ccc1449daa" + integrity sha512-WWiMChneex5w4xPIX56SSnQQo0tEOy5ZV2dqmj8Z371LJ0E+aymWD25JQ/l4FOuuX+Q49A7pzh/CGIQflxMVXg== + dependencies: + "@typescript-eslint/typescript-estree" "5.42.1" + "@typescript-eslint/utils" "5.42.1" + debug "^4.3.4" + tsutils "^3.21.0" + +"@typescript-eslint/types@5.42.1": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.42.1.tgz#0d4283c30e9b70d2aa2391c36294413de9106df2" + integrity sha512-Qrco9dsFF5lhalz+lLFtxs3ui1/YfC6NdXu+RAGBa8uSfn01cjO7ssCsjIsUs484vny9Xm699FSKwpkCcqwWwA== + +"@typescript-eslint/typescript-estree@5.42.1": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.42.1.tgz#f9a223ecb547a781d37e07a5ac6ba9ff681eaef0" + integrity sha512-qElc0bDOuO0B8wDhhW4mYVgi/LZL+igPwXtV87n69/kYC/7NG3MES0jHxJNCr4EP7kY1XVsRy8C/u3DYeTKQmw== + dependencies: + "@typescript-eslint/types" "5.42.1" + "@typescript-eslint/visitor-keys" "5.42.1" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/utils@5.42.1": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.42.1.tgz#2789b1cd990f0c07aaa3e462dbe0f18d736d5071" + integrity sha512-Gxvf12xSp3iYZd/fLqiQRD4uKZjDNR01bQ+j8zvhPjpsZ4HmvEFL/tC4amGNyxN9Rq+iqvpHLhlqx6KTxz9ZyQ== + dependencies: + "@types/json-schema" "^7.0.9" + "@types/semver" "^7.3.12" + "@typescript-eslint/scope-manager" "5.42.1" + "@typescript-eslint/types" "5.42.1" + "@typescript-eslint/typescript-estree" "5.42.1" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + semver "^7.3.7" + +"@typescript-eslint/visitor-keys@5.42.1": + version "5.42.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.42.1.tgz#df10839adf6605e1cdb79174cf21e46df9be4872" + integrity sha512-LOQtSF4z+hejmpUvitPlc4hA7ERGoj2BVkesOcG91HCn8edLGUXbTrErmutmPbl8Bo9HjAvOO/zBKQHExXNA2A== + dependencies: + "@typescript-eslint/types" "5.42.1" + eslint-visitor-keys "^3.3.0" + "@vitejs/plugin-react@^2.2.0": version "2.2.0" resolved "https://registry.yarnpkg.com/@vitejs/plugin-react/-/plugin-react-2.2.0.tgz#1b9f63b8b6bc3f56258d20cd19b33f5cc761ce6e" @@ -654,6 +810,31 @@ magic-string "^0.26.7" react-refresh "^0.14.0" +acorn-jsx@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + +acorn@^8.8.0: + version "8.8.1" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.1.tgz#0a3f9cbecc4ec3bea6f0a80b66ae8dd2da250b73" + integrity sha512-7zFpHzhnqYKrkYdUjF1HI1bzd0VygEGX8lFk4k5zVMqHEoES+P+7TKI+EvLO9WVMJ8eekdO0aDEK044xTXwPPA== + +ajv@^6.10.0, ajv@^6.12.4: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + ansi-styles@^3.2.1: version "3.2.1" resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" @@ -661,6 +842,18 @@ ansi-styles@^3.2.1: dependencies: color-convert "^1.9.0" +ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + aria-hidden@^1.1.3: version "1.2.1" resolved "https://registry.yarnpkg.com/aria-hidden/-/aria-hidden-1.2.1.tgz#ad8c1edbde360b454eb2bf717ea02da00bfee0f8" @@ -668,6 +861,11 @@ aria-hidden@^1.1.3: dependencies: tslib "^2.0.0" +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + attr-accept@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-2.2.2.tgz#646613809660110749e92f2c10833b70968d929b" @@ -682,6 +880,26 @@ babel-plugin-macros@^3.1.0: cosmiconfig "^7.0.0" resolve "^1.19.0" +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +braces@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + browserslist@^4.21.3: version "4.21.4" resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987" @@ -719,6 +937,14 @@ chalk@^2.0.0: escape-string-regexp "^1.0.5" supports-color "^5.3.0" +chalk@^4.0.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + clone@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/clone/-/clone-2.1.2.tgz#1b7f4b9f591f1e8f83670401600345a02887435f" @@ -736,11 +962,28 @@ color-convert@^1.9.0: dependencies: color-name "1.1.3" +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + color-name@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + convert-source-map@^1.5.0, convert-source-map@^1.7.0: version "1.9.0" resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" @@ -757,6 +1000,15 @@ cosmiconfig@^7.0.0: path-type "^4.0.0" yaml "^1.10.0" +cross-spawn@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + csstype@3.0.9: version "3.0.9" resolved "https://registry.yarnpkg.com/csstype/-/csstype-3.0.9.tgz#6410af31b26bd0520933d02cbc64fce9ce3fbf0b" @@ -772,7 +1024,7 @@ dayjs@^1.11.6: resolved "https://registry.yarnpkg.com/dayjs/-/dayjs-1.11.6.tgz#2e79a226314ec3ec904e3ee1dd5a4f5e5b1c7afb" integrity sha512-zZbY5giJAinCG+7AGaw0wIhNZ6J8AhWuSXKvuc1KAyMiRsvGQWqh4L+MomvhdAYjN+lqvVCMq1I41e3YHvXkyQ== -debug@^4.1.0: +debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: version "4.3.4" resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== @@ -791,6 +1043,11 @@ deep-equal@^1.0.1: object-keys "^1.1.1" regexp.prototype.flags "^1.2.0" +deep-is@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + define-properties@^1.1.3: version "1.1.4" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.4.tgz#0b14d7bd7fbeb2f3572c3a7eda80ea5d57fb05b1" @@ -799,6 +1056,20 @@ define-properties@^1.1.3: has-property-descriptors "^1.0.0" object-keys "^1.1.1" +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + dom-helpers@^5.0.1: version "5.2.1" resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-5.2.1.tgz#d9400536b2bf8225ad98fe052e029451ac40e902" @@ -962,6 +1233,122 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== +eslint-scope@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +eslint-scope@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642" + integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw== + dependencies: + esrecurse "^4.3.0" + estraverse "^5.2.0" + +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== + dependencies: + eslint-visitor-keys "^2.0.0" + +eslint-visitor-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + +eslint-visitor-keys@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" + integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== + +eslint@^8.27.0: + version "8.27.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.27.0.tgz#d547e2f7239994ad1faa4bb5d84e5d809db7cf64" + integrity sha512-0y1bfG2ho7mty+SiILVf9PfuRA49ek4Nc60Wmmu62QlobNR+CeXa4xXIJgcuwSQgZiWaPH+5BDsctpIW0PR/wQ== + dependencies: + "@eslint/eslintrc" "^1.3.3" + "@humanwhocodes/config-array" "^0.11.6" + "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" + doctrine "^3.0.0" + escape-string-regexp "^4.0.0" + eslint-scope "^7.1.1" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.3.0" + espree "^9.4.0" + esquery "^1.4.0" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + find-up "^5.0.0" + glob-parent "^6.0.2" + globals "^13.15.0" + grapheme-splitter "^1.0.4" + ignore "^5.2.0" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + is-path-inside "^3.0.3" + js-sdsl "^4.1.4" + js-yaml "^4.1.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.1.2" + natural-compare "^1.4.0" + optionator "^0.9.1" + regexpp "^3.2.0" + strip-ansi "^6.0.1" + strip-json-comments "^3.1.0" + text-table "^0.2.0" + +espree@^9.4.0: + version "9.4.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.1.tgz#51d6092615567a2c2cff7833445e37c28c0065bd" + integrity sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg== + dependencies: + acorn "^8.8.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.3.0" + +esquery@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" + integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.1.0, estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + eventemitter3@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/eventemitter3/-/eventemitter3-2.0.3.tgz#b5e1079b59fb5e1ba2771c0a993be060a58c99ba" @@ -972,7 +1359,7 @@ extend@^3.0.2: resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" integrity sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g== -fast-deep-equal@^3.1.3: +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: version "3.1.3" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== @@ -982,6 +1369,41 @@ fast-diff@1.1.2: resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154" integrity sha512-KaJUt+M9t1qaIteSvjc6P3RbMdXsNhK61GRftR6SNxqmhthcd9MGIi4T+o0jD8LUSpSnSKXE20nLtJ3fOHxQig== +fast-glob@^3.2.9: + version "3.2.12" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" + integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== + +fastq@^1.6.0: + version "1.13.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.13.0.tgz#616760f88a7526bdfc596b7cab8c18938c36b98c" + integrity sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw== + dependencies: + reusify "^1.0.4" + +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== + dependencies: + flat-cache "^3.0.4" + file-selector@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/file-selector/-/file-selector-0.6.0.tgz#fa0a8d9007b829504db4d07dd4de0310b65287dc" @@ -989,11 +1411,44 @@ file-selector@^0.6.0: dependencies: tslib "^2.4.0" +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + find-root@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/find-root/-/find-root-1.1.0.tgz#abcfc8ba76f708c42a97b3d685b7e9450bfb9ce4" integrity sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng== +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +flat-cache@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + dependencies: + flatted "^3.1.0" + rimraf "^3.0.2" + +flatted@^3.1.0: + version "3.2.7" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" + integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + fsevents@~2.3.2: version "2.3.2" resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" @@ -1023,16 +1478,71 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.1: has "^1.0.3" has-symbols "^1.0.3" +glob-parent@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + +glob@^7.1.3: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + globals@^11.1.0: version "11.12.0" resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== +globals@^13.15.0: + version "13.17.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.17.0.tgz#902eb1e680a41da93945adbdcb5a9f361ba69bd4" + integrity sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw== + dependencies: + type-fest "^0.20.2" + +globby@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + +grapheme-splitter@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" + integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== + has-flag@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + has-property-descriptors@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" @@ -1066,7 +1576,12 @@ hoist-non-react-statics@^3.3.1: dependencies: react-is "^16.7.0" -import-fresh@^3.2.1: +ignore@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.0.tgz#6d3bac8fa7fe0d45d9f9be7bac2fc279577e345a" + integrity sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ== + +import-fresh@^3.0.0, import-fresh@^3.2.1: version "3.3.0" resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== @@ -1074,6 +1589,24 @@ import-fresh@^3.2.1: parent-module "^1.0.0" resolve-from "^4.0.0" +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + is-arguments@^1.0.4: version "1.1.1" resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" @@ -1101,6 +1634,28 @@ is-date-object@^1.0.1: dependencies: has-tostringtag "^1.0.0" +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-path-inside@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== + is-regex@^1.0.4: version "1.1.4" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.1.4.tgz#eef5663cd59fa4c0ae339505323df6854bb15958" @@ -1109,11 +1664,28 @@ is-regex@^1.0.4: call-bind "^1.0.2" has-tostringtag "^1.0.0" +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +js-sdsl@^4.1.4: + version "4.1.5" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.1.5.tgz#1ff1645e6b4d1b028cd3f862db88c9d887f26e2a" + integrity sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q== + "js-tokens@^3.0.0 || ^4.0.0", js-tokens@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + jsesc@^2.5.1: version "2.5.2" resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" @@ -1124,6 +1696,16 @@ json-parse-even-better-errors@^2.3.0: resolved "https://registry.yarnpkg.com/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz#7c47805a94319928e05777405dc12e1f7a4ee02d" integrity sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w== +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== + json5@^2.2.1: version "2.2.1" resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.1.tgz#655d50ed1e6f95ad1a3caababd2b0efda10b395c" @@ -1134,11 +1716,31 @@ klona@^2.0.5: resolved "https://registry.yarnpkg.com/klona/-/klona-2.0.5.tgz#d166574d90076395d9963aa7a928fabb8d76afbc" integrity sha512-pJiBpiXMbt7dkzXe8Ghj/u4FfXOOa98fPW+bihOJ4SjnoijweJrNThJfd3ifXpXhREjpoF2mZVH1GfS9LV3kHQ== +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + lines-and-columns@^1.1.6: version "1.2.4" resolved "https://registry.yarnpkg.com/lines-and-columns/-/lines-and-columns-1.2.4.tgz#eca284f75d2965079309dc0ad9255abb2ebc1632" integrity sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg== +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + lodash@^4.17.4: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" @@ -1151,6 +1753,13 @@ loose-envify@^1.1.0, loose-envify@^1.4.0: dependencies: js-tokens "^3.0.0 || ^4.0.0" +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + magic-string@^0.26.7: version "0.26.7" resolved "https://registry.yarnpkg.com/magic-string/-/magic-string-0.26.7.tgz#caf7daf61b34e9982f8228c4527474dac8981d6f" @@ -1158,6 +1767,26 @@ magic-string@^0.26.7: dependencies: sourcemap-codec "^1.4.8" +merge2@^1.3.0, merge2@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + +minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + ms@2.1.2: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" @@ -1168,6 +1797,16 @@ nanoid@^3.3.4: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.3.4.tgz#730b67e3cd09e2deacf03c027c81c9d9dbc5e8ab" integrity sha512-MqBkQh/OHTS2egovRtLk45wEyNXwF+cokD+1YPf9u5VfJiRdAiRwB2froX5Co9Rh20xs4siNPm8naNotSD6RBw== +natural-compare-lite@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" + integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== + node-releases@^2.0.6: version "2.0.6" resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" @@ -1191,6 +1830,39 @@ object-keys@^1.1.1: resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +optionator@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" + integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== + dependencies: + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + word-wrap "^1.2.3" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + parchment@^1.1.2, parchment@^1.1.4: version "1.1.4" resolved "https://registry.yarnpkg.com/parchment/-/parchment-1.1.4.tgz#aeded7ab938fe921d4c34bc339ce1168bc2ffde5" @@ -1213,6 +1885,21 @@ parse-json@^5.0.0: json-parse-even-better-errors "^2.3.0" lines-and-columns "^1.1.6" +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + path-parse@^1.0.7: version "1.0.7" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" @@ -1228,6 +1915,11 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== +picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + postcss@^8.4.18: version "8.4.19" resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.19.tgz#61178e2add236b17351897c8bcc0b4c8ecab56fc" @@ -1237,6 +1929,11 @@ postcss@^8.4.18: picocolors "^1.0.0" source-map-js "^1.0.2" +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== + prop-types@^15.6.2, prop-types@^15.8.1: version "15.8.1" resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.8.1.tgz#67d87bf1a694f48435cf332c24af10214a3140b5" @@ -1246,6 +1943,16 @@ prop-types@^15.6.2, prop-types@^15.8.1: object-assign "^4.1.1" react-is "^16.13.1" +punycode@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" + integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== + +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + quill-delta@^3.6.2: version "3.6.3" resolved "https://registry.yarnpkg.com/quill-delta/-/quill-delta-3.6.3.tgz#b19fd2b89412301c60e1ff213d8d860eac0f1032" @@ -1365,6 +2072,11 @@ regexp.prototype.flags@^1.2.0: define-properties "^1.1.3" functions-have-names "^1.2.2" +regexpp@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== + resolve-from@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" @@ -1379,6 +2091,18 @@ resolve@^1.19.0, resolve@^1.22.1: path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + rollup@^2.79.1: version "2.79.1" resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.79.1.tgz#bedee8faef7c9f93a2647ac0108748f497f081c7" @@ -1386,6 +2110,13 @@ rollup@^2.79.1: optionalDependencies: fsevents "~2.3.2" +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + scheduler@^0.23.0: version "0.23.0" resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.0.tgz#ba8041afc3d30eb206a487b6b384002e4e61fdfe" @@ -1398,6 +2129,30 @@ semver@^6.3.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +semver@^7.3.7: + version "7.3.8" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" + integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== + dependencies: + lru-cache "^6.0.0" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + source-map-js@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" @@ -1413,6 +2168,18 @@ sourcemap-codec@^1.4.8: resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz#ea804bd94857402e6992d05a38ef1ae35a9ab4c4" integrity sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA== +strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + stylis@4.1.3: version "4.1.3" resolved "https://registry.yarnpkg.com/stylis/-/stylis-4.1.3.tgz#fd2fbe79f5fed17c55269e16ed8da14c84d069f7" @@ -1425,22 +2192,65 @@ supports-color@^5.3.0: dependencies: has-flag "^3.0.0" +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + supports-preserve-symlinks-flag@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== + to-fast-properties@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +tslib@^1.8.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + tslib@^2.0.0, tslib@^2.4.0: version "2.4.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.4.1.tgz#0d0bfbaac2880b91e22df0768e55be9753a5b17e" integrity sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA== -typescript@^4.6.4: +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + +typescript@^4.8.4: version "4.8.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6" integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ== @@ -1453,6 +2263,13 @@ update-browserslist-db@^1.0.9: escalade "^3.1.1" picocolors "^1.0.0" +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + use-composed-ref@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/use-composed-ref/-/use-composed-ref-1.3.0.tgz#3d8104db34b7b264030a9d916c5e94fbe280dbda" @@ -1482,7 +2299,34 @@ vite@^3.2.3: optionalDependencies: fsevents "~2.3.2" +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +word-wrap@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + yaml@^1.10.0: version "1.10.2" resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b" integrity sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg== + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From 03bf6f2367b1a3ab3d28f95461ca2dacbba9fff7 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 00:25:34 +0100 Subject: [PATCH 016/406] style fix --- InvenTree/web/src/src/App.tsx | 6 ------ InvenTree/web/src/src/components/HeaderTabs.tsx | 7 ------- 2 files changed, 13 deletions(-) diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index 60c1c9feb2ee..1172b6153349 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -1,21 +1,15 @@ import { useState } from 'react'; import { MantineProvider, ColorSchemeProvider, ColorScheme } from '@mantine/core'; import { useColorScheme } from '@mantine/hooks'; -import { Text } from '@mantine/core'; -import { ColorToggle } from './components/ColorToggle'; -import { HeaderTabs } from './components/HeaderTabs'; import { createBrowserRouter, RouterProvider, - Route, } from "react-router-dom"; import ErrorPage from './pages/error'; import Layout, { Home, Part } from './pages/layout'; const routes = { base: 'https://demo.inventree.org/api', - home: '/', - error: '/error', }; const user = { diff --git a/InvenTree/web/src/src/components/HeaderTabs.tsx b/InvenTree/web/src/src/components/HeaderTabs.tsx index 2f433442db0c..611ac4ba57b3 100644 --- a/InvenTree/web/src/src/components/HeaderTabs.tsx +++ b/InvenTree/web/src/src/components/HeaderTabs.tsx @@ -2,7 +2,6 @@ import { useState } from 'react'; import { createStyles, Container, - Avatar, UnstyledButton, Group, Text, @@ -12,15 +11,9 @@ import { } from '@mantine/core'; import { useDisclosure } from '@mantine/hooks'; import { - IconAlien, IconLogout, IconHeart, - IconStar, - IconMessage, IconSettings, - IconPlayerPause, - IconTrash, - IconSwitchHorizontal, IconChevronDown, } from '@tabler/icons'; import { ColorToggle } from './ColorToggle'; From a98fc0e701a0c3a44179a23b5ab330925430b0b7 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 00:27:20 +0100 Subject: [PATCH 017/406] fix types --- InvenTree/web/src/src/pages/layout.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index 497996a2bb73..717e24d40ad3 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -2,10 +2,10 @@ import { Outlet } from "react-router-dom"; import { HeaderTabs } from "../components/HeaderTabs"; import { Text } from "@mantine/core"; -import { FooterSimple } from "../components/FooterSimple"; +import { FooterSimple, FooterSimpleProps } from "../components/FooterSimple"; -export default function Layout({ user, tabs, links }: any) { +export default function Layout({ user, tabs, links }: {user: any, tabs: any, links: FooterSimpleProps}) { return (<> From 618f851e80d0d9da569b7187d6f75398567eb4d8 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 01:42:54 +0100 Subject: [PATCH 018/406] Create Dashboard UI Fixes #5 Add Dashboard route --- InvenTree/web/src/src/App.tsx | 3 ++- InvenTree/web/src/src/pages/layout.tsx | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index 1172b6153349..4753e3e83ab3 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -6,7 +6,7 @@ import { RouterProvider, } from "react-router-dom"; import ErrorPage from './pages/error'; -import Layout, { Home, Part } from './pages/layout'; +import Layout, { Dashboard, Home, Part } from './pages/layout'; const routes = { base: 'https://demo.inventree.org/api', @@ -43,6 +43,7 @@ const router = createBrowserRouter([ element: , errorElement: , children: [ + { index: true, element: }, { path: "home/", element: , diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index 717e24d40ad3..6630431aa000 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -14,6 +14,12 @@ export default function Layout({ user, tabs, links }: {user: any, tabs: any, lin ); } +export function Dashboard() { + + return (<> + Dashboard + ); +} export function Home() { From cd94ccbfddcdae57454c6372c855f49ba89dad53 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 01:53:38 +0100 Subject: [PATCH 019/406] put Layout content into container --- InvenTree/web/src/src/pages/layout.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index 6630431aa000..fa0112b92d37 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -1,6 +1,6 @@ import { Outlet } from "react-router-dom"; import { HeaderTabs } from "../components/HeaderTabs"; -import { Text } from "@mantine/core"; +import { Container, Text } from "@mantine/core"; import { FooterSimple, FooterSimpleProps } from "../components/FooterSimple"; @@ -9,7 +9,9 @@ export default function Layout({ user, tabs, links }: {user: any, tabs: any, lin return (<> + + ); } From 5b75b717fc88af312e04a85cdb29130d87a258b6 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 02:02:21 +0100 Subject: [PATCH 020/406] add dashboard link --- InvenTree/web/src/src/components/HeaderTabs.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/InvenTree/web/src/src/components/HeaderTabs.tsx b/InvenTree/web/src/src/components/HeaderTabs.tsx index 611ac4ba57b3..c3b12415a7a2 100644 --- a/InvenTree/web/src/src/components/HeaderTabs.tsx +++ b/InvenTree/web/src/src/components/HeaderTabs.tsx @@ -15,6 +15,7 @@ import { IconHeart, IconSettings, IconChevronDown, + IconDashboard } from '@tabler/icons'; import { ColorToggle } from './ColorToggle'; import { InvenTreeLogo } from './InvenTreeLogo'; @@ -152,9 +153,10 @@ export function HeaderTabs({ user, tabs }: HeaderTabsProps) { tabsList: classes.tabsList, tab: classes.tab, }} - value={tabValue} onTabChange={(value) => navigate(`/${value}`)} + value={tabValue} + onTabChange={(value) => value=='/' ? navigate('/') : navigate(`/${value}`)} > - {items} + }/>{items} From f7479c710390d3e76c76e900b84a5b78826e84e5 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 02:07:33 +0100 Subject: [PATCH 021/406] reduce margin --- InvenTree/web/src/src/components/ColorToggle.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/web/src/src/components/ColorToggle.tsx b/InvenTree/web/src/src/components/ColorToggle.tsx index eccc12691f1f..393541bd586d 100644 --- a/InvenTree/web/src/src/components/ColorToggle.tsx +++ b/InvenTree/web/src/src/components/ColorToggle.tsx @@ -5,7 +5,7 @@ export function ColorToggle() { const { colorScheme, toggleColorScheme } = useMantineColorScheme(); return ( - + toggleColorScheme()} size="lg" From d84ca163eb4d0455486dc7eb4363079202b17a4e Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 02:18:25 +0100 Subject: [PATCH 022/406] fix types --- InvenTree/web/src/src/App.tsx | 34 ++++---- .../web/src/src/components/FooterSimple.tsx | 81 +++++++++---------- InvenTree/web/src/src/pages/layout.tsx | 8 +- 3 files changed, 62 insertions(+), 61 deletions(-) diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index 4753e3e83ab3..baae2d766fae 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -18,24 +18,26 @@ const user = { } const tabs = [ - {text: "Home", name:"home"}, - {text: "Part", name:"part"}, + { text: "Home", name: "home" }, + { text: "Part", name: "part" }, ] -const links = [ - { - "link": "https://inventree.org/", - "label": "Website" - }, - { - "link": "https://github.com/invenhost/InvenTree", - "label": "GitHub" - }, - { - "link": "https://demo.inventree.org/", - "label": "Demo" - } -] +const links = { + links: [ + { + "link": "https://inventree.org/", + "label": "Website" + }, + { + "link": "https://github.com/invenhost/InvenTree", + "label": "GitHub" + }, + { + "link": "https://demo.inventree.org/", + "label": "Demo" + } + ] +} const router = createBrowserRouter([ { diff --git a/InvenTree/web/src/src/components/FooterSimple.tsx b/InvenTree/web/src/src/components/FooterSimple.tsx index a64062ad6f8c..434ce8ae6ff5 100644 --- a/InvenTree/web/src/src/components/FooterSimple.tsx +++ b/InvenTree/web/src/src/components/FooterSimple.tsx @@ -2,56 +2,55 @@ import { InvenTreeLogo } from "./InvenTreeLogo"; import { createStyles, Container, Group, Anchor } from '@mantine/core'; const useStyles = createStyles((theme) => ({ - footer: { - marginTop: 120, - borderTop: `1px solid ${ - theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[2] + footer: { + marginTop: 120, + borderTop: `1px solid ${theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[2] }`, - }, + }, - inner: { - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', - paddingTop: theme.spacing.xl, - paddingBottom: theme.spacing.xl, + inner: { + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + paddingTop: theme.spacing.xl, + paddingBottom: theme.spacing.xl, - [theme.fn.smallerThan('xs')]: { - flexDirection: 'column', - }, + [theme.fn.smallerThan('xs')]: { + flexDirection: 'column', }, + }, - links: { - [theme.fn.smallerThan('xs')]: { - marginTop: theme.spacing.md, - }, + links: { + [theme.fn.smallerThan('xs')]: { + marginTop: theme.spacing.md, }, - })); + }, +})); export interface FooterSimpleProps { - links: { link: string; label: string }[]; - } + links: { link: string; label: string }[]; +} export function FooterSimple({ links }: FooterSimpleProps) { - const { classes } = useStyles(); - const items = links.map((link) => ( - - color="dimmed" - key={link.label} - href={link.link} - onClick={(event) => event.preventDefault()} - size="sm" - > - {link.label} - - )); + const { classes } = useStyles(); + const items = links.map((link) => ( + + color="dimmed" + key={link.label} + href={link.link} + onClick={(event) => event.preventDefault()} + size="sm" + > + {link.label} + + )); - return ( -
- - - {items} - -
- ); + return ( +
+ + + {items} + +
+ ); } diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index fa0112b92d37..6554832ce23c 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -5,14 +5,14 @@ import { Container, Text } from "@mantine/core"; import { FooterSimple, FooterSimpleProps } from "../components/FooterSimple"; -export default function Layout({ user, tabs, links }: {user: any, tabs: any, links: FooterSimpleProps}) { +export default function Layout({ user, tabs, links }: { user: any, tabs: any, links: FooterSimpleProps }) { return (<> - + - + - + ); } From a80c7a72bdcfcb7fd660c9b6817c7fecca501ea1 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 02:54:39 +0100 Subject: [PATCH 023/406] Add react-query --- InvenTree/web/src/package.json | 1 + InvenTree/web/src/src/App.tsx | 13 +++++++++++-- InvenTree/web/src/src/pages/Dashboard.tsx | 20 ++++++++++++++++++++ InvenTree/web/src/src/pages/layout.tsx | 7 ------- InvenTree/web/src/yarn.lock | 20 +++++++++++++++++++- 5 files changed, 51 insertions(+), 10 deletions(-) create mode 100644 InvenTree/web/src/src/pages/Dashboard.tsx diff --git a/InvenTree/web/src/package.json b/InvenTree/web/src/package.json index 7343783bbc7e..582727ba3d90 100644 --- a/InvenTree/web/src/package.json +++ b/InvenTree/web/src/package.json @@ -19,6 +19,7 @@ "@mantine/modals": "^5.7.1", "@mantine/notifications": "^5.7.1", "@mantine/rte": "^5.7.1", + "@tanstack/react-query": "^4.16.1", "@types/react-router-dom": "^5.3.3", "dayjs": "^1.11.6", "react": "^18.2.0", diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index baae2d766fae..8b51d8e404f0 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -6,7 +6,12 @@ import { RouterProvider, } from "react-router-dom"; import ErrorPage from './pages/error'; -import Layout, { Dashboard, Home, Part } from './pages/layout'; +import Layout, { Home, Part } from './pages/layout'; +import { Dashboard } from "./pages/Dashboard"; +import { + QueryClient, + QueryClientProvider, +} from '@tanstack/react-query' const routes = { base: 'https://demo.inventree.org/api', @@ -39,6 +44,8 @@ const links = { ] } +const queryClient = new QueryClient() + const router = createBrowserRouter([ { path: "/", @@ -67,7 +74,9 @@ export default function App() { return ( - + + + ); diff --git a/InvenTree/web/src/src/pages/Dashboard.tsx b/InvenTree/web/src/src/pages/Dashboard.tsx new file mode 100644 index 000000000000..db2787477b08 --- /dev/null +++ b/InvenTree/web/src/src/pages/Dashboard.tsx @@ -0,0 +1,20 @@ +import { Text } from "@mantine/core"; +import { useQuery } from '@tanstack/react-query'; + +export function fetchTodos() { + return fetch('https://jsonplaceholder.typicode.com/todos/1').then((res) => res.json()) +} + +export function Dashboard() { + const { isLoading, error, data, isFetching } = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }); + + if (isLoading) + return <>Loading...; + if (error) + return <>An error has occurred: {error.message}; + return (<> + Dashboard +
{isFetching ? "Updating..." : ""}
+
{data.title}
+ ); +} diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index 6554832ce23c..7ae10641238c 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -16,13 +16,6 @@ export default function Layout({ user, tabs, links }: { user: any, tabs: any, li ); } -export function Dashboard() { - - return (<> - Dashboard - ); -} - export function Home() { return (<> diff --git a/InvenTree/web/src/yarn.lock b/InvenTree/web/src/yarn.lock index 29b5246a27ed..10a720327da7 100644 --- a/InvenTree/web/src/yarn.lock +++ b/InvenTree/web/src/yarn.lock @@ -644,6 +644,19 @@ resolved "https://registry.yarnpkg.com/@tabler/icons/-/icons-1.111.0.tgz#0538fdd8b5de7072ae60fc5d2f13a9a636d2d0e3" integrity sha512-TZWYiMT5ccqfHxRE0Qtgvl+sGsMbNkrv7cJMt/tm8TN9l/CDXx/o7d8uAwUN+3PAlSFfF5e/rD1bi1WJs2xNIA== +"@tanstack/query-core@4.15.1": + version "4.15.1" + resolved "https://registry.yarnpkg.com/@tanstack/query-core/-/query-core-4.15.1.tgz#a282f04fe5e612b50019e1cfaf0efabd220e00ce" + integrity sha512-+UfqJsNbPIVo0a9ANW0ZxtjiMfGLaaoIaL9vZeVycvmBuWywJGtSi7fgPVMCPdZQFOzMsaXaOsDtSKQD5xLRVQ== + +"@tanstack/react-query@^4.16.1": + version "4.16.1" + resolved "https://registry.yarnpkg.com/@tanstack/react-query/-/react-query-4.16.1.tgz#077006b8eb2c87fbe8d1597c1a0083a2d218b791" + integrity sha512-PDE9u49wSDykPazlCoLFevUpceLjQ0Mm8i6038HgtTEKb/aoVnUZdlUP7C392ds3Cd75+EGlHU7qpEX06R7d9Q== + dependencies: + "@tanstack/query-core" "4.15.1" + use-sync-external-store "^1.2.0" + "@types/history@^4.7.11": version "4.7.11" resolved "https://registry.yarnpkg.com/@types/history/-/history-4.7.11.tgz#56588b17ae8f50c53983a524fc3cc47437969d64" @@ -2250,7 +2263,7 @@ type-fest@^0.20.2: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== -typescript@^4.8.4: +typescript@^4.6.4: version "4.8.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.8.4.tgz#c464abca159669597be5f96b8943500b238e60e6" integrity sha512-QCh+85mCy+h0IGff8r5XWzOVSbBO+KfeYrMQh7NJ58QujwcE22u+NUSmUxqF+un70P9GXKxa2HCNiTTMJknyjQ== @@ -2287,6 +2300,11 @@ use-latest@^1.2.1: dependencies: use-isomorphic-layout-effect "^1.1.1" +use-sync-external-store@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" + integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== + vite@^3.2.3: version "3.2.3" resolved "https://registry.yarnpkg.com/vite/-/vite-3.2.3.tgz#7a68d9ef73eff7ee6dc0718ad3507adfc86944a7" From 8dd139f8e102036edf29e707972ba4af3b8975b1 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 03:08:51 +0100 Subject: [PATCH 024/406] add axios --- InvenTree/web/src/package.json | 1 + InvenTree/web/src/src/api.tsx | 5 ++ InvenTree/web/src/src/pages/Dashboard.tsx | 3 +- InvenTree/web/src/yarn.lock | 57 +++++++++++++++++++++++ 4 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 InvenTree/web/src/src/api.tsx diff --git a/InvenTree/web/src/package.json b/InvenTree/web/src/package.json index 582727ba3d90..b7a3cdf0becc 100644 --- a/InvenTree/web/src/package.json +++ b/InvenTree/web/src/package.json @@ -21,6 +21,7 @@ "@mantine/rte": "^5.7.1", "@tanstack/react-query": "^4.16.1", "@types/react-router-dom": "^5.3.3", + "axios": "^1.1.3", "dayjs": "^1.11.6", "react": "^18.2.0", "react-dom": "^18.2.0", diff --git a/InvenTree/web/src/src/api.tsx b/InvenTree/web/src/src/api.tsx new file mode 100644 index 000000000000..95d8e4dc3225 --- /dev/null +++ b/InvenTree/web/src/src/api.tsx @@ -0,0 +1,5 @@ +import axios from 'axios'; + +export default axios.create({ + baseURL: `http://jsonplaceholder.typicode.com/` +}); diff --git a/InvenTree/web/src/src/pages/Dashboard.tsx b/InvenTree/web/src/src/pages/Dashboard.tsx index db2787477b08..9b5dfe6b3792 100644 --- a/InvenTree/web/src/src/pages/Dashboard.tsx +++ b/InvenTree/web/src/src/pages/Dashboard.tsx @@ -1,8 +1,9 @@ import { Text } from "@mantine/core"; import { useQuery } from '@tanstack/react-query'; +import api from "../api"; export function fetchTodos() { - return fetch('https://jsonplaceholder.typicode.com/todos/1').then((res) => res.json()) + return api.get('/todos/1').then((res) => res.data); } export function Dashboard() { diff --git a/InvenTree/web/src/yarn.lock b/InvenTree/web/src/yarn.lock index 10a720327da7..fa5ef9111438 100644 --- a/InvenTree/web/src/yarn.lock +++ b/InvenTree/web/src/yarn.lock @@ -879,11 +879,25 @@ array-union@^2.1.0: resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== +asynckit@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" + integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== + attr-accept@^2.2.2: version "2.2.2" resolved "https://registry.yarnpkg.com/attr-accept/-/attr-accept-2.2.2.tgz#646613809660110749e92f2c10833b70968d929b" integrity sha512-7prDjvt9HmqiZ0cl5CRjtS84sEyhsHP2coDkaZKRKVfCDo9s7iw7ChVmar78Gu9pC4SoR/28wFu/G5JJhTnqEg== +axios@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.1.3.tgz#8274250dada2edf53814ed7db644b9c2866c1e35" + integrity sha512-00tXVRwKx/FZr/IDVFt4C+f9FYairX517WoGCL6dpOntqLkZofjhu43F/Xl44UOpqa+9sLFDrG/XAnFsUYgkDA== + dependencies: + follow-redirects "^1.15.0" + form-data "^4.0.0" + proxy-from-env "^1.1.0" + babel-plugin-macros@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/babel-plugin-macros/-/babel-plugin-macros-3.1.0.tgz#9ef6dc74deb934b4db344dc973ee851d148c50c1" @@ -992,6 +1006,13 @@ color-name@~1.1.4: resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== +combined-stream@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f" + integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg== + dependencies: + delayed-stream "~1.0.0" + concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" @@ -1069,6 +1090,11 @@ define-properties@^1.1.3: has-property-descriptors "^1.0.0" object-keys "^1.1.1" +delayed-stream@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" + integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== + dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -1457,6 +1483,20 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== +follow-redirects@^1.15.0: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + +form-data@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" + integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww== + dependencies: + asynckit "^0.4.0" + combined-stream "^1.0.8" + mime-types "^2.1.12" + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -1793,6 +1833,18 @@ micromatch@^4.0.4: braces "^3.0.2" picomatch "^2.3.1" +mime-db@1.52.0: + version "1.52.0" + resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70" + integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg== + +mime-types@^2.1.12: + version "2.1.35" + resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a" + integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw== + dependencies: + mime-db "1.52.0" + minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" @@ -1956,6 +2008,11 @@ prop-types@^15.6.2, prop-types@^15.8.1: object-assign "^4.1.1" react-is "^16.13.1" +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + punycode@^2.1.0: version "2.1.1" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" From e0f2067b8c4712adb8e7e57c1c85ecd8dd3aa39d Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 03:11:03 +0100 Subject: [PATCH 025/406] remove message ref --- InvenTree/web/src/src/pages/Dashboard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/web/src/src/pages/Dashboard.tsx b/InvenTree/web/src/src/pages/Dashboard.tsx index 9b5dfe6b3792..2f43648104a5 100644 --- a/InvenTree/web/src/src/pages/Dashboard.tsx +++ b/InvenTree/web/src/src/pages/Dashboard.tsx @@ -12,7 +12,7 @@ export function Dashboard() { if (isLoading) return <>Loading...; if (error) - return <>An error has occurred: {error.message}; + return <>An error has occurred: {error}; return (<> Dashboard
{isFetching ? "Updating..." : ""}
From 5f8696ae68800e8f5e8d21134911758beaaea262 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 03:13:55 +0100 Subject: [PATCH 026/406] switch to htpps --- InvenTree/web/src/src/api.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/web/src/src/api.tsx b/InvenTree/web/src/src/api.tsx index 95d8e4dc3225..f3fad7c9dca1 100644 --- a/InvenTree/web/src/src/api.tsx +++ b/InvenTree/web/src/src/api.tsx @@ -1,5 +1,5 @@ import axios from 'axios'; export default axios.create({ - baseURL: `http://jsonplaceholder.typicode.com/` + baseURL: `https://jsonplaceholder.typicode.com/` }); From d2c33a43311c283a01b4bcc0a366486a7148181e Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 03:21:38 +0100 Subject: [PATCH 027/406] reduce margins --- InvenTree/web/src/src/components/FooterSimple.tsx | 2 +- InvenTree/web/src/src/components/HeaderTabs.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/InvenTree/web/src/src/components/FooterSimple.tsx b/InvenTree/web/src/src/components/FooterSimple.tsx index 434ce8ae6ff5..3f3a0f2ff7d2 100644 --- a/InvenTree/web/src/src/components/FooterSimple.tsx +++ b/InvenTree/web/src/src/components/FooterSimple.tsx @@ -3,7 +3,7 @@ import { createStyles, Container, Group, Anchor } from '@mantine/core'; const useStyles = createStyles((theme) => ({ footer: { - marginTop: 120, + marginTop: 10, borderTop: `1px solid ${theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[2] }`, }, diff --git a/InvenTree/web/src/src/components/HeaderTabs.tsx b/InvenTree/web/src/src/components/HeaderTabs.tsx index c3b12415a7a2..4353f799bae3 100644 --- a/InvenTree/web/src/src/components/HeaderTabs.tsx +++ b/InvenTree/web/src/src/components/HeaderTabs.tsx @@ -28,7 +28,7 @@ const useStyles = createStyles((theme) => ({ borderBottom: `1px solid ${ theme.colorScheme === 'dark' ? 'transparent' : theme.colors.gray[2] }`, - marginBottom: 120, + marginBottom: 10, }, mainSection: { From 9e714efed9d1e025b9c3bd15d674492312b67e46 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 11:05:16 +0100 Subject: [PATCH 028/406] move styling into global style --- .../web/src/src/components/HeaderTabs.tsx | 67 +----------------- .../web/src/src/components/globalStyle.tsx | 69 +++++++++++++++++++ InvenTree/web/src/src/pages/layout.tsx | 15 ++-- 3 files changed, 79 insertions(+), 72 deletions(-) create mode 100644 InvenTree/web/src/src/components/globalStyle.tsx diff --git a/InvenTree/web/src/src/components/HeaderTabs.tsx b/InvenTree/web/src/src/components/HeaderTabs.tsx index 4353f799bae3..9eb3355a24a7 100644 --- a/InvenTree/web/src/src/components/HeaderTabs.tsx +++ b/InvenTree/web/src/src/components/HeaderTabs.tsx @@ -1,6 +1,5 @@ import { useState } from 'react'; import { - createStyles, Container, UnstyledButton, Group, @@ -20,71 +19,7 @@ import { import { ColorToggle } from './ColorToggle'; import { InvenTreeLogo } from './InvenTreeLogo'; import { useNavigate, useParams } from 'react-router-dom'; - -const useStyles = createStyles((theme) => ({ - header: { - paddingTop: theme.spacing.sm, - backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[6] : theme.colors.gray[0], - borderBottom: `1px solid ${ - theme.colorScheme === 'dark' ? 'transparent' : theme.colors.gray[2] - }`, - marginBottom: 10, - }, - - mainSection: { - paddingBottom: theme.spacing.sm, - }, - - user: { - color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.black, - padding: `${theme.spacing.xs}px ${theme.spacing.sm}px`, - borderRadius: theme.radius.sm, - transition: 'background-color 100ms ease', - - '&:hover': { - backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[8] : theme.white, - }, - - [theme.fn.smallerThan('xs')]: { - display: 'none', - }, - }, - - burger: { - [theme.fn.largerThan('xs')]: { - display: 'none', - }, - }, - - userActive: { - backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[8] : theme.white, - }, - - tabs: { - [theme.fn.smallerThan('sm')]: { - display: 'none', - }, - }, - - tabsList: { - borderBottom: '0 !important', - }, - - tab: { - fontWeight: 500, - height: 38, - backgroundColor: 'transparent', - - '&:hover': { - backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[1], - }, - - '&[data-active]': { - backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white, - borderColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.colors.gray[2], - }, - }, -})); +import { useStyles } from './globalStyle'; interface HeaderTabsProps { user: { name: string; }; diff --git a/InvenTree/web/src/src/components/globalStyle.tsx b/InvenTree/web/src/src/components/globalStyle.tsx new file mode 100644 index 000000000000..7d034e985221 --- /dev/null +++ b/InvenTree/web/src/src/components/globalStyle.tsx @@ -0,0 +1,69 @@ +import { createStyles } from '@mantine/core'; + +export const useStyles = createStyles((theme) => ({ + header: { + paddingTop: theme.spacing.sm, + backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[6] : theme.colors.gray[0], + borderBottom: `1px solid ${theme.colorScheme === 'dark' ? 'transparent' : theme.colors.gray[2]}`, + marginBottom: 10, + }, + + mainSection: { + paddingBottom: theme.spacing.sm, + }, + + user: { + color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.black, + padding: `${theme.spacing.xs}px ${theme.spacing.sm}px`, + borderRadius: theme.radius.sm, + transition: 'background-color 100ms ease', + + '&:hover': { + backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[8] : theme.white, + }, + + [theme.fn.smallerThan('xs')]: { + display: 'none', + }, + }, + + burger: { + [theme.fn.largerThan('xs')]: { + display: 'none', + }, + }, + + userActive: { + backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[8] : theme.white, + }, + + tabs: { + [theme.fn.smallerThan('sm')]: { + display: 'none', + }, + }, + + tabsList: { + borderBottom: '0 !important', + }, + + tab: { + fontWeight: 500, + height: 38, + backgroundColor: 'transparent', + + '&:hover': { + backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[1], + }, + + '&[data-active]': { + backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.white, + borderColor: theme.colorScheme === 'dark' ? theme.colors.dark[7] : theme.colors.gray[2], + }, + }, + + content: { + flex: 1, + width: '100%', + }, +})); diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index 7ae10641238c..69b625d44efa 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -1,19 +1,22 @@ import { Outlet } from "react-router-dom"; import { HeaderTabs } from "../components/HeaderTabs"; -import { Container, Text } from "@mantine/core"; +import { Container, Flex, Space, Text } from "@mantine/core"; import { FooterSimple, FooterSimpleProps } from "../components/FooterSimple"; +import { useStyles } from "../components/globalStyle"; export default function Layout({ user, tabs, links }: { user: any, tabs: any, links: FooterSimpleProps }) { + const { classes } = useStyles(); - return (<> + return ( + - - - + + - ); + + ); } export function Home() { From 6a23094cd3484c6b184c3397ee72a45a4abeeff7 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 11:54:40 +0100 Subject: [PATCH 029/406] move more styles to global object --- .../web/src/src/components/FooterSimple.tsx | 28 ++----------------- .../web/src/src/components/globalStyle.tsx | 24 ++++++++++++++++ 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/InvenTree/web/src/src/components/FooterSimple.tsx b/InvenTree/web/src/src/components/FooterSimple.tsx index 3f3a0f2ff7d2..38775f4c36d3 100644 --- a/InvenTree/web/src/src/components/FooterSimple.tsx +++ b/InvenTree/web/src/src/components/FooterSimple.tsx @@ -1,31 +1,7 @@ import { InvenTreeLogo } from "./InvenTreeLogo"; -import { createStyles, Container, Group, Anchor } from '@mantine/core'; +import {Container, Group, Anchor } from '@mantine/core'; +import { useStyles } from "./globalStyle"; -const useStyles = createStyles((theme) => ({ - footer: { - marginTop: 10, - borderTop: `1px solid ${theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[2] - }`, - }, - - inner: { - display: 'flex', - justifyContent: 'space-between', - alignItems: 'center', - paddingTop: theme.spacing.xl, - paddingBottom: theme.spacing.xl, - - [theme.fn.smallerThan('xs')]: { - flexDirection: 'column', - }, - }, - - links: { - [theme.fn.smallerThan('xs')]: { - marginTop: theme.spacing.md, - }, - }, -})); export interface FooterSimpleProps { links: { link: string; label: string }[]; diff --git a/InvenTree/web/src/src/components/globalStyle.tsx b/InvenTree/web/src/src/components/globalStyle.tsx index 7d034e985221..315f90ca89a5 100644 --- a/InvenTree/web/src/src/components/globalStyle.tsx +++ b/InvenTree/web/src/src/components/globalStyle.tsx @@ -62,6 +62,30 @@ export const useStyles = createStyles((theme) => ({ }, }, + footer: { + marginTop: 10, + borderTop: `1px solid ${theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[2] + }`, + }, + + inner: { + display: 'flex', + justifyContent: 'space-between', + alignItems: 'center', + paddingTop: theme.spacing.xl, + paddingBottom: theme.spacing.xl, + + [theme.fn.smallerThan('xs')]: { + flexDirection: 'column', + }, + }, + + links: { + [theme.fn.smallerThan('xs')]: { + marginTop: theme.spacing.md, + }, + }, + content: { flex: 1, width: '100%', From 52a600f1ed115a5ec1c545bcb176f28e0aa9a6b8 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 15:13:35 +0100 Subject: [PATCH 030/406] add pre-commit --- .pre-commit-config.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index be29c2468633..a730eaf85245 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,3 +39,9 @@ repos: name: pip-compile requirements.txt args: [requirements.in, -o, requirements.txt] files: ^requirements\.(in|txt)$ +- repo: https://github.com/pre-commit/mirrors-eslint + rev: 'v8.27.0' + hooks: + - id: eslint + files: \.[jt]sx?$ + types: [file] From 9bcb4ad4f3bd0b85bffaf43d98150432c78911ba Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 21:32:25 +0100 Subject: [PATCH 031/406] Add dashboard --- InvenTree/web/src/src/App.tsx | 14 +++++--- InvenTree/web/src/src/api.tsx | 5 --- .../web/src/src/components/statsElement.tsx | 34 +++++++++++++++++++ InvenTree/web/src/src/pages/Dashboard.tsx | 34 ++++++++++++------- InvenTree/web/src/src/pages/DashboardItem.tsx | 20 +++++++++++ 5 files changed, 85 insertions(+), 22 deletions(-) delete mode 100644 InvenTree/web/src/src/api.tsx create mode 100644 InvenTree/web/src/src/components/statsElement.tsx create mode 100644 InvenTree/web/src/src/pages/DashboardItem.tsx diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index 8b51d8e404f0..c9893b901ceb 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -12,16 +12,20 @@ import { QueryClient, QueryClientProvider, } from '@tanstack/react-query' +import axios from 'axios'; -const routes = { - base: 'https://demo.inventree.org/api', -}; - -const user = { +export const user = { "name": "Matthias Mair", "email": "code@mjmair.com", + "username": "mjmair", + "token": "8a19402acdac08bfa9fe6bf95dad8f5b83e702b3", } +export const api = axios.create({ + baseURL: `https://demo.inventree.org/api/`, + headers: {'Authorization': `Token ${user.token}`}, +}); + const tabs = [ { text: "Home", name: "home" }, { text: "Part", name: "part" }, diff --git a/InvenTree/web/src/src/api.tsx b/InvenTree/web/src/src/api.tsx deleted file mode 100644 index f3fad7c9dca1..000000000000 --- a/InvenTree/web/src/src/api.tsx +++ /dev/null @@ -1,5 +0,0 @@ -import axios from 'axios'; - -export default axios.create({ - baseURL: `https://jsonplaceholder.typicode.com/` -}); diff --git a/InvenTree/web/src/src/components/statsElement.tsx b/InvenTree/web/src/src/components/statsElement.tsx new file mode 100644 index 000000000000..116d20a8a7c7 --- /dev/null +++ b/InvenTree/web/src/src/components/statsElement.tsx @@ -0,0 +1,34 @@ +import { createStyles, LoadingOverlay, Group, Paper, Text } from '@mantine/core'; + +const useStyles = createStyles((theme) => ({ + value: { + fontSize: 24, + fontWeight: 700, + lineHeight: 1, + }, + + title: { + fontWeight: 700, + }, +})); + +export interface StatsElementProps {title: string; value: string;} + +export function StatsElement({ key, data, isLoading }: {key: string, data: StatsElementProps, isLoading: boolean}) { + const { classes } = useStyles(); + + return ( + + + + + {data.title} + + + + + {data.value} + + + ); +} diff --git a/InvenTree/web/src/src/pages/Dashboard.tsx b/InvenTree/web/src/src/pages/Dashboard.tsx index 2f43648104a5..a43a7c6d1dda 100644 --- a/InvenTree/web/src/src/pages/Dashboard.tsx +++ b/InvenTree/web/src/src/pages/Dashboard.tsx @@ -1,21 +1,31 @@ import { Text } from "@mantine/core"; -import { useQuery } from '@tanstack/react-query'; -import api from "../api"; +import { SimpleGrid } from "@mantine/core"; +import { DashboardItem } from "./DashboardItem"; -export function fetchTodos() { - return api.get('/todos/1').then((res) => res.data); -} export function Dashboard() { - const { isLoading, error, data, isFetching } = useQuery({ queryKey: ['todos'], queryFn: fetchTodos }); + const items = [ + { id: "starred-parts", text: "Subscribed Parts", icon: "fa-bell", url: "part", params: { starred: true } }, + { id: "starred-categories", text: "Subscribed Categories", icon: "fa-bell", url: "part/category", params: { starred: true } }, + { id: "latest-parts", text: "Latest Parts", icon: "fa-newspaper", url: "part", params: { ordering: "-creation_date", limit: 10 } }, + { id: "bom-validation", text: "BOM Waiting Validation", icon: "fa-times-circle", url: "part", params: { bom_valid: false } }, + { id: "recently-updated-stock", text: "Recently Updated", icon: "fa-clock", url: "stock", params: { part_detail: true, ordering: "-updated", limit:10 } }, + { id: "low-stock", text: "Low Stock", icon: "fa-flag", url: "part", params: { low_stock: true } }, + { id: "depleted-stock", text: "Depleted Stock", icon: "fa-times", url: "part", params: { depleted_stock: true } }, + { id: "stock-to-build", text: "Required for Build Orders", icon: "fa-bullhorn", url: "part", params: { stock_to_build: true } }, + { id: "expired-stock", text: "Expired Stock", icon: "fa-calendar-times", url: "stock", params: { expired: true } }, + { id: "stale-stock", text: "Stale Stock", icon: "fa-stopwatch", url: "stock", params: { stale: true, expired: true } }, + { id: "build-pending", text: "Build Orders In Progress", icon: "fa-cogs", url: "build", params: { active: true } }, + { id: "build-overdue", text: "Overdue Build Orders", icon: "fa-calendar-times", url: "build", params: { overdue: true } }, + { id: "po-outstanding", text: "Outstanding Purchase Orders", icon: "fa-sign-in-alt", url: "order/po", params: { supplier_detail: true, outstanding: true } }, + { id: "po-overdue", text: "Overdue Purchase Orders", icon: "fa-calendar-times", url: "order/po", params: { supplier_detail: true, overdue: true } }, + { id: "so-outstanding", text: "Outstanding Sales Orders", icon: "fa-sign-out-alt", url: "order/so", params: { customer_detail: true, outstanding: true } }, + { id: "so-overdue", text: "Overdue Sales Orders", icon: "fa-calendar-times", url: "order/so", params: { customer_detail: true, overdue: true } }, + { id: "news", text: "Current News", icon: "fa-newspaper", url: "news", params: {} } + ] - if (isLoading) - return <>Loading...; - if (error) - return <>An error has occurred: {error}; return (<> Dashboard -
{isFetching ? "Updating..." : ""}
-
{data.title}
+ {items.map((item) => )} ); } diff --git a/InvenTree/web/src/src/pages/DashboardItem.tsx b/InvenTree/web/src/src/pages/DashboardItem.tsx new file mode 100644 index 000000000000..6d6236767d96 --- /dev/null +++ b/InvenTree/web/src/src/pages/DashboardItem.tsx @@ -0,0 +1,20 @@ +import { useQuery } from '@tanstack/react-query'; +import { api } from "../App"; +import { StatsElement } from "../components/statsElement"; +import { useEffect, useState } from "react"; + +export function DashboardItem({ id, text, url, params, autoupdate=true }: { id: string; text: string; url: string; params: any; autoupdate: boolean }) { + function fetchData() { + return api.get(`${url}/?search=&offset=0&limit=25`, { params: params }).then((res) => res.data); + } + const { isLoading, error, data, isFetching } = useQuery({ queryKey: [`dash_${id}`], queryFn: fetchData, refetchOnWindowFocus: autoupdate, }); + const [dashdata, setDashData] = useState({}); + + useEffect(() => { if (data) { setDashData({ title: text, value: data.count }); } }, [data]); + + if (error) + return <>An error has occurred: {error}; + return (
+ +
); +} From 6354c99bda1efef4c9316b02cf16363caa369424 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 21:32:58 +0100 Subject: [PATCH 032/406] add autoupdate switch --- InvenTree/web/src/src/pages/Dashboard.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/InvenTree/web/src/src/pages/Dashboard.tsx b/InvenTree/web/src/src/pages/Dashboard.tsx index a43a7c6d1dda..9e589fe5d32b 100644 --- a/InvenTree/web/src/src/pages/Dashboard.tsx +++ b/InvenTree/web/src/src/pages/Dashboard.tsx @@ -1,9 +1,12 @@ -import { Text } from "@mantine/core"; -import { SimpleGrid } from "@mantine/core"; +import { Group, Text } from "@mantine/core"; +import { SimpleGrid, Chip } from "@mantine/core"; +import { useState } from "react"; import { DashboardItem } from "./DashboardItem"; export function Dashboard() { + const [checked, setChecked] = useState(false); + const items = [ { id: "starred-parts", text: "Subscribed Parts", icon: "fa-bell", url: "part", params: { starred: true } }, { id: "starred-categories", text: "Subscribed Categories", icon: "fa-bell", url: "part/category", params: { starred: true } }, @@ -25,7 +28,7 @@ export function Dashboard() { ] return (<> - Dashboard - {items.map((item) => )} + Dashboard setChecked((v) => !v)}>Autoupdate + {items.map((item) => )} ); } From 9cae34daea4c0f8a77df3f7fe3d1fb3dcbe2989b Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 21:46:36 +0100 Subject: [PATCH 033/406] add stylish text element --- InvenTree/web/src/src/components/FooterSimple.tsx | 2 +- InvenTree/web/src/src/components/HeaderTabs.tsx | 2 +- InvenTree/web/src/src/components/StylishText.tsx | 9 +++++++++ InvenTree/web/src/src/{components => }/globalStyle.tsx | 5 +++++ InvenTree/web/src/src/pages/layout.tsx | 2 +- 5 files changed, 17 insertions(+), 3 deletions(-) create mode 100644 InvenTree/web/src/src/components/StylishText.tsx rename InvenTree/web/src/src/{components => }/globalStyle.tsx (97%) diff --git a/InvenTree/web/src/src/components/FooterSimple.tsx b/InvenTree/web/src/src/components/FooterSimple.tsx index 38775f4c36d3..46ea2ba28dee 100644 --- a/InvenTree/web/src/src/components/FooterSimple.tsx +++ b/InvenTree/web/src/src/components/FooterSimple.tsx @@ -1,6 +1,6 @@ import { InvenTreeLogo } from "./InvenTreeLogo"; import {Container, Group, Anchor } from '@mantine/core'; -import { useStyles } from "./globalStyle"; +import { useStyles } from "../globalStyle"; export interface FooterSimpleProps { diff --git a/InvenTree/web/src/src/components/HeaderTabs.tsx b/InvenTree/web/src/src/components/HeaderTabs.tsx index 9eb3355a24a7..fc32a7ba1a86 100644 --- a/InvenTree/web/src/src/components/HeaderTabs.tsx +++ b/InvenTree/web/src/src/components/HeaderTabs.tsx @@ -19,7 +19,7 @@ import { import { ColorToggle } from './ColorToggle'; import { InvenTreeLogo } from './InvenTreeLogo'; import { useNavigate, useParams } from 'react-router-dom'; -import { useStyles } from './globalStyle'; +import { useStyles } from '../globalStyle'; interface HeaderTabsProps { user: { name: string; }; diff --git a/InvenTree/web/src/src/components/StylishText.tsx b/InvenTree/web/src/src/components/StylishText.tsx new file mode 100644 index 000000000000..5fa5f64d5d90 --- /dev/null +++ b/InvenTree/web/src/src/components/StylishText.tsx @@ -0,0 +1,9 @@ +import { Text } from "@mantine/core"; +import { useStyles } from "../globalStyle"; + +export function StylishText({ children }) { + const { classes } = useStyles(); + return ( + {children} + ); +} diff --git a/InvenTree/web/src/src/components/globalStyle.tsx b/InvenTree/web/src/src/globalStyle.tsx similarity index 97% rename from InvenTree/web/src/src/components/globalStyle.tsx rename to InvenTree/web/src/src/globalStyle.tsx index 315f90ca89a5..961087ecc43e 100644 --- a/InvenTree/web/src/src/components/globalStyle.tsx +++ b/InvenTree/web/src/src/globalStyle.tsx @@ -90,4 +90,9 @@ export const useStyles = createStyles((theme) => ({ flex: 1, width: '100%', }, + + signText: { + fontSize: "xl", + fontWeight: 700, + }, })); diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index 69b625d44efa..4abab9ebb45a 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -3,7 +3,7 @@ import { HeaderTabs } from "../components/HeaderTabs"; import { Container, Flex, Space, Text } from "@mantine/core"; import { FooterSimple, FooterSimpleProps } from "../components/FooterSimple"; -import { useStyles } from "../components/globalStyle"; +import { useStyles } from "../globalStyle"; export default function Layout({ user, tabs, links }: { user: any, tabs: any, links: FooterSimpleProps }) { From e3ebe35c0b799c107e72c10c4c83b1b96bc6eae2 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 21:49:56 +0100 Subject: [PATCH 034/406] use stylish text --- InvenTree/web/src/src/pages/Dashboard.tsx | 8 ++++++-- InvenTree/web/src/src/pages/layout.tsx | 7 ++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/InvenTree/web/src/src/pages/Dashboard.tsx b/InvenTree/web/src/src/pages/Dashboard.tsx index 9e589fe5d32b..5da7bff89bc3 100644 --- a/InvenTree/web/src/src/pages/Dashboard.tsx +++ b/InvenTree/web/src/src/pages/Dashboard.tsx @@ -1,7 +1,8 @@ -import { Group, Text } from "@mantine/core"; +import { Group } from "@mantine/core"; import { SimpleGrid, Chip } from "@mantine/core"; import { useState } from "react"; import { DashboardItem } from "./DashboardItem"; +import { StylishText } from "../components/StylishText"; export function Dashboard() { @@ -28,7 +29,10 @@ export function Dashboard() { ] return (<> - Dashboard setChecked((v) => !v)}>Autoupdate + + Dashboard + setChecked((v) => !v)}>Autoupdate + {items.map((item) => )} ); } diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index 4abab9ebb45a..677e68b66563 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -1,9 +1,10 @@ import { Outlet } from "react-router-dom"; import { HeaderTabs } from "../components/HeaderTabs"; -import { Container, Flex, Space, Text } from "@mantine/core"; +import { Container, Flex, Space } from "@mantine/core"; import { FooterSimple, FooterSimpleProps } from "../components/FooterSimple"; import { useStyles } from "../globalStyle"; +import { StylishText } from "../components/StylishText"; export default function Layout({ user, tabs, links }: { user: any, tabs: any, links: FooterSimpleProps }) { @@ -22,7 +23,7 @@ export default function Layout({ user, tabs, links }: { user: any, tabs: any, li export function Home() { return (<> - Home + Home ); } @@ -30,6 +31,6 @@ export function Home() { export function Part() { return (<> - Part + Part ); } From aaffbcdf50fe68579ad9ce07a1fe406deb2a825d Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 21:55:06 +0100 Subject: [PATCH 035/406] fix style --- InvenTree/web/src/src/components/StylishText.tsx | 2 +- InvenTree/web/src/src/pages/DashboardItem.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/InvenTree/web/src/src/components/StylishText.tsx b/InvenTree/web/src/src/components/StylishText.tsx index 5fa5f64d5d90..944c19c62951 100644 --- a/InvenTree/web/src/src/components/StylishText.tsx +++ b/InvenTree/web/src/src/components/StylishText.tsx @@ -1,7 +1,7 @@ import { Text } from "@mantine/core"; import { useStyles } from "../globalStyle"; -export function StylishText({ children }) { +export function StylishText({children}: {childre: any }) { const { classes } = useStyles(); return ( {children} diff --git a/InvenTree/web/src/src/pages/DashboardItem.tsx b/InvenTree/web/src/src/pages/DashboardItem.tsx index 6d6236767d96..41a2ec28481a 100644 --- a/InvenTree/web/src/src/pages/DashboardItem.tsx +++ b/InvenTree/web/src/src/pages/DashboardItem.tsx @@ -8,7 +8,7 @@ export function DashboardItem({ id, text, url, params, autoupdate=true }: { id: return api.get(`${url}/?search=&offset=0&limit=25`, { params: params }).then((res) => res.data); } const { isLoading, error, data, isFetching } = useQuery({ queryKey: [`dash_${id}`], queryFn: fetchData, refetchOnWindowFocus: autoupdate, }); - const [dashdata, setDashData] = useState({}); + const [dashdata, setDashData] = useState({title: '', value: ''}); useEffect(() => { if (data) { setDashData({ title: text, value: data.count }); } }, [data]); From 4788436bc6a2c13bb3f22730c0680f7ddc5ec066 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 14 Nov 2022 21:56:41 +0100 Subject: [PATCH 036/406] fix typo --- InvenTree/web/src/src/components/StylishText.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/web/src/src/components/StylishText.tsx b/InvenTree/web/src/src/components/StylishText.tsx index 944c19c62951..a265ea63889a 100644 --- a/InvenTree/web/src/src/components/StylishText.tsx +++ b/InvenTree/web/src/src/components/StylishText.tsx @@ -1,7 +1,7 @@ import { Text } from "@mantine/core"; import { useStyles } from "../globalStyle"; -export function StylishText({children}: {childre: any }) { +export function StylishText({children}: {children: any }) { const { classes } = useStyles(); return ( {children} From 3920322ecba91454e5e5ebf2d80279780b1443fb Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Tue, 15 Nov 2022 00:20:13 +0100 Subject: [PATCH 037/406] Sentry for error tracking Fixes invenhost/InvenTree#21 --- InvenTree/web/src/package.json | 2 ++ InvenTree/web/src/src/App.tsx | 15 ++++++--- InvenTree/web/src/yarn.lock | 57 ++++++++++++++++++++++++++++++++-- 3 files changed, 68 insertions(+), 6 deletions(-) diff --git a/InvenTree/web/src/package.json b/InvenTree/web/src/package.json index b7a3cdf0becc..af688c103f46 100644 --- a/InvenTree/web/src/package.json +++ b/InvenTree/web/src/package.json @@ -19,6 +19,8 @@ "@mantine/modals": "^5.7.1", "@mantine/notifications": "^5.7.1", "@mantine/rte": "^5.7.1", + "@sentry/react": "^7.19.0", + "@sentry/tracing": "^7.19.0", "@tanstack/react-query": "^4.16.1", "@types/react-router-dom": "^5.3.3", "axios": "^1.1.3", diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index 8b51d8e404f0..66b6ca24e2de 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -12,12 +12,18 @@ import { QueryClient, QueryClientProvider, } from '@tanstack/react-query' +import * as Sentry from "@sentry/react"; +import { BrowserTracing } from "@sentry/tracing"; -const routes = { - base: 'https://demo.inventree.org/api', -}; +// Error tracking +Sentry.init({ + dsn: "https://84f0c3ea90c64e5092e2bf5dfe325725@o1047628.ingest.sentry.io/4504160008273920", + integrations: [new BrowserTracing()], + tracesSampleRate: 1.0, +}); -const user = { +// Constants +export const user = { "name": "Matthias Mair", "email": "code@mjmair.com", } @@ -65,6 +71,7 @@ const router = createBrowserRouter([ }, ]); +// Main App export default function App() { const preferredColorScheme = useColorScheme(); const [colorScheme, setColorScheme] = useState(preferredColorScheme); diff --git a/InvenTree/web/src/yarn.lock b/InvenTree/web/src/yarn.lock index fa5ef9111438..83d6c37545db 100644 --- a/InvenTree/web/src/yarn.lock +++ b/InvenTree/web/src/yarn.lock @@ -639,6 +639,59 @@ resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.0.3.tgz#953b88c20ea00d0eddaffdc1b115c08474aa295d" integrity sha512-ceuyTSs7PZ/tQqi19YZNBc5X7kj1f8p+4DIyrcIYFY9h+hd1OKm4RqtiWldR9eGEvIiJfsqwM4BsuCtRIuEw6Q== +"@sentry/browser@7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.19.0.tgz#ce21544b843d5c4d5dcb9fe9b7ee31c5c4e91f42" + integrity sha512-dWi5VjEwiLb4ofata0UCLdTbXLD1uDUebe9rNSBkHZ3fHF4eap4ZJlu3dYePKB0CKZhZrjzbydimMhaMUNdnug== + dependencies: + "@sentry/core" "7.19.0" + "@sentry/types" "7.19.0" + "@sentry/utils" "7.19.0" + tslib "^1.9.3" + +"@sentry/core@7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.19.0.tgz#74e0eaf4b9f42bb0290f4b3f3b0ea3e272dd693e" + integrity sha512-YF9cTBcAnO4R44092BJi5Wa2/EO02xn2ziCtmNgAVTN2LD31a/YVGxGBt/FDr4Y6yeuVehaqijVVvtpSmXrGJw== + dependencies: + "@sentry/types" "7.19.0" + "@sentry/utils" "7.19.0" + tslib "^1.9.3" + +"@sentry/react@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.19.0.tgz#de2599b27023fe24f508b34b00929ff6c19bfb23" + integrity sha512-ooF1TwdgkHkUo7u9Bx+kab51gpVNUW7b+5A2krfhk/Fx2eY8z5VilzUzHCRq2jbTE9yJTpfRL3KlEXROs0AUvg== + dependencies: + "@sentry/browser" "7.19.0" + "@sentry/types" "7.19.0" + "@sentry/utils" "7.19.0" + hoist-non-react-statics "^3.3.2" + tslib "^1.9.3" + +"@sentry/tracing@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.19.0.tgz#d69ecea2c0b53d113c5100fc52d0a0acc5c8a129" + integrity sha512-SWY17M3TsgBePaGowUcSqBwaT0TJQzuNexVnLojuU0k6F57L9hubvP9zaoosoCfARXQ/3NypAFWnlJyf570rFQ== + dependencies: + "@sentry/core" "7.19.0" + "@sentry/types" "7.19.0" + "@sentry/utils" "7.19.0" + tslib "^1.9.3" + +"@sentry/types@7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.19.0.tgz#3ebb96670399b637a945fa499fa7436f7b930147" + integrity sha512-oGRAT6lfzoKrxO1mvxiSj0XHxWPd6Gd1wpPGuu6iJo03xgWDS+MIlD1h2unqL4N5fAzLjzmbC2D2lUw50Kn2pA== + +"@sentry/utils@7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.19.0.tgz#0e039fe57056074c3a5e47bd50d9cb4ac9a6e909" + integrity sha512-2L6lq+c9Ol2uiRxQDdcgoapmHJp24MhMN0gIkn2alSfMJ+ls6bGXzQHx6JAIdoOiwFQXRZHKL9ecfAc8O+vItA== + dependencies: + "@sentry/types" "7.19.0" + tslib "^1.9.3" + "@tabler/icons@^1.68.0": version "1.111.0" resolved "https://registry.yarnpkg.com/@tabler/icons/-/icons-1.111.0.tgz#0538fdd8b5de7072ae60fc5d2f13a9a636d2d0e3" @@ -1622,7 +1675,7 @@ has@^1.0.3: dependencies: function-bind "^1.1.1" -hoist-non-react-statics@^3.3.1: +hoist-non-react-statics@^3.3.1, hoist-non-react-statics@^3.3.2: version "3.3.2" resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz#ece0acaf71d62c2969c2ec59feff42a4b1a85b45" integrity sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw== @@ -2291,7 +2344,7 @@ to-regex-range@^5.0.1: dependencies: is-number "^7.0.0" -tslib@^1.8.1: +tslib@^1.8.1, tslib@^1.9.3: version "1.14.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== From ae69f326df9d36fba40a0077f56053146468b1e8 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Thu, 17 Nov 2022 19:10:10 +0100 Subject: [PATCH 038/406] use key on items --- InvenTree/web/src/src/pages/Dashboard.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/web/src/src/pages/Dashboard.tsx b/InvenTree/web/src/src/pages/Dashboard.tsx index 5da7bff89bc3..5586d137a662 100644 --- a/InvenTree/web/src/src/pages/Dashboard.tsx +++ b/InvenTree/web/src/src/pages/Dashboard.tsx @@ -33,6 +33,6 @@ export function Dashboard() { Dashboard setChecked((v) => !v)}>Autoupdate
- {items.map((item) => )} + {items.map((item) => )} ); } From e9a6c04577dbd1c794990f9e025dbd986de9e340 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 18 Nov 2022 00:05:50 +0100 Subject: [PATCH 039/406] Add auth to the frontend --- InvenTree/web/src/src/App.tsx | 55 +++++------- .../src/src/components/AuthenticationForm.tsx | 90 +++++++++++++++++++ InvenTree/web/src/src/contex/AuthContext.tsx | 81 +++++++++++++++++ InvenTree/web/src/src/pages/layout.tsx | 33 +++++-- 4 files changed, 219 insertions(+), 40 deletions(-) create mode 100644 InvenTree/web/src/src/components/AuthenticationForm.tsx create mode 100644 InvenTree/web/src/src/contex/AuthContext.tsx diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index af7459768a32..4ea151c4f3e9 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -1,42 +1,28 @@ -import { useState } from 'react'; import { MantineProvider, ColorSchemeProvider, ColorScheme } from '@mantine/core'; -import { useColorScheme } from '@mantine/hooks'; +import { useColorScheme, useLocalStorage } from '@mantine/hooks'; import { createBrowserRouter, RouterProvider, } from "react-router-dom"; import ErrorPage from './pages/error'; -import Layout, { Home, Part } from './pages/layout'; +import Layout, { Home, Part, Login } from './pages/layout'; import { Dashboard } from "./pages/Dashboard"; import { QueryClient, QueryClientProvider, } from '@tanstack/react-query' import axios from 'axios'; +import { AuthProvider, UserProps } from './contex/AuthContext'; -import * as Sentry from "@sentry/react"; -import { BrowserTracing } from "@sentry/tracing"; +const user: UserProps = { + name: "Matthias Mair", + email: "code@mjmair.com", + username: "mjmair", +}; -// Error tracking -Sentry.init({ - dsn: "https://84f0c3ea90c64e5092e2bf5dfe325725@o1047628.ingest.sentry.io/4504160008273920", - integrations: [new BrowserTracing()], - tracesSampleRate: 1.0, -}); - -// Constants -export const user = { - "name": "Matthias Mair", - "email": "code@mjmair.com", - "username": "mjmair", - "token": "8a19402acdac08bfa9fe6bf95dad8f5b83e702b3", -} - -export const api = axios.create({ - baseURL: `https://demo.inventree.org/api/`, - headers: {'Authorization': `Token ${user.token}`}, -}); +export const api = axios.create({}); +// Static Settings const tabs = [ { text: "Home", name: "home" }, { text: "Part", name: "part" }, @@ -59,8 +45,6 @@ const links = { ] } -const queryClient = new QueryClient() - const router = createBrowserRouter([ { path: "/", @@ -78,21 +62,28 @@ const router = createBrowserRouter([ }, ], }, + { + path: "/login", + element: + } ]); // Main App export default function App() { const preferredColorScheme = useColorScheme(); - const [colorScheme, setColorScheme] = useState(preferredColorScheme); - const toggleColorScheme = (value?: ColorScheme) => - setColorScheme(value || (colorScheme === 'dark' ? 'light' : 'dark')); + const [colorScheme, setColorScheme] = useLocalStorage({ key: 'scheme', defaultValue: preferredColorScheme }); + const toggleColorScheme = (value?: ColorScheme) => setColorScheme(value || (colorScheme === 'dark' ? 'light' : 'dark')); + + const queryClient = new QueryClient() return ( - - - + + + + + ); diff --git a/InvenTree/web/src/src/components/AuthenticationForm.tsx b/InvenTree/web/src/src/components/AuthenticationForm.tsx new file mode 100644 index 000000000000..f8d72456d234 --- /dev/null +++ b/InvenTree/web/src/src/components/AuthenticationForm.tsx @@ -0,0 +1,90 @@ +import { useToggle, upperFirst } from '@mantine/hooks'; +import { useForm } from '@mantine/form'; +import { + TextInput, + PasswordInput, + Text, + Paper, + Group, + PaperProps, + Button, + Divider, + Checkbox, + Anchor, + Stack, +} from '@mantine/core'; + +export function AuthenticationForm({props, handleLogin, navigate}: {props: PaperProps, handleLogin: any, navigate: any}) { + const [type, toggle] = useToggle(['login', 'register']); + const form = useForm({ + initialValues: { + email: '', + name: '', + password: '', + terms: false, + }, + validate: { + password: (val) => (val.length <= 5 ? 'Password should include at least 6 characters' : null), + }, + }); + const submit = () => { + if (type === 'login') { + handleLogin({form: form.values, type: type, navigate: navigate}); + } + }; + + return ( + + Welcome to Mantine, {type} with + Social Buttons Here + +
{submit()})}> + + {type === 'register' && ( + form.setFieldValue('name', event.currentTarget.value)} + /> + )} + + form.setFieldValue('email', event.currentTarget.value)} + error={form.errors.email && 'Invalid email'} + /> + + form.setFieldValue('password', event.currentTarget.value)} + error={form.errors.password && 'Password should include at least 6 characters'} + /> + + {type === 'register' && ( + form.setFieldValue('terms', event.currentTarget.checked)} + /> + )} + + + + toggle()} size="xs"> + {type === 'register' + ? 'Already have an account? Login' + : "Don't have an account? Register"} + + + +
+
+ ); +} diff --git a/InvenTree/web/src/src/contex/AuthContext.tsx b/InvenTree/web/src/src/contex/AuthContext.tsx new file mode 100644 index 000000000000..650a27dab563 --- /dev/null +++ b/InvenTree/web/src/src/contex/AuthContext.tsx @@ -0,0 +1,81 @@ + +import { useLocalStorage } from "@mantine/hooks"; +import axios from "axios"; +import { createContext, useContext } from "react"; +import { Navigate } from "react-router-dom"; +import { api } from "../App"; + +export const UserProps = { + name: String, + email: String, + username: String, + token: String, +} + +export const DefaultProps = { + user: UserProps, + host: String, +} + +const AuthContext = createContext(null); + +export const useAuth = () => { + return useContext(AuthContext); +}; + +export const ProtectedRoute = ({ children }) => { + const { token } = useAuth(); + + if (!token) { + return ; + } + + return children; +}; + +export const AuthProvider = ({ children }) => { + const [token, setToken] = useLocalStorage({key: 'token', defaultValue: ''}); + // TODO make host a user selectable option + const [host, setHost] = useLocalStorage({key: 'host', defaultValue: 'http://127.0.0.1:8000/api/'}); + + function login(username: string, password: string) { + return axios.get(`${host}user/token/`, {auth:{ username, password} }) + .then((response) => response.data.token) + .catch((error) => {console.log(error);}); + } + + // TODO add types + const handleLogin = async (props: any) => { + // Get token from server + const form = props.form; + const navigate = props.navigate; + const token = await login(form.email, form.password); + + // Set token in context + setToken(token); + api.defaults.baseURL=host; + api.defaults.headers.common['Authorization'] = `Token ${token}`; + + // Navigate to home page + navigate('/'); + } + + const handleLogout = () => { + console.log("Logout"); + setToken(null); + }; + + const value = { + token, + host, + onLogin: handleLogin, + onLogout: handleLogout, + handleLogin, + }; + + return ( + + {children} + + ); +}; diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index 677e68b66563..b3b0c408a3c5 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -1,22 +1,26 @@ -import { Outlet } from "react-router-dom"; +import { Outlet, useNavigate } from "react-router-dom"; import { HeaderTabs } from "../components/HeaderTabs"; -import { Container, Flex, Space } from "@mantine/core"; +import { Center, Container, Flex, Space } from "@mantine/core"; import { FooterSimple, FooterSimpleProps } from "../components/FooterSimple"; import { useStyles } from "../globalStyle"; import { StylishText } from "../components/StylishText"; +import { ProtectedRoute, useAuth } from "../contex/AuthContext"; +import { AuthenticationForm } from "../components/AuthenticationForm"; export default function Layout({ user, tabs, links }: { user: any, tabs: any, links: FooterSimpleProps }) { const { classes } = useStyles(); return ( - - - - - - + + + + + + + + ); } @@ -34,3 +38,16 @@ export function Part() { Part ); } + +export function Login() { + const { handleLogin } = useAuth(); + const navigate = useNavigate(); + + return ( +
+ + + +
+ ); +} From 49aac793728b9f0ffb42e5df1a58698130cb397d Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 18 Nov 2022 01:03:15 +0100 Subject: [PATCH 040/406] remove props --- InvenTree/web/src/src/components/AuthenticationForm.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InvenTree/web/src/src/components/AuthenticationForm.tsx b/InvenTree/web/src/src/components/AuthenticationForm.tsx index f8d72456d234..68fefa24808a 100644 --- a/InvenTree/web/src/src/components/AuthenticationForm.tsx +++ b/InvenTree/web/src/src/components/AuthenticationForm.tsx @@ -14,7 +14,7 @@ import { Stack, } from '@mantine/core'; -export function AuthenticationForm({props, handleLogin, navigate}: {props: PaperProps, handleLogin: any, navigate: any}) { +export function AuthenticationForm({handleLogin, navigate}: {handleLogin: any, navigate: any}) { const [type, toggle] = useToggle(['login', 'register']); const form = useForm({ initialValues: { @@ -34,7 +34,7 @@ export function AuthenticationForm({props, handleLogin, navigate}: {props: Paper }; return ( - + Welcome to Mantine, {type} with Social Buttons Here From 5b2412aacdfac91e38441394c5a8137c1e82f793 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 18 Nov 2022 01:11:59 +0100 Subject: [PATCH 041/406] add type for AuthContext --- InvenTree/web/src/src/contex/AuthContext.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/InvenTree/web/src/src/contex/AuthContext.tsx b/InvenTree/web/src/src/contex/AuthContext.tsx index 650a27dab563..39a79b0654a1 100644 --- a/InvenTree/web/src/src/contex/AuthContext.tsx +++ b/InvenTree/web/src/src/contex/AuthContext.tsx @@ -4,6 +4,7 @@ import axios from "axios"; import { createContext, useContext } from "react"; import { Navigate } from "react-router-dom"; import { api } from "../App"; +import { ReactNode } from "react"; export const UserProps = { name: String, @@ -17,7 +18,13 @@ export const DefaultProps = { host: String, } -const AuthContext = createContext(null); +export type AuthContextProps = { + token: string, + host: string, + handleLogin: (username: string, password: string) => Promise, +} + +const AuthContext = createContext(null); export const useAuth = () => { return useContext(AuthContext); @@ -62,7 +69,7 @@ export const AuthProvider = ({ children }) => { const handleLogout = () => { console.log("Logout"); - setToken(null); + setToken(''); }; const value = { From 31aec91e60f82a3f842abb95772bd56de9ab238a Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 18 Nov 2022 01:17:49 +0100 Subject: [PATCH 042/406] add more types --- InvenTree/web/src/src/contex/AuthContext.tsx | 19 +++++++++---------- InvenTree/web/src/src/pages/layout.tsx | 4 ++-- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/InvenTree/web/src/src/contex/AuthContext.tsx b/InvenTree/web/src/src/contex/AuthContext.tsx index 39a79b0654a1..9bcfb5a9f140 100644 --- a/InvenTree/web/src/src/contex/AuthContext.tsx +++ b/InvenTree/web/src/src/contex/AuthContext.tsx @@ -6,16 +6,15 @@ import { Navigate } from "react-router-dom"; import { api } from "../App"; import { ReactNode } from "react"; -export const UserProps = { - name: String, - email: String, - username: String, - token: String, +export type UserProps = { + name: string, + email: string, + username: string, } -export const DefaultProps = { +export type DefaultProps = { user: UserProps, - host: String, + host: string, } export type AuthContextProps = { @@ -24,13 +23,13 @@ export type AuthContextProps = { handleLogin: (username: string, password: string) => Promise, } -const AuthContext = createContext(null); +const AuthContext = createContext({} as AuthContextProps); export const useAuth = () => { return useContext(AuthContext); }; -export const ProtectedRoute = ({ children }) => { +export const ProtectedRoute = (children: ReactNode) => { const { token } = useAuth(); if (!token) { @@ -40,7 +39,7 @@ export const ProtectedRoute = ({ children }) => { return children; }; -export const AuthProvider = ({ children }) => { +export const AuthProvider = (children: ReactNode) => { const [token, setToken] = useLocalStorage({key: 'token', defaultValue: ''}); // TODO make host a user selectable option const [host, setHost] = useLocalStorage({key: 'host', defaultValue: 'http://127.0.0.1:8000/api/'}); diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index b3b0c408a3c5..148c9645e8df 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -5,11 +5,11 @@ import { Center, Container, Flex, Space } from "@mantine/core"; import { FooterSimple, FooterSimpleProps } from "../components/FooterSimple"; import { useStyles } from "../globalStyle"; import { StylishText } from "../components/StylishText"; -import { ProtectedRoute, useAuth } from "../contex/AuthContext"; +import { ProtectedRoute, useAuth, UserProps } from "../contex/AuthContext"; import { AuthenticationForm } from "../components/AuthenticationForm"; -export default function Layout({ user, tabs, links }: { user: any, tabs: any, links: FooterSimpleProps }) { +export default function Layout({ user, tabs, links }: { user: UserProps, tabs: any, links: FooterSimpleProps }) { const { classes } = useStyles(); return ( From 86365209426732db6c91767437ac33f528e3df06 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 18 Nov 2022 01:31:05 +0100 Subject: [PATCH 043/406] fix type of children --- InvenTree/web/src/src/contex/AuthContext.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/InvenTree/web/src/src/contex/AuthContext.tsx b/InvenTree/web/src/src/contex/AuthContext.tsx index 9bcfb5a9f140..f41a4043823f 100644 --- a/InvenTree/web/src/src/contex/AuthContext.tsx +++ b/InvenTree/web/src/src/contex/AuthContext.tsx @@ -4,7 +4,6 @@ import axios from "axios"; import { createContext, useContext } from "react"; import { Navigate } from "react-router-dom"; import { api } from "../App"; -import { ReactNode } from "react"; export type UserProps = { name: string, @@ -29,7 +28,7 @@ export const useAuth = () => { return useContext(AuthContext); }; -export const ProtectedRoute = (children: ReactNode) => { +export const ProtectedRoute = ({ children }: { children: JSX.Element }) => { const { token } = useAuth(); if (!token) { @@ -39,7 +38,7 @@ export const ProtectedRoute = (children: ReactNode) => { return children; }; -export const AuthProvider = (children: ReactNode) => { +export const AuthProvider = ({ children }: { children: JSX.Element }) => { const [token, setToken] = useLocalStorage({key: 'token', defaultValue: ''}); // TODO make host a user selectable option const [host, setHost] = useLocalStorage({key: 'host', defaultValue: 'http://127.0.0.1:8000/api/'}); From 868917afcee8313ddcb6a36bdd5e65d76c5df450 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 18 Nov 2022 01:39:55 +0100 Subject: [PATCH 044/406] change default to demo --- InvenTree/web/src/src/contex/AuthContext.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/web/src/src/contex/AuthContext.tsx b/InvenTree/web/src/src/contex/AuthContext.tsx index f41a4043823f..49cce5c94a3f 100644 --- a/InvenTree/web/src/src/contex/AuthContext.tsx +++ b/InvenTree/web/src/src/contex/AuthContext.tsx @@ -41,7 +41,7 @@ export const ProtectedRoute = ({ children }: { children: JSX.Element }) => { export const AuthProvider = ({ children }: { children: JSX.Element }) => { const [token, setToken] = useLocalStorage({key: 'token', defaultValue: ''}); // TODO make host a user selectable option - const [host, setHost] = useLocalStorage({key: 'host', defaultValue: 'http://127.0.0.1:8000/api/'}); + const [host, setHost] = useLocalStorage({key: 'host', defaultValue: 'https://demo.inventree.org/api/'}); function login(username: string, password: string) { return axios.get(`${host}user/token/`, {auth:{ username, password} }) From 9bcf94fd014f100109b04697b250f7f745bda0d0 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 18 Nov 2022 01:41:14 +0100 Subject: [PATCH 045/406] move components --- .../src/components/{statsElement.tsx => StatElement.tsx} | 4 ++-- .../web/src/src/components/{ => nav}/FooterSimple.tsx | 9 +++------ .../web/src/src/components/{ => nav}/HeaderTabs.tsx | 6 +++--- InvenTree/web/src/src/pages/layout.tsx | 4 ++-- 4 files changed, 10 insertions(+), 13 deletions(-) rename InvenTree/web/src/src/components/{statsElement.tsx => StatElement.tsx} (79%) rename InvenTree/web/src/src/components/{ => nav}/FooterSimple.tsx (70%) rename InvenTree/web/src/src/components/{ => nav}/HeaderTabs.tsx (95%) diff --git a/InvenTree/web/src/src/components/statsElement.tsx b/InvenTree/web/src/src/components/StatElement.tsx similarity index 79% rename from InvenTree/web/src/src/components/statsElement.tsx rename to InvenTree/web/src/src/components/StatElement.tsx index 116d20a8a7c7..ff904edf662d 100644 --- a/InvenTree/web/src/src/components/statsElement.tsx +++ b/InvenTree/web/src/src/components/StatElement.tsx @@ -12,9 +12,9 @@ const useStyles = createStyles((theme) => ({ }, })); -export interface StatsElementProps {title: string; value: string;} +export interface StatElementProps {title: string; value: string;} -export function StatsElement({ key, data, isLoading }: {key: string, data: StatsElementProps, isLoading: boolean}) { +export function StatElement({ key, data, isLoading }: {key: string, data: StatElementProps, isLoading: boolean}) { const { classes } = useStyles(); return ( diff --git a/InvenTree/web/src/src/components/FooterSimple.tsx b/InvenTree/web/src/src/components/nav/FooterSimple.tsx similarity index 70% rename from InvenTree/web/src/src/components/FooterSimple.tsx rename to InvenTree/web/src/src/components/nav/FooterSimple.tsx index 46ea2ba28dee..8bc21066833c 100644 --- a/InvenTree/web/src/src/components/FooterSimple.tsx +++ b/InvenTree/web/src/src/components/nav/FooterSimple.tsx @@ -1,11 +1,8 @@ -import { InvenTreeLogo } from "./InvenTreeLogo"; -import {Container, Group, Anchor } from '@mantine/core'; -import { useStyles } from "../globalStyle"; +import { InvenTreeLogo } from "../InvenTreeLogo"; +import { Container, Group, Anchor } from '@mantine/core'; +import { useStyles } from "../../globalStyle"; -export interface FooterSimpleProps { - links: { link: string; label: string }[]; -} export function FooterSimple({ links }: FooterSimpleProps) { const { classes } = useStyles(); diff --git a/InvenTree/web/src/src/components/HeaderTabs.tsx b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx similarity index 95% rename from InvenTree/web/src/src/components/HeaderTabs.tsx rename to InvenTree/web/src/src/components/nav/HeaderTabs.tsx index fc32a7ba1a86..e93d27b3245d 100644 --- a/InvenTree/web/src/src/components/HeaderTabs.tsx +++ b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx @@ -16,10 +16,10 @@ import { IconChevronDown, IconDashboard } from '@tabler/icons'; -import { ColorToggle } from './ColorToggle'; -import { InvenTreeLogo } from './InvenTreeLogo'; +import { ColorToggle } from '../ColorToggle'; +import { InvenTreeLogo } from '../InvenTreeLogo'; import { useNavigate, useParams } from 'react-router-dom'; -import { useStyles } from '../globalStyle'; +import { useStyles } from '../../globalStyle'; interface HeaderTabsProps { user: { name: string; }; diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index 148c9645e8df..cd8fa8f62091 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -1,8 +1,8 @@ import { Outlet, useNavigate } from "react-router-dom"; -import { HeaderTabs } from "../components/HeaderTabs"; +import { HeaderTabs } from "../components/nav/HeaderTabs"; import { Center, Container, Flex, Space } from "@mantine/core"; -import { FooterSimple, FooterSimpleProps } from "../components/FooterSimple"; +import { FooterSimple, FooterSimpleProps } from "../components/nav/FooterSimple"; import { useStyles } from "../globalStyle"; import { StylishText } from "../components/StylishText"; import { ProtectedRoute, useAuth, UserProps } from "../contex/AuthContext"; From d1719e00852c37134c3870712ba86788df61c405 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 18 Nov 2022 01:41:51 +0100 Subject: [PATCH 046/406] move type to interface --- .../src/src/components/nav/FooterSimple.tsx | 1 + InvenTree/web/src/src/contex/AuthContext.tsx | 23 +++++++------------ 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/InvenTree/web/src/src/components/nav/FooterSimple.tsx b/InvenTree/web/src/src/components/nav/FooterSimple.tsx index 8bc21066833c..012a8079a7ae 100644 --- a/InvenTree/web/src/src/components/nav/FooterSimple.tsx +++ b/InvenTree/web/src/src/components/nav/FooterSimple.tsx @@ -3,6 +3,7 @@ import { Container, Group, Anchor } from '@mantine/core'; import { useStyles } from "../../globalStyle"; +export interface FooterSimpleProps { links: { link: string; label: string }[] } export function FooterSimple({ links }: FooterSimpleProps) { const { classes } = useStyles(); diff --git a/InvenTree/web/src/src/contex/AuthContext.tsx b/InvenTree/web/src/src/contex/AuthContext.tsx index 49cce5c94a3f..1569d262409e 100644 --- a/InvenTree/web/src/src/contex/AuthContext.tsx +++ b/InvenTree/web/src/src/contex/AuthContext.tsx @@ -5,18 +5,11 @@ import { createContext, useContext } from "react"; import { Navigate } from "react-router-dom"; import { api } from "../App"; -export type UserProps = { - name: string, - email: string, - username: string, -} +export interface UserProps { name: string, email: string, username: string } -export type DefaultProps = { - user: UserProps, - host: string, -} +export interface DefaultProps { user: UserProps, host: string } -export type AuthContextProps = { +export interface AuthContextProps { token: string, host: string, handleLogin: (username: string, password: string) => Promise, @@ -39,14 +32,14 @@ export const ProtectedRoute = ({ children }: { children: JSX.Element }) => { }; export const AuthProvider = ({ children }: { children: JSX.Element }) => { - const [token, setToken] = useLocalStorage({key: 'token', defaultValue: ''}); + const [token, setToken] = useLocalStorage({ key: 'token', defaultValue: '' }); // TODO make host a user selectable option - const [host, setHost] = useLocalStorage({key: 'host', defaultValue: 'https://demo.inventree.org/api/'}); + const [host, setHost] = useLocalStorage({ key: 'host', defaultValue: 'https://demo.inventree.org/api/' }); function login(username: string, password: string) { - return axios.get(`${host}user/token/`, {auth:{ username, password} }) + return axios.get(`${host}user/token/`, { auth: { username, password } }) .then((response) => response.data.token) - .catch((error) => {console.log(error);}); + .catch((error) => { console.log(error); }); } // TODO add types @@ -58,7 +51,7 @@ export const AuthProvider = ({ children }: { children: JSX.Element }) => { // Set token in context setToken(token); - api.defaults.baseURL=host; + api.defaults.baseURL = host; api.defaults.headers.common['Authorization'] = `Token ${token}`; // Navigate to home page From fb11bc3d7a2502c9b28a668dd643f2b78999a930 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 18 Nov 2022 01:42:00 +0100 Subject: [PATCH 047/406] format file --- InvenTree/web/src/src/components/AuthenticationForm.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/InvenTree/web/src/src/components/AuthenticationForm.tsx b/InvenTree/web/src/src/components/AuthenticationForm.tsx index 68fefa24808a..c4be27052fe3 100644 --- a/InvenTree/web/src/src/components/AuthenticationForm.tsx +++ b/InvenTree/web/src/src/components/AuthenticationForm.tsx @@ -6,7 +6,6 @@ import { Text, Paper, Group, - PaperProps, Button, Divider, Checkbox, @@ -14,7 +13,7 @@ import { Stack, } from '@mantine/core'; -export function AuthenticationForm({handleLogin, navigate}: {handleLogin: any, navigate: any}) { +export function AuthenticationForm({ handleLogin, navigate }: { handleLogin: any, navigate: any }) { const [type, toggle] = useToggle(['login', 'register']); const form = useForm({ initialValues: { @@ -29,7 +28,7 @@ export function AuthenticationForm({handleLogin, navigate}: {handleLogin: any, n }); const submit = () => { if (type === 'login') { - handleLogin({form: form.values, type: type, navigate: navigate}); + handleLogin({ form: form.values, type: type, navigate: navigate }); } }; @@ -38,7 +37,7 @@ export function AuthenticationForm({handleLogin, navigate}: {handleLogin: any, n Welcome to Mantine, {type} with Social Buttons Here -
{submit()})}> + { submit() })}> {type === 'register' && ( Date: Fri, 18 Nov 2022 01:42:43 +0100 Subject: [PATCH 048/406] rename component --- InvenTree/web/src/src/pages/DashboardItem.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InvenTree/web/src/src/pages/DashboardItem.tsx b/InvenTree/web/src/src/pages/DashboardItem.tsx index 41a2ec28481a..56cb50b1753c 100644 --- a/InvenTree/web/src/src/pages/DashboardItem.tsx +++ b/InvenTree/web/src/src/pages/DashboardItem.tsx @@ -1,6 +1,6 @@ import { useQuery } from '@tanstack/react-query'; import { api } from "../App"; -import { StatsElement } from "../components/statsElement"; +import { StatElement } from "../components/StatElement"; import { useEffect, useState } from "react"; export function DashboardItem({ id, text, url, params, autoupdate=true }: { id: string; text: string; url: string; params: any; autoupdate: boolean }) { @@ -15,6 +15,6 @@ export function DashboardItem({ id, text, url, params, autoupdate=true }: { id: if (error) return <>An error has occurred: {error}; return (
- +
); } From a1ff779142cdc32a942bede81a38211eb8f50942 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 18 Nov 2022 01:44:08 +0100 Subject: [PATCH 049/406] set default --- InvenTree/web/src/src/pages/DashboardItem.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/web/src/src/pages/DashboardItem.tsx b/InvenTree/web/src/src/pages/DashboardItem.tsx index 56cb50b1753c..7f9581fb30c5 100644 --- a/InvenTree/web/src/src/pages/DashboardItem.tsx +++ b/InvenTree/web/src/src/pages/DashboardItem.tsx @@ -8,7 +8,7 @@ export function DashboardItem({ id, text, url, params, autoupdate=true }: { id: return api.get(`${url}/?search=&offset=0&limit=25`, { params: params }).then((res) => res.data); } const { isLoading, error, data, isFetching } = useQuery({ queryKey: [`dash_${id}`], queryFn: fetchData, refetchOnWindowFocus: autoupdate, }); - const [dashdata, setDashData] = useState({title: '', value: ''}); + const [dashdata, setDashData] = useState({title: 'Title', value: '000'}); useEffect(() => { if (data) { setDashData({ title: text, value: data.count }); } }, [data]); From a68adbdd759869ec19180cd5aa1e65a20ca2307a Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 18 Nov 2022 01:54:47 +0100 Subject: [PATCH 050/406] add logout route --- InvenTree/web/src/src/App.tsx | 6 +++++- InvenTree/web/src/src/components/nav/HeaderTabs.tsx | 3 ++- InvenTree/web/src/src/contex/AuthContext.tsx | 4 ++-- InvenTree/web/src/src/pages/layout.tsx | 10 ++++++++++ 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index 4ea151c4f3e9..a1c595cf3665 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -5,7 +5,7 @@ import { RouterProvider, } from "react-router-dom"; import ErrorPage from './pages/error'; -import Layout, { Home, Part, Login } from './pages/layout'; +import Layout, { Home, Part, Login, Logout } from './pages/layout'; import { Dashboard } from "./pages/Dashboard"; import { QueryClient, @@ -65,6 +65,10 @@ const router = createBrowserRouter([ { path: "/login", element: + }, + { + path: "/logout", + element: } ]); diff --git a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx index e93d27b3245d..8d3242e2deb9 100644 --- a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx +++ b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx @@ -20,6 +20,7 @@ import { ColorToggle } from '../ColorToggle'; import { InvenTreeLogo } from '../InvenTreeLogo'; import { useNavigate, useParams } from 'react-router-dom'; import { useStyles } from '../../globalStyle'; +import { Link } from 'react-router-dom'; interface HeaderTabsProps { user: { name: string; }; @@ -73,7 +74,7 @@ export function HeaderTabs({ user, tabs }: HeaderTabsProps) { Settings }>Account settings - }>Logout + } component={Link} to="/logout">Logout diff --git a/InvenTree/web/src/src/contex/AuthContext.tsx b/InvenTree/web/src/src/contex/AuthContext.tsx index 1569d262409e..487bb914a5e9 100644 --- a/InvenTree/web/src/src/contex/AuthContext.tsx +++ b/InvenTree/web/src/src/contex/AuthContext.tsx @@ -13,6 +13,7 @@ export interface AuthContextProps { token: string, host: string, handleLogin: (username: string, password: string) => Promise, + handleLogout: () => void, } const AuthContext = createContext({} as AuthContextProps); @@ -66,9 +67,8 @@ export const AuthProvider = ({ children }: { children: JSX.Element }) => { const value = { token, host, - onLogin: handleLogin, - onLogout: handleLogout, handleLogin, + handleLogout, }; return ( diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index cd8fa8f62091..dcb58d1041fc 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -51,3 +51,13 @@ export function Login() { ); } + +export function Logout() { + const { handleLogout } = useAuth(); + const navigate = useNavigate(); + + handleLogout(); + navigate('/'); + + return (<>); +} From 19286e0f8b95b086425c4f28b647aadf4ec85754 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 18 Nov 2022 02:14:32 +0100 Subject: [PATCH 051/406] rename vars --- .../src/src/components/AuthenticationForm.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/InvenTree/web/src/src/components/AuthenticationForm.tsx b/InvenTree/web/src/src/components/AuthenticationForm.tsx index c4be27052fe3..ca32dd9a3fa4 100644 --- a/InvenTree/web/src/src/components/AuthenticationForm.tsx +++ b/InvenTree/web/src/src/components/AuthenticationForm.tsx @@ -14,7 +14,7 @@ import { } from '@mantine/core'; export function AuthenticationForm({ handleLogin, navigate }: { handleLogin: any, navigate: any }) { - const [type, toggle] = useToggle(['login', 'register']); + const [action, toggleAction] = useToggle(['login', 'register']); const form = useForm({ initialValues: { email: '', @@ -27,19 +27,19 @@ export function AuthenticationForm({ handleLogin, navigate }: { handleLogin: any }, }); const submit = () => { - if (type === 'login') { - handleLogin({ form: form.values, type: type, navigate: navigate }); + if (action === 'login') { + handleLogin({ form: form.values, type: action, navigate: navigate }); } }; return ( - Welcome to Mantine, {type} with + Welcome to Mantine, {action} with Social Buttons Here { submit() })}> - {type === 'register' && ( + {action === 'register' && ( - {type === 'register' && ( + {action === 'register' && ( - toggle()} size="xs"> - {type === 'register' + toggleAction()} size="xs"> + {action === 'register' ? 'Already have an account? Login' : "Don't have an account? Register"} - + From 34933b2c00a46b260d057cf66539ec2b7b3d18ab Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 18 Nov 2022 02:22:28 +0100 Subject: [PATCH 052/406] add placeholder for login --- InvenTree/web/src/src/components/AuthenticationForm.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/InvenTree/web/src/src/components/AuthenticationForm.tsx b/InvenTree/web/src/src/components/AuthenticationForm.tsx index ca32dd9a3fa4..c3ed12945fbe 100644 --- a/InvenTree/web/src/src/components/AuthenticationForm.tsx +++ b/InvenTree/web/src/src/components/AuthenticationForm.tsx @@ -35,7 +35,7 @@ export function AuthenticationForm({ handleLogin, navigate }: { handleLogin: any return ( Welcome to Mantine, {action} with - Social Buttons Here +
Placeholder
{ submit() })}> From 674e10f510f9ccc13dcd9c92735551273d73015b Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 18 Nov 2022 02:22:55 +0100 Subject: [PATCH 053/406] add host selector --- .../src/src/components/AuthenticationForm.tsx | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/InvenTree/web/src/src/components/AuthenticationForm.tsx b/InvenTree/web/src/src/components/AuthenticationForm.tsx index c3ed12945fbe..2a62a0621429 100644 --- a/InvenTree/web/src/src/components/AuthenticationForm.tsx +++ b/InvenTree/web/src/src/components/AuthenticationForm.tsx @@ -11,7 +11,10 @@ import { Checkbox, Anchor, Stack, + Center, + Chip, } from '@mantine/core'; +import { useState } from 'react'; export function AuthenticationForm({ handleLogin, navigate }: { handleLogin: any, navigate: any }) { const [action, toggleAction] = useToggle(['login', 'register']); @@ -32,7 +35,19 @@ export function AuthenticationForm({ handleLogin, navigate }: { handleLogin: any } }; - return ( + const hostOptions = [ + "https://demo.inventree.org", + "https://sample.app.invenhost.com", + "http://locahost:8000", + ]; + const [formHost, setFormHost] = useState(hostOptions[0]); + + return (<> +
+ + {hostOptions.map((host) => ({host}))} + +
Welcome to Mantine, {action} with
Placeholder
@@ -85,5 +100,5 @@ export function AuthenticationForm({ handleLogin, navigate }: { handleLogin: any
- ); + ); } From d464c55c5642b214da3b556165ce1de17d9c76dd Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 18 Nov 2022 02:47:14 +0100 Subject: [PATCH 054/406] make host-plattform selectable --- .../src/src/components/AuthenticationForm.tsx | 22 +++---------- InvenTree/web/src/src/contex/AuthContext.tsx | 4 ++- InvenTree/web/src/src/pages/layout.tsx | 31 +++++++++++++------ 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/InvenTree/web/src/src/components/AuthenticationForm.tsx b/InvenTree/web/src/src/components/AuthenticationForm.tsx index 2a62a0621429..cf3f168e26ba 100644 --- a/InvenTree/web/src/src/components/AuthenticationForm.tsx +++ b/InvenTree/web/src/src/components/AuthenticationForm.tsx @@ -12,11 +12,9 @@ import { Anchor, Stack, Center, - Chip, } from '@mantine/core'; -import { useState } from 'react'; -export function AuthenticationForm({ handleLogin, navigate }: { handleLogin: any, navigate: any }) { +export function AuthenticationForm({ handleLogin, navigate, hostname }: { handleLogin: any, navigate: any, hostname: string }) { const [action, toggleAction] = useToggle(['login', 'register']); const form = useForm({ initialValues: { @@ -35,21 +33,9 @@ export function AuthenticationForm({ handleLogin, navigate }: { handleLogin: any } }; - const hostOptions = [ - "https://demo.inventree.org", - "https://sample.app.invenhost.com", - "http://locahost:8000", - ]; - const [formHost, setFormHost] = useState(hostOptions[0]); - - return (<> -
- - {hostOptions.map((host) => ({host}))} - -
+ return ( - Welcome to Mantine, {action} with + Welcome to {hostname}, {action} with
Placeholder
{ submit() })}> @@ -100,5 +86,5 @@ export function AuthenticationForm({ handleLogin, navigate }: { handleLogin: any
- ); + ); } diff --git a/InvenTree/web/src/src/contex/AuthContext.tsx b/InvenTree/web/src/src/contex/AuthContext.tsx index 487bb914a5e9..5f9b5a54b50e 100644 --- a/InvenTree/web/src/src/contex/AuthContext.tsx +++ b/InvenTree/web/src/src/contex/AuthContext.tsx @@ -14,6 +14,7 @@ export interface AuthContextProps { host: string, handleLogin: (username: string, password: string) => Promise, handleLogout: () => void, + setHost: (host: string) => void, } const AuthContext = createContext({} as AuthContextProps); @@ -35,7 +36,7 @@ export const ProtectedRoute = ({ children }: { children: JSX.Element }) => { export const AuthProvider = ({ children }: { children: JSX.Element }) => { const [token, setToken] = useLocalStorage({ key: 'token', defaultValue: '' }); // TODO make host a user selectable option - const [host, setHost] = useLocalStorage({ key: 'host', defaultValue: 'https://demo.inventree.org/api/' }); + const [host, setHost] = useLocalStorage({ key: 'host', defaultValue: '' }); function login(username: string, password: string) { return axios.get(`${host}user/token/`, { auth: { username, password } }) @@ -69,6 +70,7 @@ export const AuthProvider = ({ children }: { children: JSX.Element }) => { host, handleLogin, handleLogout, + setHost, }; return ( diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index dcb58d1041fc..0290a9f52f40 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -1,12 +1,13 @@ import { Outlet, useNavigate } from "react-router-dom"; import { HeaderTabs } from "../components/nav/HeaderTabs"; -import { Center, Container, Flex, Space } from "@mantine/core"; +import { Center, Chip, Container, Flex, Space, Stack } from "@mantine/core"; import { FooterSimple, FooterSimpleProps } from "../components/nav/FooterSimple"; import { useStyles } from "../globalStyle"; import { StylishText } from "../components/StylishText"; import { ProtectedRoute, useAuth, UserProps } from "../contex/AuthContext"; import { AuthenticationForm } from "../components/AuthenticationForm"; +import { useState } from "react"; export default function Layout({ user, tabs, links }: { user: UserProps, tabs: any, links: FooterSimpleProps }) { @@ -40,16 +41,28 @@ export function Part() { } export function Login() { - const { handleLogin } = useAuth(); + const { handleLogin, host, setHost } = useAuth(); const navigate = useNavigate(); + const hostOptions = [ + "https://demo.inventree.org", + "https://sample.app.invenhost.com", + ]; + const [hostname, setHostname] = useState((host === '') ? hostOptions[0] : host.replace('/api/', '')); + function changeHost(newVal: string) { + setHost(`${newVal}/api/`); + setHostname(newVal); + } - return ( -
- - - -
- ); + return (
+ +
+ + {hostOptions.map((host) => ({host}))} + +
+ +
+
); } export function Logout() { From 44e47fddf732932dd3647c3003939bd0728f8d3e Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 18 Nov 2022 02:47:50 +0100 Subject: [PATCH 055/406] remove meaningless validation --- InvenTree/web/src/src/components/AuthenticationForm.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/InvenTree/web/src/src/components/AuthenticationForm.tsx b/InvenTree/web/src/src/components/AuthenticationForm.tsx index cf3f168e26ba..3390256d8595 100644 --- a/InvenTree/web/src/src/components/AuthenticationForm.tsx +++ b/InvenTree/web/src/src/components/AuthenticationForm.tsx @@ -22,10 +22,7 @@ export function AuthenticationForm({ handleLogin, navigate, hostname }: { handle name: '', password: '', terms: false, - }, - validate: { - password: (val) => (val.length <= 5 ? 'Password should include at least 6 characters' : null), - }, + } }); const submit = () => { if (action === 'login') { From c3a0a700bb5fddfad1625b282fb544b559346180 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 18 Nov 2022 02:49:24 +0100 Subject: [PATCH 056/406] move hostoptions to app --- InvenTree/web/src/src/App.tsx | 5 +++++ InvenTree/web/src/src/pages/layout.tsx | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index a1c595cf3665..517f4a754681 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -45,6 +45,11 @@ const links = { ] } +export const hosts = [ + "https://demo.inventree.org", + "https://sample.app.invenhost.com", +]; + const router = createBrowserRouter([ { path: "/", diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index 0290a9f52f40..91aa12afb15c 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -8,6 +8,7 @@ import { StylishText } from "../components/StylishText"; import { ProtectedRoute, useAuth, UserProps } from "../contex/AuthContext"; import { AuthenticationForm } from "../components/AuthenticationForm"; import { useState } from "react"; +import { hosts } from "../App"; export default function Layout({ user, tabs, links }: { user: UserProps, tabs: any, links: FooterSimpleProps }) { @@ -43,10 +44,7 @@ export function Part() { export function Login() { const { handleLogin, host, setHost } = useAuth(); const navigate = useNavigate(); - const hostOptions = [ - "https://demo.inventree.org", - "https://sample.app.invenhost.com", - ]; + const hostOptions = hosts; const [hostname, setHostname] = useState((host === '') ? hostOptions[0] : host.replace('/api/', '')); function changeHost(newVal: string) { setHost(`${newVal}/api/`); From 93797c6ec0124f5c74f783679a27093909c03e52 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Fri, 18 Nov 2022 02:52:31 +0100 Subject: [PATCH 057/406] add host in layout --- InvenTree/web/src/src/components/nav/HeaderTabs.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx index 8d3242e2deb9..17b2054fcddf 100644 --- a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx +++ b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx @@ -21,10 +21,11 @@ import { InvenTreeLogo } from '../InvenTreeLogo'; import { useNavigate, useParams } from 'react-router-dom'; import { useStyles } from '../../globalStyle'; import { Link } from 'react-router-dom'; +import { useAuth } from '../../contex/AuthContext'; interface HeaderTabsProps { user: { name: string; }; - tabs: { name: string; text:string;}[]; + tabs: { name: string; text: string; }[]; } export function HeaderTabs({ user, tabs }: HeaderTabsProps) { @@ -33,6 +34,7 @@ export function HeaderTabs({ user, tabs }: HeaderTabsProps) { const [userMenuOpened, setUserMenuOpened] = useState(false); const navigate = useNavigate(); const { tabValue } = useParams(); + const { host } = useAuth(); const items = tabs.map((tab) => ( @@ -44,7 +46,7 @@ export function HeaderTabs({ user, tabs }: HeaderTabsProps) {
- + {host} @@ -90,9 +92,9 @@ export function HeaderTabs({ user, tabs }: HeaderTabsProps) { tab: classes.tab, }} value={tabValue} - onTabChange={(value) => value=='/' ? navigate('/') : navigate(`/${value}`)} + onTabChange={(value) => value == '/' ? navigate('/') : navigate(`/${value}`)} > - }/>{items} + } />{items}
From 4379f16952a38e5c86386f8d9c6a8c6c4b082598 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sun, 20 Nov 2022 02:46:37 +0100 Subject: [PATCH 058/406] add profile route --- InvenTree/web/src/src/App.tsx | 6 +++++- InvenTree/web/src/src/components/nav/HeaderTabs.tsx | 6 +++++- InvenTree/web/src/src/pages/layout.tsx | 7 +++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index 517f4a754681..3f745021434f 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -5,7 +5,7 @@ import { RouterProvider, } from "react-router-dom"; import ErrorPage from './pages/error'; -import Layout, { Home, Part, Login, Logout } from './pages/layout'; +import Layout, { Home, Part, Login, Logout, Profile } from './pages/layout'; import { Dashboard } from "./pages/Dashboard"; import { QueryClient, @@ -67,6 +67,10 @@ const router = createBrowserRouter([ }, ], }, + { + path: "/profile", + element: + }, { path: "/login", element: diff --git a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx index 17b2054fcddf..0ea85e02255d 100644 --- a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx +++ b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx @@ -14,7 +14,8 @@ import { IconHeart, IconSettings, IconChevronDown, - IconDashboard + IconDashboard, + IconUserCircle, } from '@tabler/icons'; import { ColorToggle } from '../ColorToggle'; import { InvenTreeLogo } from '../InvenTreeLogo'; @@ -73,6 +74,9 @@ export function HeaderTabs({ user, tabs }: HeaderTabsProps) { }> Notifications + } component={Link} to="/profile"> + Profile + Settings }>Account settings diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index 91aa12afb15c..cb674fd75272 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -72,3 +72,10 @@ export function Logout() { return (<>); } + +export function Profile() { + + return ( + Profile + ); +} From 203c4b61a0099287299d04cd33f65707313e6fb6 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sun, 20 Nov 2022 21:48:03 +0100 Subject: [PATCH 059/406] Add user dashboard --- InvenTree/web/src/src/App.tsx | 15 +-- .../web/src/src/components/nav/HeaderTabs.tsx | 2 +- InvenTree/web/src/src/pages/Profile.tsx | 91 +++++++++++++++++++ InvenTree/web/src/src/pages/layout.tsx | 7 -- 4 files changed, 100 insertions(+), 15 deletions(-) create mode 100644 InvenTree/web/src/src/pages/Profile.tsx diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index 3f745021434f..972427e5182e 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -5,7 +5,8 @@ import { RouterProvider, } from "react-router-dom"; import ErrorPage from './pages/error'; -import Layout, { Home, Part, Login, Logout, Profile } from './pages/layout'; +import Layout, { Home, Part, Login, Logout } from './pages/layout'; +import { Profile } from "./pages/Profile"; import { Dashboard } from "./pages/Dashboard"; import { QueryClient, @@ -65,12 +66,12 @@ const router = createBrowserRouter([ path: "part/", element: , }, + { + path: "/profile/:tabValue", + element: + }, ], }, - { - path: "/profile", - element: - }, { path: "/login", element: @@ -81,14 +82,14 @@ const router = createBrowserRouter([ } ]); +export const queryClient = new QueryClient() + // Main App export default function App() { const preferredColorScheme = useColorScheme(); const [colorScheme, setColorScheme] = useLocalStorage({ key: 'scheme', defaultValue: preferredColorScheme }); const toggleColorScheme = (value?: ColorScheme) => setColorScheme(value || (colorScheme === 'dark' ? 'light' : 'dark')); - const queryClient = new QueryClient() - return ( diff --git a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx index 0ea85e02255d..1fbac60c0fa5 100644 --- a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx +++ b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx @@ -74,7 +74,7 @@ export function HeaderTabs({ user, tabs }: HeaderTabsProps) { }> Notifications - } component={Link} to="/profile"> + } component={Link} to="/profile/user"> Profile diff --git a/InvenTree/web/src/src/pages/Profile.tsx b/InvenTree/web/src/src/pages/Profile.tsx new file mode 100644 index 000000000000..94195468f01d --- /dev/null +++ b/InvenTree/web/src/src/pages/Profile.tsx @@ -0,0 +1,91 @@ +import { ActionIcon, Button, Container, Grid, Group, SimpleGrid, Skeleton, Tabs, Text, TextInput } from "@mantine/core"; +import { useForm } from "@mantine/form"; +import { useNavigate, useParams } from "react-router-dom"; +import { StylishText } from "../components/StylishText"; +import { useStyles } from "../globalStyle"; +import { useToggle } from "@mantine/hooks"; +import { IconEdit, IconDeviceFloppy } from '@tabler/icons'; +import { useQuery } from "@tanstack/react-query"; +import { api, queryClient } from "../App"; + + +export function Profile() { + const navigate = useNavigate(); + const { tabValue } = useParams(); + + return (<> + Profile + navigate(`/profile/${value}`)}> + + User + Settings + + + + + + ); +} + +function UserPanel() { + // view + const { theme } = useStyles(); + const PRIMARY_COL_HEIGHT = 300; + const SECONDARY_COL_HEIGHT = PRIMARY_COL_HEIGHT / 2 - theme.spacing.md / 2; + + // data + function fetchData() { + return api.get('user/me/').then((res) => res.data); + } + const { isLoading, data } = useQuery({ queryKey: ["user-me"], queryFn: fetchData }); + + return + + + {isLoading ? : } + + + + + + + + + + + + + + ; +} + +function UserInfo({ data }: { data: any }) { + if (!data) return ; + + const form = useForm({ initialValues: data }); + const [editing, setEditing] = useToggle([false, true] as const); + function SaveData(values: any) { + api.put('user/me/', values).then((res) => { + if (res.status === 200) { setEditing(); queryClient.invalidateQueries(['user-me']); } + }); + } + + return (
SaveData(values))}> + + Userinfo + setEditing()}>{editing ? : } + + + {editing ? : First name: {form.values.first_name}} + {editing ? : Last name: {form.values.last_name}} + {editing ? : Username: {form.values.username}} + + {editing ? : null} +
); +} + +function SettingsPanel() { + return + Settings + ; +} diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index cb674fd75272..91aa12afb15c 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -72,10 +72,3 @@ export function Logout() { return (<>); } - -export function Profile() { - - return ( - Profile - ); -} From 358c2d86fe3a1733dd687e9a49bcbc2bb15dedd4 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sun, 20 Nov 2022 21:48:57 +0100 Subject: [PATCH 060/406] fix key reference --- InvenTree/web/src/src/components/StatElement.tsx | 4 ++-- InvenTree/web/src/src/pages/DashboardItem.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/InvenTree/web/src/src/components/StatElement.tsx b/InvenTree/web/src/src/components/StatElement.tsx index ff904edf662d..09acc394f8b4 100644 --- a/InvenTree/web/src/src/components/StatElement.tsx +++ b/InvenTree/web/src/src/components/StatElement.tsx @@ -14,11 +14,11 @@ const useStyles = createStyles((theme) => ({ export interface StatElementProps {title: string; value: string;} -export function StatElement({ key, data, isLoading }: {key: string, data: StatElementProps, isLoading: boolean}) { +export function StatElement({ id, data, isLoading }: {id: string, data: StatElementProps, isLoading: boolean}) { const { classes } = useStyles(); return ( - + diff --git a/InvenTree/web/src/src/pages/DashboardItem.tsx b/InvenTree/web/src/src/pages/DashboardItem.tsx index 7f9581fb30c5..a065c3725867 100644 --- a/InvenTree/web/src/src/pages/DashboardItem.tsx +++ b/InvenTree/web/src/src/pages/DashboardItem.tsx @@ -15,6 +15,6 @@ export function DashboardItem({ id, text, url, params, autoupdate=true }: { id: if (error) return <>An error has occurred: {error}; return (
- +
); } From 6fee01a5c024828b1d27653dcffce93025e76076 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Sun, 20 Nov 2022 22:14:13 +0100 Subject: [PATCH 061/406] add explicit api endpoint for current user --- InvenTree/users/api.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/InvenTree/users/api.py b/InvenTree/users/api.py index db6a629b77b8..1d3c942cef55 100644 --- a/InvenTree/users/api.py +++ b/InvenTree/users/api.py @@ -10,7 +10,7 @@ from rest_framework.response import Response from rest_framework.views import APIView -from InvenTree.mixins import ListAPI, RetrieveAPI +from InvenTree.mixins import ListAPI, RetrieveAPI, RetrieveUpdateAPI from InvenTree.serializers import UserSerializer from users.models import Owner, RuleSet, check_user_role from users.serializers import OwnerSerializer @@ -116,6 +116,14 @@ class UserDetail(RetrieveAPI): permission_classes = (permissions.IsAuthenticated,) +class MeUserDetail(RetrieveUpdateAPI, UserDetail): + """Detail endpoint for current user.""" + + def get_object(self): + """Always return the current user object""" + return self.request.user + + class UserList(ListAPI): """List endpoint for detail on all users.""" @@ -170,6 +178,7 @@ def delete(self, request): re_path(r'roles/?$', RoleDetails.as_view(), name='api-user-roles'), re_path(r'token/?$', GetAuthToken.as_view(), name='api-token'), + re_path(r'^me/', MeUserDetail.as_view(), name='api-user-me'), re_path(r'^owner/', include([ path('/', OwnerDetail.as_view(), name='api-owner-detail'), From 2a867c46be5fcd9838d45948d913668825bf4d2a Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 00:58:14 +0100 Subject: [PATCH 062/406] Add zustand Fixes #25 --- InvenTree/web/src/package.json | 3 ++- InvenTree/web/src/yarn.lock | 9 ++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/InvenTree/web/src/package.json b/InvenTree/web/src/package.json index af688c103f46..a8eb8ddc84fa 100644 --- a/InvenTree/web/src/package.json +++ b/InvenTree/web/src/package.json @@ -27,7 +27,8 @@ "dayjs": "^1.11.6", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-router-dom": "^6.4.3" + "react-router-dom": "^6.4.3", + "zustand": "^4.1.4" }, "devDependencies": { "@types/react": "^18.0.24", diff --git a/InvenTree/web/src/yarn.lock b/InvenTree/web/src/yarn.lock index 83d6c37545db..c511441cc67e 100644 --- a/InvenTree/web/src/yarn.lock +++ b/InvenTree/web/src/yarn.lock @@ -2410,7 +2410,7 @@ use-latest@^1.2.1: dependencies: use-isomorphic-layout-effect "^1.1.1" -use-sync-external-store@^1.2.0: +use-sync-external-store@1.2.0, use-sync-external-store@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/use-sync-external-store/-/use-sync-external-store-1.2.0.tgz#7dbefd6ef3fe4e767a0cf5d7287aacfb5846928a" integrity sha512-eEgnFxGQ1Ife9bzYs6VLi8/4X6CObHMw9Qr9tPY43iKwsPw8xE8+EFsf/2cFZ5S3esXgpWgtSCtLNS41F+sKPA== @@ -2458,3 +2458,10 @@ yocto-queue@^0.1.0: version "0.1.0" resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== + +zustand@^4.1.4: + version "4.1.4" + resolved "https://registry.yarnpkg.com/zustand/-/zustand-4.1.4.tgz#b0286da4cc9edd35e91c96414fa54bfa4652a54d" + integrity sha512-k2jVOlWo8p4R83mQ+/uyB8ILPO2PCJOf+QVjcL+1PbMCk1w5OoPYpAIxy9zd93FSfmJqoH6lGdwzzjwqJIRU5A== + dependencies: + use-sync-external-store "1.2.0" From 5acae615bb5188446262ae3edb67b5faf6fe5fe0 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 01:19:28 +0100 Subject: [PATCH 063/406] add state for autoupdate --- InvenTree/web/src/src/pages/Dashboard.tsx | 9 +++++---- InvenTree/web/src/src/states.tsx | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 4 deletions(-) create mode 100644 InvenTree/web/src/src/states.tsx diff --git a/InvenTree/web/src/src/pages/Dashboard.tsx b/InvenTree/web/src/src/pages/Dashboard.tsx index 5586d137a662..72c2e4f159a4 100644 --- a/InvenTree/web/src/src/pages/Dashboard.tsx +++ b/InvenTree/web/src/src/pages/Dashboard.tsx @@ -1,12 +1,13 @@ import { Group } from "@mantine/core"; import { SimpleGrid, Chip } from "@mantine/core"; -import { useState } from "react"; import { DashboardItem } from "./DashboardItem"; import { StylishText } from "../components/StylishText"; +import { useSessionSettings } from "../states"; export function Dashboard() { - const [checked, setChecked] = useState(false); + const autoupdate = useSessionSettings((state) => state.autoupdate) + const toffleAutoupdate = useSessionSettings((state) => state.toffleAutoupdate) const items = [ { id: "starred-parts", text: "Subscribed Parts", icon: "fa-bell", url: "part", params: { starred: true } }, @@ -31,8 +32,8 @@ export function Dashboard() { return (<> Dashboard - setChecked((v) => !v)}>Autoupdate + toffleAutoupdate()}>Autoupdate - {items.map((item) => )} + {items.map((item) => )} ); } diff --git a/InvenTree/web/src/src/states.tsx b/InvenTree/web/src/src/states.tsx new file mode 100644 index 000000000000..23bb0ad9b9b4 --- /dev/null +++ b/InvenTree/web/src/src/states.tsx @@ -0,0 +1,21 @@ +import create from 'zustand' +import { persist } from 'zustand/middleware' + +interface SesstionSettings { + autoupdate: boolean, + setAutoupdate: (autoupdate: boolean) => void, + toffleAutoupdate: () => void, +} + + +export const useSessionSettings = create( + persist((set) => ({ + autoupdate: false, + setAutoupdate: (value) => set({ autoupdate: value }), + toffleAutoupdate: () => set((state) => ({ autoupdate: !state.autoupdate })), + }), + { + name: 'session-settings' + } + ) +) From 1cd392e2b1b6c45179c29dcef2e7cfff8e005f6b Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 01:19:40 +0100 Subject: [PATCH 064/406] autoformat --- InvenTree/web/src/src/pages/Dashboard.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InvenTree/web/src/src/pages/Dashboard.tsx b/InvenTree/web/src/src/pages/Dashboard.tsx index 72c2e4f159a4..ef6f98fb1cf5 100644 --- a/InvenTree/web/src/src/pages/Dashboard.tsx +++ b/InvenTree/web/src/src/pages/Dashboard.tsx @@ -14,7 +14,7 @@ export function Dashboard() { { id: "starred-categories", text: "Subscribed Categories", icon: "fa-bell", url: "part/category", params: { starred: true } }, { id: "latest-parts", text: "Latest Parts", icon: "fa-newspaper", url: "part", params: { ordering: "-creation_date", limit: 10 } }, { id: "bom-validation", text: "BOM Waiting Validation", icon: "fa-times-circle", url: "part", params: { bom_valid: false } }, - { id: "recently-updated-stock", text: "Recently Updated", icon: "fa-clock", url: "stock", params: { part_detail: true, ordering: "-updated", limit:10 } }, + { id: "recently-updated-stock", text: "Recently Updated", icon: "fa-clock", url: "stock", params: { part_detail: true, ordering: "-updated", limit: 10 } }, { id: "low-stock", text: "Low Stock", icon: "fa-flag", url: "part", params: { low_stock: true } }, { id: "depleted-stock", text: "Depleted Stock", icon: "fa-times", url: "part", params: { depleted_stock: true } }, { id: "stock-to-build", text: "Required for Build Orders", icon: "fa-bullhorn", url: "part", params: { stock_to_build: true } }, @@ -34,6 +34,6 @@ export function Dashboard() { Dashboard toffleAutoupdate()}>Autoupdate
- {items.map((item) => )} + {items.map((item) => )} ); } From 302b8e54739d614f3b830514b121fd835fb99e3c Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 01:25:33 +0100 Subject: [PATCH 065/406] reduce functions --- InvenTree/web/src/src/pages/Dashboard.tsx | 4 ++-- InvenTree/web/src/src/states.tsx | 13 ++++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/InvenTree/web/src/src/pages/Dashboard.tsx b/InvenTree/web/src/src/pages/Dashboard.tsx index ef6f98fb1cf5..893e0df522f7 100644 --- a/InvenTree/web/src/src/pages/Dashboard.tsx +++ b/InvenTree/web/src/src/pages/Dashboard.tsx @@ -7,7 +7,7 @@ import { useSessionSettings } from "../states"; export function Dashboard() { const autoupdate = useSessionSettings((state) => state.autoupdate) - const toffleAutoupdate = useSessionSettings((state) => state.toffleAutoupdate) + const toggleAutoupdate = useSessionSettings((state) => state.toggleAutoupdate) const items = [ { id: "starred-parts", text: "Subscribed Parts", icon: "fa-bell", url: "part", params: { starred: true } }, @@ -32,7 +32,7 @@ export function Dashboard() { return (<> Dashboard - toffleAutoupdate()}>Autoupdate + toggleAutoupdate()}>Autoupdate {items.map((item) => )} ); diff --git a/InvenTree/web/src/src/states.tsx b/InvenTree/web/src/src/states.tsx index 23bb0ad9b9b4..7c1b64a51de0 100644 --- a/InvenTree/web/src/src/states.tsx +++ b/InvenTree/web/src/src/states.tsx @@ -3,17 +3,16 @@ import { persist } from 'zustand/middleware' interface SesstionSettings { autoupdate: boolean, - setAutoupdate: (autoupdate: boolean) => void, - toffleAutoupdate: () => void, + toggleAutoupdate: () => void, } export const useSessionSettings = create( - persist((set) => ({ - autoupdate: false, - setAutoupdate: (value) => set({ autoupdate: value }), - toffleAutoupdate: () => set((state) => ({ autoupdate: !state.autoupdate })), - }), + persist( + (set) => ({ + autoupdate: false, + toggleAutoupdate: () => set((state) => ({ autoupdate: !state.autoupdate })), + }), { name: 'session-settings' } From c1d2d0c8ddb92d5ec5cc6da28d4aadf356192362 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 02:57:09 +0100 Subject: [PATCH 066/406] move hosts to zustand --- InvenTree/web/src/src/App.tsx | 19 +++++++++++++++---- .../web/src/src/components/nav/HeaderTabs.tsx | 7 ++++--- InvenTree/web/src/src/contex/AuthContext.tsx | 6 ++---- InvenTree/web/src/src/pages/layout.tsx | 16 +++++++++------- InvenTree/web/src/src/states.tsx | 6 ++++++ 5 files changed, 36 insertions(+), 18 deletions(-) diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index 972427e5182e..d439fc73582e 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -46,10 +46,21 @@ const links = { ] } -export const hosts = [ - "https://demo.inventree.org", - "https://sample.app.invenhost.com", -]; +export interface HostProps { + host: string, + name: string, +} + +export interface HostList { + [key: string]: HostProps +} + + +export const hosts: HostList = { + "https://demo.inventree.org": {host: "https://demo.inventree.org/api/", name: "InvenTree Demo"}, + "https://sample.app.invenhost.com": {host: "https://sample.app.invenhost.com/api/", name: "InvenHost: Sample"}, + "http://localhost:8000": {host: "http://localhost:8000/api/", name: "Localhost"}, +}; const router = createBrowserRouter([ { diff --git a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx index 1fbac60c0fa5..c9a6e7f17a26 100644 --- a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx +++ b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx @@ -22,7 +22,8 @@ import { InvenTreeLogo } from '../InvenTreeLogo'; import { useNavigate, useParams } from 'react-router-dom'; import { useStyles } from '../../globalStyle'; import { Link } from 'react-router-dom'; -import { useAuth } from '../../contex/AuthContext'; +import { useSessionSettings } from '../../states'; +import {hosts} from '../../App'; interface HeaderTabsProps { user: { name: string; }; @@ -35,7 +36,7 @@ export function HeaderTabs({ user, tabs }: HeaderTabsProps) { const [userMenuOpened, setUserMenuOpened] = useState(false); const navigate = useNavigate(); const { tabValue } = useParams(); - const { host } = useAuth(); + const [hostKey] = useSessionSettings(state => [state.hostKey]); const items = tabs.map((tab) => ( @@ -47,7 +48,7 @@ export function HeaderTabs({ user, tabs }: HeaderTabsProps) {
- {host} + {hosts[hostKey].name} diff --git a/InvenTree/web/src/src/contex/AuthContext.tsx b/InvenTree/web/src/src/contex/AuthContext.tsx index 5f9b5a54b50e..2d8c5e91d322 100644 --- a/InvenTree/web/src/src/contex/AuthContext.tsx +++ b/InvenTree/web/src/src/contex/AuthContext.tsx @@ -4,6 +4,7 @@ import axios from "axios"; import { createContext, useContext } from "react"; import { Navigate } from "react-router-dom"; import { api } from "../App"; +import { useSessionSettings } from "../states"; export interface UserProps { name: string, email: string, username: string } @@ -14,7 +15,6 @@ export interface AuthContextProps { host: string, handleLogin: (username: string, password: string) => Promise, handleLogout: () => void, - setHost: (host: string) => void, } const AuthContext = createContext({} as AuthContextProps); @@ -35,8 +35,7 @@ export const ProtectedRoute = ({ children }: { children: JSX.Element }) => { export const AuthProvider = ({ children }: { children: JSX.Element }) => { const [token, setToken] = useLocalStorage({ key: 'token', defaultValue: '' }); - // TODO make host a user selectable option - const [host, setHost] = useLocalStorage({ key: 'host', defaultValue: '' }); + const [host] = useSessionSettings(state => [state.host]); function login(username: string, password: string) { return axios.get(`${host}user/token/`, { auth: { username, password } }) @@ -70,7 +69,6 @@ export const AuthProvider = ({ children }: { children: JSX.Element }) => { host, handleLogin, handleLogout, - setHost, }; return ( diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index 91aa12afb15c..5a921d33b708 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -7,8 +7,9 @@ import { useStyles } from "../globalStyle"; import { StylishText } from "../components/StylishText"; import { ProtectedRoute, useAuth, UserProps } from "../contex/AuthContext"; import { AuthenticationForm } from "../components/AuthenticationForm"; -import { useState } from "react"; import { hosts } from "../App"; +import { useSessionSettings } from "../states"; +import { useState } from "react"; export default function Layout({ user, tabs, links }: { user: UserProps, tabs: any, links: FooterSimpleProps }) { @@ -42,20 +43,21 @@ export function Part() { } export function Login() { - const { handleLogin, host, setHost } = useAuth(); + const { handleLogin } = useAuth(); const navigate = useNavigate(); const hostOptions = hosts; - const [hostname, setHostname] = useState((host === '') ? hostOptions[0] : host.replace('/api/', '')); + const [ hostKey, setHostValue ] = useSessionSettings(state => [state.hostKey, state.setHost]); function changeHost(newVal: string) { - setHost(`${newVal}/api/`); - setHostname(newVal); + console.log(newVal); + setHostValue(hostOptions[newVal].host, newVal); } + const hostname = (hostOptions[hostKey] === undefined) ? 'No selection' : hostOptions[hostKey].name; return (
- - {hostOptions.map((host) => ({host}))} + + {Object.keys(hostOptions).map((key, index) => ({hostOptions[key].name}))}
diff --git a/InvenTree/web/src/src/states.tsx b/InvenTree/web/src/src/states.tsx index 7c1b64a51de0..bdf574e12bc7 100644 --- a/InvenTree/web/src/src/states.tsx +++ b/InvenTree/web/src/src/states.tsx @@ -4,6 +4,9 @@ import { persist } from 'zustand/middleware' interface SesstionSettings { autoupdate: boolean, toggleAutoupdate: () => void, + host: string, + hostKey: string, + setHost: (newHost: string, newHostKey: string) => void, } @@ -12,6 +15,9 @@ export const useSessionSettings = create( (set) => ({ autoupdate: false, toggleAutoupdate: () => set((state) => ({ autoupdate: !state.autoupdate })), + host: '', + hostKey: '', + setHost: (newHost, newHostKey) => set({ host: newHost, hostKey: newHostKey }), }), { name: 'session-settings' From ef46836089191a1a221a14a454f421ea7f28f74d Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 03:13:45 +0100 Subject: [PATCH 067/406] move hostlist to zsutand Fixes #32 --- InvenTree/web/src/src/App.tsx | 26 +++++++++----------------- InvenTree/web/src/src/defaults.tsx | 7 +++++++ InvenTree/web/src/src/pages/layout.tsx | 6 +----- InvenTree/web/src/src/states.tsx | 13 +++++++++++++ 4 files changed, 30 insertions(+), 22 deletions(-) create mode 100644 InvenTree/web/src/src/defaults.tsx diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index d439fc73582e..efd5a4f9857b 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -6,7 +6,7 @@ import { } from "react-router-dom"; import ErrorPage from './pages/error'; import Layout, { Home, Part, Login, Logout } from './pages/layout'; -import { Profile } from "./pages/Profile"; +import { Profile } from './pages/Profile'; import { Dashboard } from "./pages/Dashboard"; import { QueryClient, @@ -14,6 +14,8 @@ import { } from '@tanstack/react-query' import axios from 'axios'; import { AuthProvider, UserProps } from './contex/AuthContext'; +import { useSessionSettings } from './states'; +import { defaultlist } from './defaults'; const user: UserProps = { name: "Matthias Mair", @@ -46,22 +48,6 @@ const links = { ] } -export interface HostProps { - host: string, - name: string, -} - -export interface HostList { - [key: string]: HostProps -} - - -export const hosts: HostList = { - "https://demo.inventree.org": {host: "https://demo.inventree.org/api/", name: "InvenTree Demo"}, - "https://sample.app.invenhost.com": {host: "https://sample.app.invenhost.com/api/", name: "InvenHost: Sample"}, - "http://localhost:8000": {host: "http://localhost:8000/api/", name: "Localhost"}, -}; - const router = createBrowserRouter([ { path: "/", @@ -101,6 +87,12 @@ export default function App() { const [colorScheme, setColorScheme] = useLocalStorage({ key: 'scheme', defaultValue: preferredColorScheme }); const toggleColorScheme = (value?: ColorScheme) => setColorScheme(value || (colorScheme === 'dark' ? 'light' : 'dark')); + const [hostList] = useSessionSettings(state => [state.hostList]); + if (Object.keys(hostList).length === 0) { + console.log('Laoding default host list'); + useSessionSettings.setState({hostList: defaultlist}); + } + return ( diff --git a/InvenTree/web/src/src/defaults.tsx b/InvenTree/web/src/src/defaults.tsx new file mode 100644 index 000000000000..11d43d560336 --- /dev/null +++ b/InvenTree/web/src/src/defaults.tsx @@ -0,0 +1,7 @@ +import { HostList } from './states'; + +export const defaultlist: HostList = { + "https://demo.inventree.org": { host: "https://demo.inventree.org/api/", name: "InvenTree Demo" }, + "https://sample.app.invenhost.com": { host: "https://sample.app.invenhost.com/api/", name: "InvenHost: Sample" }, + "http://localhost:8000": { host: "http://localhost:8000/api/", name: "Localhost" }, +}; diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index 5a921d33b708..f4572c1d711e 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -7,10 +7,7 @@ import { useStyles } from "../globalStyle"; import { StylishText } from "../components/StylishText"; import { ProtectedRoute, useAuth, UserProps } from "../contex/AuthContext"; import { AuthenticationForm } from "../components/AuthenticationForm"; -import { hosts } from "../App"; import { useSessionSettings } from "../states"; -import { useState } from "react"; - export default function Layout({ user, tabs, links }: { user: UserProps, tabs: any, links: FooterSimpleProps }) { const { classes } = useStyles(); @@ -45,8 +42,7 @@ export function Part() { export function Login() { const { handleLogin } = useAuth(); const navigate = useNavigate(); - const hostOptions = hosts; - const [ hostKey, setHostValue ] = useSessionSettings(state => [state.hostKey, state.setHost]); + const [ hostKey, setHostValue, hostOptions ] = useSessionSettings(state => [state.hostKey, state.setHost, state.hostList]); function changeHost(newVal: string) { console.log(newVal); setHostValue(hostOptions[newVal].host, newVal); diff --git a/InvenTree/web/src/src/states.tsx b/InvenTree/web/src/src/states.tsx index bdf574e12bc7..b169cd0f4cbc 100644 --- a/InvenTree/web/src/src/states.tsx +++ b/InvenTree/web/src/src/states.tsx @@ -1,11 +1,23 @@ import create from 'zustand' import { persist } from 'zustand/middleware' +// helpers +export interface HostProps { + host: string, + name: string, +} + +export interface HostList { + [key: string]: HostProps +} + +// states interface SesstionSettings { autoupdate: boolean, toggleAutoupdate: () => void, host: string, hostKey: string, + hostList: HostList, setHost: (newHost: string, newHostKey: string) => void, } @@ -17,6 +29,7 @@ export const useSessionSettings = create( toggleAutoupdate: () => set((state) => ({ autoupdate: !state.autoupdate })), host: '', hostKey: '', + hostList: {}, setHost: (newHost, newHostKey) => set({ host: newHost, hostKey: newHostKey }), }), { From 44c6b7121c180b3aa15b0166156e7db1770bdf7c Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 03:14:10 +0100 Subject: [PATCH 068/406] move defaults into seperate file --- InvenTree/web/src/src/App.tsx | 25 +------------------------ InvenTree/web/src/src/defaults.tsx | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index efd5a4f9857b..5514f7d8b6c5 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -15,7 +15,7 @@ import { import axios from 'axios'; import { AuthProvider, UserProps } from './contex/AuthContext'; import { useSessionSettings } from './states'; -import { defaultlist } from './defaults'; +import { defaultlist, tabs, links } from './defaults'; const user: UserProps = { name: "Matthias Mair", @@ -25,29 +25,6 @@ const user: UserProps = { export const api = axios.create({}); -// Static Settings -const tabs = [ - { text: "Home", name: "home" }, - { text: "Part", name: "part" }, -] - -const links = { - links: [ - { - "link": "https://inventree.org/", - "label": "Website" - }, - { - "link": "https://github.com/invenhost/InvenTree", - "label": "GitHub" - }, - { - "link": "https://demo.inventree.org/", - "label": "Demo" - } - ] -} - const router = createBrowserRouter([ { path: "/", diff --git a/InvenTree/web/src/src/defaults.tsx b/InvenTree/web/src/src/defaults.tsx index 11d43d560336..f74a9cc6921c 100644 --- a/InvenTree/web/src/src/defaults.tsx +++ b/InvenTree/web/src/src/defaults.tsx @@ -5,3 +5,26 @@ export const defaultlist: HostList = { "https://sample.app.invenhost.com": { host: "https://sample.app.invenhost.com/api/", name: "InvenHost: Sample" }, "http://localhost:8000": { host: "http://localhost:8000/api/", name: "Localhost" }, }; + +// Static Settings +export const tabs = [ + { text: "Home", name: "home" }, + { text: "Part", name: "part" }, +]; + +export const links = { + links: [ + { + "link": "https://inventree.org/", + "label": "Website" + }, + { + "link": "https://github.com/invenhost/InvenTree", + "label": "GitHub" + }, + { + "link": "https://demo.inventree.org/", + "label": "Demo" + } + ] +}; From 2f8d2647a8dd0834aa83e9c06cb92acc1099c8e4 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 03:14:24 +0100 Subject: [PATCH 069/406] fix reference to host --- InvenTree/web/src/src/components/nav/HeaderTabs.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx index c9a6e7f17a26..621a3687e45c 100644 --- a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx +++ b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx @@ -23,7 +23,6 @@ import { useNavigate, useParams } from 'react-router-dom'; import { useStyles } from '../../globalStyle'; import { Link } from 'react-router-dom'; import { useSessionSettings } from '../../states'; -import {hosts} from '../../App'; interface HeaderTabsProps { user: { name: string; }; @@ -36,7 +35,7 @@ export function HeaderTabs({ user, tabs }: HeaderTabsProps) { const [userMenuOpened, setUserMenuOpened] = useState(false); const navigate = useNavigate(); const { tabValue } = useParams(); - const [hostKey] = useSessionSettings(state => [state.hostKey]); + const [hostKey, hostList] = useSessionSettings(state => [state.hostKey, state.hostList]); const items = tabs.map((tab) => ( @@ -48,7 +47,7 @@ export function HeaderTabs({ user, tabs }: HeaderTabsProps) {
- {hosts[hostKey].name} + {hostList[hostKey].name} From bbbc1df4c580de401f6a1b9909b6e566a44ec667 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 03:15:16 +0100 Subject: [PATCH 070/406] rename default list --- InvenTree/web/src/src/App.tsx | 4 ++-- InvenTree/web/src/src/defaults.tsx | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index 5514f7d8b6c5..c4327ca55819 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -15,7 +15,7 @@ import { import axios from 'axios'; import { AuthProvider, UserProps } from './contex/AuthContext'; import { useSessionSettings } from './states'; -import { defaultlist, tabs, links } from './defaults'; +import { defaultHostList, tabs, links } from './defaults'; const user: UserProps = { name: "Matthias Mair", @@ -67,7 +67,7 @@ export default function App() { const [hostList] = useSessionSettings(state => [state.hostList]); if (Object.keys(hostList).length === 0) { console.log('Laoding default host list'); - useSessionSettings.setState({hostList: defaultlist}); + useSessionSettings.setState({hostList: defaultHostList}); } return ( diff --git a/InvenTree/web/src/src/defaults.tsx b/InvenTree/web/src/src/defaults.tsx index f74a9cc6921c..35fe351562bd 100644 --- a/InvenTree/web/src/src/defaults.tsx +++ b/InvenTree/web/src/src/defaults.tsx @@ -1,6 +1,6 @@ import { HostList } from './states'; -export const defaultlist: HostList = { +export const defaultHostList: HostList = { "https://demo.inventree.org": { host: "https://demo.inventree.org/api/", name: "InvenTree Demo" }, "https://sample.app.invenhost.com": { host: "https://sample.app.invenhost.com/api/", name: "InvenHost: Sample" }, "http://localhost:8000": { host: "http://localhost:8000/api/", name: "Localhost" }, From 3aba46111e3bead4041f1b7169d903efcd0f8f07 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 03:15:31 +0100 Subject: [PATCH 071/406] refactor --- InvenTree/web/src/src/App.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index c4327ca55819..06c83de091df 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -24,6 +24,7 @@ const user: UserProps = { }; export const api = axios.create({}); +export const queryClient = new QueryClient() const router = createBrowserRouter([ { @@ -56,8 +57,6 @@ const router = createBrowserRouter([ } ]); -export const queryClient = new QueryClient() - // Main App export default function App() { const preferredColorScheme = useColorScheme(); From 302e9687b901801e70bf352a351ea51e116c8deb Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 03:29:28 +0100 Subject: [PATCH 072/406] move user state --- InvenTree/web/src/src/App.tsx | 10 ++----- .../web/src/src/components/nav/HeaderTabs.tsx | 10 +++---- InvenTree/web/src/src/contex/AuthContext.tsx | 4 --- InvenTree/web/src/src/pages/layout.tsx | 6 ++-- InvenTree/web/src/src/states.tsx | 29 ++++++++++++++++++- 5 files changed, 37 insertions(+), 22 deletions(-) diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index 06c83de091df..4b93d3353a9a 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -13,23 +13,17 @@ import { QueryClientProvider, } from '@tanstack/react-query' import axios from 'axios'; -import { AuthProvider, UserProps } from './contex/AuthContext'; +import { AuthProvider } from './contex/AuthContext'; import { useSessionSettings } from './states'; import { defaultHostList, tabs, links } from './defaults'; -const user: UserProps = { - name: "Matthias Mair", - email: "code@mjmair.com", - username: "mjmair", -}; - export const api = axios.create({}); export const queryClient = new QueryClient() const router = createBrowserRouter([ { path: "/", - element: , + element: , errorElement: , children: [ { index: true, element: }, diff --git a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx index 621a3687e45c..aa3fddcb654f 100644 --- a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx +++ b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx @@ -22,20 +22,20 @@ import { InvenTreeLogo } from '../InvenTreeLogo'; import { useNavigate, useParams } from 'react-router-dom'; import { useStyles } from '../../globalStyle'; import { Link } from 'react-router-dom'; -import { useSessionSettings } from '../../states'; +import { useSessionSettings, useUserState } from '../../states'; interface HeaderTabsProps { - user: { name: string; }; tabs: { name: string; text: string; }[]; } -export function HeaderTabs({ user, tabs }: HeaderTabsProps) { +export function HeaderTabs({tabs }: HeaderTabsProps) { const { classes, theme, cx } = useStyles(); const [opened, { toggle }] = useDisclosure(false); const [userMenuOpened, setUserMenuOpened] = useState(false); const navigate = useNavigate(); const { tabValue } = useParams(); const [hostKey, hostList] = useSessionSettings(state => [state.hostKey, state.hostList]); + const [username] = useUserState(state => [state.name]); const items = tabs.map((tab) => ( @@ -63,9 +63,7 @@ export function HeaderTabs({ user, tabs }: HeaderTabsProps) { className={cx(classes.user, { [classes.userActive]: userMenuOpened })} > - - {user.name} - + {username} diff --git a/InvenTree/web/src/src/contex/AuthContext.tsx b/InvenTree/web/src/src/contex/AuthContext.tsx index 2d8c5e91d322..b49b41ed0b66 100644 --- a/InvenTree/web/src/src/contex/AuthContext.tsx +++ b/InvenTree/web/src/src/contex/AuthContext.tsx @@ -6,10 +6,6 @@ import { Navigate } from "react-router-dom"; import { api } from "../App"; import { useSessionSettings } from "../states"; -export interface UserProps { name: string, email: string, username: string } - -export interface DefaultProps { user: UserProps, host: string } - export interface AuthContextProps { token: string, host: string, diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index f4572c1d711e..6cbea75e1671 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -5,17 +5,17 @@ import { Center, Chip, Container, Flex, Space, Stack } from "@mantine/core"; import { FooterSimple, FooterSimpleProps } from "../components/nav/FooterSimple"; import { useStyles } from "../globalStyle"; import { StylishText } from "../components/StylishText"; -import { ProtectedRoute, useAuth, UserProps } from "../contex/AuthContext"; +import { ProtectedRoute, useAuth } from "../contex/AuthContext"; import { AuthenticationForm } from "../components/AuthenticationForm"; import { useSessionSettings } from "../states"; -export default function Layout({ user, tabs, links }: { user: UserProps, tabs: any, links: FooterSimpleProps }) { +export default function Layout({tabs, links }: {tabs: any, links: FooterSimpleProps }) { const { classes } = useStyles(); return ( - + diff --git a/InvenTree/web/src/src/states.tsx b/InvenTree/web/src/src/states.tsx index b169cd0f4cbc..4f8b1328041e 100644 --- a/InvenTree/web/src/src/states.tsx +++ b/InvenTree/web/src/src/states.tsx @@ -2,6 +2,7 @@ import create from 'zustand' import { persist } from 'zustand/middleware' // helpers + export interface HostProps { host: string, name: string, @@ -11,7 +12,19 @@ export interface HostList { [key: string]: HostProps } -// states +export interface UserProps { + name: string, + email: string, + username: string +} + +const user = { + name: "Matthias Mair", + email: "code@mjmair.com", + username: "mjmair", +}; + +// States interface SesstionSettings { autoupdate: boolean, toggleAutoupdate: () => void, @@ -37,3 +50,17 @@ export const useSessionSettings = create( } ) ) + +interface UserStateProps { + name: string, + email: string, + username: string, + setUser: (newUser: UserProps) => void, +} + +export const useUserState = create((set) => ({ + name: user.name, + email: user.email, + username: user.username, + setUser: (newUser: UserProps) => set({ name: newUser.name, email: newUser.email, username: newUser.username }), +})) From d863be9378bd783aab712e8daf1509c758005fc6 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 03:29:39 +0100 Subject: [PATCH 073/406] cleanup --- InvenTree/web/src/src/App.tsx | 6 ++++-- InvenTree/web/src/src/states.tsx | 11 ++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index 4b93d3353a9a..3a475d5cb889 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -51,18 +51,20 @@ const router = createBrowserRouter([ } ]); -// Main App export default function App() { + // Color Scheme const preferredColorScheme = useColorScheme(); const [colorScheme, setColorScheme] = useLocalStorage({ key: 'scheme', defaultValue: preferredColorScheme }); const toggleColorScheme = (value?: ColorScheme) => setColorScheme(value || (colorScheme === 'dark' ? 'light' : 'dark')); + // Session initialization const [hostList] = useSessionSettings(state => [state.hostList]); if (Object.keys(hostList).length === 0) { console.log('Laoding default host list'); - useSessionSettings.setState({hostList: defaultHostList}); + useSessionSettings.setState({ hostList: defaultHostList }); } + // Main App component return ( diff --git a/InvenTree/web/src/src/states.tsx b/InvenTree/web/src/src/states.tsx index 4f8b1328041e..89c47ce44fed 100644 --- a/InvenTree/web/src/src/states.tsx +++ b/InvenTree/web/src/src/states.tsx @@ -2,14 +2,11 @@ import create from 'zustand' import { persist } from 'zustand/middleware' // helpers - -export interface HostProps { - host: string, - name: string, -} - export interface HostList { - [key: string]: HostProps + [key: string]: { + host: string, + name: string, + } } export interface UserProps { From bb871e79179bb6b6f2034592878535a235d2b0a5 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 18:32:49 +0100 Subject: [PATCH 074/406] make state more general --- .../web/src/src/components/nav/HeaderTabs.tsx | 4 ++-- InvenTree/web/src/src/states.tsx | 14 +++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx index aa3fddcb654f..401833499226 100644 --- a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx +++ b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx @@ -22,7 +22,7 @@ import { InvenTreeLogo } from '../InvenTreeLogo'; import { useNavigate, useParams } from 'react-router-dom'; import { useStyles } from '../../globalStyle'; import { Link } from 'react-router-dom'; -import { useSessionSettings, useUserState } from '../../states'; +import { useSessionSettings, useApiState } from '../../states'; interface HeaderTabsProps { tabs: { name: string; text: string; }[]; @@ -35,7 +35,7 @@ export function HeaderTabs({tabs }: HeaderTabsProps) { const navigate = useNavigate(); const { tabValue } = useParams(); const [hostKey, hostList] = useSessionSettings(state => [state.hostKey, state.hostList]); - const [username] = useUserState(state => [state.name]); + const [username] = useApiState(state => [state.user.name]); const items = tabs.map((tab) => ( diff --git a/InvenTree/web/src/src/states.tsx b/InvenTree/web/src/src/states.tsx index 89c47ce44fed..1fb9f0bc33bb 100644 --- a/InvenTree/web/src/src/states.tsx +++ b/InvenTree/web/src/src/states.tsx @@ -48,16 +48,12 @@ export const useSessionSettings = create( ) ) -interface UserStateProps { - name: string, - email: string, - username: string, +interface ApiStateProps { + user: UserProps, setUser: (newUser: UserProps) => void, } -export const useUserState = create((set) => ({ - name: user.name, - email: user.email, - username: user.username, - setUser: (newUser: UserProps) => set({ name: newUser.name, email: newUser.email, username: newUser.username }), +export const useApiState = create((set) => ({ + user: user, + setUser: (newUser: UserProps) => set({ user: newUser }), })) From 97b6d7f2bb38778e888cd7a463185bc190d2c977 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 19:10:15 +0100 Subject: [PATCH 075/406] make call simpler --- InvenTree/web/src/src/pages/Dashboard.tsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/InvenTree/web/src/src/pages/Dashboard.tsx b/InvenTree/web/src/src/pages/Dashboard.tsx index 893e0df522f7..4253b5b6a9d2 100644 --- a/InvenTree/web/src/src/pages/Dashboard.tsx +++ b/InvenTree/web/src/src/pages/Dashboard.tsx @@ -6,8 +6,7 @@ import { useSessionSettings } from "../states"; export function Dashboard() { - const autoupdate = useSessionSettings((state) => state.autoupdate) - const toggleAutoupdate = useSessionSettings((state) => state.toggleAutoupdate) + const [autoupdate, toggleAutoupdate] = useSessionSettings((state) => [state.autoupdate, state.toggleAutoupdate]); const items = [ { id: "starred-parts", text: "Subscribed Parts", icon: "fa-bell", url: "part", params: { starred: true } }, From fdd94dd7022bb941b451f884f089caa5bc56c769 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 21:09:09 +0100 Subject: [PATCH 076/406] clean up auth --- .../src/src/components/AuthenticationForm.tsx | 17 ++++---------- InvenTree/web/src/src/contex/AuthContext.tsx | 23 ++++++------------- InvenTree/web/src/src/pages/layout.tsx | 19 +++++++++++---- InvenTree/web/src/src/states.tsx | 12 ++++++++++ 4 files changed, 39 insertions(+), 32 deletions(-) diff --git a/InvenTree/web/src/src/components/AuthenticationForm.tsx b/InvenTree/web/src/src/components/AuthenticationForm.tsx index 3390256d8595..350a784a2828 100644 --- a/InvenTree/web/src/src/components/AuthenticationForm.tsx +++ b/InvenTree/web/src/src/components/AuthenticationForm.tsx @@ -8,17 +8,16 @@ import { Group, Button, Divider, - Checkbox, Anchor, Stack, Center, } from '@mantine/core'; -export function AuthenticationForm({ handleLogin, navigate, hostname }: { handleLogin: any, navigate: any, hostname: string }) { +export function AuthenticationForm({ Login, Register, hostname, lastUsername }: { Login: (username: string, password: string) => void, Register: (name: string, username: string, password: string) => void, hostname: string, lastUsername: string }) { const [action, toggleAction] = useToggle(['login', 'register']); const form = useForm({ initialValues: { - email: '', + email: lastUsername, name: '', password: '', terms: false, @@ -26,7 +25,9 @@ export function AuthenticationForm({ handleLogin, navigate, hostname }: { handle }); const submit = () => { if (action === 'login') { - handleLogin({ form: form.values, type: action, navigate: navigate }); + Login(form.values.email, form.values.password); + } else { + Register(form.values.name, form.values.email, form.values.password); } }; @@ -63,14 +64,6 @@ export function AuthenticationForm({ handleLogin, navigate, hostname }: { handle onChange={(event) => form.setFieldValue('password', event.currentTarget.value)} error={form.errors.password && 'Password should include at least 6 characters'} /> - - {action === 'register' && ( - form.setFieldValue('terms', event.currentTarget.checked)} - /> - )} diff --git a/InvenTree/web/src/src/contex/AuthContext.tsx b/InvenTree/web/src/src/contex/AuthContext.tsx index b49b41ed0b66..9adc050988e5 100644 --- a/InvenTree/web/src/src/contex/AuthContext.tsx +++ b/InvenTree/web/src/src/contex/AuthContext.tsx @@ -4,7 +4,7 @@ import axios from "axios"; import { createContext, useContext } from "react"; import { Navigate } from "react-router-dom"; import { api } from "../App"; -import { useSessionSettings } from "../states"; +import { useSessionSettings, useSessionState } from "../states"; export interface AuthContextProps { token: string, @@ -20,7 +20,7 @@ export const useAuth = () => { }; export const ProtectedRoute = ({ children }: { children: JSX.Element }) => { - const { token } = useAuth(); + const [token] = useSessionState(state => [state.token]); if (!token) { return ; @@ -30,29 +30,20 @@ export const ProtectedRoute = ({ children }: { children: JSX.Element }) => { }; export const AuthProvider = ({ children }: { children: JSX.Element }) => { - const [token, setToken] = useLocalStorage({ key: 'token', defaultValue: '' }); + const [token, setToken] = useSessionState(state => [state.token, state.setToken]); const [host] = useSessionSettings(state => [state.host]); - function login(username: string, password: string) { - return axios.get(`${host}user/token/`, { auth: { username, password } }) - .then((response) => response.data.token) - .catch((error) => { console.log(error); }); - } - // TODO add types - const handleLogin = async (props: any) => { + const handleLogin = async (username: string, password: string) => { // Get token from server - const form = props.form; - const navigate = props.navigate; - const token = await login(form.email, form.password); + const token = await axios.get(`${host}user/token/`, { auth: { username, password } }) + .then((response) => response.data.token) + .catch((error) => { console.log(error); }); // Set token in context setToken(token); api.defaults.baseURL = host; api.defaults.headers.common['Authorization'] = `Token ${token}`; - - // Navigate to home page - navigate('/'); } const handleLogout = () => { diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index 6cbea75e1671..546b41dcb5b8 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -42,21 +42,32 @@ export function Part() { export function Login() { const { handleLogin } = useAuth(); const navigate = useNavigate(); - const [ hostKey, setHostValue, hostOptions ] = useSessionSettings(state => [state.hostKey, state.setHost, state.hostList]); + const [ hostKey, setHostValue, hostOptions, lastUsername ] = useSessionSettings(state => [state.hostKey, state.setHost, state.hostList, state.lastUsername]); function changeHost(newVal: string) { - console.log(newVal); setHostValue(hostOptions[newVal].host, newVal); } const hostname = (hostOptions[hostKey] === undefined) ? 'No selection' : hostOptions[hostKey].name; + function Login(username: string, password: string,) { + handleLogin(username, password).then(() => { + useSessionSettings.setState({ lastUsername: username }); + navigate('/'); + }); + } + function Register(name: string, username: string, password: string) { + // TODO: Register + console.log('Registering is not implemented yet'); + console.log(name, username, password); + } + return (
- {Object.keys(hostOptions).map((key, index) => ({hostOptions[key].name}))} + {Object.keys(hostOptions).map((key) => ({hostOptions[key].name}))}
- +
); } diff --git a/InvenTree/web/src/src/states.tsx b/InvenTree/web/src/src/states.tsx index 1fb9f0bc33bb..b67e4f09ef4a 100644 --- a/InvenTree/web/src/src/states.tsx +++ b/InvenTree/web/src/src/states.tsx @@ -29,6 +29,7 @@ interface SesstionSettings { hostKey: string, hostList: HostList, setHost: (newHost: string, newHostKey: string) => void, + lastUsername: string, } @@ -41,6 +42,7 @@ export const useSessionSettings = create( hostKey: '', hostList: {}, setHost: (newHost, newHostKey) => set({ host: newHost, hostKey: newHostKey }), + lastUsername: '', }), { name: 'session-settings' @@ -57,3 +59,13 @@ export const useApiState = create((set) => ({ user: user, setUser: (newUser: UserProps) => set({ user: newUser }), })) + +interface SessionStateProps { + token: string, + setToken: (newToken: string) => void, +} + +export const useSessionState = create((set) => ({ + token: '', + setToken: (newToken: string) => set({ token: newToken }), +})) From e6dd1a72794f4cd72be7c5142241be50b3a0b7c5 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 21:16:10 +0100 Subject: [PATCH 077/406] make session state permanent --- InvenTree/web/src/src/states.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/InvenTree/web/src/src/states.tsx b/InvenTree/web/src/src/states.tsx index b67e4f09ef4a..ff11b58429bb 100644 --- a/InvenTree/web/src/src/states.tsx +++ b/InvenTree/web/src/src/states.tsx @@ -65,7 +65,15 @@ interface SessionStateProps { setToken: (newToken: string) => void, } -export const useSessionState = create((set) => ({ - token: '', - setToken: (newToken: string) => set({ token: newToken }), -})) +export const useSessionState = create()( + persist( + (set) => ({ + token: '', + setToken: (newToken) => set({ token: newToken }), + }), + { + name: 'session-state', + getStorage: () => sessionStorage, + } + ) +) From aa9aa528c3dec53cdcd861495672c56accffbf96 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 21:19:44 +0100 Subject: [PATCH 078/406] formatting fix --- InvenTree/web/src/src/states.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InvenTree/web/src/src/states.tsx b/InvenTree/web/src/src/states.tsx index ff11b58429bb..b4611150020b 100644 --- a/InvenTree/web/src/src/states.tsx +++ b/InvenTree/web/src/src/states.tsx @@ -3,7 +3,7 @@ import { persist } from 'zustand/middleware' // helpers export interface HostList { - [key: string]: { + [key: string]: { host: string, name: string, } @@ -33,7 +33,7 @@ interface SesstionSettings { } -export const useSessionSettings = create( +export const useSessionSettings = create()( persist( (set) => ({ autoupdate: false, From 349c07438cfc226602b27027e0e2a9bcc9ee392f Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 21:54:30 +0100 Subject: [PATCH 079/406] add api inti function --- InvenTree/web/src/src/App.tsx | 13 +++++++++++-- InvenTree/web/src/src/contex/AuthContext.tsx | 6 ++---- InvenTree/web/src/src/states.tsx | 6 +++++- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index 3a475d5cb889..07e72717607e 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -14,16 +14,24 @@ import { } from '@tanstack/react-query' import axios from 'axios'; import { AuthProvider } from './contex/AuthContext'; -import { useSessionSettings } from './states'; +import { useSessionSettings, useSessionState } from './states'; import { defaultHostList, tabs, links } from './defaults'; export const api = axios.create({}); +export function setApiDefaults() { + const [host] = useSessionSettings(state => [state.host]); + const [token] = useSessionState(state => [state.token]); + + api.defaults.baseURL = host; + api.defaults.headers.common['Authorization'] = `Token ${token}`; +} + export const queryClient = new QueryClient() const router = createBrowserRouter([ { path: "/", - element: , + element: , errorElement: , children: [ { index: true, element: }, @@ -63,6 +71,7 @@ export default function App() { console.log('Laoding default host list'); useSessionSettings.setState({ hostList: defaultHostList }); } + setApiDefaults(); // Main App component return ( diff --git a/InvenTree/web/src/src/contex/AuthContext.tsx b/InvenTree/web/src/src/contex/AuthContext.tsx index 9adc050988e5..edd28baf3278 100644 --- a/InvenTree/web/src/src/contex/AuthContext.tsx +++ b/InvenTree/web/src/src/contex/AuthContext.tsx @@ -1,9 +1,8 @@ -import { useLocalStorage } from "@mantine/hooks"; import axios from "axios"; import { createContext, useContext } from "react"; import { Navigate } from "react-router-dom"; -import { api } from "../App"; +import { setApiDefaults } from "../App"; import { useSessionSettings, useSessionState } from "../states"; export interface AuthContextProps { @@ -42,8 +41,7 @@ export const AuthProvider = ({ children }: { children: JSX.Element }) => { // Set token in context setToken(token); - api.defaults.baseURL = host; - api.defaults.headers.common['Authorization'] = `Token ${token}`; + setApiDefaults(); } const handleLogout = () => { diff --git a/InvenTree/web/src/src/states.tsx b/InvenTree/web/src/src/states.tsx index b4611150020b..496c6124e598 100644 --- a/InvenTree/web/src/src/states.tsx +++ b/InvenTree/web/src/src/states.tsx @@ -1,5 +1,6 @@ import create from 'zustand' import { persist } from 'zustand/middleware' +import { setApiDefaults } from './App' // helpers export interface HostList { @@ -69,7 +70,10 @@ export const useSessionState = create()( persist( (set) => ({ token: '', - setToken: (newToken) => set({ token: newToken }), + setToken: (newToken) => { + set({ token: newToken }); + setApiDefaults(); + }, }), { name: 'session-state', From f97ad7ac584091b1e7dcaef1f8ce24fde5892e7f Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 22:00:58 +0100 Subject: [PATCH 080/406] add server state --- InvenTree/web/src/src/states.tsx | 33 ++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/InvenTree/web/src/src/states.tsx b/InvenTree/web/src/src/states.tsx index 496c6124e598..abd20fb8176c 100644 --- a/InvenTree/web/src/src/states.tsx +++ b/InvenTree/web/src/src/states.tsx @@ -22,6 +22,35 @@ const user = { username: "mjmair", }; + +export interface ServerAPIProps { + server: null | string; + version: null | string; + instance: null | string; + apiVersion: null | number; + worker_running: null | boolean; + worker_pending_tasks: null | number; + plugins_enabled: null | boolean; + active_plugins: PluginProps[]; +} + +export interface PluginProps { + name: string; + slug: string; + version: null | string; +} + +const emptyServerAPI: ServerAPIProps = { + server: null, + version: null, + instance: null, + apiVersion: null, + worker_running: null, + worker_pending_tasks: null, + plugins_enabled: null, + active_plugins: [], +}; + // States interface SesstionSettings { autoupdate: boolean, @@ -54,11 +83,15 @@ export const useSessionSettings = create()( interface ApiStateProps { user: UserProps, setUser: (newUser: UserProps) => void, + server: ServerAPIProps, + setServer: (newServer: ServerAPIProps) => void, } export const useApiState = create((set) => ({ user: user, setUser: (newUser: UserProps) => set({ user: newUser }), + server: emptyServerAPI, + setServer: (newServer: ServerAPIProps) => set({ server: newServer }), })) interface SessionStateProps { From b64181ff147b55b40cdf4e6c8f1dbfe3aea59087 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 22:01:18 +0100 Subject: [PATCH 081/406] use getter instead of hook --- InvenTree/web/src/src/App.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index 07e72717607e..d48ade50c1fd 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -19,8 +19,8 @@ import { defaultHostList, tabs, links } from './defaults'; export const api = axios.create({}); export function setApiDefaults() { - const [host] = useSessionSettings(state => [state.host]); - const [token] = useSessionState(state => [state.token]); + const host = useSessionSettings.getState().host; + const token = useSessionState.getState().token; api.defaults.baseURL = host; api.defaults.headers.common['Authorization'] = `Token ${token}`; From 70cd859955e2db40e44d94edd4848443f466f70b Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 22:10:04 +0100 Subject: [PATCH 082/406] add sentry again Fixes #21 --- InvenTree/web/src/package.json | 4 +- InvenTree/web/src/src/App.tsx | 13 +++++- InvenTree/web/src/yarn.lock | 72 +++++++++++++++++----------------- 3 files changed, 50 insertions(+), 39 deletions(-) diff --git a/InvenTree/web/src/package.json b/InvenTree/web/src/package.json index a8eb8ddc84fa..4415b7d22f20 100644 --- a/InvenTree/web/src/package.json +++ b/InvenTree/web/src/package.json @@ -19,8 +19,8 @@ "@mantine/modals": "^5.7.1", "@mantine/notifications": "^5.7.1", "@mantine/rte": "^5.7.1", - "@sentry/react": "^7.19.0", - "@sentry/tracing": "^7.19.0", + "@sentry/react": "^7.20.1", + "@sentry/tracing": "^7.20.1", "@tanstack/react-query": "^4.16.1", "@types/react-router-dom": "^5.3.3", "axios": "^1.1.3", diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index d48ade50c1fd..e3b1719fa6d5 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -16,7 +16,17 @@ import axios from 'axios'; import { AuthProvider } from './contex/AuthContext'; import { useSessionSettings, useSessionState } from './states'; import { defaultHostList, tabs, links } from './defaults'; +import * as Sentry from "@sentry/react"; +import { BrowserTracing } from "@sentry/tracing"; +// Error tracking +Sentry.init({ + dsn: "https://84f0c3ea90c64e5092e2bf5dfe325725@o1047628.ingest.sentry.io/4504160008273920", + integrations: [new BrowserTracing()], + tracesSampleRate: 1.0, +}); + +// API export const api = axios.create({}); export function setApiDefaults() { const host = useSessionSettings.getState().host; @@ -25,9 +35,9 @@ export function setApiDefaults() { api.defaults.baseURL = host; api.defaults.headers.common['Authorization'] = `Token ${token}`; } - export const queryClient = new QueryClient() +// Routes const router = createBrowserRouter([ { path: "/", @@ -59,6 +69,7 @@ const router = createBrowserRouter([ } ]); +// Main App export default function App() { // Color Scheme const preferredColorScheme = useColorScheme(); diff --git a/InvenTree/web/src/yarn.lock b/InvenTree/web/src/yarn.lock index c511441cc67e..d93a65b748a6 100644 --- a/InvenTree/web/src/yarn.lock +++ b/InvenTree/web/src/yarn.lock @@ -639,57 +639,57 @@ resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.0.3.tgz#953b88c20ea00d0eddaffdc1b115c08474aa295d" integrity sha512-ceuyTSs7PZ/tQqi19YZNBc5X7kj1f8p+4DIyrcIYFY9h+hd1OKm4RqtiWldR9eGEvIiJfsqwM4BsuCtRIuEw6Q== -"@sentry/browser@7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.19.0.tgz#ce21544b843d5c4d5dcb9fe9b7ee31c5c4e91f42" - integrity sha512-dWi5VjEwiLb4ofata0UCLdTbXLD1uDUebe9rNSBkHZ3fHF4eap4ZJlu3dYePKB0CKZhZrjzbydimMhaMUNdnug== +"@sentry/browser@7.20.1": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-7.20.1.tgz#bce606db24fa02fb72e71187e510ff890f8be903" + integrity sha512-SE6mI4LkMzjEi5KB02Py24e2bKYZc/HZI/ZlTn36BuUQX/KYhzzKwzXucOJ5Qws9Ar9CViyKJDb07LxVQLYCGw== dependencies: - "@sentry/core" "7.19.0" - "@sentry/types" "7.19.0" - "@sentry/utils" "7.19.0" + "@sentry/core" "7.20.1" + "@sentry/types" "7.20.1" + "@sentry/utils" "7.20.1" tslib "^1.9.3" -"@sentry/core@7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.19.0.tgz#74e0eaf4b9f42bb0290f4b3f3b0ea3e272dd693e" - integrity sha512-YF9cTBcAnO4R44092BJi5Wa2/EO02xn2ziCtmNgAVTN2LD31a/YVGxGBt/FDr4Y6yeuVehaqijVVvtpSmXrGJw== +"@sentry/core@7.20.1": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@sentry/core/-/core-7.20.1.tgz#b06f36dddba96e2cc7dfa2d24cb72ff39ecd7a59" + integrity sha512-Sc7vtNgO4QcE683qrR+b+KFQkkhvQv7gizN46QQPOWeqLDrai7x0+NspTFDLJyvdDuDh2rjoLfRwNsgbwe7Erw== dependencies: - "@sentry/types" "7.19.0" - "@sentry/utils" "7.19.0" + "@sentry/types" "7.20.1" + "@sentry/utils" "7.20.1" tslib "^1.9.3" -"@sentry/react@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.19.0.tgz#de2599b27023fe24f508b34b00929ff6c19bfb23" - integrity sha512-ooF1TwdgkHkUo7u9Bx+kab51gpVNUW7b+5A2krfhk/Fx2eY8z5VilzUzHCRq2jbTE9yJTpfRL3KlEXROs0AUvg== +"@sentry/react@^7.20.1": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@sentry/react/-/react-7.20.1.tgz#8daef21da5706f5ce68147c555aa19dc12f8b2cf" + integrity sha512-5oTRFVkfOe8t7dQtN6oi6WZVFE9iBZKgYcLTaPTCg/5yl5RehitHDxXQRCmv8h1XWF9t3AAopf6rMR/tSdOI1A== dependencies: - "@sentry/browser" "7.19.0" - "@sentry/types" "7.19.0" - "@sentry/utils" "7.19.0" + "@sentry/browser" "7.20.1" + "@sentry/types" "7.20.1" + "@sentry/utils" "7.20.1" hoist-non-react-statics "^3.3.2" tslib "^1.9.3" -"@sentry/tracing@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.19.0.tgz#d69ecea2c0b53d113c5100fc52d0a0acc5c8a129" - integrity sha512-SWY17M3TsgBePaGowUcSqBwaT0TJQzuNexVnLojuU0k6F57L9hubvP9zaoosoCfARXQ/3NypAFWnlJyf570rFQ== +"@sentry/tracing@^7.20.1": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.20.1.tgz#7bb44ec7b00ec1623d2ab2d95f2016e9ee119493" + integrity sha512-LAiQcJMcOFkUwkGvqLghcVOtVVglHBQ2r7kRo75kqI0OTn/xMPRyPBGo94G+9zAKm+w7dGF5AUqq/4VUm7DJ+g== dependencies: - "@sentry/core" "7.19.0" - "@sentry/types" "7.19.0" - "@sentry/utils" "7.19.0" + "@sentry/core" "7.20.1" + "@sentry/types" "7.20.1" + "@sentry/utils" "7.20.1" tslib "^1.9.3" -"@sentry/types@7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.19.0.tgz#3ebb96670399b637a945fa499fa7436f7b930147" - integrity sha512-oGRAT6lfzoKrxO1mvxiSj0XHxWPd6Gd1wpPGuu6iJo03xgWDS+MIlD1h2unqL4N5fAzLjzmbC2D2lUw50Kn2pA== +"@sentry/types@7.20.1": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@sentry/types/-/types-7.20.1.tgz#26c6fc94dd25a66aeabbd795fa8985d768190970" + integrity sha512-bI4t5IXGLIQYH5MegKRl4x2LDSlPVbQJ5eE6NJCMrCm8PcFUo3WgkwP6toG9ThQwpTx/DhUo1sVNKrr0oW4cpA== -"@sentry/utils@7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.19.0.tgz#0e039fe57056074c3a5e47bd50d9cb4ac9a6e909" - integrity sha512-2L6lq+c9Ol2uiRxQDdcgoapmHJp24MhMN0gIkn2alSfMJ+ls6bGXzQHx6JAIdoOiwFQXRZHKL9ecfAc8O+vItA== +"@sentry/utils@7.20.1": + version "7.20.1" + resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.20.1.tgz#01b881b82598fca5c04af771ffe44663b66dee6f" + integrity sha512-wToW0710OijQLUZnbbOx1pxwJ4mXUZ5ZFl4/x7ubNftkOz5NwJ+F3ylRqHXpZJaR9pUfR5CNdInTFZn05h/KeQ== dependencies: - "@sentry/types" "7.19.0" + "@sentry/types" "7.20.1" tslib "^1.9.3" "@tabler/icons@^1.68.0": From 655ee5e66db6740096fed8d3db205bdb0baa0d7b Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 22:58:38 +0100 Subject: [PATCH 083/406] move default out --- InvenTree/web/src/src/defaults.tsx | 6 ++++++ InvenTree/web/src/src/states.tsx | 10 ++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/InvenTree/web/src/src/defaults.tsx b/InvenTree/web/src/src/defaults.tsx index 35fe351562bd..94a2b5dea6e4 100644 --- a/InvenTree/web/src/src/defaults.tsx +++ b/InvenTree/web/src/src/defaults.tsx @@ -28,3 +28,9 @@ export const links = { } ] }; + +export const defaultUser = { + name: "Matthias Mair", + email: "code@mjmair.com", + username: "mjmair", +}; diff --git a/InvenTree/web/src/src/states.tsx b/InvenTree/web/src/src/states.tsx index abd20fb8176c..53edb5803523 100644 --- a/InvenTree/web/src/src/states.tsx +++ b/InvenTree/web/src/src/states.tsx @@ -1,6 +1,7 @@ import create from 'zustand' import { persist } from 'zustand/middleware' import { setApiDefaults } from './App' +import { defaultUser } from './defaults' // helpers export interface HostList { @@ -16,13 +17,6 @@ export interface UserProps { username: string } -const user = { - name: "Matthias Mair", - email: "code@mjmair.com", - username: "mjmair", -}; - - export interface ServerAPIProps { server: null | string; version: null | string; @@ -88,7 +82,7 @@ interface ApiStateProps { } export const useApiState = create((set) => ({ - user: user, + user: defaultUser, setUser: (newUser: UserProps) => set({ user: newUser }), server: emptyServerAPI, setServer: (newServer: ServerAPIProps) => set({ server: newServer }), From 00e2da58c57a757a7867c4bfa5b5966eb345cf2c Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Mon, 21 Nov 2022 23:37:46 +0100 Subject: [PATCH 084/406] Add state for server settings --- InvenTree/web/src/src/App.tsx | 24 ++++++++++++++++++- .../web/src/src/components/nav/HeaderTabs.tsx | 4 ++-- InvenTree/web/src/src/pages/layout.tsx | 2 ++ 3 files changed, 27 insertions(+), 3 deletions(-) diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index e3b1719fa6d5..c3242a5b67ad 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -14,10 +14,11 @@ import { } from '@tanstack/react-query' import axios from 'axios'; import { AuthProvider } from './contex/AuthContext'; -import { useSessionSettings, useSessionState } from './states'; +import { useApiState, UserProps, useSessionSettings, useSessionState } from './states'; import { defaultHostList, tabs, links } from './defaults'; import * as Sentry from "@sentry/react"; import { BrowserTracing } from "@sentry/tracing"; +import { useState } from 'react'; // Error tracking Sentry.init({ @@ -37,6 +38,21 @@ export function setApiDefaults() { } export const queryClient = new QueryClient() +// States +export async function fetchSession() { + // Fetch user data + await api.get('/user/me/').then((response) => { + const user: UserProps = { + name: `${response.data.first_name} ${response.data.last_name}`, + email: response.data.email, + username: response.data.username, + }; + useApiState.getState().setUser(user); + }); + // Fetch server data + await api.get('/').then((response) => {useApiState.getState().setServer(response.data)}); +} + // Routes const router = createBrowserRouter([ { @@ -83,6 +99,12 @@ export default function App() { useSessionSettings.setState({ hostList: defaultHostList }); } setApiDefaults(); + const [fetchedSession, setFetchedSession] = useState(false); + const [token] = useSessionState.getState().token; + if (token && !fetchedSession) { + setFetchedSession(true); + fetchSession(); + } // Main App component return ( diff --git a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx index 401833499226..05975c2c91fb 100644 --- a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx +++ b/InvenTree/web/src/src/components/nav/HeaderTabs.tsx @@ -35,7 +35,7 @@ export function HeaderTabs({tabs }: HeaderTabsProps) { const navigate = useNavigate(); const { tabValue } = useParams(); const [hostKey, hostList] = useSessionSettings(state => [state.hostKey, state.hostList]); - const [username] = useApiState(state => [state.user.name]); + const [username, servername] = useApiState(state => [state.user.name, state.server.instance]); const items = tabs.map((tab) => ( @@ -47,7 +47,7 @@ export function HeaderTabs({tabs }: HeaderTabsProps) {
- {hostList[hostKey].name} + {hostList[hostKey].name}|{servername} diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index 546b41dcb5b8..7d2f08840d54 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -8,6 +8,7 @@ import { StylishText } from "../components/StylishText"; import { ProtectedRoute, useAuth } from "../contex/AuthContext"; import { AuthenticationForm } from "../components/AuthenticationForm"; import { useSessionSettings } from "../states"; +import { fetchSession } from "../App"; export default function Layout({tabs, links }: {tabs: any, links: FooterSimpleProps }) { const { classes } = useStyles(); @@ -53,6 +54,7 @@ export function Login() { useSessionSettings.setState({ lastUsername: username }); navigate('/'); }); + fetchSession(); } function Register(name: string, username: string, password: string) { // TODO: Register From d7cad65b1711ad6341d44a16369903ede6147b29 Mon Sep 17 00:00:00 2001 From: Matthias Mair Date: Tue, 22 Nov 2022 00:10:05 +0100 Subject: [PATCH 085/406] refactor files --- InvenTree/web/src/src/App.tsx | 23 ++-- .../DashboardItemProxy.tsx} | 6 +- .../components/{ => items}/ColorToggle.tsx | 0 .../DashboardItem.tsx} | 4 +- .../components/{ => items}/InvenTreeLogo.tsx | 2 +- .../components/{ => items}/StylishText.tsx | 2 +- .../nav/{FooterSimple.tsx => Footer.tsx} | 6 +- .../nav/{HeaderTabs.tsx => Header.tsx} | 13 ++- InvenTree/web/src/src/contex/ApiState.tsx | 18 +++ InvenTree/web/src/src/contex/AuthContext.tsx | 5 +- InvenTree/web/src/src/contex/LocalState.tsx | 30 +++++ InvenTree/web/src/src/contex/SessionState.tsx | 25 ++++ InvenTree/web/src/src/contex/states.tsx | 30 +++++ InvenTree/web/src/src/defaults.tsx | 13 ++- .../src/pages/{error.jsx => ErrorPage.jsx} | 1 - .../src/src/pages/{ => Index}/Dashboard.tsx | 10 +- InvenTree/web/src/src/pages/Index/Home.tsx | 9 ++ InvenTree/web/src/src/pages/Index/Part.tsx | 9 ++ .../web/src/src/pages/{ => Index}/Profile.tsx | 6 +- InvenTree/web/src/src/pages/Login.tsx | 41 +++++++ InvenTree/web/src/src/pages/Logout.tsx | 13 +++ InvenTree/web/src/src/pages/layout.tsx | 79 ++----------- InvenTree/web/src/src/states.tsx | 110 ------------------ 23 files changed, 238 insertions(+), 217 deletions(-) rename InvenTree/web/src/src/{pages/DashboardItem.tsx => components/DashboardItemProxy.tsx} (69%) rename InvenTree/web/src/src/components/{ => items}/ColorToggle.tsx (100%) rename InvenTree/web/src/src/components/{StatElement.tsx => items/DashboardItem.tsx} (79%) rename InvenTree/web/src/src/components/{ => items}/InvenTreeLogo.tsx (82%) rename InvenTree/web/src/src/components/{ => items}/StylishText.tsx (86%) rename InvenTree/web/src/src/components/nav/{FooterSimple.tsx => Footer.tsx} (75%) rename InvenTree/web/src/src/components/nav/{HeaderTabs.tsx => Header.tsx} (89%) create mode 100644 InvenTree/web/src/src/contex/ApiState.tsx create mode 100644 InvenTree/web/src/src/contex/LocalState.tsx create mode 100644 InvenTree/web/src/src/contex/SessionState.tsx create mode 100644 InvenTree/web/src/src/contex/states.tsx rename InvenTree/web/src/src/pages/{error.jsx => ErrorPage.jsx} (93%) rename InvenTree/web/src/src/pages/{ => Index}/Dashboard.tsx (87%) create mode 100644 InvenTree/web/src/src/pages/Index/Home.tsx create mode 100644 InvenTree/web/src/src/pages/Index/Part.tsx rename InvenTree/web/src/src/pages/{ => Index}/Profile.tsx (95%) create mode 100644 InvenTree/web/src/src/pages/Login.tsx create mode 100644 InvenTree/web/src/src/pages/Logout.tsx delete mode 100644 InvenTree/web/src/src/states.tsx diff --git a/InvenTree/web/src/src/App.tsx b/InvenTree/web/src/src/App.tsx index c3242a5b67ad..a1f8925317aa 100644 --- a/InvenTree/web/src/src/App.tsx +++ b/InvenTree/web/src/src/App.tsx @@ -4,17 +4,24 @@ import { createBrowserRouter, RouterProvider, } from "react-router-dom"; -import ErrorPage from './pages/error'; -import Layout, { Home, Part, Login, Logout } from './pages/layout'; -import { Profile } from './pages/Profile'; -import { Dashboard } from "./pages/Dashboard"; +import ErrorPage from './pages/ErrorPage'; +import Layout from './pages/Layout'; +import { Logout } from "./pages/Logout"; +import { Login } from "./pages/Login"; +import { Part } from "./pages/Index/Part"; +import { Home } from "./pages/Index/Home"; +import { Profile } from './pages/Index/Profile'; +import { Dashboard } from "./pages/Index/Dashboard"; import { QueryClient, QueryClientProvider, } from '@tanstack/react-query' import axios from 'axios'; import { AuthProvider } from './contex/AuthContext'; -import { useApiState, UserProps, useSessionSettings, useSessionState } from './states'; +import { UserProps } from './contex/states'; +import { useLocalState } from "./contex/LocalState"; +import { useSessionState } from "./contex/SessionState"; +import { useApiState } from "./contex/ApiState"; import { defaultHostList, tabs, links } from './defaults'; import * as Sentry from "@sentry/react"; import { BrowserTracing } from "@sentry/tracing"; @@ -30,7 +37,7 @@ Sentry.init({ // API export const api = axios.create({}); export function setApiDefaults() { - const host = useSessionSettings.getState().host; + const host = useLocalState.getState().host; const token = useSessionState.getState().token; api.defaults.baseURL = host; @@ -93,10 +100,10 @@ export default function App() { const toggleColorScheme = (value?: ColorScheme) => setColorScheme(value || (colorScheme === 'dark' ? 'light' : 'dark')); // Session initialization - const [hostList] = useSessionSettings(state => [state.hostList]); + const [hostList] = useLocalState(state => [state.hostList]); if (Object.keys(hostList).length === 0) { console.log('Laoding default host list'); - useSessionSettings.setState({ hostList: defaultHostList }); + useLocalState.setState({ hostList: defaultHostList }); } setApiDefaults(); const [fetchedSession, setFetchedSession] = useState(false); diff --git a/InvenTree/web/src/src/pages/DashboardItem.tsx b/InvenTree/web/src/src/components/DashboardItemProxy.tsx similarity index 69% rename from InvenTree/web/src/src/pages/DashboardItem.tsx rename to InvenTree/web/src/src/components/DashboardItemProxy.tsx index a065c3725867..4e83f71f5ef0 100644 --- a/InvenTree/web/src/src/pages/DashboardItem.tsx +++ b/InvenTree/web/src/src/components/DashboardItemProxy.tsx @@ -1,9 +1,9 @@ import { useQuery } from '@tanstack/react-query'; import { api } from "../App"; -import { StatElement } from "../components/StatElement"; +import { StatisticItem } from "./items/DashboardItem"; import { useEffect, useState } from "react"; -export function DashboardItem({ id, text, url, params, autoupdate=true }: { id: string; text: string; url: string; params: any; autoupdate: boolean }) { +export function DashboardItemProxy({ id, text, url, params, autoupdate=true }: { id: string; text: string; url: string; params: any; autoupdate: boolean }) { function fetchData() { return api.get(`${url}/?search=&offset=0&limit=25`, { params: params }).then((res) => res.data); } @@ -15,6 +15,6 @@ export function DashboardItem({ id, text, url, params, autoupdate=true }: { id: if (error) return <>An error has occurred: {error}; return (
- +
); } diff --git a/InvenTree/web/src/src/components/ColorToggle.tsx b/InvenTree/web/src/src/components/items/ColorToggle.tsx similarity index 100% rename from InvenTree/web/src/src/components/ColorToggle.tsx rename to InvenTree/web/src/src/components/items/ColorToggle.tsx diff --git a/InvenTree/web/src/src/components/StatElement.tsx b/InvenTree/web/src/src/components/items/DashboardItem.tsx similarity index 79% rename from InvenTree/web/src/src/components/StatElement.tsx rename to InvenTree/web/src/src/components/items/DashboardItem.tsx index 09acc394f8b4..08a0d0e3d28f 100644 --- a/InvenTree/web/src/src/components/StatElement.tsx +++ b/InvenTree/web/src/src/components/items/DashboardItem.tsx @@ -12,9 +12,9 @@ const useStyles = createStyles((theme) => ({ }, })); -export interface StatElementProps {title: string; value: string;} +export interface StatisticItemProps {title: string; value: string;} -export function StatElement({ id, data, isLoading }: {id: string, data: StatElementProps, isLoading: boolean}) { +export function StatisticItem({ id, data, isLoading }: {id: string, data: StatisticItemProps, isLoading: boolean}) { const { classes } = useStyles(); return ( diff --git a/InvenTree/web/src/src/components/InvenTreeLogo.tsx b/InvenTree/web/src/src/components/items/InvenTreeLogo.tsx similarity index 82% rename from InvenTree/web/src/src/components/InvenTreeLogo.tsx rename to InvenTree/web/src/src/components/items/InvenTreeLogo.tsx index 365c483073ae..0808ed4de4db 100644 --- a/InvenTree/web/src/src/components/InvenTreeLogo.tsx +++ b/InvenTree/web/src/src/components/items/InvenTreeLogo.tsx @@ -1,6 +1,6 @@ import { ActionIcon } from '@mantine/core'; import { NavLink } from 'react-router-dom'; -import InvenTreeIcon from '../assets/inventree.svg'; +import InvenTreeIcon from '../../assets/inventree.svg'; export function InvenTreeLogo() { diff --git a/InvenTree/web/src/src/components/StylishText.tsx b/InvenTree/web/src/src/components/items/StylishText.tsx similarity index 86% rename from InvenTree/web/src/src/components/StylishText.tsx rename to InvenTree/web/src/src/components/items/StylishText.tsx index a265ea63889a..0f0ebf225698 100644 --- a/InvenTree/web/src/src/components/StylishText.tsx +++ b/InvenTree/web/src/src/components/items/StylishText.tsx @@ -1,5 +1,5 @@ import { Text } from "@mantine/core"; -import { useStyles } from "../globalStyle"; +import { useStyles } from "../../globalStyle"; export function StylishText({children}: {children: any }) { const { classes } = useStyles(); diff --git a/InvenTree/web/src/src/components/nav/FooterSimple.tsx b/InvenTree/web/src/src/components/nav/Footer.tsx similarity index 75% rename from InvenTree/web/src/src/components/nav/FooterSimple.tsx rename to InvenTree/web/src/src/components/nav/Footer.tsx index 012a8079a7ae..1d48ec799fcf 100644 --- a/InvenTree/web/src/src/components/nav/FooterSimple.tsx +++ b/InvenTree/web/src/src/components/nav/Footer.tsx @@ -1,11 +1,11 @@ -import { InvenTreeLogo } from "../InvenTreeLogo"; +import { InvenTreeLogo } from "../items/InvenTreeLogo"; import { Container, Group, Anchor } from '@mantine/core'; import { useStyles } from "../../globalStyle"; -export interface FooterSimpleProps { links: { link: string; label: string }[] } +export interface FooterProps { links: { link: string; label: string }[] } -export function FooterSimple({ links }: FooterSimpleProps) { +export function Footer({ links }: FooterProps) { const { classes } = useStyles(); const items = links.map((link) => ( diff --git a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx b/InvenTree/web/src/src/components/nav/Header.tsx similarity index 89% rename from InvenTree/web/src/src/components/nav/HeaderTabs.tsx rename to InvenTree/web/src/src/components/nav/Header.tsx index 05975c2c91fb..1771c3a21774 100644 --- a/InvenTree/web/src/src/components/nav/HeaderTabs.tsx +++ b/InvenTree/web/src/src/components/nav/Header.tsx @@ -17,24 +17,25 @@ import { IconDashboard, IconUserCircle, } from '@tabler/icons'; -import { ColorToggle } from '../ColorToggle'; -import { InvenTreeLogo } from '../InvenTreeLogo'; +import { ColorToggle } from '../items/ColorToggle'; +import { InvenTreeLogo } from '../items/InvenTreeLogo'; import { useNavigate, useParams } from 'react-router-dom'; import { useStyles } from '../../globalStyle'; import { Link } from 'react-router-dom'; -import { useSessionSettings, useApiState } from '../../states'; +import { useLocalState } from "../../contex/LocalState"; +import { useApiState } from "../../contex/ApiState"; -interface HeaderTabsProps { +interface HeaderProps { tabs: { name: string; text: string; }[]; } -export function HeaderTabs({tabs }: HeaderTabsProps) { +export function Header({tabs }: HeaderProps) { const { classes, theme, cx } = useStyles(); const [opened, { toggle }] = useDisclosure(false); const [userMenuOpened, setUserMenuOpened] = useState(false); const navigate = useNavigate(); const { tabValue } = useParams(); - const [hostKey, hostList] = useSessionSettings(state => [state.hostKey, state.hostList]); + const [hostKey, hostList] = useLocalState(state => [state.hostKey, state.hostList]); const [username, servername] = useApiState(state => [state.user.name, state.server.instance]); const items = tabs.map((tab) => ( diff --git a/InvenTree/web/src/src/contex/ApiState.tsx b/InvenTree/web/src/src/contex/ApiState.tsx new file mode 100644 index 000000000000..49142d5be23a --- /dev/null +++ b/InvenTree/web/src/src/contex/ApiState.tsx @@ -0,0 +1,18 @@ +import create from 'zustand'; +import { defaultUser, emptyServerAPI } from '../defaults'; +import { UserProps, ServerAPIProps } from './states'; + + +interface ApiStateProps { + user: UserProps, + setUser: (newUser: UserProps) => void, + server: ServerAPIProps, + setServer: (newServer: ServerAPIProps) => void, +} + +export const useApiState = create((set) => ({ + user: defaultUser, + setUser: (newUser: UserProps) => set({ user: newUser }), + server: emptyServerAPI, + setServer: (newServer: ServerAPIProps) => set({ server: newServer }), +})); diff --git a/InvenTree/web/src/src/contex/AuthContext.tsx b/InvenTree/web/src/src/contex/AuthContext.tsx index edd28baf3278..dbf089f61d4d 100644 --- a/InvenTree/web/src/src/contex/AuthContext.tsx +++ b/InvenTree/web/src/src/contex/AuthContext.tsx @@ -3,7 +3,8 @@ import axios from "axios"; import { createContext, useContext } from "react"; import { Navigate } from "react-router-dom"; import { setApiDefaults } from "../App"; -import { useSessionSettings, useSessionState } from "../states"; +import { useLocalState } from "./LocalState"; +import { useSessionState } from "./ApiState"; export interface AuthContextProps { token: string, @@ -30,7 +31,7 @@ export const ProtectedRoute = ({ children }: { children: JSX.Element }) => { export const AuthProvider = ({ children }: { children: JSX.Element }) => { const [token, setToken] = useSessionState(state => [state.token, state.setToken]); - const [host] = useSessionSettings(state => [state.host]); + const [host] = useLocalState(state => [state.host]); // TODO add types const handleLogin = async (username: string, password: string) => { diff --git a/InvenTree/web/src/src/contex/LocalState.tsx b/InvenTree/web/src/src/contex/LocalState.tsx new file mode 100644 index 000000000000..a8324118c9f8 --- /dev/null +++ b/InvenTree/web/src/src/contex/LocalState.tsx @@ -0,0 +1,30 @@ +import create from 'zustand'; +import { persist } from 'zustand/middleware'; +import { HostList } from './states'; + +interface LocalStateProps { + autoupdate: boolean; + toggleAutoupdate: () => void; + host: string; + hostKey: string; + hostList: HostList; + setHost: (newHost: string, newHostKey: string) => void; + lastUsername: string; +} + +export const useLocalState = create()( + persist( + (set) => ({ + autoupdate: false, + toggleAutoupdate: () => set((state) => ({ autoupdate: !state.autoupdate })), + host: '', + hostKey: '', + hostList: {}, + setHost: (newHost, newHostKey) => set({ host: newHost, hostKey: newHostKey }), + lastUsername: '', + }), + { + name: 'session-settings' + } + ) +); diff --git a/InvenTree/web/src/src/contex/SessionState.tsx b/InvenTree/web/src/src/contex/SessionState.tsx new file mode 100644 index 000000000000..b5da74dd597b --- /dev/null +++ b/InvenTree/web/src/src/contex/SessionState.tsx @@ -0,0 +1,25 @@ +import create from 'zustand'; +import { persist } from 'zustand/middleware'; +import { setApiDefaults } from '../App'; + + +interface SessionStateProps { + token: string, + setToken: (newToken: string) => void, +} + +export const useSessionState = create()( + persist( + (set) => ({ + token: '', + setToken: (newToken) => { + set({ token: newToken }); + setApiDefaults(); + }, + }), + { + name: 'session-state', + getStorage: () => sessionStorage, + } + ) +); diff --git a/InvenTree/web/src/src/contex/states.tsx b/InvenTree/web/src/src/contex/states.tsx new file mode 100644 index 000000000000..b6533ba79028 --- /dev/null +++ b/InvenTree/web/src/src/contex/states.tsx @@ -0,0 +1,30 @@ + +export interface HostList { + [key: string]: { + host: string, + name: string, + } +} + +export interface UserProps { + name: string, + email: string, + username: string +} + +export interface ServerAPIProps { + server: null | string; + version: null | string; + instance: null | string; + apiVersion: null | number; + worker_running: null | boolean; + worker_pending_tasks: null | number; + plugins_enabled: null | boolean; + active_plugins: PluginProps[]; +} + +export interface PluginProps { + name: string; + slug: string; + version: null | string; +} diff --git a/InvenTree/web/src/src/defaults.tsx b/InvenTree/web/src/src/defaults.tsx index 94a2b5dea6e4..4a7e41dd3c7a 100644 --- a/InvenTree/web/src/src/defaults.tsx +++ b/InvenTree/web/src/src/defaults.tsx @@ -1,4 +1,4 @@ -import { HostList } from './states'; +import { HostList } from './contex/states'; export const defaultHostList: HostList = { "https://demo.inventree.org": { host: "https://demo.inventree.org/api/", name: "InvenTree Demo" }, @@ -34,3 +34,14 @@ export const defaultUser = { email: "code@mjmair.com", username: "mjmair", }; + +export const emptyServerAPI = { + server: null, + version: null, + instance: null, + apiVersion: null, + worker_running: null, + worker_pending_tasks: null, + plugins_enabled: null, + active_plugins: [], +}; diff --git a/InvenTree/web/src/src/pages/error.jsx b/InvenTree/web/src/src/pages/ErrorPage.jsx similarity index 93% rename from InvenTree/web/src/src/pages/error.jsx rename to InvenTree/web/src/src/pages/ErrorPage.jsx index 7a5fe129db01..ca07e2566729 100644 --- a/InvenTree/web/src/src/pages/error.jsx +++ b/InvenTree/web/src/src/pages/ErrorPage.jsx @@ -2,7 +2,6 @@ import { useRouteError } from "react-router-dom"; export default function ErrorPage() { const error = useRouteError(); - console.error(error); return (
diff --git a/InvenTree/web/src/src/pages/Dashboard.tsx b/InvenTree/web/src/src/pages/Index/Dashboard.tsx similarity index 87% rename from InvenTree/web/src/src/pages/Dashboard.tsx rename to InvenTree/web/src/src/pages/Index/Dashboard.tsx index 4253b5b6a9d2..a20c4f92bd92 100644 --- a/InvenTree/web/src/src/pages/Dashboard.tsx +++ b/InvenTree/web/src/src/pages/Index/Dashboard.tsx @@ -1,12 +1,12 @@ import { Group } from "@mantine/core"; import { SimpleGrid, Chip } from "@mantine/core"; -import { DashboardItem } from "./DashboardItem"; -import { StylishText } from "../components/StylishText"; -import { useSessionSettings } from "../states"; +import { DashboardItemProxy } from "../../components/DashboardItemProxy"; +import { StylishText } from "../../components/items/StylishText"; +import { useLocalState } from "../../contex/LocalState"; export function Dashboard() { - const [autoupdate, toggleAutoupdate] = useSessionSettings((state) => [state.autoupdate, state.toggleAutoupdate]); + const [autoupdate, toggleAutoupdate] = useLocalState((state) => [state.autoupdate, state.toggleAutoupdate]); const items = [ { id: "starred-parts", text: "Subscribed Parts", icon: "fa-bell", url: "part", params: { starred: true } }, @@ -33,6 +33,6 @@ export function Dashboard() { Dashboard toggleAutoupdate()}>Autoupdate - {items.map((item) => )} + {items.map((item) => )} ); } diff --git a/InvenTree/web/src/src/pages/Index/Home.tsx b/InvenTree/web/src/src/pages/Index/Home.tsx new file mode 100644 index 000000000000..6dbaefe69f86 --- /dev/null +++ b/InvenTree/web/src/src/pages/Index/Home.tsx @@ -0,0 +1,9 @@ +import { StylishText } from "../../components/items/StylishText"; + + +export function Home() { + + return (<> + Home + ); +} diff --git a/InvenTree/web/src/src/pages/Index/Part.tsx b/InvenTree/web/src/src/pages/Index/Part.tsx new file mode 100644 index 000000000000..68c16cbe69e8 --- /dev/null +++ b/InvenTree/web/src/src/pages/Index/Part.tsx @@ -0,0 +1,9 @@ +import { StylishText } from "../../components/items/StylishText"; + + +export function Part() { + + return (<> + Part + ); +} diff --git a/InvenTree/web/src/src/pages/Profile.tsx b/InvenTree/web/src/src/pages/Index/Profile.tsx similarity index 95% rename from InvenTree/web/src/src/pages/Profile.tsx rename to InvenTree/web/src/src/pages/Index/Profile.tsx index 94195468f01d..3e7628d41382 100644 --- a/InvenTree/web/src/src/pages/Profile.tsx +++ b/InvenTree/web/src/src/pages/Index/Profile.tsx @@ -1,12 +1,12 @@ import { ActionIcon, Button, Container, Grid, Group, SimpleGrid, Skeleton, Tabs, Text, TextInput } from "@mantine/core"; import { useForm } from "@mantine/form"; import { useNavigate, useParams } from "react-router-dom"; -import { StylishText } from "../components/StylishText"; -import { useStyles } from "../globalStyle"; +import { StylishText } from "../../components/items/StylishText"; +import { useStyles } from "../../globalStyle"; import { useToggle } from "@mantine/hooks"; import { IconEdit, IconDeviceFloppy } from '@tabler/icons'; import { useQuery } from "@tanstack/react-query"; -import { api, queryClient } from "../App"; +import { api, queryClient } from "../../App"; export function Profile() { diff --git a/InvenTree/web/src/src/pages/Login.tsx b/InvenTree/web/src/src/pages/Login.tsx new file mode 100644 index 000000000000..794df45739bf --- /dev/null +++ b/InvenTree/web/src/src/pages/Login.tsx @@ -0,0 +1,41 @@ +import { useNavigate } from "react-router-dom"; +import { Center, Chip, Container, Stack } from "@mantine/core"; +import { useAuth } from "../contex/AuthContext"; +import { AuthenticationForm } from "../components/AuthenticationForm"; +import { useLocalState } from "../contex/LocalState"; +import { fetchSession } from "../App"; + + +export function Login() { + const { handleLogin } = useAuth(); + const navigate = useNavigate(); + const [hostKey, setHostValue, hostOptions, lastUsername] = useLocalState(state => [state.hostKey, state.setHost, state.hostList, state.lastUsername]); + function changeHost(newVal: string) { + setHostValue(hostOptions[newVal].host, newVal); + } + const hostname = (hostOptions[hostKey] === undefined) ? 'No selection' : hostOptions[hostKey].name; + + function Login(username: string, password: string) { + handleLogin(username, password).then(() => { + useLocalState.setState({ lastUsername: username }); + navigate('/'); + }); + fetchSession(); + } + function Register(name: string, username: string, password: string) { + // TODO: Register + console.log('Registering is not implemented yet'); + console.log(name, username, password); + } + + return (
+ +
+ + {Object.keys(hostOptions).map((key) => ({hostOptions[key].name}))} + +
+ +
+
); +} diff --git a/InvenTree/web/src/src/pages/Logout.tsx b/InvenTree/web/src/src/pages/Logout.tsx new file mode 100644 index 000000000000..3e3f11e9f9d9 --- /dev/null +++ b/InvenTree/web/src/src/pages/Logout.tsx @@ -0,0 +1,13 @@ +import { useNavigate } from "react-router-dom"; +import { useAuth } from "../contex/AuthContext"; + + +export function Logout() { + const { handleLogout } = useAuth(); + const navigate = useNavigate(); + + handleLogout(); + navigate('/'); + + return (<>); +} diff --git a/InvenTree/web/src/src/pages/layout.tsx b/InvenTree/web/src/src/pages/layout.tsx index 7d2f08840d54..15ed4158c9c6 100644 --- a/InvenTree/web/src/src/pages/layout.tsx +++ b/InvenTree/web/src/src/pages/layout.tsx @@ -1,85 +1,22 @@ -import { Outlet, useNavigate } from "react-router-dom"; -import { HeaderTabs } from "../components/nav/HeaderTabs"; -import { Center, Chip, Container, Flex, Space, Stack } from "@mantine/core"; +import { Outlet } from "react-router-dom"; +import { Header } from "../components/nav/Header"; +import { Container, Flex, Space } from "@mantine/core"; -import { FooterSimple, FooterSimpleProps } from "../components/nav/FooterSimple"; +import { Footer, FooterProps } from "../components/nav/Footer"; import { useStyles } from "../globalStyle"; -import { StylishText } from "../components/StylishText"; -import { ProtectedRoute, useAuth } from "../contex/AuthContext"; -import { AuthenticationForm } from "../components/AuthenticationForm"; -import { useSessionSettings } from "../states"; -import { fetchSession } from "../App"; +import { ProtectedRoute } from "../contex/AuthContext"; -export default function Layout({tabs, links }: {tabs: any, links: FooterSimpleProps }) { +export default function Layout({tabs, links }: {tabs: any, links: FooterProps }) { const { classes } = useStyles(); return ( - +
- +