diff --git a/jams-react-client/package.json b/jams-react-client/package.json index f098febf71a1be60b15b3cf2cc0e009aef38d771..361a1230467d6a662e06941da4733d89b63d4519 100644 --- a/jams-react-client/package.json +++ b/jams-react-client/package.json @@ -21,16 +21,16 @@ "material-ui-popup-state": "^1.6.1", "perfect-scrollbar": "1.5.5", "prop-types": "15.8.1", - "react": "^16.13.1", + "react": "^17.0.0", "react-color": "^2.19.3", "react-copy-to-clipboard": "^5.0.2", - "react-dom": "16.13.1", + "react-dom": "^17.0.0", "react-dropzone": "^14.2.3", "react-easy-crop": "^3.1.1", "react-i18next": "^11.7.3", "react-image-file-resizer": "^0.3.8", "react-router-dom": "5.2.0", - "react-scripts": "^3.4.3", + "react-scripts": "^4.0.0", "yup": "^1.2.0" }, "scripts": { diff --git a/jams-react-client/src/assets/jss/material-dashboard-react/components/cardHeaderStyle.js b/jams-react-client/src/assets/jss/material-dashboard-react/components/cardHeaderStyle.js index 7cb8f459a6687f32db2e3d66a941b4c0c8913d20..799fe484479a15dd75a73dfdba4d9e07af61f747 100644 --- a/jams-react-client/src/assets/jss/material-dashboard-react/components/cardHeaderStyle.js +++ b/jams-react-client/src/assets/jss/material-dashboard-react/components/cardHeaderStyle.js @@ -15,22 +15,24 @@ const cardHeaderStyle = { borderBottom: "none", background: "transparent", zIndex: "3 !important", - "&$cardHeaderPlain,&$cardHeaderIcon,&$cardHeaderStats,&$warningCardHeader,&$successCardHeader,&$dangerCardHeader,&$infoCardHeader,&$primaryCardHeader,&$roseCardHeader": { - margin: "0 15px", - padding: "0", - position: "relative", - color: whiteColor, - }, + "&$cardHeaderPlain,&$cardHeaderIcon,&$cardHeaderStats,&$warningCardHeader,&$successCardHeader,&$dangerCardHeader,&$infoCardHeader,&$primaryCardHeader,&$roseCardHeader": + { + margin: "0 15px", + padding: "0", + position: "relative", + color: whiteColor, + }, "&:first-child": { borderRadius: "calc(.25rem - 1px) calc(.25rem - 1px) 0 0", }, - "&$warningCardHeader,&$successCardHeader,&$dangerCardHeader,&$infoCardHeader,&$primaryCardHeader,&$roseCardHeader": { - "&:not($cardHeaderIcon)": { - borderRadius: "3px", - marginTop: "-20px", - padding: "15px", + "&$warningCardHeader,&$successCardHeader,&$dangerCardHeader,&$infoCardHeader,&$primaryCardHeader,&$roseCardHeader": + { + "&:not($cardHeaderIcon)": { + borderRadius: "3px", + marginTop: "-20px", + padding: "15px", + }, }, - }, "&$cardHeaderStats svg": { fontSize: "36px", lineHeight: "56px", @@ -65,10 +67,11 @@ const cardHeaderStyle = { }, }, cardHeaderIcon: { - "&$warningCardHeader,&$successCardHeader,&$dangerCardHeader,&$infoCardHeader,&$primaryCardHeader,&$roseCardHeader": { - background: "transparent", - boxShadow: "none", - }, + "&$warningCardHeader,&$successCardHeader,&$dangerCardHeader,&$infoCardHeader,&$primaryCardHeader,&$roseCardHeader": + { + background: "transparent", + boxShadow: "none", + }, "& i,& .material-icons": { width: "33px", height: "33px", diff --git a/jams-react-client/src/assets/jss/material-dashboard-react/components/cardIconStyle.js b/jams-react-client/src/assets/jss/material-dashboard-react/components/cardIconStyle.js index 572ed2cbdc2b3192645f477e20c83f6811d24055..b94080caa48018148dc73862d33b99e0ff8f0299 100644 --- a/jams-react-client/src/assets/jss/material-dashboard-react/components/cardIconStyle.js +++ b/jams-react-client/src/assets/jss/material-dashboard-react/components/cardIconStyle.js @@ -10,14 +10,15 @@ import { const cardIconStyle = { cardIcon: { - "&$warningCardHeader,&$successCardHeader,&$dangerCardHeader,&$infoCardHeader,&$primaryCardHeader,&$roseCardHeader": { - borderRadius: "3px", - backgroundColor: grayColor[0], - padding: "15px", - marginTop: "-20px", - marginRight: "15px", - float: "left", - }, + "&$warningCardHeader,&$successCardHeader,&$dangerCardHeader,&$infoCardHeader,&$primaryCardHeader,&$roseCardHeader": + { + borderRadius: "3px", + backgroundColor: grayColor[0], + padding: "15px", + marginTop: "-20px", + marginRight: "15px", + float: "left", + }, }, warningCardHeader, successCardHeader, diff --git a/jams-react-client/src/components/CaSetup/CaSetup.js b/jams-react-client/src/components/CaSetup/CaSetup.js index 647f68957d744625a9e356b776d54d38f8987fbe..0029e0058149efc9654a5ec8ca0c7946ee9dd42f 100644 --- a/jams-react-client/src/components/CaSetup/CaSetup.js +++ b/jams-react-client/src/components/CaSetup/CaSetup.js @@ -212,8 +212,9 @@ export default function CaSetup(props) { value={certificateOpt.value} onChange={handleCertifOptionChange} variant="outlined" - children={certificateOptionsItems} - /> + > + {certificateOptionsItems} + </Select> <TextField variant="outlined" @@ -312,8 +313,9 @@ export default function CaSetup(props) { variant="outlined" value={validityPeriod.value} onChange={handleValidPeriodChange} - children={validityPeriodsItems} - /> + > + {validityPeriodsItems} + </Select> <Button type="submit" @@ -358,8 +360,9 @@ export default function CaSetup(props) { value={certificateOpt.value} onChange={handleCertifOptionChange} variant="outlined" - children={certificateOptionsItems} - /> + > + {certificateOptionsItems} + </Select> <Typography variant="subtitle1" gutterBottom> CA file (PEM-encoded) </Typography> diff --git a/jams-react-client/src/components/CustomImgDropZone/CustomImgDropZone.js b/jams-react-client/src/components/CustomImgDropZone/CustomImgDropZone.js index 423eb972248044a93bc545b3dde2d4140a944002..988733d0fd46f9f6121ae251757b937925789959 100644 --- a/jams-react-client/src/components/CustomImgDropZone/CustomImgDropZone.js +++ b/jams-react-client/src/components/CustomImgDropZone/CustomImgDropZone.js @@ -33,15 +33,8 @@ const useStyles = makeStyles({ }); function CustomImgDropZone(props) { - const { - onDrop, - accept, - maxFiles, - label, - file, - handleDelete, - ...rest - } = props; + const { onDrop, accept, maxFiles, label, file, handleDelete, ...rest } = + props; const classes = useStyles(); const handleDrop = (acceptedFiles) => { diff --git a/jams-react-client/src/components/IdentityManagement/IdentityManagement.js b/jams-react-client/src/components/IdentityManagement/IdentityManagement.js index 4b4386a594df5837aa2fe11b4d130e0d3becbbdb..31e560ba8c6f6a60526ef34138b92041dcf222a6 100644 --- a/jams-react-client/src/components/IdentityManagement/IdentityManagement.js +++ b/jams-react-client/src/components/IdentityManagement/IdentityManagement.js @@ -323,8 +323,9 @@ export default function IdentityManagement(props) { value={directory.value} onChange={handleChangeDirectoryType} variant="outlined" - children={directoryTypesItems} - /> + > + {directoryTypesItems} + </Select> </Grid> </Grid> <LocalStorageForm @@ -379,8 +380,9 @@ export default function IdentityManagement(props) { value={directory.value} onChange={handleChangeDirectoryType} variant="outlined" - children={directoryTypesItems} - /> + > + {directoryTypesItems} + </Select> </Grid> </Grid> {returnForm(values, touched, errors, handleChange, handleBlur)} @@ -438,8 +440,9 @@ export default function IdentityManagement(props) { value={directory.value} onChange={handleChangeDirectoryType} variant="outlined" - children={directoryTypesItems} - /> + > + {directoryTypesItems} + </Select> </Grid> </Grid> {returnForm(values, touched, errors, handleChange, handleBlur)} diff --git a/jams-react-client/src/components/IdentityManagement/LdapStorageForm.js b/jams-react-client/src/components/IdentityManagement/LdapStorageForm.js index ab6f51bec40af9540c23e53ebc16784c8aa420af..df98d525a6f5d3bc23b6b65b423f601e2b0694d1 100644 --- a/jams-react-client/src/components/IdentityManagement/LdapStorageForm.js +++ b/jams-react-client/src/components/IdentityManagement/LdapStorageForm.js @@ -140,8 +140,9 @@ export default function LdapStorageForm(props) { value={props.ldapFilter.value} onChange={props.handleFilterIdChange} variant="outlined" - children={props.ldapFiltersTypesItems} - /> + > + {props.ldapFiltersTypesItems} + </Select> </Grid> </Grid> ); diff --git a/jams-react-client/src/components/PasswordDialog/PasswordDialog.js b/jams-react-client/src/components/PasswordDialog/PasswordDialog.js index a9c6bccef128a3c5dfefb7eb36cae01d612eb048..b3974c115d7edbcd05a68a6f4a64aa77af00a7cf 100644 --- a/jams-react-client/src/components/PasswordDialog/PasswordDialog.js +++ b/jams-react-client/src/components/PasswordDialog/PasswordDialog.js @@ -158,7 +158,7 @@ export default function PasswordDialog(props) { <form onSubmit={handleSubmit}> <DialogContent> <DialogContentText id="change-password-description"> - Change <strong>{props.username}'s</strong> password{" "} + Change <strong>{props.username}'s</strong> password </DialogContentText> <FormikField name="password" diff --git a/jams-react-client/src/components/ServerParameters/ServerParameters.js b/jams-react-client/src/components/ServerParameters/ServerParameters.js index 18451c0c165413b53cfe97225e060401eb09a8f7..7cb0c143de2bc5ad39f45abe38908bae4a67c36c 100644 --- a/jams-react-client/src/components/ServerParameters/ServerParameters.js +++ b/jams-react-client/src/components/ServerParameters/ServerParameters.js @@ -74,9 +74,8 @@ export default function ServerParameters(props) { const certificateRevocationTypesItems = tool.buildSelectMenuItems( certificateRevocationTypes ); - const deviceLifetimeTypesItems = tool.buildSelectMenuItems( - deviceLifetimeTypes - ); + const deviceLifetimeTypesItems = + tool.buildSelectMenuItems(deviceLifetimeTypes); const userAccountLifetimeTypesItems = tool.buildSelectMenuItems( userAccountLifetimeTypes ); @@ -244,8 +243,9 @@ export default function ServerParameters(props) { value={certificateRevocation.value} onChange={handleCertificateRevocationChange} variant="outlined" - children={certificateRevocationTypesItems} - /> + > + {certificateRevocationTypesItems} + </Select> <Typography variant="subtitle1" gutterBottom> {i18next.t("device_lifetime", "Device lifetime")} </Typography> @@ -255,8 +255,9 @@ export default function ServerParameters(props) { value={deviceLifetime.value} onChange={handleDeviceLifetimeChange} variant="outlined" - children={deviceLifetimeTypesItems} - /> + > + {deviceLifetimeTypesItems} + </Select> <Typography variant="subtitle1" gutterBottom> {i18next.t("user_account_lifetime", "User account lifetime")} </Typography> @@ -266,8 +267,9 @@ export default function ServerParameters(props) { value={userAccountLifetime.value} onChange={handleUserAccountLifetimeChange} variant="outlined" - children={userAccountLifetimeTypesItems} - /> + > + {userAccountLifetimeTypesItems} + </Select> {userlifeDisabled ? ( <span className="spanError"> {i18next.t( diff --git a/jams-react-client/src/tools.js b/jams-react-client/src/tools.js index eb0cec1340561e6636b4975c6fc4a5976dc2677a..e3df480d6d77b0a87386e35e31a360d24ac54707 100644 --- a/jams-react-client/src/tools.js +++ b/jams-react-client/src/tools.js @@ -2,7 +2,11 @@ import React from "react"; import MenuItem from "@material-ui/core/MenuItem"; export function buildSelectMenuItems(elements) { - return elements.map((d) => <MenuItem key={d.value} value={d.value}>{d.label}</MenuItem>); + return elements.map((d) => ( + <MenuItem key={d.value} value={d.value}> + {d.label} + </MenuItem> + )); } // read file content diff --git a/jams-react-client/src/views/Blueprint/EditBlueprintConfiguration.js b/jams-react-client/src/views/Blueprint/EditBlueprintConfiguration.js index 7017a89f0b3e1ea4f870688f8535862efc869a2d..588e8317c8d1239053ee4ada3c92f99fdde1409f 100644 --- a/jams-react-client/src/views/Blueprint/EditBlueprintConfiguration.js +++ b/jams-react-client/src/views/Blueprint/EditBlueprintConfiguration.js @@ -159,9 +159,8 @@ const StyledRadio = (props) => { export default function EditBlueprintConfiguration(props) { const classes = useStyles(); - const { policyData, updatePolicyData, snackbar, setSnackbar } = useContext( - PolicyDataContext - ); + const { policyData, updatePolicyData, snackbar, setSnackbar } = + useContext(PolicyDataContext); const { upnpEnabled, diff --git a/jams-react-client/src/views/Blueprint/EditBlueprintPermissions.js b/jams-react-client/src/views/Blueprint/EditBlueprintPermissions.js index acfaecb1f73fdd252a0480bf1d22376b60d3aa4d..3ae3e513d4be8fa4b29f6391f68b62491f0d4462 100644 --- a/jams-react-client/src/views/Blueprint/EditBlueprintPermissions.js +++ b/jams-react-client/src/views/Blueprint/EditBlueprintPermissions.js @@ -104,9 +104,8 @@ export default function EditBlueprintPermissions(props) { const classes = useStyles(); const history = useHistory(); - const { policyData, updatePolicyData, snackbar, setSnackbar } = useContext( - PolicyDataContext - ); + const { policyData, updatePolicyData, snackbar, setSnackbar } = + useContext(PolicyDataContext); const [openDrawer, setOpenDrawer] = useState(false); const [users, setUsers] = useState([]); diff --git a/jams-react-client/src/views/Blueprint/EditBlueprintUi.js b/jams-react-client/src/views/Blueprint/EditBlueprintUi.js index ccd33ac78c1a3bf8d2529db75a89a3e24d704a46..d5be85f831a02461b5c2ad15e28ab7cd0635542e 100644 --- a/jams-react-client/src/views/Blueprint/EditBlueprintUi.js +++ b/jams-react-client/src/views/Blueprint/EditBlueprintUi.js @@ -14,7 +14,12 @@ import GridContainer from "components/Grid/GridContainer.js"; import { hexToRgb, blackColor } from "assets/jss/material-dashboard-react.js"; -import { api_path_get_image, api_path_post_image, url_path, url_port } from "../../globalUrls"; +import { + api_path_get_image, + api_path_post_image, + url_path, + url_port, +} from "../../globalUrls"; import dashboardStyle from "assets/jss/material-dashboard-react/views/dashboardStyle.js"; @@ -93,9 +98,8 @@ const useStyles = makeStyles(styles); export default function EditBlueprintUi({ blueprintName }) { const classes = useStyles(); - const { policyData, updatePolicyData, snackbar, setSnackbar } = useContext( - PolicyDataContext - ); + const { policyData, updatePolicyData, snackbar, setSnackbar } = + useContext(PolicyDataContext); const { uiCustomization } = policyData; const setUiCustomization = (ui) => { diff --git a/jams-react-client/src/views/Blueprint/EditBlueprintUiForm.js b/jams-react-client/src/views/Blueprint/EditBlueprintUiForm.js index 5831a73b47dd3a6d22711d9551782eecb090a4db..333853308702dcbb13dbf23b3b5eea050a635dc5 100644 --- a/jams-react-client/src/views/Blueprint/EditBlueprintUiForm.js +++ b/jams-react-client/src/views/Blueprint/EditBlueprintUiForm.js @@ -271,7 +271,9 @@ const CustomBackgroundForm = ({ onDrop={(files) => { handleImgDrop(files, "background"); }} - label={i18next.t("upload_an_image", "Upload an image").toUpperCase()} + label={i18next + .t("upload_an_image", "Upload an image") + .toUpperCase()} file={bgFile} setFile={setBgFile} handleDelete={(e) => { @@ -330,7 +332,9 @@ const LogoForm = ({ <FormGroup row style={{ padding: "10px 0" }}> <CustomImgDropZone onDrop={(files) => handleImgDrop(files, "logo")} - label={i18next.t("upload_a_logotype", "Upload a logotype").toUpperCase()} + label={i18next + .t("upload_a_logotype", "Upload a logotype") + .toUpperCase()} file={logoFile} setFile={setLogoFile} handleDelete={(e) => { diff --git a/jams-react-client/src/views/Groups/EditGroup.js b/jams-react-client/src/views/Groups/EditGroup.js index dcbd5fd35872318fc7e49d9de610f861107d547f..f2323c32ba0da9dffce69885fa637bf842af52bf 100644 --- a/jams-react-client/src/views/Groups/EditGroup.js +++ b/jams-react-client/src/views/Groups/EditGroup.js @@ -436,9 +436,10 @@ export default function EditGroup(props) { value={selectedBlueprint.value} onChange={handleBlueprintsChange} variant="outlined" - children={blueprintsOptionsItems} disabled={blueprints.length === 0} - /> + > + {blueprintsOptionsItems} + </Select> </FormControl> </Grid> </Grid> diff --git a/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js b/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js index 0c4ca59493ddd964037503f490098edea7d84a67..45c82e1d061bba51a7a8960e5a9c9bce50ba11fa 100644 --- a/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js +++ b/jams-react-client/src/views/UserProfile/EditCreateUserProfile.js @@ -231,9 +231,8 @@ export default function EditCreateUserProfile(props) { const [progress, setProgress] = useState(0); const [profilePicture, setProfilePicture] = useState(""); - const [profilePicturePreview, setProfilePicturePreview] = useState( - noProfilePicture - ); + const [profilePicturePreview, setProfilePicturePreview] = + useState(noProfilePicture); const [originalUploadedImage, setOriginalUploadedImage] = useState(""); const [open, setOpen] = useState(false); @@ -687,9 +686,7 @@ export default function EditCreateUserProfile(props) { </InputAdornment> } endAdornment={ - values.username === "" ? ( - null - ) : userExists ? ( + values.username === "" ? null : userExists ? ( <CancelIcon style={{ color: "#cc0000" }} /> ) : ( <CheckCircleIcon @@ -801,7 +798,8 @@ export default function EditCreateUserProfile(props) { className={classes.button} startIcon={<RefreshIcon />} onClick={() => { - const newGeneratedPassword = passwordGenerator(); + const newGeneratedPassword = + passwordGenerator(); setFieldValue( "password", newGeneratedPassword,