From 905b58a318755b35901aab3a16984e2016079a3e Mon Sep 17 00:00:00 2001 From: OlehMaliuta <104268973+OlehMaliuta@users.noreply.github.com> Date: Sat, 19 Aug 2023 21:30:20 +0300 Subject: [PATCH] changed language of the client app --- client-app/.eslintrc.cjs | 18 + client-app/README.md | 27 + client-app/index.html | 4 +- client-app/package-lock.json | 18720 ++-------------- client-app/package.json | 24 +- client-app/src/{App.jsx => App.tsx} | 2 +- .../src/components/Accordion/Accordion.jsx | 52 - .../src/components/Accordion/Accordion.tsx | 70 + .../{AdminLayout.jsx => AdminLayout.tsx} | 24 +- .../CustomCheckbox/CustomCheckbox.jsx | 41 - .../CustomCheckbox/CustomCheckbox.tsx | 52 + ...{CustomTextarea.jsx => CustomTextarea.tsx} | 26 +- .../InputBox/{InputBox.jsx => InputBox.tsx} | 24 +- ...{ItemsContainer.jsx => ItemsContainer.tsx} | 13 +- ...dingAnimation.jsx => LoadingAnimation.tsx} | 9 +- .../{ModalWindow.jsx => ModalWindow.tsx} | 8 +- .../{ObjectSection.jsx => ObjectSection.tsx} | 80 +- .../src/components/PropertyRecord/.module.css | 18 +- ...{PropertyRecord.jsx => PropertyRecord.tsx} | 71 +- ...eOrCancelForm.jsx => SaveOrCancelForm.tsx} | 11 +- .../{ScrollDiv.jsx => ScrollDiv.tsx} | 20 +- client-app/src/components/Space/Space.jsx | 12 - client-app/src/components/Space/Space.tsx | 15 + .../Switch/{Switch.jsx => Switch.tsx} | 12 +- .../{TableHeader.jsx => TableHeader.tsx} | 28 +- client-app/src/main.jsx | 10 - client-app/src/main.tsx | 9 + ...rizationPage.jsx => AuthorizationPage.tsx} | 10 +- .../HomePage/{HomePage.jsx => HomePage.tsx} | 6 +- ...{ObjectEditPage.jsx => ObjectEditPage.tsx} | 68 +- .../src/pages/ObjectListPage/.module.css | 4 + ...{ObjectListPage.jsx => ObjectListPage.tsx} | 57 +- .../src/pages/ScriptEditPage/.module.css | 1 - ...{ScriptEditPage.jsx => ScriptEditPage.tsx} | 93 +- .../src/pages/ScriptListPage/.module.css | 18 +- ...{ScriptListPage.jsx => ScriptListPage.tsx} | 66 +- ...{SystemInfoPage.jsx => SystemInfoPage.tsx} | 0 .../{UserEditPage.jsx => UserEditPage.tsx} | 88 +- client-app/src/pages/UserListPage/.module.css | 12 +- .../{UserListPage.jsx => UserListPage.tsx} | 49 +- .../{CookieManager.js => CookieManager.ts} | 6 +- ...{LanguageManager.js => LanguageManager.ts} | 12 +- .../src/services/api/{auth.js => auth.ts} | 2 +- .../src/services/api/{base.js => base.ts} | 14 +- .../api/{extensions.js => extensions.ts} | 4 +- .../services/api/{objects.js => objects.ts} | 22 +- .../services/api/{scripts.js => scripts.ts} | 14 +- .../src/services/api/{users.js => users.ts} | 10 +- .../services/{setupProxy.js => setupProxy.ts} | 4 +- client-app/src/storage/colors/dark.json | 3 - client-app/src/storage/colors/light.json | 3 - client-app/src/storage/strings/en.json | 3 - client-app/src/storage/strings/ru.json | 3 - client-app/src/storage/strings/ua.json | 3 - client-app/src/vite-env.d.ts | 1 + client-app/tsconfig.json | 25 + client-app/tsconfig.node.json | 10 + client-app/{vite.config.js => vite.config.ts} | 4 +- 58 files changed, 2912 insertions(+), 17103 deletions(-) create mode 100644 client-app/.eslintrc.cjs create mode 100644 client-app/README.md rename client-app/src/{App.jsx => App.tsx} (98%) delete mode 100644 client-app/src/components/Accordion/Accordion.jsx create mode 100644 client-app/src/components/Accordion/Accordion.tsx rename client-app/src/components/AdminLayout/{AdminLayout.jsx => AdminLayout.tsx} (86%) delete mode 100644 client-app/src/components/CustomCheckbox/CustomCheckbox.jsx create mode 100644 client-app/src/components/CustomCheckbox/CustomCheckbox.tsx rename client-app/src/components/CustomTextarea/{CustomTextarea.jsx => CustomTextarea.tsx} (58%) rename client-app/src/components/InputBox/{InputBox.jsx => InputBox.tsx} (72%) rename client-app/src/components/ItemsContainer/{ItemsContainer.jsx => ItemsContainer.tsx} (79%) rename client-app/src/components/LoadingAnimation/{LoadingAnimation.jsx => LoadingAnimation.tsx} (82%) rename client-app/src/components/ModalWindow/{ModalWindow.jsx => ModalWindow.tsx} (69%) rename client-app/src/components/ObjectSection/{ObjectSection.jsx => ObjectSection.tsx} (78%) rename client-app/src/components/PropertyRecord/{PropertyRecord.jsx => PropertyRecord.tsx} (65%) rename client-app/src/components/SaveOrCancelForm/{SaveOrCancelForm.jsx => SaveOrCancelForm.tsx} (76%) rename client-app/src/components/ScrollDiv/{ScrollDiv.jsx => ScrollDiv.tsx} (71%) delete mode 100644 client-app/src/components/Space/Space.jsx create mode 100644 client-app/src/components/Space/Space.tsx rename client-app/src/components/Switch/{Switch.jsx => Switch.tsx} (78%) rename client-app/src/components/TableHeader/{TableHeader.jsx => TableHeader.tsx} (65%) delete mode 100644 client-app/src/main.jsx create mode 100644 client-app/src/main.tsx rename client-app/src/pages/AuthorizationPage/{AuthorizationPage.jsx => AuthorizationPage.tsx} (88%) rename client-app/src/pages/HomePage/{HomePage.jsx => HomePage.tsx} (94%) rename client-app/src/pages/ObjectEditPage/{ObjectEditPage.jsx => ObjectEditPage.tsx} (84%) rename client-app/src/pages/ObjectListPage/{ObjectListPage.jsx => ObjectListPage.tsx} (81%) rename client-app/src/pages/ScriptEditPage/{ScriptEditPage.jsx => ScriptEditPage.tsx} (84%) rename client-app/src/pages/ScriptListPage/{ScriptListPage.jsx => ScriptListPage.tsx} (80%) rename client-app/src/pages/SystemInfoPage/{SystemInfoPage.jsx => SystemInfoPage.tsx} (100%) rename client-app/src/pages/UserEditPage/{UserEditPage.jsx => UserEditPage.tsx} (85%) rename client-app/src/pages/UserListPage/{UserListPage.jsx => UserListPage.tsx} (86%) rename client-app/src/services/{CookieManager.js => CookieManager.ts} (74%) rename client-app/src/services/{LanguageManager.js => LanguageManager.ts} (79%) rename client-app/src/services/api/{auth.js => auth.ts} (87%) rename client-app/src/services/api/{base.js => base.ts} (77%) rename client-app/src/services/api/{extensions.js => extensions.ts} (79%) rename client-app/src/services/api/{objects.js => objects.ts} (70%) rename client-app/src/services/api/{scripts.js => scripts.ts} (68%) rename client-app/src/services/api/{users.js => users.ts} (78%) rename client-app/src/services/{setupProxy.js => setupProxy.ts} (74%) delete mode 100644 client-app/src/storage/colors/dark.json delete mode 100644 client-app/src/storage/colors/light.json delete mode 100644 client-app/src/storage/strings/en.json delete mode 100644 client-app/src/storage/strings/ru.json delete mode 100644 client-app/src/storage/strings/ua.json create mode 100644 client-app/src/vite-env.d.ts create mode 100644 client-app/tsconfig.json create mode 100644 client-app/tsconfig.node.json rename client-app/{vite.config.js => vite.config.ts} (77%) diff --git a/client-app/.eslintrc.cjs b/client-app/.eslintrc.cjs new file mode 100644 index 0000000..d6c9537 --- /dev/null +++ b/client-app/.eslintrc.cjs @@ -0,0 +1,18 @@ +module.exports = { + root: true, + env: { browser: true, es2020: true }, + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:react-hooks/recommended', + ], + ignorePatterns: ['dist', '.eslintrc.cjs'], + parser: '@typescript-eslint/parser', + plugins: ['react-refresh'], + rules: { + 'react-refresh/only-export-components': [ + 'warn', + { allowConstantExport: true }, + ], + }, +} diff --git a/client-app/README.md b/client-app/README.md new file mode 100644 index 0000000..1ebe379 --- /dev/null +++ b/client-app/README.md @@ -0,0 +1,27 @@ +# React + TypeScript + Vite + +This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules. + +Currently, two official plugins are available: + +- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh +- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh + +## Expanding the ESLint configuration + +If you are developing a production application, we recommend updating the configuration to enable type aware lint rules: + +- Configure the top-level `parserOptions` property like this: + +```js + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + project: ['./tsconfig.json', './tsconfig.node.json'], + tsconfigRootDir: __dirname, + }, +``` + +- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked` +- Optionally add `plugin:@typescript-eslint/stylistic-type-checked` +- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list diff --git a/client-app/index.html b/client-app/index.html index f7d9499..2085dc7 100644 --- a/client-app/index.html +++ b/client-app/index.html @@ -17,7 +17,7 @@
- +