diff --git a/jams-react-client/src/components/CustomUiPreview/CustomUiPreview.tsx b/jams-react-client/src/components/CustomUiPreview/CustomUiPreview.tsx index 598aa8afb506d993fa69bc22e767c9bbe11704b9..73dbb3810993c7f9904393ae4da5ed1e1673eada 100644 --- a/jams-react-client/src/components/CustomUiPreview/CustomUiPreview.tsx +++ b/jams-react-client/src/components/CustomUiPreview/CustomUiPreview.tsx @@ -113,22 +113,24 @@ export const CustomUiPreview: FC<CustomUiPreviewProps> = ({ opacity, uiCustomization, }) => { - let { + const { hasTitle, - title, hasDescription, - description, hasTips, hasBackground, - backgroundColor, - backgroundUrl, tipBoxAndIdColor, hasMainBoxColor, - mainBoxColor, hasLogo, - logoUrl, logoSize, } = uiCustomization; + let { + title, + description, + backgroundColor, + backgroundUrl, + mainBoxColor, + logoUrl, + } = uiCustomization; if (!title) { title = i18next.t("welcome_title", "Welcome to Jami"); diff --git a/jams-react-client/src/components/Footer/Footer.tsx b/jams-react-client/src/components/Footer/Footer.tsx index 2586f39059c7bd186fe47fd79e06593c378250ee..96f0c805c8c20ea4e58cc4c046e5ab259e91852e 100755 --- a/jams-react-client/src/components/Footer/Footer.tsx +++ b/jams-react-client/src/components/Footer/Footer.tsx @@ -4,7 +4,7 @@ import { makeStyles } from "@mui/styles"; // core components import styles from "assets/jss/material-dashboard-react/components/footerStyle"; -const pjson = require("../../../package.json"); +import pjson from "../../../package.json"; const useStyles = makeStyles(styles); diff --git a/jams-react-client/src/components/PasswordDialog/PasswordDialog.tsx b/jams-react-client/src/components/PasswordDialog/PasswordDialog.tsx index 60ad74868edb0f1b5a047ad055153cb4ca2de03d..a8dc9a3b37dc5e0bc54ce253cb3f3ba966e7a70f 100644 --- a/jams-react-client/src/components/PasswordDialog/PasswordDialog.tsx +++ b/jams-react-client/src/components/PasswordDialog/PasswordDialog.tsx @@ -31,7 +31,7 @@ import IconButton from "@mui/material/IconButton"; import { CopyToClipboard } from "react-copy-to-clipboard"; -let generator = require("generate-password"); +import generator from "generate-password"; const styles = (theme) => ({ root: { diff --git a/jams-react-client/src/components/ServerParameters/ServerParameters.tsx b/jams-react-client/src/components/ServerParameters/ServerParameters.tsx index 644e30269341447df802efde0582aabde7bc10ac..2c0fa736312dfdd0fd0e3cd3d03e2982a04cbd07 100644 --- a/jams-react-client/src/components/ServerParameters/ServerParameters.tsx +++ b/jams-react-client/src/components/ServerParameters/ServerParameters.tsx @@ -115,8 +115,8 @@ export default function ServerParameters({ setError, setErrorMessage }) { function handleSubmit(values: Settings) { let jsonData = {}; - let re = new RegExp(/^http[s]?:\/\/\w+(\.\w+)*(:[0-9]+)?\/?(\/[.\w]*)*$/); - let nohttpre = new RegExp(/^\w+(\.\w+)*(:[0-9]+)?\/?(\/[.\w]*)*$/); + const re = new RegExp(/^http[s]?:\/\/\w+(\.\w+)*(:[0-9]+)?\/?(\/[.\w]*)*$/); + const nohttpre = new RegExp(/^\w+(\.\w+)*(:[0-9]+)?\/?(\/[.\w]*)*$/); if (values.domain.match(nohttpre)) values.domain = window.location.protocol + "//" + values.domain; diff --git a/jams-react-client/src/components/Sidebar/Sidebar.tsx b/jams-react-client/src/components/Sidebar/Sidebar.tsx index d2750c6e26ed9ce9053ba3a78290ca74319e27dd..7dd27eb82e53d158b25fd902328b63595f65c3a7 100755 --- a/jams-react-client/src/components/Sidebar/Sidebar.tsx +++ b/jams-react-client/src/components/Sidebar/Sidebar.tsx @@ -46,13 +46,13 @@ export default function Sidebar(props) { } const { color, logo, image, routes } = props; - var brand = ( + const brand = ( <Link to={"/"}> <img src={logo} alt="logo" className={classes.img} /> </Link> ); - var links = ( + const links = ( <List className={classes.list}> <ListItem className={classes.itemLink}>{brand}</ListItem> <div className={classes.itemLinkSeparator}> @@ -113,7 +113,7 @@ export default function Sidebar(props) { </List> ); - var bottomLinks = ( + const bottomLinks = ( <List className={classes.bottomlist}> {open && ( <ListItem diff --git a/jams-react-client/src/tools.tsx b/jams-react-client/src/tools.tsx index c8bf330ba48f5efe55fd4643b939b63d2c13f334..4ddaa5100ca2bed477f38e239e266deef2cfc4a6 100644 --- a/jams-react-client/src/tools.tsx +++ b/jams-react-client/src/tools.tsx @@ -11,11 +11,11 @@ export function buildSelectMenuItems(elements) { // read file content export function readSingleFile(evt, fieldContents) { - var f = evt.target.files[0]; + const f = evt.target.files[0]; if (f) { - var r = new FileReader(); + const r = new FileReader(); r.onload = function (e) { - var contents = e.target.result; + const contents = e.target.result; fieldContents = contents; }; console.log(fieldContents); diff --git a/jams-react-client/src/views/Blueprints/Blueprints.tsx b/jams-react-client/src/views/Blueprints/Blueprints.tsx index 5579325c0a97a8972450608c86a1038b6a98b0da..9cd1caf322ce880e59625346649c65e759783ded 100644 --- a/jams-react-client/src/views/Blueprints/Blueprints.tsx +++ b/jams-react-client/src/views/Blueprints/Blueprints.tsx @@ -100,7 +100,7 @@ export default function Blueprints() { }, 500); axios(configApiCall(api_path_blueprints + "?name=*", "GET", null, null)) .then((response) => { - let allBluePrints = response.data; + const allBluePrints = response.data; if (allBluePrints.length === 0) setZeroBlueprint(true); else setZeroBlueprint(false); setBlueprints(allBluePrints); diff --git a/jams-react-client/src/views/Blueprints/CreateBlueprintDialog.tsx b/jams-react-client/src/views/Blueprints/CreateBlueprintDialog.tsx index bf1d2cbb6e6c888623343fa70fdec2c364e9e324..84f3aaf222249ed8f844595322e69e0df3d5ba34 100644 --- a/jams-react-client/src/views/Blueprints/CreateBlueprintDialog.tsx +++ b/jams-react-client/src/views/Blueprints/CreateBlueprintDialog.tsx @@ -75,7 +75,7 @@ export default function CreateBlueprintDialog({ open, setOpen }) { ); const handleCreateBlueprint = () => { - let defaultPolicyData = { + const defaultPolicyData = { videoEnabled: true, publicInCalls: false, allowCertFromContact: true, diff --git a/jams-react-client/src/views/Contacts/Contacts.tsx b/jams-react-client/src/views/Contacts/Contacts.tsx index 394f8852cc7623e65c148a36d5c93625516799ed..21728582a49fd4f5b6184f918efd8892d637be12 100644 --- a/jams-react-client/src/views/Contacts/Contacts.tsx +++ b/jams-react-client/src/views/Contacts/Contacts.tsx @@ -107,7 +107,7 @@ export default function Users(props) { ) ) .then((response) => { - let profiles = []; + const profiles = []; const profilesResults = response.data.profiles; profilesResults.forEach((profile) => { if (profile.username !== props.username) { diff --git a/jams-react-client/src/views/Groups/CreateGroupDialog.tsx b/jams-react-client/src/views/Groups/CreateGroupDialog.tsx index 9661ac59e5c8dc0da68f635aea9ea6379445b2af..47b5e7f35bfc1b893c951c5b9b9b37c035b84d0f 100644 --- a/jams-react-client/src/views/Groups/CreateGroupDialog.tsx +++ b/jams-react-client/src/views/Groups/CreateGroupDialog.tsx @@ -66,7 +66,7 @@ export default function CreateGroupDialog({ ) ) .then((response) => { - let allGroups = response.data; + const allGroups = response.data; setDisableCreate(false); setGroupNameExits(false); allGroups.forEach((group) => { diff --git a/jams-react-client/src/views/Groups/EditGroup.tsx b/jams-react-client/src/views/Groups/EditGroup.tsx index 44bb81bc69ce7fea8ea7ebbf9712fa549b198b64..e9284f897135347365a864533551d4bfa5ac2707 100644 --- a/jams-react-client/src/views/Groups/EditGroup.tsx +++ b/jams-react-client/src/views/Groups/EditGroup.tsx @@ -143,7 +143,7 @@ export default function EditGroup(props) { const getGroup = () => { axios(configApiCall(api_path_get_group + props.groupid, "GET", null, null)) .then((response) => { - let group = response.data; + const group = response.data; axios(configApiCall(api_path_blueprints + "?name=*", "GET", null, null)) .then((response) => { @@ -172,10 +172,10 @@ export default function EditGroup(props) { ) ) .then((response) => { - let members = response.data; + const members = response.data; members.forEach((member) => { getUserInfo(member.username).then((userInfo) => { - let newGroupMembers = groupMembers; + const newGroupMembers = groupMembers; newGroupMembers.push(userInfo); setGroupMembers(newGroupMembers); @@ -210,7 +210,7 @@ export default function EditGroup(props) { ); const updateGroup = (blueprintValue) => { - let data = { + const data = { name: newName, blueprint: blueprintValue ? blueprintValue : selectedBlueprint.label, }; @@ -241,7 +241,7 @@ export default function EditGroup(props) { ) ) .then((response) => { - let profiles = []; + const profiles = []; const profilesResults = response.data.profiles; profilesResults.forEach((profile) => { let existingUser = false; @@ -262,7 +262,7 @@ export default function EditGroup(props) { }; const addUserInGroup = (user) => { - let data = { + const data = { username: user.username, }; axios( @@ -274,7 +274,7 @@ export default function EditGroup(props) { ) ) .then(() => { - let newGroupMembers = groupMembers; + const newGroupMembers = groupMembers; newGroupMembers.push(user); setGroupMembers(newGroupMembers); @@ -290,7 +290,7 @@ export default function EditGroup(props) { }; const deleteUserFromGroup = (user) => { - let data = { + const data = { username: user.username, }; axios( @@ -302,7 +302,7 @@ export default function EditGroup(props) { ) ) .then(() => { - let newGroupMembers = groupMembers; + const newGroupMembers = groupMembers; newGroupMembers.splice(newGroupMembers.indexOf(user), 1); setGroupMembers(newGroupMembers); diff --git a/jams-react-client/src/views/Groups/Groups.tsx b/jams-react-client/src/views/Groups/Groups.tsx index 63b8adb2ed29c72707c0a7241f0af6329a4f9c0e..2213d7fc75b0c9f13fdda1be5041f4ad30117c85 100644 --- a/jams-react-client/src/views/Groups/Groups.tsx +++ b/jams-react-client/src/views/Groups/Groups.tsx @@ -139,7 +139,7 @@ export default function Groups() { axios(configApiCall(api_path_get_list_group, "GET", null, null)) .then((response) => { - let allGroups = response.data; + const allGroups = response.data; allGroups.forEach((group) => { axios( diff --git a/jams-react-client/src/views/Settings/General.tsx b/jams-react-client/src/views/Settings/General.tsx index 2d8ade87e3e8f5715abe1290f7cc3ebd7cef2d24..ff62940e41a67a75b9d3817f5d41d19d441f0811 100644 --- a/jams-react-client/src/views/Settings/General.tsx +++ b/jams-react-client/src/views/Settings/General.tsx @@ -30,9 +30,8 @@ import i18next from "i18next"; import LanguagePicker from "../../components/LanguagePicker/LanguagePicker"; -const pjson = require("../../../package.json"); - -let generator = require("generate-password"); +import pjson from "../../../package.json"; +import generator from "generate-password"; const useStyles = makeStyles((theme) => ({ paper: { diff --git a/jams-react-client/src/views/UserProfile/AdminAddUserToGroup.tsx b/jams-react-client/src/views/UserProfile/AdminAddUserToGroup.tsx index 9423c60dc90b7b2fdf12d6c3d434c45576596d50..a05f7b586f6c0ee61c36d7ab54a8f1ca0bb96487 100644 --- a/jams-react-client/src/views/UserProfile/AdminAddUserToGroup.tsx +++ b/jams-react-client/src/views/UserProfile/AdminAddUserToGroup.tsx @@ -91,7 +91,7 @@ const AdminAddUserToGroup: FC<AdminAddUserToGroupProps> = ({ ) ) .then(() => { - let newGroupMemberships = groupMemberships; + const newGroupMemberships = groupMemberships; newGroupMemberships.push({ groupId: group.id, name: group.name, diff --git a/jams-react-client/src/views/UserProfile/DisplayUserProfile.tsx b/jams-react-client/src/views/UserProfile/DisplayUserProfile.tsx index 19216cd864d0861ae7f2dd78b9ce7032cf732aaf..bed01123957b08a0d412df063ead1a25cf71c49c 100644 --- a/jams-react-client/src/views/UserProfile/DisplayUserProfile.tsx +++ b/jams-react-client/src/views/UserProfile/DisplayUserProfile.tsx @@ -230,7 +230,7 @@ const DisplayUserProfile: FC<DisplayUserProfileProps> = ({ ) ) .then(() => { - let newGroupMemberships = groupMemberships; + const newGroupMemberships = groupMemberships; newGroupMemberships.splice(newGroupMemberships.indexOf(group), 1); setGroupMemberships(newGroupMemberships); }) @@ -265,7 +265,7 @@ const DisplayUserProfile: FC<DisplayUserProfileProps> = ({ null ) ).then((userGroups) => { - let userGroupsData: UserGroup[] = userGroups.data; + const userGroupsData: UserGroup[] = userGroups.data; userGroupsData.forEach((group) => { axios( configApiCall(api_path_get_group + group.groupId, "GET", null, null) diff --git a/jams-react-client/src/views/UserProfile/EditCreateUserProfile.tsx b/jams-react-client/src/views/UserProfile/EditCreateUserProfile.tsx index 0cfde3113f0b811ac0d80b4eefc2876ffc97218c..32ffc2816afeb05db349c0141b548fc21a80b096 100644 --- a/jams-react-client/src/views/UserProfile/EditCreateUserProfile.tsx +++ b/jams-react-client/src/views/UserProfile/EditCreateUserProfile.tsx @@ -73,8 +73,7 @@ import LinearProgress from "@mui/material/LinearProgress"; import i18next from "i18next"; -let generator = require("generate-password"); - +import generator from "generate-password"; const fileUpload = require("fuctbase64"); const styles = (theme) => ({ @@ -637,7 +636,7 @@ export default function EditCreateUserProfile(props) { alt="..." className={classes.editProfilePicture} onClick={() => { - let pictureChange = document.getElementById( + const pictureChange = document.getElementById( "change-profile-picture" ); pictureChange.click();