From f88b323dbaab937db0cf21d0f9959215b8df4bd3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9o=20Banno-Cloutier?= <leo.banno-cloutier@savoirfairelinux.com> Date: Fri, 25 Aug 2023 14:58:22 -0400 Subject: [PATCH] jams-react-client: run npx react-codemod update-react-imports Change-Id: I8e08437adb437ac7f1f64f46812db4ed0c953ed6 --- jams-react-client/.eslintrc.js | 8 +++++++- jams-react-client/src/components/CaSetup/CaSetup.tsx | 2 +- jams-react-client/src/components/Card/Card.tsx | 2 -- jams-react-client/src/components/Card/CardAvatar.tsx | 2 -- jams-react-client/src/components/Card/CardBody.tsx | 2 -- jams-react-client/src/components/Card/CardFooter.tsx | 2 -- jams-react-client/src/components/Card/CardHeader.tsx | 2 -- jams-react-client/src/components/Card/CardIcon.tsx | 2 -- .../src/components/CountrySelect/CountrySelect.tsx | 1 - .../src/components/CreateAdmin/CreateAdmin.tsx | 1 - jams-react-client/src/components/CustomButtons/Button.tsx | 2 -- .../components/CustomImgDropZone/CustomImgDropZone.tsx | 2 +- .../src/components/CustomInput/CustomInput.tsx | 1 - .../src/components/CustomPopupState/CustomPopupState.tsx | 1 - .../src/components/CustomUiPreview/CustomUiPreview.tsx | 2 +- .../src/components/CustomUiPreview/JamiIdCard.tsx | 2 +- .../src/components/CustomUiPreview/TipBox.tsx | 2 +- .../components/CustomizedSteppers/CustomizedSteppers.tsx | 1 - jams-react-client/src/components/Devices/Devices.tsx | 2 +- .../src/components/Devices/EditDeviceDialog.tsx | 1 - .../src/components/Devices/RevokeDeviceDialog.tsx | 2 +- jams-react-client/src/components/Drawer/Drawer.tsx | 6 +++--- jams-react-client/src/components/Footer/Footer.tsx | 2 -- .../src/components/FormikField/FormikField.tsx | 4 ++-- jams-react-client/src/components/Grid/GridContainer.tsx | 2 -- jams-react-client/src/components/Grid/GridItem.tsx | 3 ++- .../src/components/IdentityManagement/AdStorageForm.tsx | 1 - .../components/IdentityManagement/IdentityManagement.tsx | 2 +- .../src/components/IdentityManagement/LdapStorageForm.tsx | 1 - .../components/IdentityManagement/LocalStorageForm.tsx | 1 - .../src/components/LanguagePicker/LanguagePicker.tsx | 6 +++--- jams-react-client/src/components/Navbars/Navbar.tsx | 1 - .../src/components/PasswordDialog/PasswordDialog.tsx | 2 +- .../src/components/ServerParameters/ServerParameters.tsx | 2 +- jams-react-client/src/components/Sidebar/Sidebar.tsx | 4 ++-- .../src/components/Snackbar/BlueprintSnackbar.tsx | 8 ++++---- jams-react-client/src/configured.route.tsx | 1 - jams-react-client/src/index.tsx | 2 +- jams-react-client/src/layouts/BaseLayout.tsx | 4 ++-- jams-react-client/src/layouts/ListLayout.tsx | 4 ++-- jams-react-client/src/layouts/SignIn.tsx | 2 +- jams-react-client/src/layouts/SignUp.tsx | 2 +- jams-react-client/src/protected.route.tsx | 1 - jams-react-client/src/routes/BlueprintRoute.tsx | 2 -- jams-react-client/src/routes/BlueprintsRoute.tsx | 2 -- jams-react-client/src/routes/CreateUserRoute.tsx | 2 -- jams-react-client/src/routes/GroupRoute.tsx | 2 -- jams-react-client/src/routes/GroupsRoute.tsx | 2 -- jams-react-client/src/routes/SettingsRoute.tsx | 2 -- jams-react-client/src/routes/UserRoute.tsx | 2 -- jams-react-client/src/routes/UsersRoute.tsx | 2 -- jams-react-client/src/tools.tsx | 1 - jams-react-client/src/views/Blueprint/Blueprint.tsx | 3 ++- .../src/views/Blueprint/ColorPickerPopup.tsx | 2 +- .../src/views/Blueprint/EditBlueprintConfiguration.tsx | 2 +- .../src/views/Blueprint/EditBlueprintPermissions.tsx | 2 +- jams-react-client/src/views/Blueprint/EditBlueprintUi.tsx | 2 +- .../src/views/Blueprint/EditBlueprintUiForm.tsx | 2 -- .../src/views/Blueprint/PolicyDataContext.tsx | 8 +------- jams-react-client/src/views/Blueprints/Blueprints.tsx | 2 +- .../src/views/Blueprints/CreateBlueprintDialog.tsx | 2 +- jams-react-client/src/views/Contacts/Contacts.tsx | 2 +- jams-react-client/src/views/Groups/CreateGroupDialog.tsx | 2 +- jams-react-client/src/views/Groups/EditGroup.tsx | 2 +- jams-react-client/src/views/Groups/Groups.tsx | 2 +- jams-react-client/src/views/Settings/General.tsx | 2 +- jams-react-client/src/views/Settings/Settings.tsx | 2 +- jams-react-client/src/views/Settings/Subscription.tsx | 2 +- .../src/views/UserProfile/AdminAddUserToGroup.tsx | 2 +- .../src/views/UserProfile/DisplayUserProfile.tsx | 2 +- .../src/views/UserProfile/EditCreateUserProfile.tsx | 2 +- jams-react-client/src/views/UserProfile/UserProfile.tsx | 2 +- .../src/views/UserProfile/UserProfileFieldsList.tsx | 2 +- jams-react-client/src/views/Users/Users.tsx | 2 +- 74 files changed, 62 insertions(+), 109 deletions(-) diff --git a/jams-react-client/.eslintrc.js b/jams-react-client/.eslintrc.js index aeaa0027..fa6521f4 100644 --- a/jams-react-client/.eslintrc.js +++ b/jams-react-client/.eslintrc.js @@ -1,5 +1,5 @@ module.exports = { - parser: "babel-eslint", + parser: "@typescript-eslint/parser", env: { es6: true, node: true, @@ -17,9 +17,15 @@ module.exports = { "eslint:recommended", "plugin:react/recommended", "plugin:prettier/recommended", + "plugin:react/jsx-runtime", ], rules: { "react/prop-types": "off", "no-unused-vars": "warn", }, + settings: { + react: { + version: "detect", + }, + }, }; diff --git a/jams-react-client/src/components/CaSetup/CaSetup.tsx b/jams-react-client/src/components/CaSetup/CaSetup.tsx index 361c1ea4..99e0c928 100644 --- a/jams-react-client/src/components/CaSetup/CaSetup.tsx +++ b/jams-react-client/src/components/CaSetup/CaSetup.tsx @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import { useState } from "react"; import { useHistory } from "react-router-dom"; import { Formik, Field } from "formik"; import * as Yup from "yup"; diff --git a/jams-react-client/src/components/Card/Card.tsx b/jams-react-client/src/components/Card/Card.tsx index e0f03ac8..abe1c095 100644 --- a/jams-react-client/src/components/Card/Card.tsx +++ b/jams-react-client/src/components/Card/Card.tsx @@ -1,5 +1,3 @@ -import React from "react"; -// nodejs library that concatenates classes import classNames from "classnames"; // nodejs library to set properties for components import PropTypes from "prop-types"; diff --git a/jams-react-client/src/components/Card/CardAvatar.tsx b/jams-react-client/src/components/Card/CardAvatar.tsx index cf5a72b0..3d81e39e 100644 --- a/jams-react-client/src/components/Card/CardAvatar.tsx +++ b/jams-react-client/src/components/Card/CardAvatar.tsx @@ -1,5 +1,3 @@ -import React from "react"; -// nodejs library that concatenates classes import classNames from "classnames"; // nodejs library to set properties for components import PropTypes from "prop-types"; diff --git a/jams-react-client/src/components/Card/CardBody.tsx b/jams-react-client/src/components/Card/CardBody.tsx index 2ad5ecdd..f51557ed 100644 --- a/jams-react-client/src/components/Card/CardBody.tsx +++ b/jams-react-client/src/components/Card/CardBody.tsx @@ -1,5 +1,3 @@ -import React from "react"; -// nodejs library that concatenates classes import classNames from "classnames"; // nodejs library to set properties for components import PropTypes from "prop-types"; diff --git a/jams-react-client/src/components/Card/CardFooter.tsx b/jams-react-client/src/components/Card/CardFooter.tsx index 31f09f0e..9ac88ea1 100644 --- a/jams-react-client/src/components/Card/CardFooter.tsx +++ b/jams-react-client/src/components/Card/CardFooter.tsx @@ -1,5 +1,3 @@ -import React from "react"; -// nodejs library that concatenates classes import classNames from "classnames"; // nodejs library to set properties for components import PropTypes from "prop-types"; diff --git a/jams-react-client/src/components/Card/CardHeader.tsx b/jams-react-client/src/components/Card/CardHeader.tsx index 594c3c38..6c53e905 100644 --- a/jams-react-client/src/components/Card/CardHeader.tsx +++ b/jams-react-client/src/components/Card/CardHeader.tsx @@ -1,5 +1,3 @@ -import React from "react"; -// nodejs library that concatenates classes import classNames from "classnames"; // nodejs library to set properties for components import PropTypes from "prop-types"; diff --git a/jams-react-client/src/components/Card/CardIcon.tsx b/jams-react-client/src/components/Card/CardIcon.tsx index 4daf5cd8..7d3a1c68 100644 --- a/jams-react-client/src/components/Card/CardIcon.tsx +++ b/jams-react-client/src/components/Card/CardIcon.tsx @@ -1,5 +1,3 @@ -import React from "react"; -// nodejs library that concatenates classes import classNames from "classnames"; // nodejs library to set properties for components import PropTypes from "prop-types"; diff --git a/jams-react-client/src/components/CountrySelect/CountrySelect.tsx b/jams-react-client/src/components/CountrySelect/CountrySelect.tsx index ed53dfb1..bbf48ca3 100644 --- a/jams-react-client/src/components/CountrySelect/CountrySelect.tsx +++ b/jams-react-client/src/components/CountrySelect/CountrySelect.tsx @@ -1,4 +1,3 @@ -import React from "react"; import TextField from "@mui/material/TextField"; import { Autocomplete, Box } from "@mui/material"; import { makeStyles } from "@mui/styles"; diff --git a/jams-react-client/src/components/CreateAdmin/CreateAdmin.tsx b/jams-react-client/src/components/CreateAdmin/CreateAdmin.tsx index 518fc508..642c79bf 100644 --- a/jams-react-client/src/components/CreateAdmin/CreateAdmin.tsx +++ b/jams-react-client/src/components/CreateAdmin/CreateAdmin.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { useHistory } from "react-router-dom"; import { useFormik } from "formik"; import * as Yup from "yup"; diff --git a/jams-react-client/src/components/CustomButtons/Button.tsx b/jams-react-client/src/components/CustomButtons/Button.tsx index 096a7150..f75d2d2e 100644 --- a/jams-react-client/src/components/CustomButtons/Button.tsx +++ b/jams-react-client/src/components/CustomButtons/Button.tsx @@ -1,5 +1,3 @@ -import React from "react"; -// nodejs library that concatenates classes import classNames from "classnames"; // nodejs library to set properties for components import PropTypes from "prop-types"; diff --git a/jams-react-client/src/components/CustomImgDropZone/CustomImgDropZone.tsx b/jams-react-client/src/components/CustomImgDropZone/CustomImgDropZone.tsx index 27fe93da..8937219a 100644 --- a/jams-react-client/src/components/CustomImgDropZone/CustomImgDropZone.tsx +++ b/jams-react-client/src/components/CustomImgDropZone/CustomImgDropZone.tsx @@ -1,4 +1,4 @@ -import React, { FC, MouseEventHandler } from "react"; +import { FC, MouseEventHandler } from "react"; import { makeStyles } from "@mui/styles"; import Dropzone, { Accept } from "react-dropzone"; import UploadIcon from "@mui/icons-material/CloudUpload"; diff --git a/jams-react-client/src/components/CustomInput/CustomInput.tsx b/jams-react-client/src/components/CustomInput/CustomInput.tsx index bcf20d18..8dc52139 100644 --- a/jams-react-client/src/components/CustomInput/CustomInput.tsx +++ b/jams-react-client/src/components/CustomInput/CustomInput.tsx @@ -1,4 +1,3 @@ -import React from "react"; import classNames from "classnames"; import PropTypes from "prop-types"; // @mui/material components diff --git a/jams-react-client/src/components/CustomPopupState/CustomPopupState.tsx b/jams-react-client/src/components/CustomPopupState/CustomPopupState.tsx index 214298f9..f56fe7cb 100644 --- a/jams-react-client/src/components/CustomPopupState/CustomPopupState.tsx +++ b/jams-react-client/src/components/CustomPopupState/CustomPopupState.tsx @@ -1,4 +1,3 @@ -import React from "react"; import InfoIcon from "@mui/icons-material/Info"; import Popover from "@mui/material/Popover"; import PopupState, { bindTrigger, bindPopover } from "material-ui-popup-state"; diff --git a/jams-react-client/src/components/CustomUiPreview/CustomUiPreview.tsx b/jams-react-client/src/components/CustomUiPreview/CustomUiPreview.tsx index 73dbb381..7d792452 100644 --- a/jams-react-client/src/components/CustomUiPreview/CustomUiPreview.tsx +++ b/jams-react-client/src/components/CustomUiPreview/CustomUiPreview.tsx @@ -1,4 +1,4 @@ -import React, { FC } from "react"; +import { FC } from "react"; import { makeStyles } from "@mui/styles"; diff --git a/jams-react-client/src/components/CustomUiPreview/JamiIdCard.tsx b/jams-react-client/src/components/CustomUiPreview/JamiIdCard.tsx index 67e92474..4ec6453d 100644 --- a/jams-react-client/src/components/CustomUiPreview/JamiIdCard.tsx +++ b/jams-react-client/src/components/CustomUiPreview/JamiIdCard.tsx @@ -1,4 +1,4 @@ -import React, { FC } from "react"; +import { FC } from "react"; import { makeStyles } from "@mui/styles"; diff --git a/jams-react-client/src/components/CustomUiPreview/TipBox.tsx b/jams-react-client/src/components/CustomUiPreview/TipBox.tsx index bd6061c1..cb6748b1 100644 --- a/jams-react-client/src/components/CustomUiPreview/TipBox.tsx +++ b/jams-react-client/src/components/CustomUiPreview/TipBox.tsx @@ -1,4 +1,4 @@ -import React, { FC } from "react"; +import { FC } from "react"; import { makeStyles } from "@mui/styles"; import tipLightBulbImage from "assets/img/tip_light_bulb.svg"; diff --git a/jams-react-client/src/components/CustomizedSteppers/CustomizedSteppers.tsx b/jams-react-client/src/components/CustomizedSteppers/CustomizedSteppers.tsx index 3f9c39d2..7c1cea96 100644 --- a/jams-react-client/src/components/CustomizedSteppers/CustomizedSteppers.tsx +++ b/jams-react-client/src/components/CustomizedSteppers/CustomizedSteppers.tsx @@ -1,4 +1,3 @@ -import React from "react"; import PropTypes from "prop-types"; import { makeStyles } from "@mui/styles"; import clsx from "clsx"; diff --git a/jams-react-client/src/components/Devices/Devices.tsx b/jams-react-client/src/components/Devices/Devices.tsx index 6b6de2a5..de830421 100755 --- a/jams-react-client/src/components/Devices/Devices.tsx +++ b/jams-react-client/src/components/Devices/Devices.tsx @@ -1,4 +1,4 @@ -import React, { FC, useEffect, useState } from "react"; +import { FC, useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; import classnames from "classnames"; diff --git a/jams-react-client/src/components/Devices/EditDeviceDialog.tsx b/jams-react-client/src/components/Devices/EditDeviceDialog.tsx index 473fd862..a43b8865 100644 --- a/jams-react-client/src/components/Devices/EditDeviceDialog.tsx +++ b/jams-react-client/src/components/Devices/EditDeviceDialog.tsx @@ -8,7 +8,6 @@ import { } from "@mui/material"; import { Formik, Field } from "formik"; import i18next from "i18next"; -import React from "react"; import { Dispatch, FC, SetStateAction } from "react"; import { Device } from "./Devices"; diff --git a/jams-react-client/src/components/Devices/RevokeDeviceDialog.tsx b/jams-react-client/src/components/Devices/RevokeDeviceDialog.tsx index 1445b64e..53662b29 100644 --- a/jams-react-client/src/components/Devices/RevokeDeviceDialog.tsx +++ b/jams-react-client/src/components/Devices/RevokeDeviceDialog.tsx @@ -1,4 +1,4 @@ -import React, { FC } from "react"; +import { FC } from "react"; import i18next from "i18next"; import { Dialog, diff --git a/jams-react-client/src/components/Drawer/Drawer.tsx b/jams-react-client/src/components/Drawer/Drawer.tsx index bb604683..fdd421d7 100644 --- a/jams-react-client/src/components/Drawer/Drawer.tsx +++ b/jams-react-client/src/components/Drawer/Drawer.tsx @@ -1,4 +1,4 @@ -import React, { FC, useCallback } from "react"; +import { Fragment, FC, useCallback } from "react"; import clsx from "clsx"; import { debounce } from "lodash"; import { makeStyles } from "@mui/styles"; @@ -129,7 +129,7 @@ const TemporaryDrawer: FC<TemporaryDrawerProps> = ({ return ( <div> - <React.Fragment key={direction}> + <Fragment key={direction}> <Drawer anchor="right" open={openDrawer} @@ -161,7 +161,7 @@ const TemporaryDrawer: FC<TemporaryDrawerProps> = ({ {listUsers()} </div> </Drawer> - </React.Fragment> + </Fragment> </div> ); }; diff --git a/jams-react-client/src/components/Footer/Footer.tsx b/jams-react-client/src/components/Footer/Footer.tsx index 96f0c805..0a6b262d 100755 --- a/jams-react-client/src/components/Footer/Footer.tsx +++ b/jams-react-client/src/components/Footer/Footer.tsx @@ -1,5 +1,3 @@ -import React from "react"; -// @mui/material components import { makeStyles } from "@mui/styles"; // core components import styles from "assets/jss/material-dashboard-react/components/footerStyle"; diff --git a/jams-react-client/src/components/FormikField/FormikField.tsx b/jams-react-client/src/components/FormikField/FormikField.tsx index b1f118e2..0f6df7aa 100644 --- a/jams-react-client/src/components/FormikField/FormikField.tsx +++ b/jams-react-client/src/components/FormikField/FormikField.tsx @@ -1,4 +1,4 @@ -import React from "react"; +import { Component } from "react"; import PropTypes from "prop-types"; import { ErrorMessage, Field } from "formik"; @@ -6,7 +6,7 @@ import FormControl from "@mui/material/FormControl"; import InputLabel from "@mui/material/InputLabel"; import Input from "@mui/material/Input"; -class FormikField extends React.Component { +class FormikField extends Component { render() { return ( <div className="FormikField"> diff --git a/jams-react-client/src/components/Grid/GridContainer.tsx b/jams-react-client/src/components/Grid/GridContainer.tsx index 585746cc..46764549 100644 --- a/jams-react-client/src/components/Grid/GridContainer.tsx +++ b/jams-react-client/src/components/Grid/GridContainer.tsx @@ -1,5 +1,3 @@ -import React from "react"; -// nodejs library to set properties for components import PropTypes from "prop-types"; // @mui/material components import { makeStyles } from "@mui/styles"; diff --git a/jams-react-client/src/components/Grid/GridItem.tsx b/jams-react-client/src/components/Grid/GridItem.tsx index 922404b8..589f93e1 100644 --- a/jams-react-client/src/components/Grid/GridItem.tsx +++ b/jams-react-client/src/components/Grid/GridItem.tsx @@ -1,4 +1,5 @@ -import React, { FC } from "react"; +import { FC } from "react"; +import * as React from "react"; import { makeStyles } from "@mui/styles"; import { Grid, GridTypeMap } from "@mui/material"; import { OverridableComponent } from "@mui/material/OverridableComponent"; diff --git a/jams-react-client/src/components/IdentityManagement/AdStorageForm.tsx b/jams-react-client/src/components/IdentityManagement/AdStorageForm.tsx index 6259f35b..4064a8f3 100644 --- a/jams-react-client/src/components/IdentityManagement/AdStorageForm.tsx +++ b/jams-react-client/src/components/IdentityManagement/AdStorageForm.tsx @@ -1,4 +1,3 @@ -import React from "react"; import FormControlLabel from "@mui/material/FormControlLabel"; import Typography from "@mui/material/Typography"; import Grid from "@mui/material/Grid"; diff --git a/jams-react-client/src/components/IdentityManagement/IdentityManagement.tsx b/jams-react-client/src/components/IdentityManagement/IdentityManagement.tsx index d65bd88d..2804c981 100644 --- a/jams-react-client/src/components/IdentityManagement/IdentityManagement.tsx +++ b/jams-react-client/src/components/IdentityManagement/IdentityManagement.tsx @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import { useState } from "react"; import { useHistory } from "react-router-dom"; import { Formik } from "formik"; import Button from "@mui/material/Button"; diff --git a/jams-react-client/src/components/IdentityManagement/LdapStorageForm.tsx b/jams-react-client/src/components/IdentityManagement/LdapStorageForm.tsx index 580f7826..35bdad31 100644 --- a/jams-react-client/src/components/IdentityManagement/LdapStorageForm.tsx +++ b/jams-react-client/src/components/IdentityManagement/LdapStorageForm.tsx @@ -1,4 +1,3 @@ -import React from "react"; import FormControlLabel from "@mui/material/FormControlLabel"; import Typography from "@mui/material/Typography"; import Grid from "@mui/material/Grid"; diff --git a/jams-react-client/src/components/IdentityManagement/LocalStorageForm.tsx b/jams-react-client/src/components/IdentityManagement/LocalStorageForm.tsx index 4b4dd143..0524c418 100644 --- a/jams-react-client/src/components/IdentityManagement/LocalStorageForm.tsx +++ b/jams-react-client/src/components/IdentityManagement/LocalStorageForm.tsx @@ -1,4 +1,3 @@ -import React from "react"; import FormControlLabel from "@mui/material/FormControlLabel"; import Checkbox from "@mui/material/Checkbox"; import Typography from "@mui/material/Typography"; diff --git a/jams-react-client/src/components/LanguagePicker/LanguagePicker.tsx b/jams-react-client/src/components/LanguagePicker/LanguagePicker.tsx index f69dfc5c..38a4619d 100644 --- a/jams-react-client/src/components/LanguagePicker/LanguagePicker.tsx +++ b/jams-react-client/src/components/LanguagePicker/LanguagePicker.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import { Fragment, useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; import Button from "@mui/material/Button"; @@ -52,7 +52,7 @@ export default function LanguagePicker(props) { return ( <PopupState variant="popover" popupId="demo-popup-menu"> {(popupState) => ( - <React.Fragment> + <Fragment> <Button variant="contained" color="inherit" @@ -77,7 +77,7 @@ export default function LanguagePicker(props) { </MenuItem> ))} </Menu> - </React.Fragment> + </Fragment> )} </PopupState> ); diff --git a/jams-react-client/src/components/Navbars/Navbar.tsx b/jams-react-client/src/components/Navbars/Navbar.tsx index 2d849926..056a5061 100755 --- a/jams-react-client/src/components/Navbars/Navbar.tsx +++ b/jams-react-client/src/components/Navbars/Navbar.tsx @@ -1,4 +1,3 @@ -import React from "react"; import classNames from "classnames"; import PropTypes from "prop-types"; // @mui/material components diff --git a/jams-react-client/src/components/PasswordDialog/PasswordDialog.tsx b/jams-react-client/src/components/PasswordDialog/PasswordDialog.tsx index 74d9329b..fdf23d67 100644 --- a/jams-react-client/src/components/PasswordDialog/PasswordDialog.tsx +++ b/jams-react-client/src/components/PasswordDialog/PasswordDialog.tsx @@ -1,4 +1,4 @@ -import React, { FC, useEffect, useState } from "react"; +import { FC, useEffect, useState } from "react"; // @mui/material components import { makeStyles } from "@mui/styles"; // core components diff --git a/jams-react-client/src/components/ServerParameters/ServerParameters.tsx b/jams-react-client/src/components/ServerParameters/ServerParameters.tsx index 2c0fa736..2045eb8c 100644 --- a/jams-react-client/src/components/ServerParameters/ServerParameters.tsx +++ b/jams-react-client/src/components/ServerParameters/ServerParameters.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; import Button from "@mui/material/Button"; import TextField from "@mui/material/TextField"; diff --git a/jams-react-client/src/components/Sidebar/Sidebar.tsx b/jams-react-client/src/components/Sidebar/Sidebar.tsx index 7dd27eb8..c9310c15 100755 --- a/jams-react-client/src/components/Sidebar/Sidebar.tsx +++ b/jams-react-client/src/components/Sidebar/Sidebar.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import { createRef, useEffect, useState } from "react"; import { Link, useHistory } from "react-router-dom"; import classNames from "classnames"; import PropTypes from "prop-types"; @@ -26,7 +26,7 @@ const useStyles = makeStyles(styles); export default function Sidebar(props) { const classes = useStyles(); - const mainPanel = React.createRef(); + const mainPanel = createRef(); const [open, setOpen] = useState(false); const history = useHistory(); diff --git a/jams-react-client/src/components/Snackbar/BlueprintSnackbar.tsx b/jams-react-client/src/components/Snackbar/BlueprintSnackbar.tsx index 454d521e..9c50167b 100644 --- a/jams-react-client/src/components/Snackbar/BlueprintSnackbar.tsx +++ b/jams-react-client/src/components/Snackbar/BlueprintSnackbar.tsx @@ -1,4 +1,4 @@ -import React, { Dispatch, FC, SetStateAction } from "react"; +import { forwardRef, createRef, Dispatch, FC, SetStateAction } from "react"; import MuiAlert from "@mui/material/Alert"; import Snackbar from "@mui/material/Snackbar"; @@ -6,11 +6,11 @@ import Slide from "@mui/material/Slide"; import { SnackbarProps } from "views/Blueprint/PolicyDataContext"; // https://stackoverflow.com/a/67961603 -const Alert = React.forwardRef(function Alert(props, ref) { +const Alert = forwardRef(function Alert(props, ref) { return <MuiAlert elevation={6} ref={ref} variant="filled" {...props} />; }); -const SlideTransition = React.forwardRef(function SlideTransition(props, ref) { +const SlideTransition = forwardRef(function SlideTransition(props, ref) { return <Slide ref={ref} {...props} direction="left" />; }); @@ -23,7 +23,7 @@ export const BlueprintSnackbar: FC<BlueprintSnackbarProps> = ({ snackbar, setSnackbar, }) => { - const snackbarRef = React.createRef(null); + const snackbarRef = createRef(null); const handleClose = () => { setSnackbar((state) => ({ ...state, open: false })); diff --git a/jams-react-client/src/configured.route.tsx b/jams-react-client/src/configured.route.tsx index d56b33dc..bdd0e3a4 100644 --- a/jams-react-client/src/configured.route.tsx +++ b/jams-react-client/src/configured.route.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { Route } from "react-router-dom"; import auth from "./auth"; import SignUp from "layouts/SignUp"; diff --git a/jams-react-client/src/index.tsx b/jams-react-client/src/index.tsx index ad3206aa..ea3d599e 100644 --- a/jams-react-client/src/index.tsx +++ b/jams-react-client/src/index.tsx @@ -15,7 +15,7 @@ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. */ -import React, { StrictMode, Suspense } from "react"; +import { StrictMode, Suspense } from "react"; import ReactDOM from "react-dom"; import { createBrowserHistory } from "history"; import { Router, Switch, Redirect } from "react-router-dom"; diff --git a/jams-react-client/src/layouts/BaseLayout.tsx b/jams-react-client/src/layouts/BaseLayout.tsx index 0dce2c33..a083021f 100644 --- a/jams-react-client/src/layouts/BaseLayout.tsx +++ b/jams-react-client/src/layouts/BaseLayout.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import { createRef, useEffect, useState } from "react"; // creates a beautiful scrollbar import PerfectScrollbar from "perfect-scrollbar"; import "perfect-scrollbar/css/perfect-scrollbar.css"; @@ -50,7 +50,7 @@ export default function Admin(props) { // styles const classes = useStyles(); // ref to help us initialize PerfectScrollbar on windows devices - const mainPanel = React.createRef(); + const mainPanel = createRef(); // states and functions const [mobileOpen, setMobileOpen] = useState(false); const [open, setOpen] = useState(false); diff --git a/jams-react-client/src/layouts/ListLayout.tsx b/jams-react-client/src/layouts/ListLayout.tsx index 1b5cf876..e92d9c9e 100644 --- a/jams-react-client/src/layouts/ListLayout.tsx +++ b/jams-react-client/src/layouts/ListLayout.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import { createRef, useEffect, useState } from "react"; // creates a beautiful scrollbar import PerfectScrollbar from "perfect-scrollbar"; import "perfect-scrollbar/css/perfect-scrollbar.css"; @@ -50,7 +50,7 @@ export default function Admin(props) { // styles const classes = useStyles(); // ref to help us initialize PerfectScrollbar on windows devices - const mainPanel = React.createRef(); + const mainPanel = createRef(); // states and functions const [mobileOpen, setMobileOpen] = useState(false); const [open, setOpen] = useState(false); diff --git a/jams-react-client/src/layouts/SignIn.tsx b/jams-react-client/src/layouts/SignIn.tsx index e785aeae..f139bea8 100644 --- a/jams-react-client/src/layouts/SignIn.tsx +++ b/jams-react-client/src/layouts/SignIn.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; import { Formik } from "formik"; import Button from "@mui/material/Button"; diff --git a/jams-react-client/src/layouts/SignUp.tsx b/jams-react-client/src/layouts/SignUp.tsx index e771ac17..6b7a9305 100644 --- a/jams-react-client/src/layouts/SignUp.tsx +++ b/jams-react-client/src/layouts/SignUp.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import CssBaseline from "@mui/material/CssBaseline"; import Link from "@mui/material/Link"; import Box from "@mui/material/Box"; diff --git a/jams-react-client/src/protected.route.tsx b/jams-react-client/src/protected.route.tsx index bf48b92f..56f6bddd 100644 --- a/jams-react-client/src/protected.route.tsx +++ b/jams-react-client/src/protected.route.tsx @@ -1,4 +1,3 @@ -import React from "react"; import { Route, Redirect } from "react-router-dom"; import auth from "./auth"; diff --git a/jams-react-client/src/routes/BlueprintRoute.tsx b/jams-react-client/src/routes/BlueprintRoute.tsx index 33e3394b..6377e7b6 100644 --- a/jams-react-client/src/routes/BlueprintRoute.tsx +++ b/jams-react-client/src/routes/BlueprintRoute.tsx @@ -1,5 +1,3 @@ -import React from "react"; - import BaseLayout from "layouts/BaseLayout"; import { Blueprint } from "views/Blueprint/Blueprint"; diff --git a/jams-react-client/src/routes/BlueprintsRoute.tsx b/jams-react-client/src/routes/BlueprintsRoute.tsx index 0ef35978..ccbf0df8 100644 --- a/jams-react-client/src/routes/BlueprintsRoute.tsx +++ b/jams-react-client/src/routes/BlueprintsRoute.tsx @@ -1,5 +1,3 @@ -import React from "react"; - import Blueprints from "views/Blueprints/Blueprints"; import ListLayout from "layouts/ListLayout"; diff --git a/jams-react-client/src/routes/CreateUserRoute.tsx b/jams-react-client/src/routes/CreateUserRoute.tsx index b0566210..285dc653 100644 --- a/jams-react-client/src/routes/CreateUserRoute.tsx +++ b/jams-react-client/src/routes/CreateUserRoute.tsx @@ -1,5 +1,3 @@ -import React from "react"; - import EditCreateUserProfile from "views/UserProfile/EditCreateUserProfile"; import ListLayout from "layouts/ListLayout"; diff --git a/jams-react-client/src/routes/GroupRoute.tsx b/jams-react-client/src/routes/GroupRoute.tsx index f0ce8fb3..abd26d31 100644 --- a/jams-react-client/src/routes/GroupRoute.tsx +++ b/jams-react-client/src/routes/GroupRoute.tsx @@ -1,5 +1,3 @@ -import React from "react"; - import ListLayout from "layouts/ListLayout"; import EditGroup from "views/Groups/EditGroup"; diff --git a/jams-react-client/src/routes/GroupsRoute.tsx b/jams-react-client/src/routes/GroupsRoute.tsx index b25da065..c9115481 100644 --- a/jams-react-client/src/routes/GroupsRoute.tsx +++ b/jams-react-client/src/routes/GroupsRoute.tsx @@ -1,5 +1,3 @@ -import React from "react"; - import ListLayout from "layouts/ListLayout"; import Groups from "views/Groups/Groups"; diff --git a/jams-react-client/src/routes/SettingsRoute.tsx b/jams-react-client/src/routes/SettingsRoute.tsx index 146d0106..877b780c 100644 --- a/jams-react-client/src/routes/SettingsRoute.tsx +++ b/jams-react-client/src/routes/SettingsRoute.tsx @@ -1,5 +1,3 @@ -import React from "react"; - import Settings from "views/Settings/Settings"; import BaseLayout from "layouts/BaseLayout"; diff --git a/jams-react-client/src/routes/UserRoute.tsx b/jams-react-client/src/routes/UserRoute.tsx index 2be35c56..1259ed5a 100644 --- a/jams-react-client/src/routes/UserRoute.tsx +++ b/jams-react-client/src/routes/UserRoute.tsx @@ -1,5 +1,3 @@ -import React from "react"; - import UserProfile from "views/UserProfile/UserProfile"; import BaseLayout from "layouts/BaseLayout"; diff --git a/jams-react-client/src/routes/UsersRoute.tsx b/jams-react-client/src/routes/UsersRoute.tsx index 6bfd698e..894ef5b6 100644 --- a/jams-react-client/src/routes/UsersRoute.tsx +++ b/jams-react-client/src/routes/UsersRoute.tsx @@ -1,5 +1,3 @@ -import React from "react"; - import Users from "views/Users/Users"; import ListLayout from "layouts/ListLayout"; diff --git a/jams-react-client/src/tools.tsx b/jams-react-client/src/tools.tsx index 4ddaa510..9fe862a7 100644 --- a/jams-react-client/src/tools.tsx +++ b/jams-react-client/src/tools.tsx @@ -1,4 +1,3 @@ -import React from "react"; import MenuItem from "@mui/material/MenuItem"; export function buildSelectMenuItems(elements) { diff --git a/jams-react-client/src/views/Blueprint/Blueprint.tsx b/jams-react-client/src/views/Blueprint/Blueprint.tsx index d8d64f0b..8b1dee29 100644 --- a/jams-react-client/src/views/Blueprint/Blueprint.tsx +++ b/jams-react-client/src/views/Blueprint/Blueprint.tsx @@ -1,4 +1,5 @@ -import React, { FC, useState } from "react"; +import { FC, useState } from "react"; +import * as React from "react"; import AppBar from "@mui/material/AppBar"; import Tabs from "@mui/material/Tabs"; diff --git a/jams-react-client/src/views/Blueprint/ColorPickerPopup.tsx b/jams-react-client/src/views/Blueprint/ColorPickerPopup.tsx index 5cde80a8..62a775fa 100644 --- a/jams-react-client/src/views/Blueprint/ColorPickerPopup.tsx +++ b/jams-react-client/src/views/Blueprint/ColorPickerPopup.tsx @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import { useState } from "react"; import { makeStyles } from "@mui/styles"; import { HexAlphaColorPicker, HexColorPicker } from "react-colorful"; diff --git a/jams-react-client/src/views/Blueprint/EditBlueprintConfiguration.tsx b/jams-react-client/src/views/Blueprint/EditBlueprintConfiguration.tsx index 869dc68c..a167c62f 100644 --- a/jams-react-client/src/views/Blueprint/EditBlueprintConfiguration.tsx +++ b/jams-react-client/src/views/Blueprint/EditBlueprintConfiguration.tsx @@ -1,4 +1,4 @@ -import React, { useContext, useState } from "react"; +import { useContext, useState } from "react"; import clsx from "clsx"; // @mui/material components diff --git a/jams-react-client/src/views/Blueprint/EditBlueprintPermissions.tsx b/jams-react-client/src/views/Blueprint/EditBlueprintPermissions.tsx index 0b0b0632..3ae6a983 100644 --- a/jams-react-client/src/views/Blueprint/EditBlueprintPermissions.tsx +++ b/jams-react-client/src/views/Blueprint/EditBlueprintPermissions.tsx @@ -1,4 +1,4 @@ -import React, { useContext, useEffect, useState } from "react"; +import { useContext, useEffect, useState } from "react"; import { Link, useHistory } from "react-router-dom"; import axios from "axios"; import i18next from "i18next"; diff --git a/jams-react-client/src/views/Blueprint/EditBlueprintUi.tsx b/jams-react-client/src/views/Blueprint/EditBlueprintUi.tsx index 224adc19..9968f4e9 100644 --- a/jams-react-client/src/views/Blueprint/EditBlueprintUi.tsx +++ b/jams-react-client/src/views/Blueprint/EditBlueprintUi.tsx @@ -1,4 +1,4 @@ -import React, { useContext, useState } from "react"; +import { useContext, useState } from "react"; import { makeStyles } from "@mui/styles"; import Grid from "@mui/material/Grid"; diff --git a/jams-react-client/src/views/Blueprint/EditBlueprintUiForm.tsx b/jams-react-client/src/views/Blueprint/EditBlueprintUiForm.tsx index 457bcce3..312ba414 100644 --- a/jams-react-client/src/views/Blueprint/EditBlueprintUiForm.tsx +++ b/jams-react-client/src/views/Blueprint/EditBlueprintUiForm.tsx @@ -1,5 +1,3 @@ -import React from "react"; - import Checkbox from "@mui/material/Checkbox"; import Switch from "@mui/material/Switch"; import FormGroup from "@mui/material/FormGroup"; diff --git a/jams-react-client/src/views/Blueprint/PolicyDataContext.tsx b/jams-react-client/src/views/Blueprint/PolicyDataContext.tsx index 653a6560..9fa77385 100644 --- a/jams-react-client/src/views/Blueprint/PolicyDataContext.tsx +++ b/jams-react-client/src/views/Blueprint/PolicyDataContext.tsx @@ -1,10 +1,4 @@ -import React, { - FC, - ReactNode, - createContext, - useEffect, - useState, -} from "react"; +import { FC, ReactNode, createContext, useEffect, useState } from "react"; import axios from "axios"; diff --git a/jams-react-client/src/views/Blueprints/Blueprints.tsx b/jams-react-client/src/views/Blueprints/Blueprints.tsx index 9cd1caf3..2951d03d 100644 --- a/jams-react-client/src/views/Blueprints/Blueprints.tsx +++ b/jams-react-client/src/views/Blueprints/Blueprints.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import { Link, useHistory } from "react-router-dom"; // @mui/material components import { makeStyles } from "@mui/styles"; diff --git a/jams-react-client/src/views/Blueprints/CreateBlueprintDialog.tsx b/jams-react-client/src/views/Blueprints/CreateBlueprintDialog.tsx index 84f3aaf2..946cfd15 100644 --- a/jams-react-client/src/views/Blueprints/CreateBlueprintDialog.tsx +++ b/jams-react-client/src/views/Blueprints/CreateBlueprintDialog.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useState } from "react"; +import { useCallback, useState } from "react"; import { useHistory } from "react-router-dom"; import axios from "axios"; import i18next from "i18next"; diff --git a/jams-react-client/src/views/Contacts/Contacts.tsx b/jams-react-client/src/views/Contacts/Contacts.tsx index 21728582..cbe92c23 100644 --- a/jams-react-client/src/views/Contacts/Contacts.tsx +++ b/jams-react-client/src/views/Contacts/Contacts.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; // @mui/material components import { makeStyles } from "@mui/styles"; diff --git a/jams-react-client/src/views/Groups/CreateGroupDialog.tsx b/jams-react-client/src/views/Groups/CreateGroupDialog.tsx index 47b5e7f3..23288dee 100644 --- a/jams-react-client/src/views/Groups/CreateGroupDialog.tsx +++ b/jams-react-client/src/views/Groups/CreateGroupDialog.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect, useState } from "react"; +import { useCallback, useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; import { Dialog, diff --git a/jams-react-client/src/views/Groups/EditGroup.tsx b/jams-react-client/src/views/Groups/EditGroup.tsx index e9284f89..7f541d37 100644 --- a/jams-react-client/src/views/Groups/EditGroup.tsx +++ b/jams-react-client/src/views/Groups/EditGroup.tsx @@ -1,4 +1,4 @@ -import React, { useCallback, useEffect, useState } from "react"; +import { useCallback, useEffect, useState } from "react"; import { Link, useHistory } from "react-router-dom"; import classnames from "classnames"; diff --git a/jams-react-client/src/views/Groups/Groups.tsx b/jams-react-client/src/views/Groups/Groups.tsx index 73e5124e..9d0ae494 100644 --- a/jams-react-client/src/views/Groups/Groups.tsx +++ b/jams-react-client/src/views/Groups/Groups.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import { Link, useHistory } from "react-router-dom"; // @mui/material components import { makeStyles } from "@mui/styles"; diff --git a/jams-react-client/src/views/Settings/General.tsx b/jams-react-client/src/views/Settings/General.tsx index ba08f23f..37d376c0 100644 --- a/jams-react-client/src/views/Settings/General.tsx +++ b/jams-react-client/src/views/Settings/General.tsx @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import { useState } from "react"; import { Formik } from "formik"; import FormikField from "components/FormikField/FormikField"; import * as Yup from "yup"; diff --git a/jams-react-client/src/views/Settings/Settings.tsx b/jams-react-client/src/views/Settings/Settings.tsx index 02b37f41..9a1c0dcf 100644 --- a/jams-react-client/src/views/Settings/Settings.tsx +++ b/jams-react-client/src/views/Settings/Settings.tsx @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import { useState } from "react"; // core components import General from "./General"; import Subscription from "./Subscription"; diff --git a/jams-react-client/src/views/Settings/Subscription.tsx b/jams-react-client/src/views/Settings/Subscription.tsx index a578ed6b..3a30ade8 100644 --- a/jams-react-client/src/views/Settings/Subscription.tsx +++ b/jams-react-client/src/views/Settings/Subscription.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import { useFormik } from "formik"; import * as Yup from "yup"; import Button from "@mui/material/Button"; diff --git a/jams-react-client/src/views/UserProfile/AdminAddUserToGroup.tsx b/jams-react-client/src/views/UserProfile/AdminAddUserToGroup.tsx index a05f7b58..d6f05f2b 100644 --- a/jams-react-client/src/views/UserProfile/AdminAddUserToGroup.tsx +++ b/jams-react-client/src/views/UserProfile/AdminAddUserToGroup.tsx @@ -1,4 +1,4 @@ -import React, { FC, useState } from "react"; +import { FC, useState } from "react"; import { Link, useHistory } from "react-router-dom"; import classnames from "classnames"; import i18next from "i18next"; diff --git a/jams-react-client/src/views/UserProfile/DisplayUserProfile.tsx b/jams-react-client/src/views/UserProfile/DisplayUserProfile.tsx index bed01123..7881b01f 100644 --- a/jams-react-client/src/views/UserProfile/DisplayUserProfile.tsx +++ b/jams-react-client/src/views/UserProfile/DisplayUserProfile.tsx @@ -1,4 +1,4 @@ -import React, { FC, useEffect, useState } from "react"; +import { FC, useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; import axios from "axios"; import i18next from "i18next"; diff --git a/jams-react-client/src/views/UserProfile/EditCreateUserProfile.tsx b/jams-react-client/src/views/UserProfile/EditCreateUserProfile.tsx index 8b848f7c..b74695f7 100644 --- a/jams-react-client/src/views/UserProfile/EditCreateUserProfile.tsx +++ b/jams-react-client/src/views/UserProfile/EditCreateUserProfile.tsx @@ -1,4 +1,4 @@ -import React, { ChangeEvent, useEffect, useState } from "react"; +import { ChangeEvent, useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; // @mui/material components diff --git a/jams-react-client/src/views/UserProfile/UserProfile.tsx b/jams-react-client/src/views/UserProfile/UserProfile.tsx index 4fd5fe81..92e6642b 100755 --- a/jams-react-client/src/views/UserProfile/UserProfile.tsx +++ b/jams-react-client/src/views/UserProfile/UserProfile.tsx @@ -1,4 +1,4 @@ -import React, { useEffect, useState } from "react"; +import { useEffect, useState } from "react"; import { useHistory } from "react-router-dom"; // core components import Devices from "components/Devices/Devices"; diff --git a/jams-react-client/src/views/UserProfile/UserProfileFieldsList.tsx b/jams-react-client/src/views/UserProfile/UserProfileFieldsList.tsx index 6c26b2d6..e4d0d088 100644 --- a/jams-react-client/src/views/UserProfile/UserProfileFieldsList.tsx +++ b/jams-react-client/src/views/UserProfile/UserProfileFieldsList.tsx @@ -1,4 +1,4 @@ -import React, { FC } from "react"; +import { FC } from "react"; import { Grid, List, diff --git a/jams-react-client/src/views/Users/Users.tsx b/jams-react-client/src/views/Users/Users.tsx index c509559e..700eaf12 100644 --- a/jams-react-client/src/views/Users/Users.tsx +++ b/jams-react-client/src/views/Users/Users.tsx @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useCallback } from "react"; +import { useState, useEffect, useCallback } from "react"; import { Link } from "react-router-dom"; import { useHistory } from "react-router-dom"; // @mui/material components -- GitLab