{"version":3,"sources":["utilities/enums/index.tsx","auth/instance.ts","utilities/useIsMounted/index.tsx","utilities/openNewTab/index.tsx","assets/image-solid.svg","components/SimulationCard/index.tsx","components/Modal/index.tsx","components/DeleteModal/index.tsx","utilities/gatewayHelper/index.tsx","gateway/Simulation/index.tsx","utilities/useMessage/index.tsx","utilities/messageHelper/index.tsx","utilities/inputHelper/index.tsx","components/DownloadDataModal/index.tsx","components/SimulationAddEditModal/index.tsx","components/EmptyListPlaceholder/index.tsx","components/FileUploadingIndicator/index.tsx","gateway/AzureStorage/index.tsx","gateway/FileManagement/index.tsx","utilities/fileHelper/index.tsx","components/SimulationCardList/index.tsx","components/PaginationSection/index.tsx","components/FloatingActionButton/index.tsx","components/InitialSection/index.tsx","components/PageLoader/index.tsx","utilities/pagination/index.tsx","containers/Simulations/index.tsx","utilities/dateHelper/index.tsx","assets/m-neo3-7.jpg","components/DeviceCard/index.tsx","components/SimulationLinkModal/index.tsx","components/NotificationModal/index.tsx","gateway/Device/index.tsx","components/DeviceCardList/index.tsx","containers/Devices/index.tsx","components/WebPasswordCard/index.tsx","components/WebPasswordAddEditModal/index.tsx","gateway/WebPassword/index.tsx","components/WebPasswordCardList/index.tsx","containers/WebPasswords/index.tsx","constants.tsx","gateway/Auth/index.tsx","auth/AuthProvider.tsx","assets/coc-logo.svg","components/Navbar/index.tsx","components/CustomListItem/index.tsx","assets/maltese-cross.jpg","assets/red-iron-logo.jpg","assets/vizworx-horizontal-no-icon.png","assets/cop-logo.jpg","components/SideMenuBottomLogos/index.tsx","components/SideMenuBottomVersion/index.tsx","components/SideMenu/index.tsx","containers/App/index.tsx","components/RequestInterceptor/index.tsx","containers/AppAuthWrapper/index.tsx","App.tsx","index.tsx"],"names":["SimulationCardVariants","SimulationPlatformType","MessageVariants","PlatformWebUploadStatus","SimulationDisplay","createInstance","msalConfig","msalInstance","PublicClientApplication","addEventCallback","event","eventType","EventType","LOGIN_SUCCESS","payload","account","setActiveAccount","useIsMounted","isMounted","useRef","useEffect","current","useCallback","onClickUrl","url","newWindow","window","open","opener","openInNewTab","SimulationCard","index","simulation","variant","image","isSimulationDeleted","handleUploadVR","handleUploadWeb","handleUploadImage","handleDownloadData","handleEditModalOpen","handleDeleteModalOpen","handleDeviceLibraryAdd","handleDeviceLibraryRemove","handleRestore","setSelectedSimulation","useState","anchorEl","setAnchorEl","undefined","imageDisplay","setImageDisplay","imageSolid","handleMenu","currentTarget","handleClose","handleUploadImageOnClick","Fade","in","Card","raised","className","Grid","container","item","md","xl","sx","display","xs","Skeleton","width","height","animation","imageClass","CardMedia","component","src","alt","name","ImageElement","CardHeader","action","ShowMenu","IconButton","id","Boolean","onClick","icon","faEllipsisV","size","isAdd","Add","faPlusSquare","faMinusSquare","title","SIMULATION","CARD","HEADER","ACTION_BUTTON","ADD","REMOVE","handleClick","HeaderActionButton","hasVR","platforms","some","platform","type","VR","hasWeb","Web","webUrl","find","data","chipVRTitle","TITLE","VR_CHIP","UPLOADED","NOT_UPLOADED","chipWebTitle","WEB_CHIP","Typography","Chip","faVrCardboard","disabled","faGlobe","HeaderTitle","CardContent","description","Menu","MenuListProps","anchorOrigin","vertical","horizontal","transformOrigin","keepMounted","onClose","TransitionComponent","MenuItem","OPTIONS","WEB","Tooltip","classes","tooltip","placement","IMAGE_UPLOAD_HELPER","IMAGE","DOWNLOAD","EDIT","DELETE","RESTORE","Modal","children","cancelText","confirmText","danger","big","hideCancel","confirmDisabled","handleModalClose","handleModalConfirm","Dialog","paper","DialogTitle","faExclamationCircle","DialogContent","root","DialogActions","Button","DeleteModal","contentText","mt","mb","isResponseValid","response","state","Error","statusText","value","getAllSimulations","params","a","axios","get","WEB_SERVICE_URL","then","catch","error","updateSimulation","put","insertSimulation","post","deleteSimulation","delete","insertSimulationPlatform","getSimulationSurveyData","useMessage","enqueueSnackbar","useSnackbar","message","autoHideDuration","checkMessageText","errorText","errorTextAuth","toString","includes","handleInputOnChange","setValue","target","handleCheckedInputOnChange","checked","DownloadDataModal","simulationId","questionnaire","setQuestionnaire","interaction","setInteraction","setData","handleExportButton","includeQuestionnaire","includeInteraction","csvLinkRef","link","click","MESSAGES","DOWNLOAD_DATA_SUCCESS","Success","messageText","DOWNLOAD_DATA_ERROR","DOWNLOAD_DATA_ERROR_AUTH","handlePostDataDownload","CheckboxLabel","text","reset","FormControl","m","focused","FormLabel","FormGroup","FormControlLabel","control","Checkbox","onChange","label","ref","filename","SimulationAddEditModal","nameLabel","nameValue","packageNameLabel","packageNameValue","descriptionLabel","descriptionValue","setNameValue","setPackageNameValue","setDescriptionValue","localName","setLocalName","localPackageName","setLocalPackageName","localDescription","setLocalDescription","length","TextField","autoFocus","margin","fullWidth","onBlur","multiline","minRows","maxRows","InputProps","input","EmptyListPlaceholder","justifyContent","FileUploadingIndicator","isFileUploading","Backdrop","gutterBottom","Box","position","CircularProgress","top","left","bottom","right","alignItems","color","Math","round","downloadFileFromStorage","blobFileName","parsedURL","accountName","anonymousCredential","AnonymousCredential","pipeline","newPipeline","retryOptions","maxTries","blobServiceClient","BlobServiceClient","sasKey","containerClient","getContainerClient","containerName","blockBlobClient","getBlobClient","getBlockBlobClient","download","_response","status","blobBody","uploadFileToStorage","file","progressCallBack","uploadData","blobHTTPHeaders","blobContentType","onProgress","e","loadedBytes","storage","upload","getSimulationsStorageParams","getWebStorageParams","uploadImageToStorage","fileName","uploadFileToWebStorage","getImageFromStorage","blob","URL","createObjectURL","blobToFile","theBlob","File","extractFile","f","tmpPath","unzip","zinfo","SimulationCardList","simulations","allSimulationsImageData","handleSpecificUpdate","handleSpecificUpdatePlatform","handleSpecificDelete","handleSpecificRestore","downloadDataModalOpen","setDownloadDataModalOpen","editModalOpen","setEditModalOpen","deleteModalOpen","setDeleteModalOpen","selectedSimulation","editSimulationName","setEditSimulationName","editSimulationPackageName","setEditSimulationPackageName","editSimulationDescription","setEditSimulationDescription","setIsFileUploading","progressValue","setProgressValue","uploaderText","setUploaderText","inputFileImage","inputFileVR","inputFileWeb","handleDownloadDataModalOpen","handleDownloadDataModalClose","handleEditModalClose","handleProgressUpdate","bytes","lastBytes","totalSize","lastProgress","handleEditModalConfirm","updateData","packageName","UPDATE_SUCCESS","UPDATE_ERROR","UPDATE_ERROR_AUTH","handleDeleteModalClose","handleDeleteModalConfirm","DELETE_SUCCESS","DELETE_ERROR","DELETE_ERROR_AUTH","uploadImage","uniqueFileName","uuidv4","split","progress","simulationData","IMAGE_UPLOAD_SUCCESS","IMAGE_UPLOAD_ERROR","IMAGE_UPLOAD_ERROR_AUTH","handleUploadImageClick","uploadFile","FILE_UPLOADING","isVR","simulationPlatformData","simulationPlatform","successText","VR_UPLOAD_SUCCESS","WEB_UPLOAD_SUCCESS","VR_UPLOAD_ERROR","WEB_UPLOAD_ERROR","VR_UPLOAD_ERROR_AUTH","WEB_UPLOAD_ERROR_AUTH","uploadMultipleFiles","files","simId","Promise","reject","postSimulationPlatform","handleUploadVRClick","stopPropagation","entries","fileArray","FILE_EXTRACTING","mime","lookup","unzippedFile","push","simID","handleUploadWebClick","RESTORE_SUCCESS","RESTORE_ERROR","RESTORE_ERROR_AUTH","spacing","EMPTY_LIST_PLACEHOLDER","map","lg","imageData","MODAL","CONFIRM","CANCEL","NAME_LABEL","PACKAGE_NAME_LABEL","DESCRIPTION_LABEL","CONTENT","accept","PaginationSection","page","count","direction","alignContent","Pagination","FloatingActionButton","Fab","faPlus","InitialSection","pageTitle","displayFilter","displayModeSelector","currentMode","onFilterChange","onNonDeletedModeClick","onDeletedModeClick","INITIAL_SECTION","ACTIVE_SIMULATIONS","disableFocusRipple","disableRipple","NonDeleted","faFolderOpen","faGripLinesVertical","DELETED_SIMULATIONS","Deleted","faTrash","PageLoader","getPagesCount","array","perPage","SIMULATIONS_PER_PAGE","ceil","itemsToRender","currentPage","currentPageIndex","firstIndex","endIndex","slice","filterItemsPerName","filter","Simulations","setSimulations","simulationImages","setSimulationImages","deletedSimulations","setDeletedSimulations","deletedSimulationImages","setDeletedSimulationImages","setFilter","setPage","modalOpen","setModalOpen","addSimulationName","setAddSimulationName","addSimulationPackageName","setAddSimulationPackageName","addSimulationDescription","setAddSimulationDescription","loading","setLoading","loadingDeleted","setLoadingDeleted","mode","setMode","fetchData","allSimulations","sort","b","Date","parse","creationDate","FETCH_ERROR","FETCH_ERROR_AUTH","fetchDataDeleted","isDeleted","allDeletedSimulations","FETCH_DELETED_ERROR","FETCH_DELETED_ERROR_AUTH","loadImages","imagesPromises","allSettled","results","imagesData","result","loadImagesDeleted","filteredSimulations","filteredDeletedSimulations","handleAddModalClose","clearAddModalValues","handleAddModalConfirm","insertData","newSimulation","handleSpecificInsertion","CREATE_SUCCESS","CREATE_ERROR","CREATE_ERROR_AUTH","newSimulations","unshift","restoredSimulation","newDeletedSimulations","findIndex","newPlatform","shouldKeep","deletedSimulation","Loading","CardList","simulationsToRender","images","Container","maxWidth","disableGutters","PAGE_TITLE","localizeDate","date","localDate","setTime","getTime","getTimezoneOffset","DeviceCard","device","handleManageModalOpen","setSelectedDevice","picoNeo3","noWrap","format","lastOnlineDate","DEVICE","MANAGE","SimulationLinkModal","addedSimulations","availableSimulations","loadingSimulationData","SimulationCards","simulationsList","emptyText","SIMULATION_LINK","LEFT_HEADER","LEFT_HEADER_TOOLTIP","faInfoCircle","Remove","LEFT_EMPTY_LIST_PLACEHOLDER","Divider","orientation","RIGHT_HEADER","RIGHT_HEADER_TOOLTIP","RIGHT_EMPTY_LIST_PLACEHOLDER","NotificationModal","getAllDevices","deleteDevice","insertIntoLibrary","deviceId","deleteFromLibrary","DeviceCardList","devices","shouldFetch","setShouldFetch","manageModalOpen","setManageModalOpen","notificationModalOpen","setNotificationModalOpen","selectedDevice","otherSimulations","setOtherSimulations","setLoadingSimulationData","fetchSimulationData","vrSimulations","deviceLibrary","otherOptions","librarySimulation","SIMULATION_FETCH_ERROR","SIMULATION_FETCH_ERROR_AUTH","handleDeviceSimulationInsertion","selectedDeviceCurrent","updatedDevice","newOther","handleDeviceSimulationDelete","currentSimulations","newOtherSimulation","addedSimulation","ADD_TO_LIBRARY_SUCCESS","ADD_TO_LIBRARY_ERROR","ADD_TO_LIBRARY_ERROR_AUTH","REMOVE_FROM_LIBRARY_SUCCESS","REMOVE_FROM_LIBRARY_ERROR","REMOVE_FROM_LIBRARY_ERROR_AUTH","handleManageModalClose","deviceData","handleNotificationModalOpen","handleNotificationModalClose","NOTIFICATION","Devices","setDevices","allDevices","filteredDevices","newDevices","DEVICES_PER_PAGE","WebPasswordCard","webPassword","setSelectedWebPassword","userType","password","disableUnderline","endAdornment","InputAdornment","navigator","clipboard","writeText","WEB_PASSWORD","COPY_TO_CLIPBOARD","faCopy","WebPasswordAddEditModal","userTypeLabel","userTypeValue","passwordLabel","passwordValue","setUserTypeValue","setPasswordValue","localUserType","setLocalUserType","localPassword","setLocalPassword","getAllWebPasswords","updateWebPassword","insertWebPassword","deleteWebPassword","WebPasswordCardList","webPasswords","selectedWebPassword","editUserType","setEditUserType","editPassword","setEditPassword","USER_TYPE_LABEL","PASSWORD_LABEL","WebPasswords","setWebPasswords","addWebPasswordUserType","setAddWebPasswordUserType","addWebPasswordPassword","setAddWebPasswordPassword","allWebPasswords","localeCompare","filteredWebPasswords","filterWebPasswordsPerUserType","newWebPassword","newWebPasswords","webPasswordData","WEB_PASSWORDS_PER_PAGE","ROUTES_DATA","linkPath","routePaths","faFireAlt","fixedWidth","faLock","VERSION_TEXT","version","process","REACT_APP_WEB_SERVICE_URL","location","origin","getAuthParams","AuthProvider","instance","setInstance","fetchAuthParams","authParams","config","auth","clientId","authority","tenantId","redirectUri","postLogoutRedirectUri","cache","cacheLocation","storeAuthStateInCookie","createdInstance","console","Navbar","userName","handleLogoClick","handleLogout","AppBar","Toolbar","logo","ml","Avatar","fullName","names","initials","firstNameInitial","substring","toUpperCase","lastNameInitial","join","getUserNameInitials","CustomListItem","to","selected","ListItemButton","Link","ListItemIcon","ListItemText","primary","SideMenuBottomLogos","vizworxLogo","redIronLogo","copLogo","cfdLogo","SideMenuBottomVersion","SideMenu","items","useLocation","Drawer","List","disablePadding","pathname","ListItem","App","exact","path","RequestInterceptor","useMsal","accounts","useAccount","onRequest","scopes","getConfiguration","redirectRequest","silentRequest","acquireTokenSilent","bearer","accessToken","headers","Authorization","interceptors","request","use","AppAuthWrapper","history","useHistory","setUserName","useMsalAuthentication","InteractionType","Redirect","getActiveAccount","logoutRequest","logoutRedirect","theme","createTheme","typography","fontFamily","breakpoints","values","sm","Application","ThemeProvider","ReactDOM","render","StrictMode","document","getElementById"],"mappings":"8pBAIYA,EAMAC,EAKAC,EAKAC,EAOAC,E,6HCJGC,EAfQ,SAACC,GACtB,IAAMC,EAAwC,IAAIC,IAAwBF,GAW1E,OATAC,EAAaE,kBAAiB,SAACC,GAC7B,GAAIA,EAAMC,YAAcC,IAAUC,eAAiBH,EAAMI,QAAS,CAChE,IACMC,EADUL,EAAMI,QACEC,QAExBR,EAAaS,iBAAiBD,OAI3BR,G,mNDhBGP,K,oBAAAA,E,UAAAA,E,iBAAAA,M,cAMAC,K,QAAAA,E,WAAAA,M,cAKAC,K,kBAAAA,E,eAAAA,M,cAKAC,K,kBAAAA,E,wBAAAA,E,kBAAAA,E,aAAAA,M,cAOAC,K,wBAAAA,E,mBAAAA,M,KEpBZ,IAcea,EAdM,WACnB,IAAMC,EAAYC,kBAAO,GAUzB,OARAC,qBAAU,WAGR,OAFAF,EAAUG,SAAU,EAEb,WACLH,EAAUG,SAAU,KAErB,IAEIC,uBAAY,kBAAMJ,EAAUG,UAAS,KCHxCE,EACJ,SAACC,GAAD,OACA,kBAZmB,SAACA,GACpB,IAAMC,EAAYC,OAAOC,KAAKH,EAAK,SAAU,uBACzCC,IAAWA,EAAUG,OAAS,MAWhCC,CAAaL,KClBF,MAA0B,wC,gBC6T1BM,EAtQwC,SAAC,GAgBjD,IAfLC,EAeI,EAfJA,MACAC,EAcI,EAdJA,WACAC,EAaI,EAbJA,QACAC,EAYI,EAZJA,MACAC,EAWI,EAXJA,oBAWI,IAVJC,sBAUI,MAVa,aAUb,MATJ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BVS,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,GAAD,MAEFC,SAASC,eAAe,W","file":"static/js/main.e193229c.chunk.js","sourcesContent":["/**\r\n * A simulation card can have three variants: ShowMenu, Add or Remove.\r\n * They affect the card's header, with `ShowMenu` having a context menu, `Add` having a green plus iconed button, and `Remove` having a red minus iconed button.\r\n */\r\nexport enum SimulationCardVariants {\r\n ShowMenu = \"ShowMenu\",\r\n Add = \"Add\",\r\n Remove = \"Remove\",\r\n}\r\n\r\nexport enum SimulationPlatformType {\r\n VR = \"VR\",\r\n Web = \"Web\",\r\n}\r\n\r\nexport enum MessageVariants {\r\n Success = \"success\",\r\n Error = \"error\",\r\n}\r\n\r\nexport enum PlatformWebUploadStatus {\r\n InQueue = \"InQueue\",\r\n InProgress = \"InProgress\",\r\n Success = \"Success\",\r\n Fail = \"Fail\",\r\n}\r\n\r\nexport enum SimulationDisplay {\r\n NonDeleted = \"NonDeleted\",\r\n Deleted = \"Deleted\",\r\n}\r\n","import {\r\n PublicClientApplication,\r\n EventType,\r\n EventMessage,\r\n AuthenticationResult,\r\n} from \"@azure/msal-browser\";\r\nimport { Configuration } from \"@azure/msal-browser\";\r\n\r\nconst createInstance = (msalConfig: Configuration): PublicClientApplication => {\r\n const msalInstance: PublicClientApplication = new PublicClientApplication(msalConfig);\r\n\r\n msalInstance.addEventCallback((event: EventMessage) => {\r\n if (event.eventType === EventType.LOGIN_SUCCESS && event.payload) {\r\n const payload = event.payload as AuthenticationResult;\r\n const account = payload.account;\r\n\r\n msalInstance.setActiveAccount(account);\r\n }\r\n });\r\n\r\n return msalInstance;\r\n};\r\n\r\nexport default createInstance;\r\n","import { useCallback, useEffect, useRef } from \"react\";\r\n\r\n/**\r\n * Helper hook to check if the component is mounted.\r\n * This is used so that we avoid the \"Can't perform a React state update on an unmounted component\" issue.\r\n * @returns {(() => boolean)} A function returning true or false.\r\n */\r\nconst useIsMounted = (): (() => boolean) => {\r\n const isMounted = useRef(false);\r\n\r\n useEffect(() => {\r\n isMounted.current = true;\r\n\r\n return () => {\r\n isMounted.current = false;\r\n };\r\n }, []);\r\n\r\n return useCallback(() => isMounted.current, []);\r\n};\r\n\r\nexport default useIsMounted;\r\n","/**\r\n * Method to open a link in a new tab.\r\n * @param {string} url The url to be opened.\r\n * @returns {void} Nothing is returned.\r\n */\r\nconst openInNewTab = (url: string): void => {\r\n const newWindow = window.open(url, \"_blank\", \"noopener,noreferrer\");\r\n if (newWindow) newWindow.opener = null;\r\n};\r\n\r\n/**\r\n * Function that wrapps the openInNewTab method, returning a function.\r\n * @param {string} url The url to be opened.\r\n * @returns {(() => void)} The function wrapping the openInNewTab method.\r\n */\r\nconst onClickUrl =\r\n (url: string): (() => void) =>\r\n () =>\r\n openInNewTab(url);\r\n\r\nexport { openInNewTab, onClickUrl };\r\n","export default __webpack_public_path__ + \"static/media/image-solid.3dbba70b.svg\";","import React, { useState, useEffect } from \"react\";\r\n\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport {\r\n IconDefinition,\r\n faVrCardboard,\r\n faGlobe,\r\n faPlusSquare,\r\n faMinusSquare,\r\n faEllipsisV,\r\n} from \"@fortawesome/free-solid-svg-icons\";\r\nimport Grid from \"@mui/material/Grid\";\r\nimport Card from \"@mui/material/Card\";\r\nimport CardHeader from \"@mui/material/CardHeader\";\r\nimport CardContent from \"@mui/material/CardContent\";\r\nimport CardMedia from \"@mui/material/CardMedia\";\r\nimport Typography from \"@mui/material/Typography\";\r\nimport Chip from \"@mui/material/Chip\";\r\nimport IconButton from \"@mui/material/IconButton\";\r\nimport MenuItem from \"@mui/material/MenuItem\";\r\nimport Menu from \"@mui/material/Menu\";\r\nimport Fade from \"@mui/material/Fade\";\r\nimport Skeleton from \"@mui/material/Skeleton\";\r\nimport Tooltip from \"@mui/material/Tooltip\";\r\n\r\nimport { Simulation, Platform, SimulationImageLink } from \"../../utilities/types\";\r\nimport {\r\n SimulationCardVariants,\r\n SimulationPlatformType,\r\n} from \"../../utilities/enums\";\r\nimport useIsMounted from \"./../../utilities/useIsMounted\";\r\nimport { onClickUrl } from \"../../utilities/openNewTab\";\r\nimport { SIMULATION } from \"./../../constants\";\r\n\r\nimport imageSolid from \"../../assets/image-solid.svg\";\r\nimport \"./styles.scss\";\r\n\r\ntype Props = {\r\n index: number;\r\n simulation: Simulation;\r\n variant: SimulationCardVariants;\r\n image: SimulationImageLink;\r\n isSimulationDeleted: boolean;\r\n handleUploadVR?: () => void;\r\n handleUploadWeb?: () => void;\r\n handleUploadImage?: () => void;\r\n handleDownloadData?: () => void;\r\n handleEditModalOpen?: () => void;\r\n handleDeleteModalOpen?: () => void;\r\n handleDeviceLibraryAdd?: () => void;\r\n handleDeviceLibraryRemove?: () => void;\r\n handleRestore?: () => void;\r\n setSelectedSimulation?: (simulation: Simulation) => void;\r\n};\r\n\r\nconst SimulationCard: React.FunctionComponent = ({\r\n index,\r\n simulation,\r\n variant,\r\n image,\r\n isSimulationDeleted,\r\n handleUploadVR = (): void => {},\r\n handleUploadWeb = (): void => {},\r\n handleUploadImage = (): void => {},\r\n handleDownloadData = (): void => {},\r\n handleEditModalOpen = (): void => {},\r\n handleDeleteModalOpen = (): void => {},\r\n handleDeviceLibraryAdd = (): void => {},\r\n handleDeviceLibraryRemove = (): void => {},\r\n handleRestore = () => (): void => {},\r\n setSelectedSimulation = (simulation: Simulation): void => {},\r\n}) => {\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n const [imageDisplay, setImageDisplay] = useState(undefined);\r\n\r\n const isMounted = useIsMounted();\r\n\r\n /**\r\n * If image is undefined, it means it is still being loaded.\r\n * If image is null, it means the simulation has no image, so we use a default image.\r\n * Else, we have the image's link.\r\n */\r\n useEffect(() => {\r\n if (image === undefined) return;\r\n if (image === null) {\r\n if (isMounted()) setImageDisplay(imageSolid);\r\n } else {\r\n if (isMounted()) setImageDisplay(image);\r\n }\r\n }, [image, isMounted]);\r\n\r\n const handleMenu = (event: React.MouseEvent): void => {\r\n setSelectedSimulation(simulation);\r\n setAnchorEl(event.currentTarget);\r\n };\r\n\r\n const handleClose = (): void => {\r\n setAnchorEl(null);\r\n };\r\n\r\n const HeaderTitle = (): React.ReactNode => {\r\n const hasVR = simulation.platforms.some(\r\n (platform: Platform) => platform.type === SimulationPlatformType.VR\r\n );\r\n const hasWeb = simulation.platforms.some(\r\n (platform: Platform) =>\r\n platform.type === SimulationPlatformType.Web\r\n );\r\n const webUrl: string | undefined = simulation.platforms.find(\r\n (platform: Platform) => platform.type === SimulationPlatformType.Web\r\n )?.data?.url;\r\n\r\n const chipVRTitle = hasVR\r\n ? SIMULATION.CARD.HEADER.TITLE.VR_CHIP.UPLOADED\r\n : SIMULATION.CARD.HEADER.TITLE.VR_CHIP.NOT_UPLOADED;\r\n const chipWebTitle = hasWeb\r\n ? SIMULATION.CARD.HEADER.TITLE.WEB_CHIP.UPLOADED\r\n : SIMULATION.CARD.HEADER.TITLE.WEB_CHIP.NOT_UPLOADED;\r\n\r\n return (\r\n
\r\n \r\n {simulation.name}\r\n \r\n
\r\n }\r\n className=\"vr\"\r\n disabled={!hasVR}\r\n title={chipVRTitle}\r\n />\r\n }\r\n className=\"web\"\r\n disabled={!hasWeb}\r\n title={chipWebTitle}\r\n {...(webUrl && { onClick: onClickUrl(webUrl) })}\r\n />\r\n
\r\n
\r\n );\r\n };\r\n\r\n const Loading = (): React.ReactNode => (\r\n \r\n );\r\n\r\n const ImageElement = (): React.ReactNode => {\r\n const imageClass: string = image && imageDisplay ? \"withImage\" : \"nullImage\";\r\n return (\r\n \r\n );\r\n };\r\n\r\n const handleUploadVROnClick = (): void => {\r\n handleUploadVR();\r\n handleClose();\r\n };\r\n\r\n const handleUploadWebOnClick = (): void => {\r\n handleUploadWeb();\r\n handleClose();\r\n };\r\n\r\n const handleUploadImageOnClick = (): void => {\r\n handleUploadImage();\r\n handleClose();\r\n };\r\n\r\n const handleDownloadOnClick = (): void => {\r\n handleDownloadData();\r\n handleClose();\r\n };\r\n\r\n const handleEditOnClick = (): void => {\r\n handleEditModalOpen();\r\n handleClose();\r\n };\r\n\r\n const handleDeleteOnClick = (): void => {\r\n handleDeleteModalOpen();\r\n handleClose();\r\n };\r\n\r\n const handleRestoreOnClick = (): void => {\r\n handleRestore();\r\n handleClose();\r\n };\r\n\r\n const HeaderActionButton = (): React.ReactNode => {\r\n if (variant === SimulationCardVariants.ShowMenu) {\r\n return (\r\n \r\n \r\n \r\n );\r\n }\r\n\r\n const isAdd: boolean = variant === SimulationCardVariants.Add;\r\n const icon: IconDefinition = isAdd ? faPlusSquare : faMinusSquare;\r\n const title: string = isAdd\r\n ? SIMULATION.CARD.HEADER.ACTION_BUTTON.ADD\r\n : SIMULATION.CARD.HEADER.ACTION_BUTTON.REMOVE;\r\n const className: string = `simulationButton${isAdd ? \"Add\" : \"Remove\"}`;\r\n const handleClick = isAdd ? handleDeviceLibraryAdd : handleDeviceLibraryRemove;\r\n\r\n return (\r\n \r\n \r\n \r\n );\r\n };\r\n\r\n const ImageUploadMenuItem = (): React.ReactNode => (\r\n \r\n {SIMULATION.CARD.OPTIONS.IMAGE}\r\n \r\n );\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n {imageDisplay === undefined ? Loading() : ImageElement()}\r\n \r\n \r\n \r\n \r\n \r\n {simulation.description}\r\n \r\n \r\n \r\n \r\n {variant === SimulationCardVariants.ShowMenu && !isSimulationDeleted && (\r\n \r\n {SIMULATION.CARD.OPTIONS.VR}\r\n {SIMULATION.CARD.OPTIONS.WEB}\r\n {ImageUploadMenuItem()}\r\n {SIMULATION.CARD.OPTIONS.DOWNLOAD}\r\n {SIMULATION.CARD.OPTIONS.EDIT}\r\n {SIMULATION.CARD.OPTIONS.DELETE}\r\n \r\n )}\r\n {variant === SimulationCardVariants.ShowMenu && isSimulationDeleted && (\r\n \r\n {SIMULATION.CARD.OPTIONS.RESTORE}\r\n \r\n )}\r\n \r\n \r\n );\r\n};\r\n\r\nexport default SimulationCard;\r\n","import React from \"react\";\r\n\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport { faExclamationCircle } from \"@fortawesome/free-solid-svg-icons\";\r\nimport Button from \"@mui/material/Button\";\r\nimport Dialog from \"@mui/material/Dialog\";\r\nimport DialogActions from \"@mui/material/DialogActions\";\r\nimport DialogContent from \"@mui/material/DialogContent\";\r\nimport Typography from \"@mui/material/Typography\";\r\nimport DialogTitle from \"@mui/material/DialogTitle\";\r\n\r\nimport \"./styles.scss\";\r\n\r\ntype Props = {\r\n children: React.ReactNode;\r\n title?: string;\r\n cancelText?: string;\r\n confirmText: string;\r\n open: boolean;\r\n danger?: boolean;\r\n big?: boolean;\r\n hideCancel?: boolean;\r\n confirmDisabled?: boolean;\r\n handleModalClose: () => void;\r\n handleModalConfirm: () => void;\r\n};\r\n\r\nconst Modal: React.FunctionComponent = ({\r\n children,\r\n title,\r\n cancelText,\r\n confirmText,\r\n open,\r\n danger,\r\n big,\r\n hideCancel,\r\n confirmDisabled,\r\n handleModalClose,\r\n handleModalConfirm,\r\n}) => (\r\n \r\n {title && (\r\n \r\n \r\n {danger && (\r\n \r\n )}\r\n {title}\r\n \r\n \r\n )}\r\n {children}\r\n \r\n {!hideCancel && (\r\n \r\n {cancelText}\r\n \r\n )}\r\n \r\n {confirmText}\r\n \r\n \r\n \r\n);\r\n\r\nexport default Modal;\r\n","import React from \"react\";\r\n\r\nimport Typography from \"@mui/material/Typography\";\r\nimport Modal from \"../Modal\";\r\n\r\ntype Props = {\r\n title: string;\r\n cancelText: string;\r\n confirmText: string;\r\n contentText: string;\r\n open: boolean;\r\n handleModalClose: () => void;\r\n handleModalConfirm: () => void;\r\n};\r\n\r\nconst DeleteModal: React.FunctionComponent = ({\r\n title,\r\n cancelText,\r\n confirmText,\r\n contentText,\r\n open,\r\n handleModalClose,\r\n handleModalConfirm,\r\n}) => (\r\n \r\n \r\n {contentText}\r\n \r\n \r\n);\r\n\r\nexport default DeleteModal;\r\n","import { AxiosResponse } from \"axios\";\r\n\r\nimport { WebserviceResponse } from \"./../types\";\r\n\r\n/**\r\n * Checks if the received response is valid.\r\n * @param {AxiosResponse} response The response received.\r\n * @returns {unknown} If the state equals to true, we return the data.value, which may vary according to the request that was sent.\r\n */\r\nexport const isResponseValid = (response: AxiosResponse): unknown => {\r\n const data = response.data as WebserviceResponse;\r\n if (!data.state) throw new Error(response.statusText);\r\n return data.value;\r\n};\r\n","import axios, { AxiosResponse } from \"axios\";\r\n\r\nimport { WEB_SERVICE_URL } from \"../../constants\";\r\nimport {\r\n Simulation,\r\n SimulationUpdateData,\r\n SimulationInsertData,\r\n SimulationPlatformInsertData,\r\n SimulationGetParams,\r\n SimulationDeleteParams,\r\n SimulationSurveyDataParams,\r\n Platform,\r\n} from \"../../utilities/types\";\r\nimport { isResponseValid } from \"../../utilities/gatewayHelper\";\r\n\r\nconst getAllSimulations = async (params?: SimulationGetParams): Promise =>\r\n axios\r\n .get(`${WEB_SERVICE_URL}/simulations`, { params })\r\n .then((response: AxiosResponse) => {\r\n const simulations: Simulation[] = isResponseValid(response) as Simulation[];\r\n return simulations;\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nconst updateSimulation = async (id: string, data: SimulationUpdateData): Promise =>\r\n axios\r\n .put(`${WEB_SERVICE_URL}/simulations/${id}`, data)\r\n .then((response: AxiosResponse) => {\r\n isResponseValid(response);\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nconst insertSimulation = async (data: SimulationInsertData): Promise =>\r\n axios\r\n .post(`${WEB_SERVICE_URL}/simulations`, data)\r\n .then((response: AxiosResponse) => {\r\n const simulation: Simulation = isResponseValid(response) as Simulation;\r\n return simulation;\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nconst deleteSimulation = async (id: string, params?: SimulationDeleteParams): Promise =>\r\n axios\r\n .delete(`${WEB_SERVICE_URL}/simulations/${id}`, { params })\r\n .then((response: AxiosResponse) => {\r\n isResponseValid(response);\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nconst insertSimulationPlatform = async (\r\n id: string,\r\n data: SimulationPlatformInsertData\r\n): Promise =>\r\n axios\r\n .post(`${WEB_SERVICE_URL}/simulations/${id}/platforms`, data)\r\n .then((response: AxiosResponse) => {\r\n const platform: Platform = isResponseValid(response) as Platform;\r\n return platform;\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nconst getSimulationSurveyData = async (\r\n id: string,\r\n params?: SimulationSurveyDataParams\r\n): Promise =>\r\n axios\r\n .get(`${WEB_SERVICE_URL}/simulations/${id}/survey`, { params })\r\n .then((response: AxiosResponse) => {\r\n const surveyData: object[] = isResponseValid(response) as object[];\r\n return surveyData;\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nexport {\r\n getAllSimulations,\r\n updateSimulation,\r\n insertSimulation,\r\n deleteSimulation,\r\n insertSimulationPlatform,\r\n getSimulationSurveyData,\r\n};\r\n","import { useCallback } from \"react\";\r\nimport { useSnackbar } from \"notistack\";\r\n\r\nimport { MessageVariants } from \"../../utilities/enums\";\r\n\r\n/**\r\n * Helper hook to avoid unnecessary duplicate code related to snackbars.\r\n * @returns {((message: string, type: MessageVariants) => void)} A method that receives the message configuration, and displays a snackbar.\r\n */\r\nconst useMessage = (): ((message: string, type: MessageVariants) => void) => {\r\n const { enqueueSnackbar } = useSnackbar();\r\n\r\n const message = useCallback(\r\n (message: string, type: MessageVariants): void => {\r\n enqueueSnackbar(message, {\r\n variant: type,\r\n autoHideDuration: 3000,\r\n anchorOrigin: {\r\n vertical: \"bottom\",\r\n horizontal: \"center\",\r\n },\r\n });\r\n },\r\n [enqueueSnackbar]\r\n );\r\n\r\n return message;\r\n};\r\n\r\nexport default useMessage;\r\n","/**\r\n * Decides which error message should be displayed. If the error contains a 401 string, it should be an unauthorized message.\r\n * If not, the default error message should be displayed.\r\n * @param {Error} error The error.\r\n * @param {string} errorText The default error message.\r\n * @param {string} errorTextAuth The auth error message.\r\n * @returns {string} The error message to be used.\r\n */\r\nexport const checkMessageText = (error: Error, errorText: string, errorTextAuth: string): string =>\r\n error.toString().includes(\"401\") ? errorTextAuth : errorText;\r\n","import React from \"react\";\r\n\r\n/**\r\n * Method to handle the onChange for an input. It receives the event, and the set method to be used.\r\n * @param {React.ChangeEvent} event The input change event.\r\n * @param {(value: string) => void} setValue The function that should be used to update the value with the event target value (usually, the set function of a React state variable).\r\n * @returns {void} Nothing is returned.\r\n */\r\nconst handleInputOnChange = (\r\n event: React.ChangeEvent,\r\n setValue: (value: string) => void\r\n): void => {\r\n setValue(event.target.value);\r\n};\r\n\r\n/**\r\n * Method to handle the onChange for a checkbox input. It receives the event, and the set method to be used.\r\n * @param {React.ChangeEvent} event The input change event.\r\n * @param {(value: boolean) => void} setValue The function that should be used to update the value with the event target value (usually, the set function of a React state variable).\r\n * @returns {void} Nothing is returned.\r\n */\r\nconst handleCheckedInputOnChange = (\r\n event: React.ChangeEvent,\r\n setValue: (value: boolean) => void\r\n): void => {\r\n setValue(event.target.checked);\r\n};\r\n\r\nexport { handleInputOnChange, handleCheckedInputOnChange };\r\n","import React, { useState, useRef } from \"react\";\r\nimport { CSVLink } from \"react-csv\";\r\n\r\nimport FormGroup from \"@mui/material/FormGroup\";\r\nimport FormControl from \"@mui/material/FormControl\";\r\nimport FormLabel from \"@mui/material/FormLabel\";\r\nimport FormControlLabel from \"@mui/material/FormControlLabel\";\r\nimport Checkbox from \"@mui/material/Checkbox\";\r\nimport Typography from \"@mui/material/Typography\";\r\nimport Modal from \"../Modal\";\r\n\r\nimport { getSimulationSurveyData } from \"../../gateway/Simulation\";\r\nimport { SimulationSurveyDataParams } from \"../../utilities/types\";\r\nimport { MessageVariants } from \"../../utilities/enums\";\r\nimport useIsMounted from \"./../../utilities/useIsMounted\";\r\nimport useMessage from \"./../../utilities/useMessage\";\r\nimport { checkMessageText } from \"./../../utilities/messageHelper\";\r\nimport { handleCheckedInputOnChange } from \"./../../utilities/inputHelper\";\r\nimport { MESSAGES } from \"../../constants\";\r\n\r\ntype Props = {\r\n title?: string;\r\n simulationId?: string;\r\n confirmText: string;\r\n open: boolean;\r\n handleModalClose: () => void;\r\n handleModalConfirm: () => void;\r\n};\r\n\r\nconst DownloadDataModal: React.FunctionComponent = ({\r\n title,\r\n simulationId,\r\n confirmText,\r\n open,\r\n handleModalClose,\r\n handleModalConfirm,\r\n}) => {\r\n const [questionnaire, setQuestionnaire] = useState(true);\r\n const [interaction, setInteraction] = useState(false);\r\n const [data, setData] = useState([]);\r\n\r\n const isMounted = useIsMounted();\r\n const message = useMessage();\r\n\r\n const handleExportButton = async () => {\r\n if (!simulationId) return;\r\n try {\r\n const params: SimulationSurveyDataParams = {\r\n includeQuestionnaire: questionnaire,\r\n includeInteraction: interaction,\r\n };\r\n const data: object[] = await getSimulationSurveyData(simulationId, params);\r\n if (isMounted()) {\r\n setData(data);\r\n csvLinkRef?.current?.link.click();\r\n message(MESSAGES.SIMULATION.DOWNLOAD_DATA_SUCCESS, MessageVariants.Success);\r\n }\r\n } catch (error: unknown) {\r\n const messageText = checkMessageText(\r\n error as Error,\r\n MESSAGES.SIMULATION.DOWNLOAD_DATA_ERROR,\r\n MESSAGES.SIMULATION.DOWNLOAD_DATA_ERROR_AUTH\r\n );\r\n message(messageText, MessageVariants.Error);\r\n }\r\n handlePostDataDownload();\r\n };\r\n\r\n const csvLinkRef = useRef(null);\r\n\r\n const CheckboxLabel = (text: string): React.ReactNode => (\r\n \r\n {text}\r\n \r\n );\r\n\r\n const reset = (): void => {\r\n setQuestionnaire(true);\r\n setInteraction(false);\r\n setData([]);\r\n };\r\n\r\n const handleClose = (): void => {\r\n handleModalClose();\r\n reset();\r\n };\r\n\r\n const handlePostDataDownload = (): void => {\r\n handleModalConfirm();\r\n reset();\r\n };\r\n\r\n const handleConfirm = (): void => {\r\n handleExportButton();\r\n };\r\n\r\n return (\r\n \r\n \r\n Select the data to be downloaded.\r\n \r\n ) =>\r\n handleCheckedInputOnChange(event, setQuestionnaire)\r\n }\r\n />\r\n }\r\n label={CheckboxLabel(\"Questionnaire Data\")}\r\n />\r\n ) =>\r\n handleCheckedInputOnChange(event, setInteraction)\r\n }\r\n />\r\n }\r\n label={CheckboxLabel(\"Interaction Data\")}\r\n />\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default DownloadDataModal;\r\n","import React, { useEffect, useState } from \"react\";\r\n\r\nimport TextField from \"@mui/material/TextField\";\r\nimport Modal from \"../Modal\";\r\n\r\nimport { handleInputOnChange } from \"../../utilities/inputHelper\";\r\n\r\ntype Props = {\r\n title: string;\r\n cancelText: string;\r\n confirmText: string;\r\n open: boolean;\r\n nameLabel: string;\r\n nameValue: string;\r\n packageNameLabel: string;\r\n packageNameValue: string;\r\n descriptionLabel: string;\r\n descriptionValue: string;\r\n setNameValue: (value: string) => void;\r\n setPackageNameValue: (value: string) => void;\r\n setDescriptionValue: (value: string) => void;\r\n handleModalClose: () => void;\r\n handleModalConfirm: () => void;\r\n};\r\n\r\nconst SimulationAddEditModal: React.FunctionComponent = ({\r\n title,\r\n cancelText,\r\n confirmText,\r\n open,\r\n nameLabel,\r\n nameValue,\r\n packageNameLabel,\r\n packageNameValue,\r\n descriptionLabel,\r\n descriptionValue,\r\n setNameValue,\r\n setPackageNameValue,\r\n setDescriptionValue,\r\n handleModalClose,\r\n handleModalConfirm,\r\n}) => {\r\n const [localName, setLocalName] = useState(\"\");\r\n const [localPackageName, setLocalPackageName] = useState(\"\");\r\n const [localDescription, setLocalDescription] = useState(\"\");\r\n\r\n useEffect(() => {\r\n if (!open) return;\r\n setLocalName(nameValue);\r\n setLocalPackageName(packageNameValue);\r\n setLocalDescription(descriptionValue);\r\n }, [open, nameValue, packageNameValue, descriptionValue]);\r\n\r\n return (\r\n \r\n ) =>\r\n handleInputOnChange(event, setLocalName)\r\n }\r\n onBlur={() => setNameValue(localName)}\r\n />\r\n ) =>\r\n handleInputOnChange(event, setLocalPackageName)\r\n }\r\n onBlur={() => setPackageNameValue(localPackageName)}\r\n />\r\n ) =>\r\n handleInputOnChange(event, setLocalDescription)\r\n }\r\n onBlur={() => setDescriptionValue(localDescription)}\r\n />\r\n \r\n );\r\n};\r\n\r\nexport default SimulationAddEditModal;\r\n","import React from \"react\";\r\n\r\nimport Grid from \"@mui/material/Grid\";\r\nimport Typography from \"@mui/material/Typography\";\r\n\r\nimport \"./styles.scss\";\r\n\r\ntype Props = {\r\n text: string;\r\n};\r\n\r\nconst EmptyListPlaceholder: React.FunctionComponent = ({ text }) => (\r\n \r\n \r\n {text}\r\n \r\n \r\n);\r\n\r\nexport default EmptyListPlaceholder;\r\n","import React from \"react\";\r\n\r\nimport Card from \"@mui/material/Card\";\r\nimport CardContent from \"@mui/material/CardContent\";\r\nimport CircularProgress from \"@mui/material/CircularProgress\";\r\nimport Box from \"@mui/material/Box\";\r\nimport Typography from \"@mui/material/Typography\";\r\nimport Backdrop from \"@mui/material/Backdrop\";\r\n\r\nimport \"./styles.scss\";\r\n\r\ntype Props = {\r\n isFileUploading: boolean;\r\n text: string;\r\n value: number;\r\n};\r\n\r\nconst FileUploadingIndicator: React.FunctionComponent = ({\r\n isFileUploading,\r\n text,\r\n value,\r\n}) => (\r\n \r\n \r\n \r\n \r\n {text}\r\n \r\n \r\n \r\n {value >= 1 ? (\r\n \r\n \r\n {`${Math.round(value)}%`}\r\n \r\n \r\n ) : null}\r\n \r\n \r\n \r\n \r\n);\r\n\r\nexport default FileUploadingIndicator;\r\n","import { AnonymousCredential, newPipeline, BlobServiceClient } from \"@azure/storage-blob\";\r\nimport { StorageParams } from \"../../utilities/types\";\r\n\r\nconst downloadFileFromStorage = async (\r\n params: StorageParams,\r\n blobFileName: string\r\n): Promise => {\r\n const parsedURL = params.url || `https://${params.accountName}.blob.core.windows.net/`;\r\n const anonymousCredential = new AnonymousCredential();\r\n const pipeline = newPipeline(anonymousCredential, { retryOptions: { maxTries: 4 } });\r\n const blobServiceClient = new BlobServiceClient(`${parsedURL}${params.sasKey}`, pipeline);\r\n const containerClient = blobServiceClient.getContainerClient(params.containerName);\r\n\r\n const blockBlobClient = containerClient.getBlobClient(blobFileName).getBlockBlobClient();\r\n return blockBlobClient\r\n .download()\r\n .then((response) => {\r\n if (response._response.status !== 200) throw new Error(\"The service answered with an error\");\r\n return response.blobBody;\r\n })\r\n .catch((error) => error);\r\n};\r\n\r\nconst uploadFileToStorage = async (\r\n params: StorageParams,\r\n file: File,\r\n blobFileName: string,\r\n progressCallBack: (bytes: number) => void\r\n): Promise => {\r\n const parsedURL = params.url || `https://${params.accountName}.blob.core.windows.net/`;\r\n const anonymousCredential = new AnonymousCredential();\r\n const pipeline = newPipeline(anonymousCredential, { retryOptions: { maxTries: 4 } });\r\n const blobServiceClient = new BlobServiceClient(`${parsedURL}${params.sasKey}`, pipeline);\r\n const containerClient = blobServiceClient.getContainerClient(params.containerName);\r\n\r\n const blockBlobClient = containerClient.getBlobClient(blobFileName).getBlockBlobClient();\r\n await blockBlobClient\r\n .uploadData(file, {\r\n blobHTTPHeaders: {\r\n blobContentType: file.type,\r\n },\r\n onProgress: (e) => {\r\n progressCallBack(e.loadedBytes);\r\n },\r\n })\r\n .then((response) => {\r\n if (response._response.status !== 201) throw new Error(\"The service answered with an error\");\r\n })\r\n .catch((error) => error);\r\n};\r\n\r\nexport { downloadFileFromStorage, uploadFileToStorage };\r\n","import axios, { AxiosResponse } from \"axios\";\r\n\r\nimport { WEB_SERVICE_URL } from \"../../constants\";\r\nimport { StorageParams, FileStorage } from \"../../utilities/types\";\r\nimport { isResponseValid } from \"../../utilities/gatewayHelper\";\r\nimport { downloadFileFromStorage, uploadFileToStorage } from \"../../gateway/AzureStorage\";\r\n\r\nconst storage = (): FileStorage => {\r\n const storage: FileStorage = {\r\n download: downloadFileFromStorage,\r\n upload: uploadFileToStorage,\r\n };\r\n return storage;\r\n};\r\n\r\nconst getSimulationsStorageParams = async (simulationId: string): Promise =>\r\n axios\r\n .get(`${WEB_SERVICE_URL}/simulations/${simulationId}/file-management`)\r\n .then((response: AxiosResponse) => {\r\n const responseParams = isResponseValid(response) as StorageParams;\r\n return responseParams;\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nconst getWebStorageParams = async (): Promise =>\r\n axios\r\n .get(`${WEB_SERVICE_URL}/simulations/hosting-management`)\r\n .then((response: AxiosResponse) => {\r\n const responseParams = isResponseValid(response) as StorageParams;\r\n return responseParams;\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nconst uploadImageToStorage = async (\r\n file: File,\r\n fileName: string,\r\n simulationId: string,\r\n progressCallBack: (bytes: number) => void\r\n): Promise =>\r\n getSimulationsStorageParams(simulationId)\r\n .then((params: StorageParams) => storage().upload(params, file, fileName, progressCallBack))\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nconst uploadFileToWebStorage = async (\r\n file: File,\r\n fileName: string,\r\n progressCallBack: (bytes: number) => void\r\n): Promise => {\r\n await getWebStorageParams()\r\n .then(async (params: StorageParams) => {\r\n await storage().upload(params, file, fileName, progressCallBack);\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n};\r\n\r\nconst getImageFromStorage = async (fileName: string, simulationId: string): Promise =>\r\n getSimulationsStorageParams(simulationId)\r\n .then(async (params: StorageParams) => {\r\n const blob = await storage().download(params, fileName);\r\n return window.URL.createObjectURL(blob);\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nexport {\r\n getSimulationsStorageParams,\r\n uploadImageToStorage,\r\n getImageFromStorage,\r\n uploadFileToWebStorage,\r\n};\r\n","import { unzip, ZipInfo } from \"unzipit\";\n\nconst blobToFile = (theBlob: Blob, fileName: string): File => {\n const f: File = new File([theBlob], fileName, { type: theBlob.type });\n return f;\n};\n\nconst extractFile = async (f: File): Promise => {\n const tmpPath = URL.createObjectURL(f);\n const zinfo = await unzip(tmpPath);\n return zinfo;\n};\n\nexport { blobToFile, extractFile };\n","import React, { useEffect, useState, useRef } from \"react\";\r\nimport { v4 as uuidv4 } from \"uuid\";\r\nimport { lookup } from \"mime-types\";\r\n\r\nimport Grid from \"@mui/material/Grid\";\r\nimport SimulationCard from \"../SimulationCard\";\r\nimport DeleteModal from \"../DeleteModal\";\r\nimport DownloadDataModal from \"../DownloadDataModal\";\r\nimport SimulationAddEditModal from \"../SimulationAddEditModal\";\r\nimport EmptyListPlaceholder from \"../EmptyListPlaceholder\";\r\nimport FileUploadingIndicator from \"../FileUploadingIndicator\";\r\n\r\nimport {\r\n deleteSimulation,\r\n updateSimulation,\r\n insertSimulationPlatform,\r\n} from \"../../gateway/Simulation\";\r\nimport { uploadImageToStorage, uploadFileToWebStorage } from \"../../gateway/FileManagement\";\r\nimport {\r\n Simulation,\r\n SimulationUpdateData,\r\n SimulationInsertData,\r\n SimulationPlatformInsertData,\r\n SimulationImageData,\r\n SimulationDeleteParams,\r\n Platform,\r\n} from \"../../utilities/types\";\r\nimport {\r\n SimulationCardVariants,\r\n SimulationPlatformType,\r\n MessageVariants,\r\n} from \"../../utilities/enums\";\r\nimport { blobToFile, extractFile } from \"../../utilities/fileHelper\";\r\nimport useIsMounted from \"./../../utilities/useIsMounted\";\r\nimport useMessage from \"./../../utilities/useMessage\";\r\nimport { checkMessageText } from \"./../../utilities/messageHelper\";\r\nimport { MESSAGES, SIMULATION } from \"../../constants\";\r\n\r\nimport \"./styles.scss\";\r\n\r\ntype Props = {\r\n simulations: Simulation[];\r\n allSimulationsImageData: SimulationImageData[];\r\n isSimulationDeleted: boolean;\r\n handleSpecificUpdate: (\r\n id: string,\r\n simulationData: SimulationUpdateData | SimulationInsertData\r\n ) => void;\r\n handleSpecificUpdatePlatform: (id: string, platform: Platform) => void;\r\n handleSpecificDelete: (deletedSimulation: Simulation) => void;\r\n handleSpecificRestore: (restoredSimulation: Simulation) => void;\r\n};\r\n\r\nconst SimulationCardList: React.FunctionComponent = ({\r\n simulations,\r\n allSimulationsImageData,\r\n isSimulationDeleted,\r\n handleSpecificUpdate,\r\n handleSpecificUpdatePlatform,\r\n handleSpecificDelete,\r\n handleSpecificRestore,\r\n}) => {\r\n const [downloadDataModalOpen, setDownloadDataModalOpen] = useState(false);\r\n const [editModalOpen, setEditModalOpen] = useState(false);\r\n const [deleteModalOpen, setDeleteModalOpen] = useState(false);\r\n const [selectedSimulation, setSelectedSimulation] = useState(undefined);\r\n const [editSimulationName, setEditSimulationName] = useState(\"\");\r\n const [editSimulationPackageName, setEditSimulationPackageName] = useState(\"\");\r\n const [editSimulationDescription, setEditSimulationDescription] = useState(\"\");\r\n const [isFileUploading, setIsFileUploading] = useState(false);\r\n const [progressValue, setProgressValue] = useState(0);\r\n const [uploaderText, setUploaderText] = useState(\"\");\r\n const inputFileImage = useRef(null);\r\n const inputFileVR = useRef(null);\r\n const inputFileWeb = useRef(null);\r\n\r\n const isMounted = useIsMounted();\r\n const message = useMessage();\r\n\r\n const handleDownloadDataModalOpen = (): void => {\r\n setDownloadDataModalOpen(true);\r\n };\r\n\r\n const handleDownloadDataModalClose = (): void => {\r\n setDownloadDataModalOpen(false);\r\n };\r\n\r\n const handleEditModalOpen = (): void => {\r\n setEditModalOpen(true);\r\n };\r\n\r\n const handleEditModalClose = (): void => {\r\n setEditModalOpen(false);\r\n };\r\n\r\n const handleProgressUpdate = (\r\n bytes: number,\r\n lastBytes: number,\r\n totalSize: number,\r\n lastProgress: number\r\n ): number => {\r\n const newValue = (lastProgress * totalSize + bytes - lastBytes) / totalSize;\r\n return newValue;\r\n };\r\n\r\n const handleEditModalConfirm = async (): Promise => {\r\n if (!selectedSimulation) return;\r\n try {\r\n const updateData: SimulationUpdateData = {\r\n name: editSimulationName,\r\n packageName: editSimulationPackageName,\r\n description: editSimulationDescription,\r\n };\r\n handleEditModalClose();\r\n await updateSimulation(selectedSimulation.id, updateData);\r\n handleSpecificUpdate(selectedSimulation.id, updateData);\r\n message(MESSAGES.SIMULATION.UPDATE_SUCCESS, MessageVariants.Success);\r\n } catch (error: unknown) {\r\n const messageText = checkMessageText(\r\n error as Error,\r\n MESSAGES.SIMULATION.UPDATE_ERROR,\r\n MESSAGES.SIMULATION.UPDATE_ERROR_AUTH\r\n );\r\n message(messageText, MessageVariants.Error);\r\n }\r\n };\r\n\r\n const handleDeleteModalOpen = (): void => {\r\n setDeleteModalOpen(true);\r\n };\r\n\r\n const handleDeleteModalClose = (): void => {\r\n setDeleteModalOpen(false);\r\n };\r\n\r\n const handleDeleteModalConfirm = async (): Promise => {\r\n if (!selectedSimulation) return;\r\n try {\r\n handleDeleteModalClose();\r\n await deleteSimulation(selectedSimulation.id);\r\n handleSpecificDelete(selectedSimulation);\r\n message(MESSAGES.SIMULATION.DELETE_SUCCESS, MessageVariants.Success);\r\n } catch (error: unknown) {\r\n const messageText = checkMessageText(\r\n error as Error,\r\n MESSAGES.SIMULATION.DELETE_ERROR,\r\n MESSAGES.SIMULATION.DELETE_ERROR_AUTH\r\n );\r\n message(messageText, MessageVariants.Error);\r\n }\r\n };\r\n\r\n const uploadImage = async (file: File, id: string): Promise => {\r\n setIsFileUploading(true);\r\n try {\r\n const uniqueFileName: string = `${uuidv4()}.${file.name.split(\".\")[0]}`;\r\n let progress = 0;\r\n let lastBytes = 0;\r\n await uploadImageToStorage(file, uniqueFileName, id, (bytes) => {\r\n progress = handleProgressUpdate(bytes, lastBytes, file.size, progress);\r\n lastBytes = bytes;\r\n setProgressValue(progress);\r\n });\r\n const simulationData: SimulationUpdateData = { image: uniqueFileName };\r\n await updateSimulation(id, simulationData);\r\n handleSpecificUpdate(id, simulationData);\r\n message(MESSAGES.SIMULATION.IMAGE_UPLOAD_SUCCESS, MessageVariants.Success);\r\n } catch (error: unknown) {\r\n const messageText = checkMessageText(\r\n error as Error,\r\n MESSAGES.SIMULATION.IMAGE_UPLOAD_ERROR,\r\n MESSAGES.SIMULATION.IMAGE_UPLOAD_ERROR_AUTH\r\n );\r\n message(messageText, MessageVariants.Error);\r\n }\r\n if (isMounted()) setIsFileUploading(false);\r\n };\r\n\r\n const handleUploadImage = (event: React.ChangeEvent): void => {\r\n if (!selectedSimulation) return;\r\n\r\n event.stopPropagation();\r\n const target = event.target as HTMLInputElement;\r\n if (target && target.files && target.files.length > 0) {\r\n uploadImage(target.files[0], selectedSimulation.id);\r\n }\r\n target.value = \"\";\r\n };\r\n\r\n const handleUploadImageClick = (): void => {\r\n inputFileImage?.current?.click();\r\n };\r\n\r\n const uploadFile = async (\r\n file: File,\r\n id: string,\r\n type: SimulationPlatformType\r\n ): Promise => {\r\n setProgressValue(0);\r\n setUploaderText(SIMULATION.FILE_UPLOADING);\r\n setIsFileUploading(true);\r\n const isVR: boolean = type === SimulationPlatformType.VR;\r\n try {\r\n const uniqueFileName: string = `${uuidv4()}.${file.name.split(\".\")[0]}`;\r\n let progress = 0;\r\n let lastBytes = 0;\r\n await uploadImageToStorage(file, uniqueFileName, id, (bytes) => {\r\n progress = handleProgressUpdate(bytes, lastBytes, file.size, progress);\r\n lastBytes = bytes;\r\n setProgressValue(progress);\r\n });\r\n const simulationPlatformData: SimulationPlatformInsertData = {\r\n platform: type,\r\n filename: uniqueFileName,\r\n };\r\n const simulationPlatform = await insertSimulationPlatform(id, simulationPlatformData);\r\n handleSpecificUpdatePlatform(id, simulationPlatform);\r\n const successText: string = isVR\r\n ? MESSAGES.SIMULATION.VR_UPLOAD_SUCCESS\r\n : MESSAGES.SIMULATION.WEB_UPLOAD_SUCCESS;\r\n message(successText, MessageVariants.Success);\r\n } catch (error: unknown) {\r\n const errorText: string = isVR\r\n ? MESSAGES.SIMULATION.VR_UPLOAD_ERROR\r\n : MESSAGES.SIMULATION.WEB_UPLOAD_ERROR;\r\n const errorTextAuth: string = isVR\r\n ? MESSAGES.SIMULATION.VR_UPLOAD_ERROR_AUTH\r\n : MESSAGES.SIMULATION.WEB_UPLOAD_ERROR_AUTH;\r\n const messageText = checkMessageText(error as Error, errorText, errorTextAuth);\r\n message(messageText, MessageVariants.Error);\r\n }\r\n if (isMounted()) setIsFileUploading(false);\r\n };\r\n\r\n const uploadMultipleFiles = async (\r\n files: File[],\r\n type: SimulationPlatformType,\r\n simId: string,\r\n totalSize: number\r\n ): Promise => {\r\n const isVR: boolean = type === SimulationPlatformType.VR;\r\n try {\r\n let progress = 0;\r\n for (const file of files) {\r\n let lastBytes = 0;\r\n const uniqueFileName = `${simId}/${file.name}`;\r\n // Just leave this be please\r\n // eslint-disable-next-line\r\n await uploadFileToWebStorage(file, uniqueFileName, (bytes) => {\r\n progress = handleProgressUpdate(bytes, lastBytes, totalSize, progress);\r\n lastBytes = bytes;\r\n setProgressValue(progress);\r\n });\r\n }\r\n } catch (error: unknown) {\r\n const errorText: string = isVR\r\n ? MESSAGES.SIMULATION.VR_UPLOAD_ERROR\r\n : MESSAGES.SIMULATION.WEB_UPLOAD_ERROR;\r\n const errorTextAuth: string = isVR\r\n ? MESSAGES.SIMULATION.VR_UPLOAD_ERROR_AUTH\r\n : MESSAGES.SIMULATION.WEB_UPLOAD_ERROR_AUTH;\r\n const messageText = checkMessageText(error as Error, errorText, errorTextAuth);\r\n\r\n message(messageText, MessageVariants.Error);\r\n return Promise.reject(messageText);\r\n }\r\n };\r\n\r\n const postSimulationPlatform = async (\r\n id: string,\r\n simId: string,\r\n type: SimulationPlatformType\r\n ): Promise => {\r\n const isVR: boolean = type === SimulationPlatformType.VR;\r\n const simulationPlatformData: SimulationPlatformInsertData = {\r\n platform: type,\r\n filename: simId,\r\n };\r\n const simulationPlatform = await insertSimulationPlatform(id, simulationPlatformData);\r\n handleSpecificUpdatePlatform(id, simulationPlatform);\r\n const successText: string = isVR\r\n ? MESSAGES.SIMULATION.VR_UPLOAD_SUCCESS\r\n : MESSAGES.SIMULATION.WEB_UPLOAD_SUCCESS;\r\n message(successText, MessageVariants.Success);\r\n };\r\n\r\n const handleUploadVR = (event: React.ChangeEvent): void => {\r\n if (!selectedSimulation) return;\r\n\r\n event.stopPropagation();\r\n const target = event.target as HTMLInputElement;\r\n if (target && target.files && target.files.length > 0) {\r\n uploadFile(target.files[0], selectedSimulation.id, SimulationPlatformType.VR);\r\n }\r\n target.value = \"\";\r\n };\r\n\r\n const handleUploadVRClick = (): void => {\r\n inputFileVR?.current?.click();\r\n };\r\n\r\n const handleUploadWeb = async (event: React.ChangeEvent): Promise => {\r\n if (!selectedSimulation) return;\r\n\r\n event.stopPropagation();\r\n const target = event.target as HTMLInputElement;\r\n if (target && target.files && target.files.length > 0) {\r\n const f: File = target.files[0];\r\n const entries = (await extractFile(f)).entries;\r\n const fileArray: File[] = [];\r\n setUploaderText(SIMULATION.FILE_EXTRACTING);\r\n setProgressValue(0);\r\n setIsFileUploading(true);\r\n let totalSize = 0;\r\n\r\n for (const fileName in entries) {\r\n const mime = lookup(fileName) ? (lookup(fileName) as string) : \"\";\r\n const blob = await entries[fileName].blob(mime);\r\n const unzippedFile = blobToFile(blob, fileName);\r\n totalSize += unzippedFile.size;\r\n fileArray.push(unzippedFile);\r\n }\r\n setUploaderText(SIMULATION.FILE_UPLOADING);\r\n const simID = uuidv4();\r\n uploadMultipleFiles(fileArray, SimulationPlatformType.Web, simID, totalSize)\r\n .then(() =>\r\n postSimulationPlatform(selectedSimulation.id, simID, SimulationPlatformType.Web)\r\n )\r\n .catch(() => {})\r\n .then(() => {\r\n if (isMounted()) setIsFileUploading(false);\r\n });\r\n }\r\n target.value = \"\";\r\n };\r\n\r\n const handleUploadWebClick = (): void => {\r\n inputFileWeb?.current?.click();\r\n };\r\n\r\n const handleRestore = async (): Promise => {\r\n if (!selectedSimulation) return;\r\n try {\r\n const params: SimulationDeleteParams = { delete: false };\r\n await deleteSimulation(selectedSimulation.id, params);\r\n handleSpecificRestore(selectedSimulation);\r\n message(MESSAGES.SIMULATION.RESTORE_SUCCESS, MessageVariants.Success);\r\n } catch (error: unknown) {\r\n const messageText = checkMessageText(\r\n error as Error,\r\n MESSAGES.SIMULATION.RESTORE_ERROR,\r\n MESSAGES.SIMULATION.RESTORE_ERROR_AUTH\r\n );\r\n message(messageText, MessageVariants.Error);\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n if (!selectedSimulation) return;\r\n setEditSimulationName(selectedSimulation.name);\r\n setEditSimulationPackageName(selectedSimulation.packageName || \"\");\r\n setEditSimulationDescription(selectedSimulation.description);\r\n }, [selectedSimulation]);\r\n\r\n const EmptyList = (): React.ReactNode => (\r\n \r\n );\r\n\r\n const SimulationCards = (): React.ReactNode =>\r\n simulations.map((simulation: Simulation, index: number) => (\r\n \r\n imageData.id === simulation.id\r\n )?.link\r\n }\r\n isSimulationDeleted={isSimulationDeleted}\r\n handleUploadVR={handleUploadVRClick}\r\n handleUploadWeb={handleUploadWebClick}\r\n handleUploadImage={handleUploadImageClick}\r\n handleDownloadData={handleDownloadDataModalOpen}\r\n handleEditModalOpen={handleEditModalOpen}\r\n handleDeleteModalOpen={handleDeleteModalOpen}\r\n handleRestore={handleRestore}\r\n setSelectedSimulation={setSelectedSimulation}\r\n />\r\n \r\n ));\r\n\r\n return (\r\n \r\n {simulations.length < 1 ? EmptyList() : SimulationCards()}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default SimulationCardList;\r\n","import React from \"react\";\r\n\r\nimport Grid from \"@mui/material/Grid\";\r\nimport Pagination from \"@mui/material/Pagination\";\r\n\r\nimport \"./styles.scss\";\r\n\r\ntype Props = {\r\n page: number;\r\n count: number;\r\n onChange: (event: React.ChangeEvent, value: number) => void;\r\n};\r\n\r\nconst PaginationSection: React.FunctionComponent = ({ page, count, onChange }) => (\r\n \r\n \r\n \r\n);\r\n\r\nexport default PaginationSection;\r\n","import React from \"react\";\r\n\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport { faPlus } from \"@fortawesome/free-solid-svg-icons\";\r\nimport Fab from \"@mui/material/Fab\";\r\n\r\nimport \"./styles.scss\";\r\n\r\ntype Props = {\r\n onClick: () => void;\r\n};\r\n\r\nconst FloatingActionButton: React.FunctionComponent = ({ onClick }) => (\r\n
\r\n \r\n \r\n \r\n
\r\n);\r\n\r\nexport default FloatingActionButton;\r\n","import React from \"react\";\r\n\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport { faFolderOpen, faGripLinesVertical, faTrash } from \"@fortawesome/free-solid-svg-icons\";\r\nimport IconButton from \"@mui/material/IconButton\";\r\nimport TextField from \"@mui/material/TextField\";\r\nimport Typography from \"@mui/material/Typography\";\r\nimport Tooltip from \"@mui/material/Tooltip\";\r\n\r\nimport { SimulationDisplay } from \"./../../utilities/enums\";\r\nimport { INITIAL_SECTION } from \"./../../constants\";\r\n\r\nimport \"./styles.scss\";\r\n\r\ntype Props = {\r\n pageTitle: string;\r\n displayFilter: boolean;\r\n displayModeSelector: boolean;\r\n currentMode?: SimulationDisplay;\r\n onFilterChange?: (event: React.ChangeEvent) => void;\r\n onNonDeletedModeClick?: () => void;\r\n onDeletedModeClick?: () => void;\r\n};\r\n\r\nconst InitialSection: React.FunctionComponent = ({\r\n pageTitle,\r\n displayFilter,\r\n displayModeSelector,\r\n currentMode,\r\n onFilterChange,\r\n onNonDeletedModeClick,\r\n onDeletedModeClick,\r\n}) => (\r\n
\r\n \r\n {pageTitle}\r\n \r\n
\r\n {displayModeSelector && (\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n )}\r\n {displayFilter && (\r\n \r\n )}\r\n
\r\n
\r\n);\r\n\r\nexport default InitialSection;\r\n","import React from \"react\";\r\n\r\nimport Grid from \"@mui/material/Grid\";\r\nimport CircularProgress from \"@mui/material/CircularProgress\";\r\n\r\nimport \"./styles.scss\";\r\n\r\nconst PageLoader: React.FunctionComponent = () => (\r\n \r\n \r\n \r\n);\r\n\r\nexport default PageLoader;\r\n","import { Element, Device, Simulation, WebPassword } from \"./../../utilities/types\";\r\nimport { SIMULATIONS_PER_PAGE } from \"./../../constants\";\r\n\r\n/**\r\n * Calculates the quantity of pages, based on the quantity of elements, and how many element should be displayed by page.\r\n * @param {Element[]} array The elements array.\r\n * @param {number} perPage The quantity of elements to be displayed per page.\r\n * @returns {number} The quantity of pages.\r\n */\r\nconst getPagesCount = (array: Element[], perPage: number = SIMULATIONS_PER_PAGE): number =>\r\n Math.ceil(array.length / perPage);\r\n\r\n/**\r\n * Defines which elements should be displayed on the specific page the user is at.\r\n * @param {Element[]} array The elements array.\r\n * @param {number} currentPage The current page.\r\n * @param {number} perPage The quantity of elements to be displayed per page.\r\n * @returns {number} The items to be rendered for the given page.\r\n */\r\nconst itemsToRender = (\r\n array: Element[],\r\n currentPage: number,\r\n perPage: number = SIMULATIONS_PER_PAGE\r\n): Element[] => {\r\n const currentPageIndex = currentPage - 1;\r\n const firstIndex = currentPageIndex * perPage;\r\n const endIndex = firstIndex + perPage;\r\n return endIndex >= array.length\r\n ? array.slice(firstIndex, array.length)\r\n : array.slice(firstIndex, endIndex);\r\n};\r\n\r\n/**\r\n * Filters an array based on the filter. The filter will be compared to the item's name property.\r\n * @param {(Device | Simulation)[]} array An array of Devices or Simulations.\r\n * @param {string} filter The filter.\r\n * @returns {(Device | Simulation)[]} The items matching the filter.\r\n */\r\nconst filterItemsPerName = (array: (Device | Simulation)[], filter: string): (Device | Simulation)[] =>\r\n array.filter((item: Device | Simulation) => {\r\n if (!filter) return true;\r\n else if (item.name.includes(filter)) return true;\r\n else return false;\r\n });\r\n\r\n/**\r\n * Filters an array based on the filter. The filter will be compared to the item's userType property.\r\n * @param {WebPassword[]} array An array of WebPasswords.\r\n * @param {string} filter The filter.\r\n * @returns {WebPassword[]} The items matching the filter.\r\n */\r\nconst filterWebPasswordsPerUserType = (array: WebPassword[], filter: string): WebPassword[] =>\r\n array.filter((item: WebPassword) => {\r\n if (!filter) return true;\r\n else if (item.userType.includes(filter)) return true;\r\n else return false;\r\n });\r\n\r\nexport { getPagesCount, itemsToRender, filterItemsPerName, filterWebPasswordsPerUserType };\r\n","import React, { useEffect, useState, useCallback } from \"react\";\r\n\r\nimport Container from \"@mui/material/Container\";\r\nimport SimulationCardList from \"../../components/SimulationCardList\";\r\nimport PaginationSection from \"../../components/PaginationSection\";\r\nimport FloatingActionButton from \"../../components/FloatingActionButton\";\r\nimport InitialSection from \"../../components/InitialSection\";\r\nimport SimulationAddEditModal from \"../../components/SimulationAddEditModal\";\r\nimport PageLoader from \"../../components/PageLoader\";\r\n\r\nimport { getAllSimulations, insertSimulation } from \"../../gateway/Simulation\";\r\nimport { getImageFromStorage } from \"../../gateway/FileManagement\";\r\nimport {\r\n Platform,\r\n Simulation,\r\n SimulationInsertData,\r\n SimulationUpdateData,\r\n SimulationImageLink,\r\n SimulationImageData,\r\n SimulationGetParams,\r\n} from \"./../../utilities/types\";\r\nimport { MessageVariants, SimulationDisplay } from \"./../../utilities/enums\";\r\nimport useIsMounted from \"./../../utilities/useIsMounted\";\r\nimport useMessage from \"./../../utilities/useMessage\";\r\nimport { checkMessageText } from \"./../../utilities/messageHelper\";\r\nimport { handleInputOnChange } from \"./../../utilities/inputHelper\";\r\nimport { getPagesCount, itemsToRender, filterItemsPerName } from \"./../../utilities/pagination\";\r\nimport { MESSAGES, SIMULATION } from \"./../../constants\";\r\n\r\nconst Simulations: React.FunctionComponent = () => {\r\n const [simulations, setSimulations] = useState([]);\r\n const [simulationImages, setSimulationImages] = useState([]);\r\n const [deletedSimulations, setDeletedSimulations] = useState([]);\r\n const [deletedSimulationImages, setDeletedSimulationImages] = useState([]);\r\n const [filter, setFilter] = useState(\"\");\r\n const [page, setPage] = useState(1);\r\n const [modalOpen, setModalOpen] = useState(false);\r\n const [addSimulationName, setAddSimulationName] = useState(\"\");\r\n const [addSimulationPackageName, setAddSimulationPackageName] = useState(\"\");\r\n const [addSimulationDescription, setAddSimulationDescription] = useState(\"\");\r\n const [loading, setLoading] = useState(true);\r\n const [loadingDeleted, setLoadingDeleted] = useState(true);\r\n const [mode, setMode] = useState(SimulationDisplay.NonDeleted);\r\n\r\n const isMounted = useIsMounted();\r\n const message = useMessage();\r\n\r\n /**\r\n * Simulations are fetched and ordered by the creationDate field (newest first)\r\n */\r\n const fetchData = useCallback(async (): Promise => {\r\n setLoading(true);\r\n try {\r\n const allSimulations: Simulation[] = await getAllSimulations();\r\n allSimulations.sort(\r\n (a: Simulation, b: Simulation) => Date.parse(b.creationDate) - Date.parse(a.creationDate)\r\n );\r\n if (isMounted()) setSimulations(allSimulations);\r\n } catch (error: unknown) {\r\n const messageText = checkMessageText(\r\n error as Error,\r\n MESSAGES.SIMULATION.FETCH_ERROR,\r\n MESSAGES.SIMULATION.FETCH_ERROR_AUTH\r\n );\r\n message(messageText, MessageVariants.Error);\r\n }\r\n if (isMounted()) setLoading(false);\r\n }, [isMounted, message]);\r\n\r\n /**\r\n * Deleted simulations are also fetched and ordered by the creationDate field (newest first)\r\n */\r\n const fetchDataDeleted = useCallback(async (): Promise => {\r\n setLoadingDeleted(true);\r\n try {\r\n const params: SimulationGetParams = { isDeleted: true };\r\n const allDeletedSimulations: Simulation[] = await getAllSimulations(params);\r\n allDeletedSimulations.sort(\r\n (a: Simulation, b: Simulation) => Date.parse(b.creationDate) - Date.parse(a.creationDate)\r\n );\r\n if (isMounted()) setDeletedSimulations(allDeletedSimulations);\r\n } catch (error: unknown) {\r\n const messageText = checkMessageText(\r\n error as Error,\r\n MESSAGES.SIMULATION.FETCH_DELETED_ERROR,\r\n MESSAGES.SIMULATION.FETCH_DELETED_ERROR_AUTH\r\n );\r\n message(messageText, MessageVariants.Error);\r\n }\r\n if (isMounted()) setLoadingDeleted(false);\r\n }, [isMounted, message]);\r\n\r\n useEffect(() => {\r\n fetchData();\r\n fetchDataDeleted();\r\n }, [fetchData, fetchDataDeleted]);\r\n\r\n /**\r\n * Loading the simulations' images here, so that we can pass the links directly to the cards.\r\n */\r\n const loadImages = useCallback(async (): Promise => {\r\n const imagesPromises: Promise[] = simulations.map(\r\n async (simulation: Simulation) => {\r\n const link: SimulationImageLink = simulation.image\r\n ? await getImageFromStorage(simulation.image, simulation.id)\r\n : null;\r\n const data: SimulationImageData = { id: simulation.id, link };\r\n return data;\r\n }\r\n );\r\n const results: PromiseSettledResult[] = await Promise.allSettled(\r\n imagesPromises\r\n );\r\n const imagesData = results.map((result: PromiseSettledResult) => ({\r\n ...(result as PromiseFulfilledResult).value,\r\n }));\r\n if (isMounted()) setSimulationImages(imagesData);\r\n }, [simulations, isMounted]);\r\n\r\n /**\r\n * Loading the deleted simulations' images here, so that we can pass the links directly to the cards.\r\n */\r\n const loadImagesDeleted = useCallback(async (): Promise => {\r\n const imagesPromises: Promise[] = deletedSimulations.map(\r\n async (simulation: Simulation) => {\r\n const link: SimulationImageLink = simulation.image\r\n ? await getImageFromStorage(simulation.image, simulation.id)\r\n : null;\r\n const data: SimulationImageData = { id: simulation.id, link };\r\n return data;\r\n }\r\n );\r\n const results: PromiseSettledResult[] = await Promise.allSettled(\r\n imagesPromises\r\n );\r\n const imagesData = results.map((result: PromiseSettledResult) => ({\r\n ...(result as PromiseFulfilledResult).value,\r\n }));\r\n if (isMounted()) setDeletedSimulationImages(imagesData);\r\n }, [deletedSimulations, isMounted]);\r\n\r\n useEffect(() => {\r\n loadImages();\r\n loadImagesDeleted();\r\n }, [loadImages, loadImagesDeleted, deletedSimulations]);\r\n\r\n const filteredSimulations: Simulation[] = !filter\r\n ? simulations\r\n : (filterItemsPerName(simulations, filter) as Simulation[]);\r\n const filteredDeletedSimulations: Simulation[] = !filter\r\n ? deletedSimulations\r\n : (filterItemsPerName(deletedSimulations, filter) as Simulation[]);\r\n\r\n const onPaginationChange = (event: React.ChangeEvent, value: number): void => {\r\n setPage(value);\r\n };\r\n\r\n const handleAddModalOpen = (): void => {\r\n setModalOpen(true);\r\n };\r\n\r\n const handleAddModalClose = (): void => {\r\n setModalOpen(false);\r\n clearAddModalValues();\r\n };\r\n\r\n const clearAddModalValues = (): void => {\r\n setAddSimulationName(\"\");\r\n setAddSimulationPackageName(\"\");\r\n setAddSimulationDescription(\"\");\r\n };\r\n\r\n const handleAddModalConfirm = async (): Promise => {\r\n try {\r\n const insertData: SimulationInsertData = {\r\n name: addSimulationName,\r\n packageName: addSimulationPackageName,\r\n description: addSimulationDescription,\r\n };\r\n handleAddModalClose();\r\n const newSimulation: Simulation = await insertSimulation(insertData);\r\n handleSpecificInsertion(newSimulation);\r\n message(MESSAGES.SIMULATION.CREATE_SUCCESS, MessageVariants.Success);\r\n } catch (error: unknown) {\r\n const messageText = checkMessageText(\r\n error as Error,\r\n MESSAGES.SIMULATION.CREATE_ERROR,\r\n MESSAGES.SIMULATION.CREATE_ERROR_AUTH\r\n );\r\n message(messageText, MessageVariants.Error);\r\n }\r\n };\r\n\r\n const handleSpecificInsertion = useCallback(\r\n (newSimulation: Simulation): void => {\r\n const newSimulations: Simulation[] = [...simulations];\r\n newSimulations.unshift(newSimulation);\r\n if (isMounted()) setSimulations(newSimulations);\r\n },\r\n [simulations, isMounted]\r\n );\r\n\r\n const handleSpecificRestore = useCallback(\r\n (restoredSimulation: Simulation): void => {\r\n const newSimulations: Simulation[] = [...simulations];\r\n newSimulations.unshift(restoredSimulation);\r\n newSimulations.sort(\r\n (a: Simulation, b: Simulation) => Date.parse(b.creationDate) - Date.parse(a.creationDate)\r\n );\r\n if (isMounted()) setSimulations(newSimulations);\r\n const newDeletedSimulations = deletedSimulations.filter(\r\n (simulation: Simulation) => simulation.id !== restoredSimulation.id\r\n );\r\n if (isMounted()) setDeletedSimulations(newDeletedSimulations);\r\n },\r\n [simulations, deletedSimulations, isMounted]\r\n );\r\n\r\n const handleSpecificUpdate = useCallback(\r\n (id: string, simulationData: SimulationUpdateData | SimulationInsertData): void => {\r\n const newSimulations: Simulation[] = [...simulations];\r\n const index: number = simulations.findIndex((simulation: Simulation) => simulation.id === id);\r\n newSimulations[index] = { ...newSimulations[index], ...simulationData };\r\n if (isMounted()) setSimulations(newSimulations);\r\n },\r\n [simulations, isMounted]\r\n );\r\n\r\n /**\r\n * After successfully uploading a platform file for a simulation, should update that simulation's platforms\r\n * by removing the existing register for the current uploaded platform type, and inserting the new value (on the state variable).\r\n */\r\n const handleSpecificUpdatePlatform = useCallback(\r\n (id: string, newPlatform: Platform): void => {\r\n const newSimulations: Simulation[] = [...simulations];\r\n const index: number = simulations.findIndex((simulation: Simulation) => simulation.id === id);\r\n const currentPlatforms: Platform[] = newSimulations[index].platforms;\r\n const shouldKeep: Platform[] = currentPlatforms.filter(\r\n (platform: Platform) => platform.type !== newPlatform.type\r\n );\r\n newSimulations[index].platforms = [...shouldKeep, newPlatform];\r\n if (isMounted()) setSimulations(newSimulations);\r\n },\r\n [simulations, isMounted]\r\n );\r\n\r\n const handleSpecificDelete = useCallback(\r\n (deletedSimulation: Simulation): void => {\r\n const newSimulations = simulations.filter(\r\n (simulation: Simulation) => simulation.id !== deletedSimulation.id\r\n );\r\n if (isMounted()) setSimulations(newSimulations);\r\n const newDeletedSimulations: Simulation[] = [...deletedSimulations];\r\n newDeletedSimulations.unshift(deletedSimulation);\r\n newDeletedSimulations.sort(\r\n (a: Simulation, b: Simulation) => Date.parse(b.creationDate) - Date.parse(a.creationDate)\r\n );\r\n if (isMounted()) setDeletedSimulations(newDeletedSimulations);\r\n },\r\n [simulations, deletedSimulations, isMounted]\r\n );\r\n\r\n const Loading = (): React.ReactNode => ;\r\n\r\n const CardList = (\r\n simulationsToRender: Simulation[],\r\n images: SimulationImageData[],\r\n isSimulationDeleted: boolean\r\n ): React.ReactNode => (\r\n \r\n );\r\n\r\n const NonDeletedDisplay = (): React.ReactNode =>\r\n loading ? Loading() : CardList(filteredSimulations, simulationImages, false);\r\n\r\n const DeletedDisplay = (): React.ReactNode =>\r\n loadingDeleted\r\n ? Loading()\r\n : CardList(filteredDeletedSimulations, deletedSimulationImages, true);\r\n\r\n const handleOnNonDeletedModeClick = (): void => {\r\n setPage(1);\r\n setMode(SimulationDisplay.NonDeleted);\r\n };\r\n\r\n const handleOnDeletedModeClick = (): void => {\r\n setPage(1);\r\n setMode(SimulationDisplay.Deleted);\r\n };\r\n\r\n return (\r\n
\r\n \r\n ) =>\r\n handleInputOnChange(event, setFilter)\r\n }\r\n displayModeSelector\r\n onNonDeletedModeClick={handleOnNonDeletedModeClick}\r\n onDeletedModeClick={handleOnDeletedModeClick}\r\n currentMode={mode}\r\n />\r\n {mode === SimulationDisplay.NonDeleted && NonDeletedDisplay()}\r\n {mode === SimulationDisplay.Deleted && DeletedDisplay()}\r\n \r\n \r\n {mode === SimulationDisplay.NonDeleted && (\r\n \r\n )}\r\n \r\n
\r\n );\r\n};\r\n\r\nexport default Simulations;\r\n","/**\r\n * Function that localizes a given date. It uses the getTimezoneOffset method.\r\n * @param {string} date The date to be localized.\r\n * @returns {Date} The localized date.\r\n */\r\nconst localizeDate = (date: string): Date => {\r\n const localDate = new Date(date);\r\n localDate.setTime(localDate.getTime() - localDate.getTimezoneOffset() * 60000);\r\n return localDate;\r\n};\r\n\r\nexport { localizeDate };\r\n","export default __webpack_public_path__ + \"static/media/m-neo3-7.bd77c05b.jpg\";","import React, { useState } from \"react\";\r\nimport { format } from \"date-fns\";\r\n\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport { faEllipsisV } from \"@fortawesome/free-solid-svg-icons\";\r\nimport Grid from \"@mui/material/Grid\";\r\nimport Card from \"@mui/material/Card\";\r\nimport CardContent from \"@mui/material/CardContent\";\r\nimport CardMedia from \"@mui/material/CardMedia\";\r\nimport Typography from \"@mui/material/Typography\";\r\nimport IconButton from \"@mui/material/IconButton\";\r\nimport MenuItem from \"@mui/material/MenuItem\";\r\nimport Menu from \"@mui/material/Menu\";\r\nimport Fade from \"@mui/material/Fade\";\r\n\r\nimport { Device } from \"../../utilities/types\";\r\nimport { localizeDate } from \"../../utilities/dateHelper\";\r\nimport { DEVICE } from \"../../constants\";\r\n\r\nimport picoNeo3 from \"../../assets/m-neo3-7.jpg\";\r\nimport \"./styles.scss\";\r\n\r\ntype Props = {\r\n index: number;\r\n device: Device;\r\n handleManageModalOpen: () => void;\r\n handleDeleteModalOpen: () => void;\r\n setSelectedDevice: (device: Device) => void;\r\n};\r\n\r\nconst DeviceCard: React.FunctionComponent = ({\r\n index,\r\n device,\r\n handleManageModalOpen,\r\n handleDeleteModalOpen,\r\n setSelectedDevice,\r\n}) => {\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n\r\n const handleMenu = (event: React.MouseEvent): void => {\r\n setSelectedDevice(device);\r\n setAnchorEl(event.currentTarget);\r\n };\r\n\r\n const handleClose = (): void => {\r\n setAnchorEl(null);\r\n };\r\n\r\n const ImageElement = (): React.ReactNode => (\r\n \r\n );\r\n\r\n const handleManageOnClick = (): void => {\r\n handleManageModalOpen();\r\n handleClose();\r\n };\r\n\r\n const handleDeleteOnClick = (): void => {\r\n handleDeleteModalOpen();\r\n handleClose();\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n {ImageElement()}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n {device.name}\r\n \r\n \r\n ►{\" \"}\r\n {device.simulations.length === 1\r\n ? `${device.simulations.length} simulation`\r\n : `${device.simulations.length} simulations`}\r\n \r\n \r\n ► Last online at{\" \"}\r\n {format(localizeDate(device.lastOnlineDate), \"yyyy/MM/dd HH:mm a\")}\r\n \r\n \r\n \r\n \r\n \r\n \r\n {DEVICE.CARD.OPTIONS.MANAGE}\r\n {DEVICE.CARD.OPTIONS.DELETE}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default DeviceCard;\r\n","import React, { useEffect, useState, useCallback } from \"react\";\r\n\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport { faInfoCircle } from \"@fortawesome/free-solid-svg-icons\";\r\nimport Typography from \"@mui/material/Typography\";\r\nimport Grid from \"@mui/material/Grid\";\r\nimport Divider from \"@mui/material/Divider\";\r\nimport Tooltip from \"@mui/material/Tooltip\";\r\nimport IconButton from \"@mui/material/IconButton\";\r\nimport Modal from \"../Modal\";\r\nimport EmptyListPlaceholder from \"../EmptyListPlaceholder\";\r\nimport SimulationCard from \"../SimulationCard\";\r\nimport PageLoader from \"../PageLoader\";\r\n\r\nimport { getImageFromStorage } from \"../../gateway/FileManagement\";\r\nimport {\r\n Simulation,\r\n Device,\r\n SimulationImageLink,\r\n SimulationImageData,\r\n} from \"../../utilities/types\";\r\nimport { SimulationCardVariants } from \"../../utilities/enums\";\r\nimport useIsMounted from \"./../../utilities/useIsMounted\";\r\nimport { DEVICE } from \"../../constants\";\r\n\r\nimport \"./styles.scss\";\r\n\r\ntype Props = {\r\n confirmText: string;\r\n open: boolean;\r\n addedSimulations: Simulation[];\r\n availableSimulations: Simulation[];\r\n device: Device | undefined;\r\n loadingSimulationData: boolean;\r\n handleDeviceLibraryAdd: (simulationId: string) => Promise;\r\n handleDeviceLibraryRemove: (simulationId: string) => Promise;\r\n handleModalClose: () => void;\r\n handleModalConfirm: () => void;\r\n};\r\n\r\nconst SimulationLinkModal: React.FunctionComponent = ({\r\n confirmText,\r\n open,\r\n addedSimulations,\r\n availableSimulations,\r\n device,\r\n loadingSimulationData,\r\n handleDeviceLibraryAdd,\r\n handleDeviceLibraryRemove,\r\n handleModalClose,\r\n handleModalConfirm,\r\n}) => {\r\n const [simulationImages, setSimulationImages] = useState([]);\r\n\r\n const isMounted = useIsMounted();\r\n\r\n /**\r\n * Loading the images here, so that we can pass the links directly to the cards.\r\n */\r\n const loadImages = useCallback(async (): Promise => {\r\n const allSimulations: Simulation[] = [...addedSimulations, ...availableSimulations];\r\n const imagesPromises: Promise[] = allSimulations.map(\r\n async (simulation: Simulation) => {\r\n const link: SimulationImageLink = simulation.image\r\n ? await getImageFromStorage(simulation.image, simulation.id)\r\n : null;\r\n const data: SimulationImageData = { id: simulation.id, link };\r\n return data;\r\n }\r\n );\r\n const results: PromiseSettledResult[] = await Promise.allSettled(\r\n imagesPromises\r\n );\r\n const imagesData = results.map((result: PromiseSettledResult) => ({\r\n ...(result as PromiseFulfilledResult).value,\r\n }));\r\n if (isMounted()) setSimulationImages(imagesData);\r\n }, [addedSimulations, availableSimulations, isMounted]);\r\n\r\n /**\r\n * Load images when modal gets opened, and there are simulations that should be displayed on that modal.\r\n */\r\n useEffect(() => {\r\n const modalHasSimulations: boolean =\r\n addedSimulations.length > 0 || availableSimulations.length > 0;\r\n if (!modalHasSimulations || !open) return;\r\n loadImages();\r\n }, [loadImages, addedSimulations, availableSimulations, open]);\r\n\r\n const EmptyList = (text: string): React.ReactNode => ;\r\n\r\n const SimulationCards = (\r\n simulations: Simulation[],\r\n variant: SimulationCardVariants\r\n ): React.ReactNode =>\r\n simulations.map((simulation: Simulation, index: number) => (\r\n \r\n imageData.id === simulation.id\r\n )?.link\r\n }\r\n isSimulationDeleted={false}\r\n handleDeviceLibraryAdd={() => handleDeviceLibraryAdd(simulation.id)}\r\n handleDeviceLibraryRemove={() => handleDeviceLibraryRemove(simulation.id)}\r\n />\r\n \r\n ));\r\n\r\n const SimulationCardList = (\r\n simulationsList: Simulation[],\r\n variant: SimulationCardVariants,\r\n emptyText: string\r\n ) => (\r\n \r\n {simulationsList.length < 1\r\n ? EmptyList(emptyText)\r\n : SimulationCards(simulationsList, variant)}\r\n \r\n );\r\n\r\n const Loading = (): React.ReactNode => ;\r\n\r\n return (\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n {DEVICE.MODAL.SIMULATION_LINK.LEFT_HEADER}\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n {loadingSimulationData\r\n ? Loading()\r\n : SimulationCardList(\r\n addedSimulations,\r\n SimulationCardVariants.Remove,\r\n DEVICE.MODAL.SIMULATION_LINK.LEFT_EMPTY_LIST_PLACEHOLDER\r\n )}\r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n \r\n {DEVICE.MODAL.SIMULATION_LINK.RIGHT_HEADER}\r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n {loadingSimulationData\r\n ? Loading()\r\n : SimulationCardList(\r\n availableSimulations,\r\n SimulationCardVariants.Add,\r\n DEVICE.MODAL.SIMULATION_LINK.RIGHT_EMPTY_LIST_PLACEHOLDER\r\n )}\r\n
\r\n
\r\n
\r\n \r\n );\r\n};\r\n\r\nexport default SimulationLinkModal;\r\n","import React from \"react\";\r\n\r\nimport Typography from \"@mui/material/Typography\";\r\nimport Modal from \"../Modal\";\r\n\r\ntype Props = {\r\n title: string;\r\n confirmText: string;\r\n contentText: string;\r\n open: boolean;\r\n handleModalClose: () => void;\r\n handleModalConfirm: () => void;\r\n};\r\n\r\nconst NotificationModal: React.FunctionComponent = ({\r\n title,\r\n confirmText,\r\n contentText,\r\n open,\r\n handleModalClose,\r\n handleModalConfirm,\r\n}) => (\r\n \r\n \r\n {contentText}\r\n \r\n \r\n);\r\n\r\nexport default NotificationModal;\r\n","import axios, { AxiosResponse } from \"axios\";\r\n\r\nimport { WEB_SERVICE_URL } from \"../../constants\";\r\nimport { Device, Simulation, SimulationIntoLibraryData } from \"../../utilities/types\";\r\nimport { isResponseValid } from \"../../utilities/gatewayHelper\";\r\n\r\nconst getAllDevices = async (): Promise =>\r\n axios\r\n .get(`${WEB_SERVICE_URL}/devices`)\r\n .then((response: AxiosResponse) => {\r\n const devices: Device[] = isResponseValid(response) as Device[];\r\n return devices;\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nconst deleteDevice = async (id: string): Promise =>\r\n axios\r\n .delete(`${WEB_SERVICE_URL}/devices/${id}`)\r\n .then((response: AxiosResponse) => {\r\n isResponseValid(response);\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nconst insertIntoLibrary = async (\r\n deviceId: string,\r\n data: SimulationIntoLibraryData\r\n): Promise =>\r\n axios\r\n .post(`${WEB_SERVICE_URL}/devices/${deviceId}/library`, data)\r\n .then((response: AxiosResponse) => {\r\n const simulation: Simulation = isResponseValid(response) as Simulation;\r\n return simulation;\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nconst deleteFromLibrary = async (deviceId: string, simulationId: string): Promise =>\r\n axios\r\n .delete(`${WEB_SERVICE_URL}/devices/${deviceId}/library/${simulationId}`)\r\n .then((response: AxiosResponse) => {\r\n isResponseValid(response);\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nexport { getAllDevices, deleteDevice, insertIntoLibrary, deleteFromLibrary };\r\n","import React, { useState, useEffect, useCallback } from \"react\";\r\n\r\nimport Grid from \"@mui/material/Grid\";\r\nimport DeviceCard from \"../DeviceCard\";\r\nimport EmptyListPlaceholder from \"../EmptyListPlaceholder\";\r\nimport DeleteModal from \"../DeleteModal\";\r\nimport SimulationLinkModal from \"../SimulationLinkModal\";\r\nimport NotificationModal from \"../NotificationModal\";\r\n\r\nimport { getAllSimulations } from \"../../gateway/Simulation\";\r\nimport { deleteDevice, insertIntoLibrary, deleteFromLibrary } from \"../../gateway/Device\";\r\nimport {\r\n Device,\r\n DeviceUpdateData,\r\n Simulation,\r\n SimulationGetParams,\r\n SimulationIntoLibraryData,\r\n} from \"../../utilities/types\";\r\nimport { MessageVariants, SimulationPlatformType } from \"../../utilities/enums\";\r\nimport useIsMounted from \"./../../utilities/useIsMounted\";\r\nimport useMessage from \"./../../utilities/useMessage\";\r\nimport { checkMessageText } from \"./../../utilities/messageHelper\";\r\nimport { MESSAGES, DEVICE } from \"../../constants\";\r\n\r\nimport \"./styles.scss\";\r\n\r\ntype Props = {\r\n devices: Device[];\r\n handleSpecificDelete: (id: string) => void;\r\n handleSpecificUpdate: (id: string, deviceData: DeviceUpdateData) => void;\r\n};\r\n\r\nconst DeviceCardList: React.FunctionComponent = ({\r\n devices,\r\n handleSpecificDelete,\r\n handleSpecificUpdate,\r\n}) => {\r\n const [shouldFetch, setShouldFetch] = useState(true);\r\n const [deleteModalOpen, setDeleteModalOpen] = useState(false);\r\n const [manageModalOpen, setManageModalOpen] = useState(false);\r\n const [notificationModalOpen, setNotificationModalOpen] = useState(false);\r\n const [selectedDevice, setSelectedDevice] = useState(undefined);\r\n const [otherSimulations, setOtherSimulations] = useState([]);\r\n const [loadingSimulationData, setLoadingSimulationData] = useState(true);\r\n\r\n const isMounted = useIsMounted();\r\n const message = useMessage();\r\n\r\n /**\r\n * Simulations containing a VR platform file are fetched, when manageModalOpen is true, and shouldFetch is also true.\r\n * The simulations already on the device library are removed from these fetched Simulations, and sorted by creationDate, composing the Other simulations array.\r\n */\r\n useEffect(() => {\r\n if (!manageModalOpen || !shouldFetch) return;\r\n setLoadingSimulationData(true);\r\n const fetchSimulationData = async (): Promise => {\r\n try {\r\n const params: SimulationGetParams = { platform: SimulationPlatformType.VR };\r\n const vrSimulations: Simulation[] = await getAllSimulations(params);\r\n\r\n const deviceLibrary: Simulation[] = selectedDevice ? selectedDevice.simulations : [];\r\n const otherOptions = vrSimulations.filter(\r\n (simulation: Simulation) =>\r\n !deviceLibrary.find(\r\n (librarySimulation: Simulation) => librarySimulation.id === simulation.id\r\n )\r\n );\r\n otherOptions.sort(\r\n (a: Simulation, b: Simulation) => Date.parse(b.creationDate) - Date.parse(a.creationDate)\r\n );\r\n\r\n if (isMounted()) {\r\n setOtherSimulations(otherOptions);\r\n setShouldFetch(false);\r\n setLoadingSimulationData(false);\r\n }\r\n } catch (error: unknown) {\r\n const messageText = checkMessageText(\r\n error as Error,\r\n MESSAGES.DEVICE.SIMULATION_FETCH_ERROR,\r\n MESSAGES.DEVICE.SIMULATION_FETCH_ERROR_AUTH\r\n );\r\n message(messageText, MessageVariants.Error);\r\n }\r\n };\r\n fetchSimulationData();\r\n }, [manageModalOpen, shouldFetch, selectedDevice, isMounted, message]);\r\n\r\n /**\r\n * Should update the Device's simulations and the Other simulations after adding a simulation to the device library.\r\n */\r\n const handleDeviceSimulationInsertion = useCallback(\r\n (newSimulation: Simulation, selectedDeviceCurrent: Device): void => {\r\n const newSimulations: Simulation[] = [...selectedDeviceCurrent.simulations];\r\n newSimulations.unshift(newSimulation);\r\n newSimulations.sort(\r\n (a: Simulation, b: Simulation) => Date.parse(b.creationDate) - Date.parse(a.creationDate)\r\n );\r\n\r\n /**\r\n * Updating the selected device.\r\n */\r\n const updatedDevice: Device = { ...selectedDeviceCurrent };\r\n updatedDevice.simulations = newSimulations;\r\n if (isMounted()) setSelectedDevice(updatedDevice);\r\n\r\n /**\r\n * Updating the other simulations.\r\n */\r\n const currentOther: Simulation[] = [...otherSimulations];\r\n const newOther: Simulation[] = currentOther.filter(\r\n (simulation: Simulation) => simulation.id !== newSimulation.id\r\n );\r\n if (isMounted()) setOtherSimulations(newOther);\r\n },\r\n [isMounted, otherSimulations]\r\n );\r\n\r\n /**\r\n * Should update the Device's simulations and the Other Simulations after removing a simulation from the device library.\r\n */\r\n const handleDeviceSimulationDelete = useCallback(\r\n (simulationId: string, selectedDeviceCurrent: Device): void => {\r\n const currentSimulations: Simulation[] = [...selectedDeviceCurrent.simulations];\r\n const newSimulations: Simulation[] = currentSimulations.filter(\r\n (simulation: Simulation) => simulation.id !== simulationId\r\n );\r\n\r\n /**\r\n * Updating the selected device.\r\n */\r\n const updatedDevice: Device = { ...selectedDeviceCurrent };\r\n updatedDevice.simulations = newSimulations;\r\n if (isMounted()) setSelectedDevice(updatedDevice);\r\n\r\n /**\r\n * Updating the other simulations.\r\n */\r\n const newOther: Simulation[] = [...otherSimulations];\r\n const newOtherSimulation: Simulation | undefined = currentSimulations.find(\r\n (simulation: Simulation) => simulation.id === simulationId\r\n );\r\n if (newOtherSimulation) newOther.unshift(newOtherSimulation);\r\n newOther.sort(\r\n (a: Simulation, b: Simulation) => Date.parse(b.creationDate) - Date.parse(a.creationDate)\r\n );\r\n if (isMounted()) setOtherSimulations(newOther);\r\n },\r\n [isMounted, otherSimulations]\r\n );\r\n\r\n /**\r\n * Calls the endpoint to add a simulation to the device's library.\r\n * Calls handleDeviceSimulationInsertion to update the device's simulations.\r\n */\r\n const handleDeviceLibraryAdd = async (simulationId: string): Promise => {\r\n if (!selectedDevice) return;\r\n try {\r\n const insertData: SimulationIntoLibraryData = { simulationId };\r\n const addedSimulation: Simulation = await insertIntoLibrary(selectedDevice.id, insertData);\r\n handleDeviceSimulationInsertion(addedSimulation, selectedDevice);\r\n message(MESSAGES.DEVICE.ADD_TO_LIBRARY_SUCCESS, MessageVariants.Success);\r\n } catch (error: unknown) {\r\n const messageText = checkMessageText(\r\n error as Error,\r\n MESSAGES.DEVICE.ADD_TO_LIBRARY_ERROR,\r\n MESSAGES.DEVICE.ADD_TO_LIBRARY_ERROR_AUTH\r\n );\r\n message(messageText, MessageVariants.Error);\r\n }\r\n };\r\n\r\n /**\r\n * Calls the endpoint to remove a simulation from the device's library.\r\n * Calls handleDeviceSimulationDelete to update the device's simulations.\r\n */\r\n const handleDeviceLibraryRemove = async (simulationId: string): Promise => {\r\n if (!selectedDevice) return;\r\n try {\r\n await deleteFromLibrary(selectedDevice.id, simulationId);\r\n handleDeviceSimulationDelete(simulationId, selectedDevice);\r\n message(MESSAGES.DEVICE.REMOVE_FROM_LIBRARY_SUCCESS, MessageVariants.Success);\r\n } catch (error: unknown) {\r\n const messageText = checkMessageText(\r\n error as Error,\r\n MESSAGES.DEVICE.REMOVE_FROM_LIBRARY_ERROR,\r\n MESSAGES.DEVICE.REMOVE_FROM_LIBRARY_ERROR_AUTH\r\n );\r\n message(messageText, MessageVariants.Error);\r\n }\r\n };\r\n\r\n const handleManageModalOpen = (): void => {\r\n setManageModalOpen(true);\r\n };\r\n\r\n /**\r\n * Closing the modal updates the devices list, and resets the shouldFetch boolean.\r\n */\r\n const handleManageModalClose = (): void => {\r\n if (selectedDevice) {\r\n const deviceData: DeviceUpdateData = { simulations: selectedDevice.simulations };\r\n handleSpecificUpdate(selectedDevice.id, deviceData);\r\n }\r\n setShouldFetch(true);\r\n setManageModalOpen(false);\r\n setOtherSimulations([]);\r\n handleNotificationModalOpen();\r\n };\r\n\r\n const handleDeleteModalOpen = (): void => {\r\n setDeleteModalOpen(true);\r\n };\r\n\r\n const handleDeleteModalClose = (): void => {\r\n setDeleteModalOpen(false);\r\n };\r\n\r\n const handleNotificationModalOpen = (): void => {\r\n setNotificationModalOpen(true);\r\n };\r\n\r\n const handleNotificationModalClose = (): void => {\r\n setNotificationModalOpen(false);\r\n };\r\n\r\n const handleDeleteModalConfirm = async (): Promise => {\r\n if (!selectedDevice) return;\r\n try {\r\n handleDeleteModalClose();\r\n await deleteDevice(selectedDevice.id);\r\n handleSpecificDelete(selectedDevice.id);\r\n message(MESSAGES.DEVICE.DELETE_SUCCESS, MessageVariants.Success);\r\n } catch (error: unknown) {\r\n const messageText = checkMessageText(\r\n error as Error,\r\n MESSAGES.DEVICE.DELETE_ERROR,\r\n MESSAGES.DEVICE.DELETE_ERROR_AUTH\r\n );\r\n message(messageText, MessageVariants.Error);\r\n }\r\n };\r\n\r\n const EmptyList = (): React.ReactNode => (\r\n \r\n );\r\n\r\n const DeviceCards = (): React.ReactNode =>\r\n devices.map((device: Device, index: number) => (\r\n \r\n \r\n \r\n ));\r\n\r\n return (\r\n \r\n {devices.length < 1 ? EmptyList() : DeviceCards()}\r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default DeviceCardList;\r\n","import React, { useEffect, useState, useCallback } from \"react\";\r\n\r\nimport Container from \"@mui/material/Container\";\r\nimport DeviceCardList from \"../../components/DeviceCardList\";\r\nimport PaginationSection from \"../../components/PaginationSection\";\r\nimport InitialSection from \"../../components/InitialSection\";\r\nimport PageLoader from \"../../components/PageLoader\";\r\n\r\nimport { getAllDevices } from \"../../gateway/Device\";\r\nimport { Device, DeviceUpdateData } from \"./../../utilities/types\";\r\nimport { MessageVariants } from \"./../../utilities/enums\";\r\nimport useIsMounted from \"./../../utilities/useIsMounted\";\r\nimport useMessage from \"./../../utilities/useMessage\";\r\nimport { checkMessageText } from \"./../../utilities/messageHelper\";\r\nimport { handleInputOnChange } from \"./../../utilities/inputHelper\";\r\nimport { getPagesCount, itemsToRender, filterItemsPerName } from \"./../../utilities/pagination\";\r\nimport { MESSAGES, DEVICES_PER_PAGE, DEVICE } from \"./../../constants\";\r\n\r\nconst Devices: React.FunctionComponent = () => {\r\n const [devices, setDevices] = useState([]);\r\n const [filter, setFilter] = useState(\"\");\r\n const [page, setPage] = useState(1);\r\n const [loading, setLoading] = useState(true);\r\n\r\n const isMounted = useIsMounted();\r\n const message = useMessage();\r\n\r\n /**\r\n * Devices are fetched and ordered by the creationDate field (newest first)\r\n */\r\n const fetchData = useCallback(async (): Promise => {\r\n setLoading(true);\r\n try {\r\n const allDevices = await getAllDevices();\r\n allDevices.sort(\r\n (a: Device, b: Device) => Date.parse(b.creationDate) - Date.parse(a.creationDate)\r\n );\r\n if (isMounted()) setDevices(allDevices);\r\n } catch (error: unknown) {\r\n const messageText = checkMessageText(\r\n error as Error,\r\n MESSAGES.DEVICE.FETCH_ERROR,\r\n MESSAGES.DEVICE.FETCH_ERROR_AUTH\r\n );\r\n message(messageText, MessageVariants.Error);\r\n }\r\n if (isMounted()) setLoading(false);\r\n }, [isMounted, message]);\r\n\r\n useEffect(() => {\r\n fetchData();\r\n }, [fetchData]);\r\n\r\n const filteredDevices = !filter ? devices : filterItemsPerName(devices, filter);\r\n\r\n const onPaginationChange = (event: React.ChangeEvent, value: number): void => {\r\n setPage(value);\r\n };\r\n\r\n const handleSpecificDelete = useCallback(\r\n (id: string): void => {\r\n const newDevices = devices.filter((device: Device) => device.id !== id);\r\n if (isMounted()) setDevices(newDevices);\r\n },\r\n [devices, isMounted]\r\n );\r\n\r\n const handleSpecificUpdate = useCallback(\r\n (id: string, deviceData: DeviceUpdateData): void => {\r\n const newDevices: Device[] = [...devices];\r\n const index: number = devices.findIndex((device: Device) => device.id === id);\r\n newDevices[index] = { ...newDevices[index], ...deviceData };\r\n if (isMounted()) setDevices(newDevices);\r\n },\r\n [devices, isMounted]\r\n );\r\n\r\n const Loading = (): React.ReactNode => ;\r\n\r\n const CardList = (): React.ReactNode => (\r\n \r\n );\r\n\r\n return (\r\n
\r\n \r\n ) =>\r\n handleInputOnChange(event, setFilter)\r\n }\r\n displayModeSelector={false}\r\n />\r\n {loading ? Loading() : CardList()}\r\n \r\n \r\n
\r\n );\r\n};\r\n\r\nexport default Devices;\r\n","import React, { useState } from \"react\";\r\n\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport { faEllipsisV, faCopy } from \"@fortawesome/free-solid-svg-icons\";\r\nimport Grid from \"@mui/material/Grid\";\r\nimport Card from \"@mui/material/Card\";\r\nimport CardHeader from \"@mui/material/CardHeader\";\r\nimport CardContent from \"@mui/material/CardContent\";\r\nimport Typography from \"@mui/material/Typography\";\r\nimport IconButton from \"@mui/material/IconButton\";\r\nimport MenuItem from \"@mui/material/MenuItem\";\r\nimport Menu from \"@mui/material/Menu\";\r\nimport Fade from \"@mui/material/Fade\";\r\nimport TextField from \"@mui/material/TextField\";\r\nimport InputAdornment from \"@mui/material/InputAdornment\";\r\n\r\nimport useMessage from \"./../../utilities/useMessage\";\r\nimport { WebPassword } from \"../../utilities/types\";\r\nimport { MessageVariants } from \"../../utilities/enums\";\r\nimport { MESSAGES, WEB_PASSWORD } from \"../../constants\";\r\n\r\nimport \"./styles.scss\";\r\n\r\ntype Props = {\r\n index: number;\r\n webPassword: WebPassword;\r\n handleEditModalOpen: () => void;\r\n handleDeleteModalOpen: () => void;\r\n setSelectedWebPassword: (webPassword: WebPassword) => void;\r\n};\r\n\r\nconst WebPasswordCard: React.FunctionComponent = ({\r\n index,\r\n webPassword,\r\n handleEditModalOpen,\r\n handleDeleteModalOpen,\r\n setSelectedWebPassword,\r\n}) => {\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n\r\n const message = useMessage();\r\n\r\n const handleMenu = (event: React.MouseEvent): void => {\r\n setSelectedWebPassword(webPassword);\r\n setAnchorEl(event.currentTarget);\r\n };\r\n\r\n const handleClose = (): void => {\r\n setAnchorEl(null);\r\n };\r\n\r\n const handleEditOnClick = (): void => {\r\n handleEditModalOpen();\r\n handleClose();\r\n };\r\n\r\n const handleDeleteOnClick = (): void => {\r\n handleDeleteModalOpen();\r\n handleClose();\r\n };\r\n\r\n const handleClipboardOnClick = (): void => {\r\n navigator.clipboard.writeText(webPassword.password);\r\n message(MESSAGES.WEB_PASSWORD.COPY_TO_CLIPBOARD, MessageVariants.Success);\r\n };\r\n\r\n const HeaderTitle = (): React.ReactNode => {\r\n return (\r\n
\r\n \r\n {webPassword.userType}\r\n \r\n
\r\n );\r\n };\r\n\r\n const HeaderActionButton = (): React.ReactNode => {\r\n return (\r\n \r\n \r\n \r\n );\r\n };\r\n\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n ),\r\n }}\r\n />\r\n \r\n \r\n \r\n \r\n {WEB_PASSWORD.CARD.OPTIONS.EDIT}\r\n {WEB_PASSWORD.CARD.OPTIONS.DELETE}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default WebPasswordCard;\r\n","import React, { useEffect, useState } from \"react\";\r\n\r\nimport TextField from \"@mui/material/TextField\";\r\nimport Modal from \"../Modal\";\r\n\r\nimport { handleInputOnChange } from \"../../utilities/inputHelper\";\r\n\r\ntype Props = {\r\n title: string;\r\n cancelText: string;\r\n confirmText: string;\r\n open: boolean;\r\n userTypeLabel: string;\r\n userTypeValue: string;\r\n passwordLabel: string;\r\n passwordValue: string;\r\n setUserTypeValue: (value: string) => void;\r\n setPasswordValue: (value: string) => void;\r\n handleModalClose: () => void;\r\n handleModalConfirm: () => void;\r\n};\r\n\r\nconst WebPasswordAddEditModal: React.FunctionComponent = ({\r\n title,\r\n cancelText,\r\n confirmText,\r\n open,\r\n userTypeLabel,\r\n userTypeValue,\r\n passwordLabel,\r\n passwordValue,\r\n setUserTypeValue,\r\n setPasswordValue,\r\n handleModalClose,\r\n handleModalConfirm,\r\n}) => {\r\n const [localUserType, setLocalUserType] = useState(\"\");\r\n const [localPassword, setLocalPassword] = useState(\"\");\r\n\r\n useEffect(() => {\r\n if (!open) return;\r\n setLocalUserType(userTypeValue);\r\n setLocalPassword(passwordValue);\r\n }, [open, userTypeValue, passwordValue]);\r\n\r\n return (\r\n \r\n ) =>\r\n handleInputOnChange(event, setLocalUserType)\r\n }\r\n onBlur={() => setUserTypeValue(localUserType)}\r\n />\r\n ) =>\r\n handleInputOnChange(event, setLocalPassword)\r\n }\r\n onBlur={() => setPasswordValue(localPassword)}\r\n />\r\n \r\n );\r\n};\r\n\r\nexport default WebPasswordAddEditModal;\r\n","import axios, { AxiosResponse } from \"axios\";\r\n\r\nimport { WEB_SERVICE_URL } from \"../../constants\";\r\nimport { WebPassword, WebPasswordInsertData, WebPasswordUpdateData } from \"../../utilities/types\";\r\nimport { isResponseValid } from \"../../utilities/gatewayHelper\";\r\n\r\nconst getAllWebPasswords = async (): Promise =>\r\n axios\r\n .get(`${WEB_SERVICE_URL}/web-passwords`)\r\n .then((response: AxiosResponse) => {\r\n const webPasswords: WebPassword[] = isResponseValid(response) as WebPassword[];\r\n return webPasswords;\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nconst updateWebPassword = async (id: string, data: WebPasswordUpdateData): Promise =>\r\n axios\r\n .put(`${WEB_SERVICE_URL}/web-passwords/${id}`, data)\r\n .then((response: AxiosResponse) => {\r\n isResponseValid(response);\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nconst insertWebPassword = async (data: WebPasswordInsertData): Promise =>\r\n axios\r\n .post(`${WEB_SERVICE_URL}/web-passwords`, data)\r\n .then((response: AxiosResponse) => {\r\n const webPassword: WebPassword = isResponseValid(response) as WebPassword;\r\n return webPassword;\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nconst deleteWebPassword = async (id: string): Promise =>\r\n axios\r\n .delete(`${WEB_SERVICE_URL}/web-passwords/${id}`)\r\n .then((response: AxiosResponse) => {\r\n isResponseValid(response);\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nexport { getAllWebPasswords, updateWebPassword, insertWebPassword, deleteWebPassword };\r\n","import React, { useState, useEffect } from \"react\";\r\n\r\nimport Grid from \"@mui/material/Grid\";\r\nimport WebPasswordCard from \"../WebPasswordCard\";\r\nimport EmptyListPlaceholder from \"../EmptyListPlaceholder\";\r\nimport DeleteModal from \"../DeleteModal\";\r\nimport WebPasswordAddEditModal from \"../WebPasswordAddEditModal\";\r\n\r\nimport { updateWebPassword, deleteWebPassword } from \"../../gateway/WebPassword\";\r\nimport { WebPassword, WebPasswordUpdateData } from \"../../utilities/types\";\r\nimport { MessageVariants } from \"../../utilities/enums\";\r\nimport useMessage from \"./../../utilities/useMessage\";\r\nimport { checkMessageText } from \"./../../utilities/messageHelper\";\r\nimport { MESSAGES, WEB_PASSWORD } from \"../../constants\";\r\n\r\nimport \"./styles.scss\";\r\n\r\ntype Props = {\r\n webPasswords: WebPassword[];\r\n handleSpecificDelete: (id: string) => void;\r\n handleSpecificUpdate: (id: string, webPasswordData: WebPasswordUpdateData) => void;\r\n};\r\n\r\nconst WebPasswordCardList: React.FunctionComponent = ({\r\n webPasswords,\r\n handleSpecificDelete,\r\n handleSpecificUpdate,\r\n}) => {\r\n const [editModalOpen, setEditModalOpen] = useState(false);\r\n const [deleteModalOpen, setDeleteModalOpen] = useState(false);\r\n const [selectedWebPassword, setSelectedWebPassword] = useState(\r\n undefined\r\n );\r\n const [editUserType, setEditUserType] = useState(\"\");\r\n const [editPassword, setEditPassword] = useState(\"\");\r\n\r\n const message = useMessage();\r\n\r\n const handleEditModalOpen = (): void => {\r\n setEditModalOpen(true);\r\n };\r\n\r\n const handleEditModalClose = (): void => {\r\n setEditModalOpen(false);\r\n };\r\n\r\n const handleEditModalConfirm = async (): Promise => {\r\n if (!selectedWebPassword) return;\r\n try {\r\n const updateData: WebPasswordUpdateData = {\r\n userType: editUserType,\r\n password: editPassword,\r\n };\r\n handleEditModalClose();\r\n await updateWebPassword(selectedWebPassword.id, updateData);\r\n handleSpecificUpdate(selectedWebPassword.id, updateData);\r\n message(MESSAGES.WEB_PASSWORD.UPDATE_SUCCESS, MessageVariants.Success);\r\n } catch (error: unknown) {\r\n const messageText = checkMessageText(\r\n error as Error,\r\n MESSAGES.WEB_PASSWORD.UPDATE_ERROR,\r\n MESSAGES.WEB_PASSWORD.UPDATE_ERROR_AUTH\r\n );\r\n message(messageText, MessageVariants.Error);\r\n }\r\n };\r\n\r\n const handleDeleteModalOpen = (): void => {\r\n setDeleteModalOpen(true);\r\n };\r\n\r\n const handleDeleteModalClose = (): void => {\r\n setDeleteModalOpen(false);\r\n };\r\n\r\n const handleDeleteModalConfirm = async (): Promise => {\r\n if (!selectedWebPassword) return;\r\n try {\r\n handleDeleteModalClose();\r\n await deleteWebPassword(selectedWebPassword.id);\r\n handleSpecificDelete(selectedWebPassword.id);\r\n message(MESSAGES.WEB_PASSWORD.DELETE_SUCCESS, MessageVariants.Success);\r\n } catch (error: unknown) {\r\n const messageText = checkMessageText(\r\n error as Error,\r\n MESSAGES.WEB_PASSWORD.DELETE_ERROR,\r\n MESSAGES.WEB_PASSWORD.DELETE_ERROR_AUTH\r\n );\r\n message(messageText, MessageVariants.Error);\r\n }\r\n };\r\n\r\n useEffect(() => {\r\n if (!selectedWebPassword) return;\r\n setEditUserType(selectedWebPassword.userType);\r\n setEditPassword(selectedWebPassword.password);\r\n }, [selectedWebPassword]);\r\n\r\n const EmptyList = (): React.ReactNode => (\r\n \r\n );\r\n\r\n const WebPasswordCards = (): React.ReactNode =>\r\n webPasswords.map((webPassword: WebPassword, index: number) => (\r\n \r\n \r\n \r\n ));\r\n\r\n return (\r\n \r\n {webPasswords.length < 1 ? EmptyList() : WebPasswordCards()}\r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default WebPasswordCardList;\r\n","import React, { useEffect, useState, useCallback } from \"react\";\r\n\r\nimport Container from \"@mui/material/Container\";\r\nimport WebPasswordCardList from \"../../components/WebPasswordCardList\";\r\nimport PaginationSection from \"../../components/PaginationSection\";\r\nimport FloatingActionButton from \"../../components/FloatingActionButton\";\r\nimport InitialSection from \"../../components/InitialSection\";\r\nimport WebPasswordAddEditModal from \"../../components/WebPasswordAddEditModal\";\r\nimport PageLoader from \"../../components/PageLoader\";\r\n\r\nimport { getAllWebPasswords, insertWebPassword } from \"../../gateway/WebPassword\";\r\nimport { WebPassword, WebPasswordInsertData, WebPasswordUpdateData } from \"./../../utilities/types\";\r\nimport { MessageVariants } from \"./../../utilities/enums\";\r\nimport useIsMounted from \"./../../utilities/useIsMounted\";\r\nimport useMessage from \"./../../utilities/useMessage\";\r\nimport { checkMessageText } from \"./../../utilities/messageHelper\";\r\nimport {\r\n getPagesCount,\r\n itemsToRender,\r\n filterWebPasswordsPerUserType,\r\n} from \"./../../utilities/pagination\";\r\nimport { MESSAGES, WEB_PASSWORD, WEB_PASSWORDS_PER_PAGE } from \"./../../constants\";\r\n\r\nconst WebPasswords: React.FunctionComponent = () => {\r\n const [webPasswords, setWebPasswords] = useState([]);\r\n const [filter, setFilter] = useState(\"\");\r\n const [page, setPage] = useState(1);\r\n const [modalOpen, setModalOpen] = useState(false);\r\n const [addWebPasswordUserType, setAddWebPasswordUserType] = useState(\"\");\r\n const [addWebPasswordPassword, setAddWebPasswordPassword] = useState(\"\");\r\n const [loading, setLoading] = useState(true);\r\n\r\n const isMounted = useIsMounted();\r\n const message = useMessage();\r\n\r\n /**\r\n * Web passwords are fetched\r\n */\r\n const fetchData = useCallback(async (): Promise => {\r\n setLoading(true);\r\n try {\r\n const allWebPasswords = await getAllWebPasswords();\r\n allWebPasswords.sort((a: WebPassword, b: WebPassword) =>\r\n a.userType.localeCompare(b.userType)\r\n );\r\n if (isMounted()) setWebPasswords(allWebPasswords);\r\n } catch (error: unknown) {\r\n const messageText = checkMessageText(\r\n error as Error,\r\n MESSAGES.WEB_PASSWORD.FETCH_ERROR,\r\n MESSAGES.WEB_PASSWORD.FETCH_ERROR_AUTH\r\n );\r\n message(messageText, MessageVariants.Error);\r\n }\r\n if (isMounted()) setLoading(false);\r\n }, [isMounted, message]);\r\n\r\n useEffect(() => {\r\n fetchData();\r\n }, [fetchData]);\r\n\r\n const filteredWebPasswords = !filter\r\n ? webPasswords\r\n : filterWebPasswordsPerUserType(webPasswords, filter);\r\n\r\n const onFilterChange = (event: React.ChangeEvent): void => {\r\n setFilter(event.target.value);\r\n };\r\n\r\n const onPaginationChange = (event: React.ChangeEvent, value: number): void => {\r\n setPage(value);\r\n };\r\n\r\n const handleAddModalOpen = (): void => {\r\n setModalOpen(true);\r\n };\r\n\r\n const handleAddModalClose = (): void => {\r\n setModalOpen(false);\r\n clearAddModalValues();\r\n };\r\n\r\n const handleAddModalConfirm = async (): Promise => {\r\n try {\r\n const insertData: WebPasswordInsertData = {\r\n userType: addWebPasswordUserType,\r\n password: addWebPasswordPassword,\r\n };\r\n handleAddModalClose();\r\n const newSimulation: WebPassword = await insertWebPassword(insertData);\r\n handleSpecificInsertion(newSimulation);\r\n message(MESSAGES.WEB_PASSWORD.CREATE_SUCCESS, MessageVariants.Success);\r\n } catch (error: unknown) {\r\n const messageText = checkMessageText(\r\n error as Error,\r\n MESSAGES.WEB_PASSWORD.CREATE_ERROR,\r\n MESSAGES.WEB_PASSWORD.CREATE_ERROR_AUTH\r\n );\r\n message(messageText, MessageVariants.Error);\r\n }\r\n };\r\n\r\n const clearAddModalValues = (): void => {\r\n setAddWebPasswordUserType(\"\");\r\n setAddWebPasswordPassword(\"\");\r\n };\r\n\r\n const handleSpecificInsertion = useCallback(\r\n (newWebPassword: WebPassword): void => {\r\n const newWebPasswords: WebPassword[] = [...webPasswords];\r\n newWebPasswords.unshift(newWebPassword);\r\n newWebPasswords.sort((a: WebPassword, b: WebPassword) =>\r\n a.userType.localeCompare(b.userType)\r\n );\r\n if (isMounted()) setWebPasswords(newWebPasswords);\r\n },\r\n [webPasswords, isMounted]\r\n );\r\n\r\n const handleSpecificDelete = useCallback(\r\n (id: string): void => {\r\n const newWebPasswords = webPasswords.filter(\r\n (webPassword: WebPassword) => webPassword.id !== id\r\n );\r\n if (isMounted()) setWebPasswords(newWebPasswords);\r\n },\r\n [webPasswords, isMounted]\r\n );\r\n\r\n const handleSpecificUpdate = useCallback(\r\n (id: string, webPasswordData: WebPasswordUpdateData): void => {\r\n const newWebPasswords: WebPassword[] = [...webPasswords];\r\n const index: number = webPasswords.findIndex(\r\n (webPassword: WebPassword) => webPassword.id === id\r\n );\r\n newWebPasswords[index] = { ...newWebPasswords[index], ...webPasswordData };\r\n newWebPasswords.sort((a: WebPassword, b: WebPassword) =>\r\n a.userType.localeCompare(b.userType)\r\n );\r\n if (isMounted()) setWebPasswords(newWebPasswords);\r\n },\r\n [webPasswords, isMounted]\r\n );\r\n\r\n const Loading = (): React.ReactNode => ;\r\n\r\n const CardList = (): React.ReactNode => (\r\n \r\n );\r\n\r\n return (\r\n
\r\n \r\n \r\n {loading ? Loading() : CardList()}\r\n \r\n \r\n \r\n \r\n
\r\n );\r\n};\r\n\r\nexport default WebPasswords;\r\n","/**\r\n * This file exports the constants that are used throughout the application.\r\n */\r\nimport { FontAwesomeIcon } from \"@fortawesome/react-fontawesome\";\r\nimport { faVrCardboard, faFireAlt, faLock } from \"@fortawesome/free-solid-svg-icons\";\r\nimport Simulations from \"./containers/Simulations\";\r\nimport Devices from \"./containers/Devices\";\r\nimport WebPasswords from \"./containers/WebPasswords\";\r\n\r\nimport { version } from \"./../package.json\";\r\nimport { RouteData } from \"./utilities/types\";\r\n\r\nconst ROUTES_DATA: RouteData[] = [\r\n {\r\n name: \"Simulations\",\r\n linkPath: \"/simulations\",\r\n routePaths: [\"/\", \"/simulations\"],\r\n component: Simulations,\r\n icon: ,\r\n } as RouteData,\r\n {\r\n name: \"Devices\",\r\n linkPath: \"/devices\",\r\n routePaths: [\"/devices\"],\r\n component: Devices,\r\n icon: ,\r\n } as RouteData,\r\n {\r\n name: \"Web Passwords\",\r\n linkPath: \"/web-passwords\",\r\n routePaths: [\"/web-passwords\"],\r\n component: WebPasswords,\r\n icon: ,\r\n } as RouteData,\r\n];\r\n\r\nconst VERSION_TEXT = `Version ${version}`;\r\n\r\nconst APP_NAME = \"Calgary Fire VR\";\r\n\r\nconst SIMULATIONS_PER_PAGE = 6;\r\n\r\nconst DEVICES_PER_PAGE = 8;\r\n\r\nconst WEB_PASSWORDS_PER_PAGE = 16;\r\n\r\nconst WEB_SERVICE_URL = process.env.REACT_APP_WEB_SERVICE_URL || `${window.location.origin}/api`;\r\n\r\nconst INITIAL_SECTION = {\r\n ACTIVE_SIMULATIONS: \"Display the active simulations\",\r\n DELETED_SIMULATIONS: \"Display the deleted simulations\",\r\n};\r\n\r\nconst MESSAGES = {\r\n SIMULATION: {\r\n CREATE_SUCCESS: \"Simulation created successfully!\",\r\n CREATE_ERROR: \"Unable to create the simulation!\",\r\n CREATE_ERROR_AUTH: \"Only administrators can create a simulation!\",\r\n UPDATE_SUCCESS: \"Simulation updated successfully!\",\r\n UPDATE_ERROR: \"Unable to update the simulation!\",\r\n UPDATE_ERROR_AUTH: \"Only administrators can update a simulation!\",\r\n DELETE_SUCCESS: \"Simulation deleted successfully!\",\r\n DELETE_ERROR: \"Unable to delete the simulation!\",\r\n DELETE_ERROR_AUTH: \"Only administrators can delete a simulation!\",\r\n RESTORE_SUCCESS: \"Simulation restored successfully!\",\r\n RESTORE_ERROR: \"Unable to restore the simulation!\",\r\n RESTORE_ERROR_AUTH: \"Only administrators can restore a simulation!\",\r\n DOWNLOAD_DATA_SUCCESS: \"Simulation's survey data downloaded successfully!\",\r\n DOWNLOAD_DATA_ERROR: \"Unable to download the simulation's survey data!\",\r\n DOWNLOAD_DATA_ERROR_AUTH: \"Only administrators can download the simulation's survey data!\",\r\n FETCH_ERROR: \"Unable to get the simulations!\",\r\n FETCH_ERROR_AUTH: \"Only administrators can see the simulations!\",\r\n FETCH_DELETED_ERROR: \"Unable to get the deleted simulations!\",\r\n FETCH_DELETED_ERROR_AUTH: \"Only administrators can see the deleted simulations!\",\r\n IMAGE_UPLOAD_SUCCESS: \"Simulation image uploaded successfully!\",\r\n IMAGE_UPLOAD_ERROR: \"Unable to upload an image for the simulation!\",\r\n IMAGE_UPLOAD_ERROR_AUTH: \"Only administrators can upload an image for the simulation!\",\r\n VR_UPLOAD_SUCCESS: \"Simulation VR file uploaded successfully!\",\r\n VR_UPLOAD_ERROR: \"Unable to upload the simulation's VR file!\",\r\n VR_UPLOAD_ERROR_AUTH: \"Only administrators can upload the simulation's VR file!\",\r\n WEB_UPLOAD_SUCCESS: \"Simulation Web file uploaded successfully!\",\r\n WEB_UPLOAD_ERROR: \"Unable to upload the simulation's Web file!\",\r\n WEB_UPLOAD_ERROR_AUTH: \"Only administrators can upload the simulation's Web file!\",\r\n },\r\n DEVICE: {\r\n SIMULATION_FETCH_ERROR: \"Unable to get the other simulations!\",\r\n SIMULATION_FETCH_ERROR_AUTH: \"Only administrators can have the other simulations displayed!\",\r\n ADD_TO_LIBRARY_SUCCESS: \"Simulation successfully added to this device's library!\",\r\n ADD_TO_LIBRARY_ERROR: \"Unable to add the simulation to this device's library!\",\r\n ADD_TO_LIBRARY_ERROR_AUTH: \"Only administrators can add a simulation to a device's library!\",\r\n REMOVE_FROM_LIBRARY_SUCCESS: \"Simulation successfully removed from this device's library!\",\r\n REMOVE_FROM_LIBRARY_ERROR: \"Unable to remove the simulation from this device's library!\",\r\n REMOVE_FROM_LIBRARY_ERROR_AUTH:\r\n \"Only administrators can remove a simulation from a device's library!\",\r\n DELETE_SUCCESS: \"Device deleted successfully!\",\r\n DELETE_ERROR: \"Unable to delete the device!\",\r\n DELETE_ERROR_AUTH: \"Only administrators can delete a device!\",\r\n FETCH_ERROR: \"Unable to get the devices!\",\r\n FETCH_ERROR_AUTH: \"Only administrators can see the devices!\",\r\n },\r\n WEB_PASSWORD: {\r\n CREATE_SUCCESS: \"Web password created successfully!\",\r\n CREATE_ERROR: \"Unable to create the web password!\",\r\n CREATE_ERROR_AUTH: \"Only administrators can create a web password!\",\r\n UPDATE_SUCCESS: \"Web password updated successfully!\",\r\n UPDATE_ERROR: \"Unable to update the web password!\",\r\n UPDATE_ERROR_AUTH: \"Only administrators can update a web password!\",\r\n DELETE_SUCCESS: \"Web password deleted successfully!\",\r\n DELETE_ERROR: \"Unable to delete the web password!\",\r\n DELETE_ERROR_AUTH: \"Only administrators can delete a web password!\",\r\n FETCH_ERROR: \"Unable to get the web passwords!\",\r\n FETCH_ERROR_AUTH: \"Only administrators can see the web passwords!\",\r\n COPY_TO_CLIPBOARD: \"Copied to clipboard!\",\r\n },\r\n};\r\n\r\nconst DEVICE = {\r\n PAGE_TITLE: \"Devices\",\r\n MODAL: {\r\n DELETE: {\r\n TITLE: \"Delete Device\",\r\n CANCEL: \"Cancel\",\r\n CONFIRM: \"Delete\",\r\n CONTENT: \"Are you really sure you want to delete this device?\",\r\n },\r\n SIMULATION_LINK: {\r\n CONFIRM: \"OK\",\r\n LEFT_HEADER: \"Device Library\",\r\n LEFT_HEADER_TOOLTIP:\r\n \"Modifications made to the device library will not be applied on the physical device until you run the launcher with internet connection.\",\r\n LEFT_EMPTY_LIST_PLACEHOLDER: \"No simulations found on the device library\",\r\n RIGHT_HEADER: \"Other Simulations\",\r\n RIGHT_HEADER_TOOLTIP:\r\n \"These are simulations applicable to this device, but are currently not part of the device library.\",\r\n RIGHT_EMPTY_LIST_PLACEHOLDER: \"No other simulations found\",\r\n },\r\n NOTIFICATION: {\r\n TITLE: \"Reminder\",\r\n CONFIRM: \"OK\",\r\n CONTENT:\r\n \"Modifications made to the device library will not be applied on the physical device until you run the launcher with internet connection.\",\r\n },\r\n },\r\n CARD: {\r\n OPTIONS: {\r\n MANAGE: \"Manage\",\r\n DELETE: \"Delete\",\r\n },\r\n },\r\n EMPTY_LIST_PLACEHOLDER: \"No devices found\",\r\n};\r\n\r\nconst SIMULATION = {\r\n PAGE_TITLE: \"Simulations\",\r\n MODAL: {\r\n ADD: {\r\n TITLE: \"Add Simulation\",\r\n CANCEL: \"Cancel\",\r\n CONFIRM: \"Add\",\r\n NAME_LABEL: \"Name\",\r\n PACKAGE_NAME_LABEL: \"Package Name\",\r\n DESCRIPTION_LABEL: \"Description\",\r\n },\r\n EDIT: {\r\n TITLE: \"Edit Simulation\",\r\n CANCEL: \"Cancel\",\r\n CONFIRM: \"Save\",\r\n NAME_LABEL: \"Name\",\r\n PACKAGE_NAME_LABEL: \"Package Name\",\r\n DESCRIPTION_LABEL: \"Description\",\r\n },\r\n DELETE: {\r\n TITLE: \"Delete Simulation\",\r\n CANCEL: \"Cancel\",\r\n CONFIRM: \"Delete\",\r\n CONTENT: \"Are you really sure you want to delete this simulation?\",\r\n },\r\n DOWNLOAD: {\r\n TITLE: \"SimulationName\",\r\n CANCEL: \"Cancel\",\r\n CONFIRM: \"Download\",\r\n NAME_LABEL: \"Name\",\r\n DESCRIPTION_LABEL: \"Description\",\r\n },\r\n },\r\n CARD: {\r\n IMAGE_UPLOAD_HELPER:\r\n \"It is recommended to upload an image with exactly square dimensions (ex. 256x256, 512x512 pixels). Images in .jpg format is also recommended.\",\r\n OPTIONS: {\r\n VR: \"Upload VR\",\r\n WEB: \"Upload Web\",\r\n IMAGE: \"Upload Image\",\r\n EDIT: \"Edit\",\r\n DELETE: \"Delete\",\r\n DOWNLOAD: \"Download Data\",\r\n RESTORE: \"Restore\",\r\n },\r\n HEADER: {\r\n TITLE: {\r\n VR_CHIP: {\r\n UPLOADED: \"VR simulation has been uploaded\",\r\n NOT_UPLOADED: \"VR simulation has not been uploaded\",\r\n },\r\n WEB_CHIP: {\r\n UPLOADED: \"Web simulation has been uploaded\",\r\n NOT_UPLOADED: \"Web simulation has not been uploaded\",\r\n },\r\n },\r\n ACTION_BUTTON: {\r\n ADD: \"Add this simulation to the device\",\r\n REMOVE: \"Remove this simulation from the device\",\r\n },\r\n },\r\n },\r\n EMPTY_LIST_PLACEHOLDER: \"No simulations found\",\r\n FILE_UPLOADING: \"File uploading...\",\r\n FILE_EXTRACTING: \"File extracting...\",\r\n};\r\n\r\nconst WEB_PASSWORD = {\r\n PAGE_TITLE: \"Web Passwords\",\r\n MODAL: {\r\n ADD: {\r\n TITLE: \"Add Web Password\",\r\n CANCEL: \"Cancel\",\r\n CONFIRM: \"Add\",\r\n USER_TYPE_LABEL: \"User Type\",\r\n PASSWORD_LABEL: \"Password\",\r\n },\r\n EDIT: {\r\n TITLE: \"Edit Web Password\",\r\n CANCEL: \"Cancel\",\r\n CONFIRM: \"Save\",\r\n USER_TYPE_LABEL: \"User Type\",\r\n PASSWORD_LABEL: \"Password\",\r\n },\r\n DELETE: {\r\n TITLE: \"Delete Web Password\",\r\n CANCEL: \"Cancel\",\r\n CONFIRM: \"Delete\",\r\n CONTENT: \"Are you really sure you want to delete this web password?\",\r\n },\r\n },\r\n CARD: {\r\n OPTIONS: {\r\n EDIT: \"Edit\",\r\n DELETE: \"Delete\",\r\n },\r\n },\r\n EMPTY_LIST_PLACEHOLDER: \"No web passwords found\",\r\n};\r\n\r\nexport {\r\n ROUTES_DATA,\r\n VERSION_TEXT,\r\n APP_NAME,\r\n SIMULATIONS_PER_PAGE,\r\n DEVICES_PER_PAGE,\r\n WEB_PASSWORDS_PER_PAGE,\r\n WEB_SERVICE_URL,\r\n MESSAGES,\r\n DEVICE,\r\n SIMULATION,\r\n WEB_PASSWORD,\r\n INITIAL_SECTION,\r\n};\r\n","import axios, { AxiosResponse } from \"axios\";\r\n\r\nimport { WEB_SERVICE_URL } from \"../../constants\";\r\nimport { AuthParams } from \"../../utilities/types\";\r\nimport { isResponseValid } from \"../../utilities/gatewayHelper\";\r\n\r\nconst getAuthParams = async (): Promise =>\r\n axios\r\n .get(`${WEB_SERVICE_URL}/auth`)\r\n .then((response: AxiosResponse) => {\r\n const responseParams = isResponseValid(response) as AuthParams;\r\n return responseParams;\r\n })\r\n .catch((error: Error) => {\r\n throw error;\r\n });\r\n\r\nexport default getAuthParams;\r\n","import React, { useEffect, useState } from \"react\";\r\nimport { MsalProvider } from \"@azure/msal-react\";\r\nimport { Configuration, PublicClientApplication } from \"@azure/msal-browser\";\r\n\r\nimport createInstance from \"../auth/instance\";\r\n\r\nimport { AuthParams } from \"../utilities/types\";\r\nimport getAuthParams from \"../gateway/Auth\";\r\n\r\ntype Props = {\r\n children: React.ReactNode;\r\n};\r\n\r\nconst AuthProvider: React.FunctionComponent = ({ children }) => {\r\n const [instance, setInstance] = useState(undefined);\r\n\r\n /**\r\n * Should set the instance when it is undefined.\r\n */\r\n useEffect(() => {\r\n if (instance) return;\r\n\r\n const fetchAuthParams = async (): Promise => {\r\n try {\r\n const authParams: AuthParams = await getAuthParams();\r\n const config: Configuration = {\r\n auth: {\r\n clientId: authParams.clientId,\r\n authority: `https://login.microsoftonline.com/${authParams.tenantId}`,\r\n redirectUri: window.location.origin,\r\n postLogoutRedirectUri: window.location.origin,\r\n },\r\n cache: {\r\n cacheLocation: \"sessionStorage\",\r\n storeAuthStateInCookie: false,\r\n },\r\n };\r\n const createdInstance: PublicClientApplication = createInstance(config);\r\n setInstance(createdInstance);\r\n } catch (error: unknown) {\r\n console.error(error);\r\n }\r\n };\r\n\r\n fetchAuthParams();\r\n }, [instance, setInstance]);\r\n\r\n return instance ? {children} : <>;\r\n};\r\n\r\nexport default AuthProvider;\r\n","export default __webpack_public_path__ + \"static/media/coc-logo.086e0d8e.svg\";","import React, { useState } from \"react\";\r\n\r\nimport Typography from \"@mui/material/Typography\";\r\nimport AppBar from \"@mui/material/AppBar\";\r\nimport Toolbar from \"@mui/material/Toolbar\";\r\nimport Button from \"@mui/material/Button\";\r\nimport Avatar from \"@mui/material/Avatar\";\r\nimport MenuItem from \"@mui/material/MenuItem\";\r\nimport Menu from \"@mui/material/Menu\";\r\n\r\nimport logo from \"../../assets/coc-logo.svg\";\r\nimport \"./styles.scss\";\r\n\r\ntype Props = {\r\n text: string;\r\n userName: string | undefined;\r\n handleLogoClick: () => void;\r\n handleLogout: () => Promise;\r\n};\r\n\r\nconst Navbar: React.FunctionComponent = ({\r\n text,\r\n userName,\r\n handleLogoClick,\r\n handleLogout,\r\n}) => {\r\n const [anchorEl, setAnchorEl] = useState(null);\r\n\r\n const handleMenu = (event: React.MouseEvent): void => {\r\n setAnchorEl(event.currentTarget);\r\n };\r\n\r\n const handleClose = (): void => {\r\n setAnchorEl(null);\r\n };\r\n\r\n const handleLogoutOnClick = (): void => {\r\n handleClose();\r\n handleLogout();\r\n };\r\n\r\n const getUserNameInitials = (fullName: string | undefined): string => {\r\n if (!fullName) return \"\";\r\n\r\n const names = fullName.split(\" \");\r\n const initials = [];\r\n const firstNameInitial = names[0].substring(0, 1).toUpperCase();\r\n initials.push(firstNameInitial);\r\n\r\n if (names.length > 1) {\r\n const lastNameInitial = names[names.length - 1].substring(0, 1).toUpperCase();\r\n initials.push(lastNameInitial);\r\n }\r\n\r\n return initials.join(\"\");\r\n };\r\n\r\n return (\r\n \r\n \r\n \"City\r\n \r\n {text}\r\n \r\n
\r\n \r\n {getUserNameInitials(userName)}\r\n {userName}\r\n \r\n \r\n Log off\r\n \r\n
\r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default Navbar;\r\n","import React from \"react\";\r\nimport { Link } from \"react-router-dom\";\r\n\r\nimport ListItemButton from \"@mui/material/ListItemButton\";\r\nimport ListItemIcon from \"@mui/material/ListItemIcon\";\r\nimport ListItemText from \"@mui/material/ListItemText\";\r\n\r\nimport \"./styles.scss\";\r\n\r\ntype Props = {\r\n to: string;\r\n text: string;\r\n selected: boolean;\r\n icon: React.ReactNode | string;\r\n};\r\n\r\nconst CustomListItem: React.FunctionComponent = ({ to, text, selected, icon }) => (\r\n \r\n {icon}\r\n \r\n \r\n);\r\n\r\nexport default CustomListItem;\r\n","export default __webpack_public_path__ + \"static/media/maltese-cross.f5157e06.jpg\";","export default __webpack_public_path__ + \"static/media/red-iron-logo.a904e100.jpg\";","export default __webpack_public_path__ + \"static/media/vizworx-horizontal-no-icon.317a3844.png\";","export default __webpack_public_path__ + \"static/media/cop-logo.c1b73723.jpg\";","import React from \"react\";\r\n\r\nimport cfdLogo from \"../../assets/maltese-cross.jpg\";\r\nimport redIronLogo from \"../../assets/red-iron-logo.jpg\";\r\nimport vizworxLogo from \"../../assets/vizworx-horizontal-no-icon.png\";\r\nimport copLogo from \"../../assets/cop-logo.jpg\";\r\nimport \"./styles.scss\";\r\n\r\nconst SideMenuBottomLogos: React.FunctionComponent = () => (\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n
\r\n \r\n
\r\n
\r\n \r\n
\r\n
\r\n
\r\n);\r\n\r\nexport default SideMenuBottomLogos;\r\n","import React from \"react\";\r\n\r\nimport { VERSION_TEXT } from \"./../../constants\";\r\n\r\nimport \"./styles.scss\";\r\n\r\nconst SideMenuBottomVersion: React.FunctionComponent = () => (\r\n
\r\n
{VERSION_TEXT}
\r\n
\r\n);\r\n\r\nexport default SideMenuBottomVersion;\r\n","import React from \"react\";\r\nimport { useLocation } from \"react-router-dom\";\r\n\r\nimport Drawer from \"@mui/material/Drawer\";\r\nimport List from \"@mui/material/List\";\r\nimport ListItem from \"@mui/material/ListItem\";\r\nimport CustomListItem from \"../CustomListItem\";\r\nimport SideMenuBottomLogos from \"../SideMenuBottomLogos\";\r\nimport SideMenuBottomVersion from \"../SideMenuBottomVersion\";\r\n\r\nimport { RouteData } from \"./../../utilities/types\";\r\n\r\nimport \"./styles.scss\";\r\n\r\ntype Props = {\r\n items: RouteData[];\r\n};\r\n\r\nconst SideMenu: React.FunctionComponent = ({ items }) => {\r\n const location = useLocation();\r\n\r\n return (\r\n \r\n
\r\n \r\n {items.map((item: RouteData) => (\r\n \r\n ))}\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
\r\n
\r\n );\r\n};\r\n\r\nexport default SideMenu;\r\n","import React from \"react\";\r\nimport { Switch, Route } from \"react-router-dom\";\r\n\r\nimport Navbar from \"../../components/Navbar\";\r\nimport SideMenu from \"../../components/SideMenu\";\r\n\r\nimport { RouteData } from \"./../../utilities/types\";\r\nimport { ROUTES_DATA, APP_NAME } from \"./../../constants\";\r\n\r\nimport \"./styles.scss\";\r\n\r\ntype Props = {\r\n userName: string | undefined;\r\n handleLogoClick: () => void;\r\n handleLogout: () => Promise;\r\n};\r\n\r\nconst App: React.FunctionComponent = ({ userName, handleLogoClick, handleLogout }) => (\r\n
\r\n \r\n \r\n
\r\n \r\n {ROUTES_DATA.map((data: RouteData) => (\r\n \r\n ))}\r\n \r\n
\r\n
\r\n);\r\n\r\nexport default App;\r\n","import React from \"react\";\r\nimport { useMsal, useAccount } from \"@azure/msal-react\";\r\nimport { RedirectRequest, SilentRequest } from \"@azure/msal-browser\";\r\nimport axios, { AxiosRequestConfig } from \"axios\";\r\n\r\ntype Props = {\r\n children: React.ReactNode;\r\n};\r\n\r\nconst RequestInterceptor: React.FunctionComponent = ({ children }) => {\r\n const { instance, accounts } = useMsal();\r\n\r\n /**\r\n * Getting the logged account value, to use on the onRequest method.\r\n * useAccount returns the AccountInfo object for that account if it is signed in or null if it is not.\r\n */\r\n const account = useAccount(accounts[0]);\r\n\r\n /**\r\n * onRequest method added as an interceptor on the axios request, executing everytime a request is sent.\r\n */\r\n const onRequest = async (config: AxiosRequestConfig): Promise => {\r\n if (!account) throw Error(\"No active account!\");\r\n\r\n const scopes: string[] = [`${instance.getConfiguration().auth.clientId}/.default`];\r\n const redirectRequest: RedirectRequest = { scopes };\r\n const silentRequest: SilentRequest = { ...redirectRequest, account };\r\n const response = await instance.acquireTokenSilent(silentRequest);\r\n\r\n const bearer = `Bearer ${response.accessToken}`;\r\n // @ts-ignore\r\n config.headers.Authorization = bearer;\r\n\r\n return config;\r\n };\r\n\r\n /**\r\n * Here we set the function intercept the requests.\r\n */\r\n axios.interceptors.request.use(onRequest);\r\n\r\n return <>{children};\r\n};\r\n\r\nexport default RequestInterceptor;\r\n","import React, { useEffect, useState } from \"react\";\r\nimport { useHistory } from \"react-router-dom\";\r\nimport { AuthenticatedTemplate, useMsalAuthentication, useMsal } from \"@azure/msal-react\";\r\nimport { InteractionType, EndSessionRequest } from \"@azure/msal-browser\";\r\n\r\nimport App from \"../App\";\r\nimport RequestInterceptor from \"../../components/RequestInterceptor\";\r\n\r\nconst AppAuthWrapper: React.FunctionComponent = () => {\r\n /**\r\n * Hooks methods/values declaration.\r\n */\r\n const history = useHistory();\r\n const { instance, accounts } = useMsal();\r\n const [userName, setUserName] = useState(undefined);\r\n\r\n /**\r\n * Displays the login page in case the user is not logged in.\r\n */\r\n useMsalAuthentication(InteractionType.Redirect);\r\n\r\n /**\r\n * Setting the userName state variable, to be used on the App component.\r\n */\r\n useEffect(() => {\r\n if (accounts.length === 0) return;\r\n const name: string | undefined = instance.getActiveAccount()?.name;\r\n setUserName(name);\r\n }, [instance, accounts]);\r\n\r\n const handleLogoClick = (): void => history.push(\"/\");\r\n\r\n const handleLogout = async (): Promise => {\r\n try {\r\n const logoutRequest: EndSessionRequest = { account: instance.getActiveAccount() };\r\n await instance.logoutRedirect(logoutRequest);\r\n } catch (err) {\r\n console.error(err);\r\n }\r\n };\r\n\r\n /**\r\n * The content inside AuthenticatedTemplate will only be displayed once the user is authenticated.\r\n */\r\n return (\r\n \r\n \r\n \r\n \r\n \r\n );\r\n};\r\n\r\nexport default AppAuthWrapper;\r\n","import React from \"react\";\r\nimport { BrowserRouter as Router } from \"react-router-dom\";\r\nimport { ThemeProvider, createTheme } from \"@mui/material/styles\";\r\nimport { SnackbarProvider } from \"notistack\";\r\n\r\nimport AuthProvider from \"./auth/AuthProvider\";\r\nimport AppAuthWrapper from \"./containers/AppAuthWrapper\";\r\n\r\nconst theme = createTheme({\r\n typography: {\r\n fontFamily: [\"Open Sans\", \"Helvetica\", \"Arial\", \"Verdana\", \"sans-serif\"].join(\",\"),\r\n },\r\n breakpoints: {\r\n values: {\r\n xs: 0,\r\n sm: 600,\r\n md: 1200,\r\n lg: 1600,\r\n xl: 1750,\r\n },\r\n },\r\n});\r\n\r\nconst Application: React.FunctionComponent = () => (\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n);\r\n\r\nexport default Application;\r\n","import React from \"react\";\r\nimport ReactDOM from \"react-dom\";\r\nimport App from \"./App\";\r\n\r\nimport \"./styles.scss\";\r\n\r\nReactDOM.render(\r\n \r\n \r\n ,\r\n document.getElementById(\"root\")\r\n);\r\n"],"sourceRoot":""}