{"version":3,"sources":["utils/user/permissions.js","components/wrappers/withConfig.js","utils/constants/userSettings.js","components/wrappers/UserContext.js","utils/constants/urls.js","components/elem/ToolkitVersion.js","components/features/user/Login.js","components/elem/GridFilters.js","components/features/psap-list/UserPSAPTable.js","components/features/psap-list/AllPSAPTable.js","components/elem/Toast.js","components/wrappers/APIRequestContext.js","components/wrappers/PSAPContext.js","components/elem/Spinner.js","components/features/psap-list/PSAPListPage.js","components/features/detail-page/DownloadButton.js","components/features/detail-page/UploadActionButton.js","components/elem/Modal.js","components/features/detail-page/UploadTable.js","components/wrappers/useModal.js","components/wrappers/PSAPDetailContext.js","components/features/detail-page/UploadForm.js","components/features/detail-page/UploadButton.js","components/features/detail-page/ClearButton.js","components/features/detail-page/DetailPage.js","components/features/user/RestrictedAccess.js","components/elem/NavBar.js","components/features/user/CallbackComponent.js","components/elem/Header.js","App.js","index.js"],"names":["getRoles","user","profile","role","roles","Array","isArray","filter","x","startsWith","map","replace","join","checkRole","toLowerCase","includes","hasApplicationAccess","some","isSysAdmin","withConfig","WrappedComponent","props","state","config","window","$config","this","React","Component","settings","authority","process","client_id","client_secret","redirect_uri","silent_redirect_uri","REACT_APP_OIDC_CLIENT_SILENT_REDIRECT_URI","response_type","scope","post_logout_redirect_uri","automaticSilentRenew","UserContext","createContext","AppUserContextProvider","loadingUser","children","client","useAuth","userManager","useState","setRoles","setUser","useEffect","getUser","a","u","console","log","Provider","value","UserContextProvider","UserManager","autoSignIn","urls","home","login","userCallback","newRegistration","changePassword","manageUsers","psapDetail","version","setVersion","API_URL","fetch","then","response","text","data","catch","error","Login","useContext","to","pathname","className","onClick","signinRedirect","target","rel","href","IncludesFilter","column","filterValue","preFilteredRows","setFilter","count","length","onChange","e","undefined","placeholder","fuzzyTextFilterFn","rows","id","matchSorter","keys","row","values","autoRemove","val","filterTypes","fuzzyText","rowValue","String","PSAPTable","psaps","visibleSearch","setVisibleSearch","DetailCell","MergeCell","ValidationCell","defaultColumn","useMemo","Filter","columns","Header","accessor","Cell","cell","original","Id","disableFilters","tableData","forEach","psap","Uploads","lastUploadDate","reduce","b","UploadDate","successfullUploads","upload","MergeStatus","ValidationStatus","ArchiveStatus","lastSuccesfulUpload","push","slice","lastMerge","lastValidation","lastSuccessfull","calcTableDate","useTable","initialState","pageIndex","pageSize","useFilters","useSortBy","usePagination","getTableProps","getTableBodyProps","headerGroups","prepareRow","page","canPreviousPage","canNextPage","pageOptions","pageCount","gotoPage","nextPage","previousPage","headerGroup","getHeaderGroupProps","headers","getHeaderProps","getSortByToggleProps","isSorted","isSortedDesc","render","canFilter","handleSearch","style","indexOf","display","i","getRowProps","cells","getCellProps","justifyContent","alignItems","disabled","DateCell","Toast","DISPLAY_TOASTS","ToastLogic","level","message","toastConfig","toast","success","info","APIRequestContext","APIRequestContextProvider","authenticatedFetch","useCallback","endpoint","options","fetchOptions","Authorization","access_token","method","PSAPContext","PSAPContextProvider","loading","setLoading","PSAPs","setPSAPs","PSAPUpdates","setPSAPUpdates","newObject","setNewObject","ok","json","Error","finally","SimpleSpinner","extraClass","size","PureComponent","PSAPListPage","paddingTop","type","name","setShowModal","uploadId","blob","saveAs","textTransform","action","Modal","toggle","header","footer","body","aria-label","UploadTable","uploads","readOnly","showModal","alertMessage","setAlertMessage","alertHeader","setAlertHeader","showMessage","ActionCell","noFinal","DownloadButton","FileNameDisplay","MergeDate","item","Object","key","sortBy","desc","isShowing","useModal","setIsShowing","PSAPDetailContext","PSAPDetailContextProvider","PSAPId","useParams","PSAP","find","Number","handleUpload","uploading","uploadingFile","useForm","register","handleSubmit","errors","fileName","setFileName","setResponse","uploadFile","file","formData","FormData","append","File","FileName","mode","POST","lastIndexOf","onSubmit","event","files","accept","ref","required","UploadButton","setUploading","Name","form","status","DetailPage","ReadOnly","RestrictedAccessPage","signoutRedirect","RestrictedAccess","allowedRoles","hasAccess","setHasAccess","hasAccessButNoRoles","setHasAccessButNoRoles","checkClientAccess","active","setActive","admin","isAdmin","sysadmin","data-target","aria-expanded","CallbackComponent","t","setTimeout","location","clearTimeout","Spinner","APP_TITLE","App","Fragment","exact","path","component","ReactDOM","StrictMode","document","getElementById"],"mappings":"8NAEMA,EAAW,SAAAC,GACb,GAAIA,GAAQA,EAAKC,SAAWD,EAAKC,QAAQC,KAAM,CAC3C,IAAMC,EAAQH,EAAKC,QAAQC,KAC3B,OAAIE,MAAMC,QAAQF,GACKA,EACEG,QAAO,SAAAC,GAAC,OAAIA,EAAEC,WAAW,WAAmB,gBAAND,KACtCE,KAAI,SAAAF,GAAC,OAAIA,EAAEG,QAAQ,SAAU,OAChCC,KAAK,KAEhBR,EAGX,MAAO,IAITS,EAAY,SAACV,EAAMC,GACrB,SAAIA,IAASD,IACFC,EAAMU,cAAcC,SAASZ,EAAKW,gBAM3CE,EAAuB,SAAAf,GACzB,GAAIA,GAAQA,EAAKC,SAAWD,EAAKC,QAAQC,KAAM,CAC3C,IAAMC,EAAQH,EAAKC,QAAQC,KAC3B,QAAIE,MAAMC,QAAQF,IACIA,EAAMa,MAAK,SAAAT,GAAC,OAAIA,EAAEO,SAAS,UAAYP,EAAEO,SAAS,cAMxE,OAAO,GAMTG,EAAa,SAAAd,GAAK,OAAIS,EAAU,cAAeT,I,uCCxBtCe,EAhBI,SAAAC,GACf,yDACI,WAAYC,GAAQ,IAAD,8BACf,cAAMA,IACDC,MAAQ,CACTC,OAAQC,OAAOC,SAHJ,EADvB,qDAQQ,OACI,cAACL,EAAD,aAAkBG,OAAQG,KAAKJ,MAAMC,QAAYG,KAAKL,YATlE,GAAqBM,IAAMC,YCUhBC,EAbA,CACXC,UAAWC,+BACXC,UAAWD,QACXE,cAAeF,uBACfG,aAAcH,4CACdI,oBAAqBJ,0nCAAYK,0CACjCC,cAAeN,OACfO,MAAOP,wCACPQ,yBAA0BR,+BAC1BS,sBAAsB,GCFpBC,EAAcC,wBAAc,MAE5BC,EAAyBxB,GAAW,YAAgC,IAA7ByB,EAA4B,EAA5BA,YAAaC,EAAe,EAAfA,SACjCC,EAAW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IuP,aAAc,CACV,QACA,OACA,SAJR,SAOI,cAAC,EAAD,WAIZ,cAAC,IAAD,CAAOuB,KAAM/Q,EAAKE,MAAO4Q,OAAK,EAACE,UAAW9P,IAC1C,cAAC,IAAD,CACI6P,KAAM/Q,EAAKG,aACX2Q,OAAK,EACLE,UAAWX,gBAOnC,cAACnI,EAAD,QC5DR+I,IAAS7J,OACP,cAAC,IAAM8J,WAAP,UACE,cAAC,GAAD,MAEFC,SAASC,eAAe,W","file":"static/js/main.49cb456d.chunk.js","sourcesContent":["// const submitterRegex = new RegExp('Submitter_([A-Za-z]+)')\r\n\r\nconst getRoles = user => {\r\n if (user && user.profile && user.profile.role) {\r\n const roles = user.profile.role\r\n if (Array.isArray(roles)) {\r\n const ng911roles = roles\r\n .filter(x => x.startsWith(\"NG911_\") || x === \"SystemAdmin\")\r\n .map(x => x.replace(\"NG911_\", \"\"))\r\n return ng911roles.join(',')\r\n } else {\r\n return roles\r\n }\r\n } else {\r\n return ''\r\n }\r\n}\r\n\r\nconst checkRole = (role, roles) => {\r\n if (roles && role) {\r\n return roles.toLowerCase().includes(role.toLowerCase())\r\n } else {\r\n return false\r\n }\r\n}\r\n\r\nconst hasApplicationAccess = user => {\r\n if (user && user.profile && user.profile.role) {\r\n const roles = user.profile.role\r\n if (Array.isArray(roles)) {\r\n const hasAccess = roles.some(x => x.includes('NG911') && x.includes('Allowed'))\r\n return hasAccess\r\n } else {\r\n return false\r\n }\r\n } else {\r\n return false\r\n }\r\n}\r\n\r\nconst isAdmin = roles => checkRole('Admin', roles)\r\n\r\nconst isSysAdmin = roles => checkRole('SystemAdmin', roles)\r\n\r\nexport {\r\n getRoles,\r\n checkRole,\r\n isAdmin,\r\n isSysAdmin,\r\n hasApplicationAccess\r\n}\r\n","import React from 'react'\r\n\r\nconst withConfig = WrappedComponent => {\r\n return class extends React.Component {\r\n constructor(props) {\r\n super(props)\r\n this.state = {\r\n config: window.$config,\r\n }\r\n }\r\n render() {\r\n return (\r\n \r\n )\r\n }\r\n }\r\n}\r\n\r\nexport default withConfig\r\n","let settings = {\r\n authority: process.env.REACT_APP_OIDC_AUTHORITY,\r\n client_id: process.env.REACT_APP_OIDC_CLIENT_ID,\r\n client_secret: process.env.REACT_APP_OIDC_CLIENT_SECRET,\r\n redirect_uri: process.env.REACT_APP_OIDC_CLIENT_REDIRECT_URI,\r\n silent_redirect_uri: process.env.REACT_APP_OIDC_CLIENT_SILENT_REDIRECT_URI,\r\n response_type: process.env.REACT_APP_OIDC_RESPONSE_TYPE,\r\n scope: process.env.REACT_APP_OIDC_SCOPE,\r\n post_logout_redirect_uri: process.env.REACT_APP_OIDC_POST_LOGOUT_REDIRECT_URI,\r\n automaticSilentRenew: true\r\n // loadUserInfo: true\r\n}\r\n\r\nexport default settings","import React, { useEffect, createContext, useState } from 'react'\r\nimport { AuthProvider, useAuth, UserManager } from 'oidc-react'\r\n\r\nimport { getRoles } from '../../utils/user/permissions'\r\nimport withConfig from '../wrappers/withConfig'\r\nimport settings from '../../utils/constants/userSettings'\r\n\r\nconst UserContext = createContext(null)\r\n\r\nconst AppUserContextProvider = withConfig(({ loadingUser, children }) => {\r\n const { userManager: client } = useAuth()\r\n const [roles, setRoles] = useState(\"\")\r\n const [ user, setUser ] = useState(null)\r\n \r\n // when the user changes, update roles list\r\n useEffect(() => {\r\n setRoles(getRoles(user))\r\n }, [user])\r\n\r\n useEffect(() => {\r\n const getUser = async () => {\r\n try {\r\n const u = await client.getUser()\r\n setUser(u)\r\n } catch (e) {\r\n console.log('UserContext: Error getting user -- ', e)\r\n }\r\n }\r\n if (client) {\r\n getUser()\r\n }\r\n }, [client])\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n})\r\n\r\nconst UserContextProvider = ({ children }) => {\r\n const userManager = new UserManager(settings)\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n}\r\n\r\nexport { UserContext }\r\nexport default UserContextProvider\r\n","const urls = {\r\n home: '/',\r\n login: '/login',\r\n userCallback: '/user/callback',\r\n newRegistration: `${process.env.REACT_APP_OIDC_REGISTRATION_URL}`,\r\n changePassword: `${process.env.REACT_APP_OIDC_CHANGE_PASSWORD_URL}`,\r\n manageUsers: `${process.env.REACT_APP_USER_MANAGEMENT_URL}`,\r\n psapDetail: '/psap-detail/:PSAPId'\r\n}\r\n\r\nexport default urls","import React, { useState, useEffect } from 'react';\r\nimport withConfig from '../wrappers/withConfig'\r\n\r\nconst ToolkitVersion = ({ config }) => {\r\n const [version, setVersion] = useState('');\r\n const { API_URL } = config\r\n\r\n useEffect(() => {\r\n fetch(`${API_URL}/PSAP/ToolkitVersion`)\r\n .then(response => response.text())\r\n .then(data => {\r\n setVersion(data);\r\n })\r\n .catch(error => {\r\n console.error('Error fetching data:', error);\r\n });\r\n }, [API_URL]);\r\n\r\n return (\r\n
\r\n

Current Version of Toolkit: {version}

\r\n
\r\n );\r\n};\r\n\r\nexport default withConfig(ToolkitVersion);\r\n","import React, { useContext } from 'react'\r\nimport { Redirect } from 'react-router-dom'\r\nimport { UserContext } from '../../wrappers/UserContext'\r\nimport urls from '../../../utils/constants/urls'\r\nimport ToolkitVersion from '../../elem/ToolkitVersion'\r\n\r\nconst Login = () => {\r\n const { user, client } = useContext(UserContext)\r\n\r\n if (user) {\r\n return (\r\n \r\n )\r\n }\r\n\r\n return (\r\n <>\r\n

\r\n Oklahoma NG911 Data Processing\r\n

\r\n
\r\n

Welcome

\r\n
\r\n
\r\n
\r\n
\r\n
\r\n \r\n Login\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 The Oklahoma NG911 Portal is a web based content\r\n management tool developed by the Oklahoma Office of\r\n Geographic Information (OGI) on behalf of the Oklahoma\r\n 9-1-1 Management Authority (OK911MA) to support the\r\n Oklahoma NG911 Program. It provides a means for members\r\n of the OGI, OK911MA, Oklahoma PSAPs and individuals and\r\n organizations participating in Oklahoma NG911 Program to\r\n facilitate the management and processing of PSAP NG911\r\n data. This will also allow participants to stay informed\r\n of the various projects and ongoing work being performed\r\n by the PSAP’s and contractors. \r\n

\r\n

\r\n For more information on the Oklahoma 9-1-1\r\n Management Authority, please visit their website. For more information on the Oklahoma Next Generation\r\n 911 (NG911) and Address Standard along with the\r\n NG911 GIS Toolkit, please visit our website. For questions about the Oklahoma NG911 Portal,\r\n contact Shellie Willoughby.\r\n

\r\n
\r\n
\r\n \r\n )\r\n}\r\n\r\nexport default Login\r\n","import React from 'react'\r\nimport {matchSorter} from 'match-sorter'\r\n\r\n\r\nconst IncludesFilter = ({\r\n column: { filterValue, preFilteredRows, setFilter },\r\n }) => {\r\n const count = preFilteredRows.length\r\n \r\n return (\r\n {\r\n setFilter(e.target.value || undefined) // Set undefined to remove the filter entirely\r\n }}\r\n placeholder={`Search ${count} PSAPs...`}\r\n />\r\n )\r\n }\r\n\r\n const fuzzyTextFilterFn = (rows, id, filterValue) => {\r\n return matchSorter(rows, filterValue, { keys: [row => row.values[id]] })\r\n }\r\n \r\n fuzzyTextFilterFn.autoRemove = val => !val\r\n\r\n \r\n const filterTypes = \r\n () => ({\r\n fuzzyText: fuzzyTextFilterFn,\r\n \r\n text: (rows, id, filterValue) => {\r\n return rows.filter((row) => {\r\n const rowValue = row.values[id]\r\n return rowValue !== undefined\r\n ? String(rowValue)\r\n .toLowerCase()\r\n .startsWith(String(filterValue).toLowerCase())\r\n : true\r\n })\r\n },\r\n })\r\n\r\nexport { IncludesFilter, filterTypes, fuzzyTextFilterFn }","import React, { useMemo, useState } from 'react'\r\nimport { useTable, useSortBy, usePagination, useFilters } from 'react-table'\r\nimport { Link } from 'react-router-dom'\r\nimport {\r\n FaAngleDown,\r\n FaAngleUp,\r\n FaChevronCircleRight,\r\n FaChevronCircleLeft,\r\n FaAngleDoubleLeft,\r\n FaAngleDoubleRight,\r\n FaSearch,\r\n} from 'react-icons/fa'\r\nimport { IncludesFilter, filterTypes } from '../../elem/GridFilters'\r\n\r\nconst PSAPTable = ({ psaps }) => {\r\n const [visibleSearch, setVisibleSearch] = useState([])\r\n\r\n const handleSearch = (column) => {\r\n const id = column.id\r\n if (id) {\r\n visibleSearch.includes(id)\r\n ? setVisibleSearch(visibleSearch.filter((x) => x !== id))\r\n : setVisibleSearch([...visibleSearch, id])\r\n }\r\n }\r\n\r\n const calcTableDate = () => {\r\n const tableData = []\r\n psaps.forEach((psap) => {\r\n if (psap.Uploads.length) {\r\n const lastUploadDate = psap.Uploads.reduce((a, b) =>\r\n a.UploadDate > b.UploadDate ? a : b\r\n )\r\n const successfullUploads = psap.Uploads.filter(\r\n (upload) =>\r\n upload.MergeStatus === 2 &&\r\n upload.ValidationStatus === 2 &&\r\n upload.ArchiveStatus === 2\r\n )\r\n const lastSuccesfulUpload = successfullUploads.length\r\n ? successfullUploads.reduce((a, b) =>\r\n a.UploadDate > b.UploadDate ? a : b\r\n )\r\n : null\r\n tableData.push({\r\n ...psap,\r\n lastUploadDate: lastUploadDate.UploadDate.slice(0, 10),\r\n lastMerge: lastUploadDate.MergeStatus,\r\n lastValidation: lastUploadDate.ValidationStatus,\r\n lastSuccessfull: lastSuccesfulUpload\r\n ? lastSuccesfulUpload.UploadDate.slice(0, 10)\r\n : 'N/A',\r\n })\r\n } else {\r\n tableData.push({\r\n ...psap,\r\n lastUploadDate: 'N/A',\r\n lastMerge: 'N/A',\r\n lastValidation: 'N/A',\r\n lastSuccessfull: 'N/A',\r\n })\r\n }\r\n })\r\n return tableData\r\n }\r\n\r\n const DetailCell = ({ value, id }) => {\r\n return (\r\n <>\r\n \r\n {value}\r\n \r\n \r\n )\r\n }\r\n\r\n const MergeCell = ({ value }) =>\r\n value === 1\r\n ? 'Pending'\r\n : value === 2\r\n ? 'Complete'\r\n : value === 3\r\n ? 'Failed'\r\n : 'N/A'\r\n\r\n const ValidationCell = ({ value }) =>\r\n value === 1\r\n ? 'Pending'\r\n : value === 2\r\n ? 'Valid'\r\n : value === 3\r\n ? 'Invalid'\r\n : value === 4\r\n ? 'Failed'\r\n : 'N/A'\r\n\r\n const createColumns = () => [\r\n {\r\n Header: 'PSAP Name',\r\n accessor: 'Name',\r\n Cell: ({ cell, row }) => (\r\n \r\n ),\r\n },\r\n {\r\n Header: 'Last Upload Validation Status',\r\n accessor: 'lastValidation',\r\n disableFilters: true,\r\n Cell: ({ cell }) => ,\r\n },\r\n {\r\n Header: 'Last Upload Merge Status',\r\n accessor: 'lastMerge',\r\n disableFilters: true,\r\n Cell: ({ cell }) => ,\r\n },\r\n {\r\n Header: 'Last Upload Date',\r\n accessor: 'lastUploadDate',\r\n disableFilters: true,\r\n },\r\n {\r\n Header: 'Last Successful Upload Date',\r\n accessor: 'lastSuccessfull',\r\n disableFilters: true,\r\n },\r\n ]\r\n\r\n const defaultColumn = useMemo(\r\n () => ({\r\n Filter: IncludesFilter,\r\n }),\r\n []\r\n )\r\n\r\n const columns = useMemo(() => createColumns(), [])\r\n const tableData = useMemo(\r\n () => (psaps && psaps.length ? calcTableDate() : []),\r\n [psaps]\r\n )\r\n\r\n const {\r\n getTableProps,\r\n getTableBodyProps,\r\n headerGroups,\r\n prepareRow,\r\n page,\r\n canPreviousPage,\r\n canNextPage,\r\n pageOptions,\r\n pageCount,\r\n gotoPage,\r\n nextPage,\r\n previousPage,\r\n state: { pageIndex },\r\n } = useTable(\r\n {\r\n columns,\r\n data: tableData,\r\n defaultColumn,\r\n filterTypes,\r\n initialState: {\r\n pageIndex: 0,\r\n pageSize: 10,\r\n // sortBy: [\r\n // {\r\n // id: 'Name',\r\n // desc: false,\r\n // },\r\n // ],\r\n },\r\n },\r\n useFilters,\r\n useSortBy,\r\n usePagination\r\n )\r\n\r\n return (\r\n
\r\n \r\n \r\n {headerGroups.map((headerGroup) => (\r\n \r\n {headerGroup.headers.map((column) => (\r\n \r\n
\r\n \r\n {column.isSorted ? (\r\n column.isSortedDesc ? (\r\n \r\n ) : (\r\n \r\n )\r\n ) : (\r\n ''\r\n )}\r\n {column.render('Header')}\r\n \r\n {column.canFilter ? (\r\n \r\n handleSearch(column)\r\n }\r\n >\r\n \r\n \r\n ) : null}\r\n -1\r\n ? null\r\n : { display: 'none' }\r\n }\r\n >\r\n {column.canFilter\r\n ? column.render('Filter')\r\n : null}\r\n \r\n
\r\n \r\n ))}\r\n
\r\n ))}\r\n \r\n \r\n {page.map((row, i) => {\r\n prepareRow(row)\r\n return (\r\n \r\n {row.cells.map((cell) => {\r\n return (\r\n \r\n )\r\n })}\r\n \r\n )\r\n })}\r\n \r\n
\r\n {cell.render('Cell')}\r\n
\r\n \r\n gotoPage(0)}\r\n disabled={!canPreviousPage}\r\n >\r\n \r\n
{' '}\r\n previousPage()}\r\n disabled={!canPreviousPage}\r\n className={!canPreviousPage ? 'has-text-grey' : ''}\r\n style={{ display: 'flex', alignItems: 'center' }}\r\n >\r\n \r\n {' '}\r\n \r\n \r\n Page{' '}\r\n \r\n {pageIndex + 1} of {pageOptions.length}\r\n {' '}\r\n \r\n \r\n nextPage()}\r\n disabled={!canNextPage}\r\n className={!canNextPage ? 'has-text-grey' : ''}\r\n style={{ display: 'flex', alignItems: 'center' }}\r\n >\r\n \r\n {' '}\r\n gotoPage(pageCount - 1)}\r\n disabled={!canNextPage}\r\n style={{ display: 'flex', alignItems: 'center' }}\r\n >\r\n \r\n {' '}\r\n \r\n \r\n )\r\n}\r\n\r\nexport default PSAPTable\r\n","import React, { useMemo, useState } from 'react'\r\nimport { useTable, useSortBy, usePagination, useFilters } from 'react-table'\r\nimport {\r\n FaAngleDown,\r\n FaAngleUp,\r\n FaChevronCircleRight,\r\n FaChevronCircleLeft,\r\n FaAngleDoubleLeft,\r\n FaAngleDoubleRight,\r\n FaSearch,\r\n} from 'react-icons/fa'\r\nimport { IncludesFilter, filterTypes } from '../../elem/GridFilters'\r\n\r\nconst PSAPTable = ({ psaps }) => {\r\n const [visibleSearch, setVisibleSearch] = useState([])\r\n\r\n const handleSearch = (column) => {\r\n const id = column.id\r\n if (id) {\r\n visibleSearch.includes(id)\r\n ? setVisibleSearch(visibleSearch.filter((x) => x !== id))\r\n : setVisibleSearch([...visibleSearch, id])\r\n }\r\n }\r\n const DateCell = ({ value }) => value\r\n\r\n const createColumns = () => [\r\n {\r\n Header: 'PSAP Name',\r\n accessor: 'PSAPName',\r\n },\r\n {\r\n Header: 'Most Recent Update',\r\n accessor: 'MostRecentUpdate',\r\n disableFilters: true,\r\n Cell: ({ cell }) => (\r\n \r\n ),\r\n },\r\n ]\r\n\r\n const defaultColumn = useMemo(\r\n () => ({\r\n Filter: IncludesFilter,\r\n }),\r\n []\r\n )\r\n\r\n const columns = useMemo(() => createColumns(), [])\r\n const tableData = useMemo(() => psaps, [psaps])\r\n const {\r\n getTableProps,\r\n getTableBodyProps,\r\n headerGroups,\r\n prepareRow,\r\n page,\r\n canPreviousPage,\r\n canNextPage,\r\n pageOptions,\r\n pageCount,\r\n gotoPage,\r\n nextPage,\r\n previousPage,\r\n state: { pageIndex },\r\n } = useTable(\r\n {\r\n columns,\r\n data: tableData,\r\n defaultColumn,\r\n filterTypes,\r\n initialState: {\r\n pageIndex: 0,\r\n pageSize: 10,\r\n // sortBy: [\r\n // {\r\n // id: 'PSAPName',\r\n // desc: false,\r\n // },\r\n // ],\r\n },\r\n },\r\n useFilters,\r\n useSortBy,\r\n usePagination\r\n )\r\n\r\n return (\r\n
\r\n \r\n \r\n {headerGroups.map((headerGroup) => (\r\n \r\n {headerGroup.headers.map((column) => (\r\n \r\n
\r\n \r\n {column.isSorted ? (\r\n column.isSortedDesc ? (\r\n \r\n ) : (\r\n \r\n )\r\n ) : (\r\n ''\r\n )}\r\n {column.render('Header')}\r\n \r\n {column.canFilter ? (\r\n \r\n handleSearch(column)\r\n }\r\n >\r\n \r\n \r\n ) : null}\r\n -1\r\n ? null\r\n : { display: 'none' }\r\n }\r\n >\r\n {column.canFilter\r\n ? column.render('Filter')\r\n : null}\r\n \r\n
\r\n \r\n ))}\r\n
\r\n ))}\r\n \r\n \r\n {page.map((row, i) => {\r\n prepareRow(row)\r\n return (\r\n \r\n {row.cells.map((cell) => {\r\n return (\r\n \r\n )\r\n })}\r\n \r\n )\r\n })}\r\n \r\n
\r\n {cell.render('Cell')}\r\n
\r\n \r\n gotoPage(0)}\r\n disabled={!canPreviousPage}\r\n >\r\n \r\n
{' '}\r\n previousPage()}\r\n disabled={!canPreviousPage}\r\n className={!canPreviousPage ? 'has-text-grey' : ''}\r\n style={{ display: 'flex', alignItems: 'center' }}\r\n >\r\n \r\n {' '}\r\n \r\n \r\n Page{' '}\r\n \r\n {pageIndex + 1} of {pageOptions.length}\r\n {' '}\r\n \r\n \r\n nextPage()}\r\n disabled={!canNextPage}\r\n className={!canNextPage ? 'has-text-grey' : ''}\r\n style={{ display: 'flex', alignItems: 'center' }}\r\n >\r\n \r\n {' '}\r\n gotoPage(pageCount - 1)}\r\n disabled={!canNextPage}\r\n style={{ display: 'flex', alignItems: 'center' }}\r\n >\r\n \r\n {' '}\r\n \r\n \r\n )\r\n}\r\n\r\nexport default PSAPTable\r\n","import React from 'react'\r\nimport { toast, ToastContainer } from 'react-toastify'\r\n\r\nimport withConfig from '../wrappers/withConfig'\r\n\r\nconst Toast = withConfig(({config}) => {\r\n const { DISPLAY_TOASTS } = config\r\n const displayToasts = !!DISPLAY_TOASTS\r\n if (!displayToasts) {\r\n return null\r\n } else {\r\n return \r\n }\r\n})\r\n\r\nconst ToastLogic = ({ level, message}) => {\r\n const toastConfig = {\r\n className: 'toast',\r\n }\r\n switch (level) {\r\n case 'success':\r\n toast.success(message, toastConfig)\r\n console.log(`%c${message}`, 'color: green;')\r\n break;\r\n case 'error':\r\n toast.error(message, toastConfig)\r\n console.log(`%c${message}`, 'color: red;')\r\n break;\r\n case 'info':\r\n toast.info(message, toastConfig)\r\n console.log(`%c${message}`, 'color: blue;')\r\n break;\r\n default:\r\n toast.info(message, toastConfig)\r\n console.log(`%c${message}`, 'color: blue;')\r\n }\r\n}\r\n\r\nexport default ToastLogic\r\n\r\nexport { ToastLogic , Toast }","import React, { createContext, useCallback } from 'react'\r\nimport { useAuth } from 'oidc-react'\r\n\r\nconst APIRequestContext = createContext(null)\r\n\r\nconst APIRequestContextProvider = ({ children }) => {\r\n const { userManager } = useAuth()\r\n\r\n const authenticatedFetch = useCallback(async (endpoint, options) => {\r\n const u = await userManager.getUser()\r\n let fetchOptions = {}\r\n if (options) {\r\n fetchOptions = {\r\n ...options,\r\n headers: {\r\n ...options.headers,\r\n Authorization: `Bearer ${u ? u.access_token : null}`,\r\n },\r\n }\r\n } else {\r\n fetchOptions = {\r\n method: 'GET',\r\n headers: {\r\n Authorization: `Bearer ${u ? u.access_token : null}`,\r\n },\r\n }\r\n }\r\n return fetch(endpoint, fetchOptions)\r\n }, [userManager])\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n}\r\n\r\nexport { APIRequestContext }\r\nexport default APIRequestContextProvider\r\n","import React, { createContext, useEffect, useContext, useState } from 'react'\r\n\r\nimport toast from '../elem/Toast'\r\nimport { APIRequestContext } from './APIRequestContext'\r\nimport withConfig from './withConfig'\r\n\r\nconst PSAPContext = createContext(null)\r\n\r\nconst PSAPContextProvider = withConfig(({ config, children }) => {\r\n const { authenticatedFetch } = useContext(APIRequestContext)\r\n const [ loading, setLoading ] = useState(true)\r\n const [ PSAPs, setPSAPs ] = useState([])\r\n const [ PSAPUpdates, setPSAPUpdates ] = useState([])\r\n const [newObject, setNewObject] = useState(null)\r\n const { API_URL } = config\r\n\r\n // fetch the uploads a user has access to\r\n useEffect(() => {\r\n setLoading(true)\r\n authenticatedFetch(`${API_URL}/PSAP/UserPSAPs`)\r\n .then(async (response) => {\r\n if (response.ok) {\r\n return response.json()\r\n } else {\r\n const error = await response.text()\r\n throw new Error(error)\r\n }\r\n })\r\n .then((response) => {\r\n setPSAPs(response)\r\n })\r\n .catch((e) => {\r\n toast({\r\n level: 'error',\r\n message:\r\n 'Landing Page:' +\r\n (e.message\r\n ? e.message\r\n : 'Unable to connect to the server'),\r\n })\r\n })\r\n .finally(setLoading(false))\r\n }, [API_URL, authenticatedFetch, newObject])\r\n\r\n useEffect(() => {\r\n setLoading(true)\r\n authenticatedFetch(`${API_URL}/PSAP/Updates`)\r\n .then(async (response) => {\r\n if (response.ok) {\r\n return response.json()\r\n } else {\r\n const error = await response.text()\r\n throw new Error(error)\r\n }\r\n })\r\n .then((response) => {\r\n setPSAPUpdates(response)\r\n })\r\n .catch((e) => {\r\n toast({\r\n level: 'error',\r\n message:\r\n 'Landing Page:' +\r\n (e.message\r\n ? e.message\r\n : 'Unable to connect to the server'),\r\n })\r\n })\r\n .finally(setLoading(false))\r\n }, [API_URL, newObject, authenticatedFetch])\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n})\r\n\r\nexport { PSAPContext }\r\nexport default PSAPContextProvider","import React from 'react'\r\nimport { IconContext } from 'react-icons'\r\nimport { FaSpinner } from 'react-icons/fa'\r\n\r\nclass SimpleSpinner extends React.PureComponent {\r\n render() {\r\n const { extraClass } = this.props\r\n return (\r\n
\r\n \r\n \r\n \r\n
\r\n )\r\n }\r\n}\r\n\r\nexport default SimpleSpinner\r\n","import React, { useContext } from 'react'\r\nimport PSAPTable from './UserPSAPTable'\r\nimport PSAPStatusTable from './AllPSAPTable'\r\nimport { UserContext } from '../../wrappers/UserContext'\r\nimport { PSAPContext } from '../../wrappers/PSAPContext'\r\nimport SimpleSpinner from '../../elem/Spinner'\r\n\r\nconst PSAPListPage = () => {\r\n const { user } = useContext(UserContext)\r\n const { PSAPUpdates, PSAPs, loading } = useContext(PSAPContext)\r\n\r\n if (loading || !user) {\r\n return \r\n }\r\n\r\n if (!PSAPs || !PSAPs.length || !PSAPUpdates || !PSAPUpdates.length) {\r\n return null\r\n }\r\n\r\n return (\r\n <>\r\n
\r\n

My PSAPs

\r\n \r\n
\r\n \r\n
\r\n

PSAP Status List

\r\n \r\n
\r\n
\r\n \r\n )\r\n}\r\n\r\nexport default PSAPListPage","import React, { useContext } from 'react'\r\nimport { saveAs } from 'file-saver'\r\n\r\nimport withConfig from '../../wrappers/withConfig'\r\nimport toast from '../../elem/Toast'\r\nimport { APIRequestContext } from '../../wrappers/APIRequestContext'\r\nimport {Link} from 'react-router-dom'\r\n\r\nconst UploadButton = ({\r\n style,\r\n id,\r\n type,\r\n name,\r\n config,\r\n setShowModal,\r\n}) => {\r\n const { API_URL } = config\r\n const { authenticatedFetch } = useContext(APIRequestContext)\r\n \r\n const downloadFile = (uploadId) => {\r\n authenticatedFetch(`${API_URL}/upload/download/${type}/${uploadId}`)\r\n .then(async (response) => {\r\n if (response.ok) {\r\n return response.blob()\r\n } else {\r\n const error = await response.text()\r\n throw new Error(error)\r\n }\r\n })\r\n .then((data) => {\r\n saveAs(data, `${name}.zip`)\r\n })\r\n .catch((e) => {\r\n toast({\r\n level: 'error',\r\n message:\r\n 'Landing Page:' +\r\n (e.message\r\n ? e.message\r\n : 'Unable to connect to the server'),\r\n })\r\n setShowModal(true)\r\n })\r\n }\r\n\r\n return (\r\n
\r\n downloadFile(id)}\r\n style={{textTransform: \"capitalize\"}}\r\n >\r\n Download {type}\r\n \r\n
\r\n )\r\n}\r\n\r\nexport default withConfig(UploadButton)\r\n","import React, { useContext } from 'react'\r\n\r\nimport withConfig from '../../wrappers/withConfig'\r\nimport toast from '../../elem/Toast'\r\nimport { APIRequestContext } from '../../wrappers/APIRequestContext'\r\nimport { PSAPContext } from '../../wrappers/PSAPContext'\r\nimport {Link} from 'react-router-dom'\r\n\r\nconst UploadActionButton = ({\r\n style,\r\n id,\r\n action,\r\n name,\r\n config,\r\n setShowModal,\r\n}) => {\r\n const { API_URL } = config\r\n const { authenticatedFetch } = useContext(APIRequestContext)\r\n const { setNewObject } = useContext(PSAPContext)\r\n \r\n const executeAction = (uploadId) => {\r\n setNewObject(false)\r\n authenticatedFetch(`${API_URL}/upload/${action}/${uploadId}`)\r\n .then(async (response) => {\r\n if (response.ok) {\r\n setShowModal(true, `The ${action} action has been executed successfully.`, \"Success\")\r\n setNewObject(true)\r\n } else {\r\n const error = await response.text()\r\n throw new Error(error)\r\n }\r\n })\r\n .catch((e) => {\r\n toast({\r\n level: 'error',\r\n message:\r\n 'Landing Page:' +\r\n (e.message\r\n ? e.message\r\n : 'Unable to connect to the server'),\r\n })\r\n setShowModal(true, `Failed to execute ${action} action.`, \"Failed\")\r\n })\r\n }\r\n\r\n return (\r\n
\r\n executeAction(id)}\r\n style={{textTransform: \"capitalize\"}}\r\n >\r\n {name}\r\n \r\n
\r\n )\r\n}\r\n\r\nexport default withConfig(UploadActionButton)\r\n","import React from 'react'\r\n\r\nconst Modal = ({ toggle, header, footer, response, body, className }) => {\r\n return (\r\n <>\r\n
\r\n
\r\n
\r\n
\r\n

\r\n {header}\r\n

\r\n \r\n
\r\n
{body}
\r\n \r\n {footer}\r\n \r\n
\r\n \r\n )\r\n}\r\n\r\nexport default Modal\r\n","import React, { useMemo, useState } from 'react'\r\nimport { useTable, useSortBy } from 'react-table'\r\nimport { FaAngleUp, FaAngleDown } from 'react-icons/fa'\r\nimport DownloadButton from './DownloadButton'\r\nimport UploadActionButton from './UploadActionButton'\r\nimport Modal from '../../elem/Modal'\r\n\r\nconst UploadTable = ({ uploads, readOnly }) => {\r\n const [showModal, setShowModal] = useState(false)\r\n const [alertMessage, setAlertMessage] = useState(`Could not find file.`)\r\n const [alertHeader, setAlertHeader] = useState(`File Download Failed`)\r\n\r\n const showMessage = (showModal, alertMessage, alertHeader) => {\r\n setAlertMessage(alertMessage != null? alertMessage: `Could not find file.`)\r\n setAlertHeader(alertHeader != null? alertHeader: `File Download Failed`)\r\n setShowModal(showModal)\r\n }\r\n\r\n const ActionCell = ({ value, noFinal, name }) => {\r\n return (\r\n <>\r\n \r\n \r\n \r\n \r\n )\r\n }\r\n\r\n const DateCell = ({ value }) => value\r\n\r\n const MergeCell = ({ value }) => value === 1 ? 'Pending' : value === 2 ? 'Complete': value === 3 ? 'Failed' : 'N/A'\r\n\r\n const ValidationCell = ({ value }) => value === 1 ? 'Pending' : value === 2 ? 'Valid' : value === 3 ? 'Invalid' : value === 4 ? 'Failed' : 'N/A'\r\n\r\n const createColumns = () => [\r\n {\r\n Header: 'Upload Date',\r\n accessor: 'UploadDate',\r\n id: 'UploadDate',\r\n Cell: ({ cell }) => (\r\n \r\n ),\r\n },\r\n { Header: 'File Name', accessor: 'FileNameDisplay' },\r\n { Header: 'Validation Status', accessor: 'ValidationStatus', Cell: ({ cell }) => (\r\n \r\n ), },\r\n {\r\n Header: 'Validation Date',\r\n accessor: 'ValidationDate',\r\n Cell: ({ cell }) => (\r\n \r\n ),\r\n },\r\n { Header: 'Merge Status', accessor: 'MergeStatus', Cell: ({ cell }) => (\r\n \r\n ), },\r\n {\r\n Header: 'Merge Date',\r\n accessor: 'MergeDate',\r\n Cell: ({ cell }) => (\r\n \r\n ),\r\n },\r\n { Header: 'Archive Status', accessor: 'ArchiveStatus', Cell: ({ cell }) => (\r\n \r\n ), },\r\n {\r\n Header: 'Archive Date',\r\n accessor: 'ArchiveDate',\r\n Cell: ({ cell }) => (\r\n \r\n ),\r\n },\r\n {\r\n Header: 'Actions',\r\n accessor: 'Id',\r\n Cell: ({ cell, row }) => (\r\n \r\n ),\r\n },\r\n ]\r\n\r\n\r\n\r\n const formatData = (upload) => {\r\n upload.forEach((item) => {\r\n Object.keys(item).forEach((key) => {\r\n if (item[key] === null) {\r\n item[key] = 'N/A'\r\n }\r\n })\r\n })\r\n return upload\r\n }\r\n\r\n const columns = useMemo(() => createColumns(), [])\r\n const tableData = useMemo(() => formatData(uploads), [uploads])\r\n const {\r\n getTableProps,\r\n getTableBodyProps,\r\n headerGroups,\r\n rows,\r\n prepareRow,\r\n } = useTable(\r\n {\r\n columns,\r\n data: tableData,\r\n initialState: {\r\n sortBy: [\r\n {\r\n id: 'UploadDate',\r\n desc: true,\r\n },\r\n ],\r\n },\r\n },\r\n useSortBy\r\n )\r\n\r\n return (\r\n
\r\n {showModal ? (\r\n setShowModal(false)}\r\n header={alertHeader}\r\n footer={\r\n setShowModal(false)}\r\n className=\"button green\"\r\n >\r\n Ok\r\n \r\n }\r\n body={

{alertMessage}

}\r\n />\r\n ) : null}\r\n \r\n \r\n {headerGroups.map((headerGroup) => (\r\n \r\n {headerGroup.headers.map((column) => (\r\n \r\n {column.render('Header')}\r\n \r\n {column.isSorted ? (\r\n column.isSortedDesc ? (\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 {rows.map((row) => {\r\n prepareRow(row)\r\n return (\r\n \r\n {row.cells.map((cell) => {\r\n return (\r\n \r\n )\r\n })}\r\n \r\n )\r\n })}\r\n \r\n
\r\n {cell.render('Cell')}\r\n
\r\n
\r\n )\r\n}\r\n\r\nexport default UploadTable\r\n","import { useState } from 'react';\r\n\r\nconst useModal = () => {\r\n const [isShowing, setIsShowing] = useState(false);\r\n\r\n const toggle = () => {\r\n setIsShowing(!isShowing);\r\n }\r\n\r\n\r\n return {\r\n isShowing,\r\n setIsShowing,\r\n toggle,\r\n }\r\n};\r\n\r\nexport default useModal;","import React, { createContext, useContext, useMemo } from 'react'\r\nimport { useParams } from 'react-router'\r\nimport { PSAPContext } from './PSAPContext'\r\n\r\nconst PSAPDetailContext = createContext(null)\r\n\r\nconst PSAPDetailContextProvider = ({ children }) => {\r\n const { PSAPs } = useContext(PSAPContext)\r\n const { PSAPId } = useParams()\r\n\r\n const PSAP = useMemo(() => PSAPs.find(psap => psap.Id === Number(PSAPId)), [PSAPId, PSAPs])\r\n\r\n return (\r\n \r\n {children}\r\n \r\n )\r\n}\r\n\r\nexport { PSAPDetailContext }\r\nexport default PSAPDetailContextProvider","import React, { useContext, useState, useEffect } from 'react'\r\nimport { useForm } from 'react-hook-form'\r\n\r\nimport withConfig from '../../wrappers/withConfig'\r\nimport toast from '../../elem/Toast'\r\nimport { APIRequestContext } from '../../wrappers/APIRequestContext'\r\nimport { PSAPDetailContext } from '../../wrappers/PSAPDetailContext'\r\n\r\nconst UploadForm = ({ config, handleUpload, uploading, uploadingFile }) => {\r\n const { authenticatedFetch } = useContext(APIRequestContext)\r\n const { register, handleSubmit, errors } = useForm()\r\n const { PSAP } = useContext(PSAPDetailContext)\r\n const [fileName, setFileName] = useState(null)\r\n const { API_URL } = config\r\n const [response, setResponse] = useState(null)\r\n\r\n useEffect(() => {\r\n if (response) {\r\n handleUpload(response)\r\n }\r\n }, [response, handleUpload])\r\n\r\n const POST = (upload) => {\r\n const formData = new FormData()\r\n formData.append('File', upload.File)\r\n formData.append('FileName', upload.FileName)\r\n formData.append('PSAPId', upload.PSAPId)\r\n return {\r\n method: 'POST',\r\n mode: 'cors',\r\n headers: {\r\n // 'Content-Type': 'application/json',\r\n 'Access-Control-Allow-Origin': '*',\r\n 'Access-Control-Allow-Headers':\r\n 'Access-Control-Allow-Origin, X-Requested-With, Content-Type, Accept',\r\n },\r\n body: formData,\r\n }\r\n }\r\n\r\n const uploadFile = (file) => {\r\n authenticatedFetch(\r\n `${API_URL}/upload/create`,\r\n POST({\r\n File: file,\r\n FileName: fileName.slice(0, fileName.lastIndexOf('.')),\r\n PSAPId: PSAP.Id,\r\n })\r\n )\r\n .then(async (response) => {\r\n if (response.ok) {\r\n return response.json()\r\n } else {\r\n const error = await response.text()\r\n throw new Error(error)\r\n }\r\n })\r\n .then((response) => {\r\n setResponse(response)\r\n })\r\n .catch((e) => {\r\n toast({\r\n level: 'error',\r\n message:\r\n 'Create Page:' +\r\n (e.message ? e.message : 'File upload failed'),\r\n })\r\n setResponse('Failed')\r\n })\r\n .finally(() => {\r\n uploadingFile(false)\r\n })\r\n }\r\n \r\n const handleChange = (event) => {\r\n setFileName(event.target.files[0].name)\r\n }\r\n\r\n const onSubmit = (data) => {\r\n uploadingFile(true)\r\n const file = data.File[0]\r\n uploadFile(file)\r\n }\r\n\r\n return (\r\n <>\r\n \r\n
\r\n \r\n
\r\n {errors.FileName ? (\r\n

\r\n {errors.FileName.message}\r\n

\r\n ) : null}\r\n

Upload must be .zip file.

\r\n

\r\n Upon successful upload and validation the file will be\r\n merged into the state-wide NG911 GIS layers.
\r\n You will be notified via email about the status of the\r\n validation and merge processes.\r\n

\r\n \r\n \r\n )\r\n}\r\n\r\nexport default withConfig(UploadForm)\r\n","import React, { useContext, useState } from 'react'\r\nimport Modal from '../../elem/Modal'\r\nimport useModal from '../../wrappers/useModal'\r\nimport UploadForm from './UploadForm'\r\nimport { PSAPDetailContext } from '../../wrappers/PSAPDetailContext'\r\nimport { PSAPContext } from '../../wrappers/PSAPContext'\r\n\r\nconst UploadButton = () => {\r\n const { PSAP } = useContext(PSAPDetailContext)\r\n const { setNewObject } = useContext(PSAPContext)\r\n const { isShowing, toggle } = useModal()\r\n const [response, setResponse] = useState(null)\r\n const [uploading, setUploading] = useState(false)\r\n\r\n const openModal = () => {\r\n setResponse(null)\r\n toggle()\r\n setNewObject(false)\r\n }\r\n\r\n const uploadingFile = (status) => {\r\n setUploading(status)\r\n }\r\n\r\n const handleUpload = (response) => {\r\n setResponse(response)\r\n }\r\n\r\n const closeForm = () => {\r\n toggle()\r\n setNewObject(true)\r\n }\r\n\r\n const text =\r\n response && typeof response === 'number'\r\n ? 'Upload Successful!'\r\n : 'File upload failed.'\r\n\r\n return isShowing ? (\r\n \r\n \r\n Save Upload\r\n \r\n \r\n Cancel\r\n \r\n \r\n ) : (\r\n <>\r\n \r\n Ok\r\n \r\n \r\n )\r\n }\r\n response={response}\r\n body={\r\n !response ? (\r\n \r\n ) : (\r\n <>\r\n

{text}

\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 UploadButton\r\n","import React, { useContext, useState } from 'react'\r\nimport Modal from '../../elem/Modal'\r\nimport { PSAPDetailContext } from '../../wrappers/PSAPDetailContext'\r\nimport withConfig from '../../wrappers/withConfig'\r\nimport toast from '../../elem/Toast'\r\nimport { APIRequestContext } from '../../wrappers/APIRequestContext'\r\nimport { UserContext } from '../../wrappers/UserContext'\r\nimport { isSysAdmin } from '../../../utils/user/permissions'\r\n\r\nconst ClearButton = ({ config }) => {\r\n const { PSAP } = useContext(PSAPDetailContext)\r\n const { API_URL } = config\r\n const { authenticatedFetch } = useContext(APIRequestContext)\r\n const { roles } = useContext(UserContext)\r\n const [showModal, setShowModal] = useState(false)\r\n const [alertMessage, setAlertMessage] = useState(null)\r\n const [alertHeader, setAlertHeader] = useState(null)\r\n\r\n const showMessage = (showModal, alertMessage, alertHeader) => {\r\n setAlertMessage(alertMessage)\r\n setAlertHeader(alertHeader)\r\n setShowModal(showModal)\r\n }\r\n\r\n const executeAction = () => {\r\n authenticatedFetch(`${API_URL}/upload/rollback/${PSAP.Id}`)\r\n .then(async (response) => {\r\n if (response.ok) {\r\n showMessage(true, 'Removing PSAP data has been scheduled successfully. We will send an email about the result shortly.', 'Clear PSAP data')\r\n } else {\r\n const error = await response.text()\r\n throw new Error(error)\r\n }\r\n })\r\n .catch((e) => {\r\n toast({\r\n level: 'error',\r\n message:\r\n 'Landing Page:' +\r\n (e.message\r\n ? e.message\r\n : 'Unable to connect to the server'),\r\n })\r\n showMessage(true, `Failed to remove PSAP data.`, \"Failed\")\r\n })\r\n }\r\n\r\n return showModal ? (\r\n setShowModal(false)}\r\n header={alertHeader}\r\n footer={\r\n setShowModal(false)}\r\n className=\"button green\"\r\n >\r\n Ok\r\n \r\n }\r\n body={

{alertMessage}

}\r\n />\r\n ) : (\r\n <>\r\n {isSysAdmin(roles) && (\r\n
\r\n \r\n
\r\n )} \r\n \r\n )\r\n}\r\n\r\nexport default withConfig(ClearButton)\r\n","import React, { useContext } from 'react'\r\n\r\nimport UploadTable from './UploadTable'\r\nimport UploadButton from './UploadButton'\r\nimport ClearButton from './ClearButton'\r\nimport { PSAPDetailContext } from '../../wrappers/PSAPDetailContext'\r\n\r\nconst DetailPage = () => {\r\n const { PSAP } = useContext(PSAPDetailContext)\r\n\r\n if (!PSAP) {\r\n return null\r\n }\r\n\r\n return (\r\n <>\r\n
\r\n

\r\n {PSAP.Name}\r\n

\r\n
\r\n {PSAP.ReadOnly ? null : } {PSAP.ReadOnly ? null : }\r\n
\r\n
\r\n {PSAP.Uploads && PSAP.Uploads.length ? (\r\n \r\n ) : (\r\n

\r\n No files have been uploaded to {PSAP.Name}.\r\n

\r\n )}\r\n
\r\n
\r\n \r\n )\r\n}\r\n\r\nexport default DetailPage\r\n","import React, { useContext, useEffect, useState } from 'react'\r\nimport { UserContext } from '../../wrappers/UserContext'\r\nimport { Redirect } from 'react-router-dom'\r\nimport { checkRole, getRoles, hasApplicationAccess } from '../../../utils/user/permissions'\r\nimport urls from '../../../utils/constants/urls'\r\n\r\nconst RestrictedAccessPage = ({ client }) => {\r\n return (\r\n
\r\n
\r\n

Unauthorized

\r\n
\r\n \r\n You do not have permission to view this page. Please\r\n contact your system administrator or \r\n
\r\n \r\n log out\r\n {' '}\r\n and log back in to access this application.\r\n \r\n
\r\n
\r\n
\r\n )\r\n}\r\n\r\nconst RestrictedAccess = ({ allowedRoles, children }) => {\r\n const { client } = useContext(UserContext)\r\n const [hasAccess, setHasAccess] = useState(true)\r\n const [hasAccessButNoRoles, setHasAccessButNoRoles] = useState(false)\r\n\r\n useEffect(() => {\r\n const checkClientAccess = async (allowedRoles) => {\r\n try {\r\n await client.getUser().then((user) => {\r\n const roles = getRoles(user)\r\n if (roles == '' && hasApplicationAccess(user)) {\r\n setHasAccessButNoRoles(true)\r\n } else if (\r\n allowedRoles.some((role) => checkRole(role, roles))\r\n ) {\r\n setHasAccess(true)\r\n } else {\r\n setHasAccess(false)\r\n }\r\n })\r\n } catch (e) {\r\n setHasAccess(false)\r\n }\r\n }\r\n checkClientAccess(allowedRoles)\r\n }, [client, allowedRoles])\r\n\r\n if (hasAccessButNoRoles) {\r\n return \r\n }\r\n if (hasAccess) {\r\n return children\r\n } else {\r\n return \r\n }\r\n}\r\n\r\nexport default RestrictedAccess\r\n","import React, { useContext, useState } from 'react'\r\nimport { saveAs } from 'file-saver'\r\n\r\nimport withConfig from '../wrappers/withConfig'\r\nimport toast from './Toast'\r\nimport Modal from './Modal'\r\nimport { APIRequestContext } from '../wrappers/APIRequestContext'\r\nimport { UserContext } from '../wrappers/UserContext'\r\nimport { isAdmin, isSysAdmin } from '../../utils/user/permissions'\r\nimport { Link } from 'react-router-dom'\r\n\r\nimport urls from '../../utils/constants/urls'\r\n\r\nconst NavBar = ({ config }) => {\r\n const [showModal, setShowModal] = useState(false)\r\n const [alertMessage] = useState(`Could not find file.`)\r\n const [alertHeader] = useState(`File Download Failed`)\r\n const { user, roles, client } = useContext(UserContext)\r\n const [active, setActive] = useState(false)\r\n\r\n const admin = isAdmin(roles)\r\n const sysadmin = isSysAdmin(roles)\r\n\r\n const { API_URL } = config\r\n const { authenticatedFetch } = useContext(APIRequestContext)\r\n\r\n const downloadPSAPs = () => {\r\n authenticatedFetch( `${API_URL}/PSAP/DownloadPSAPs`, {\r\n method: 'GET',\r\n headers: {\r\n 'Content-Type': 'text/csv'\r\n }})\r\n .then(async (response) => {\r\n if (response.ok) {\r\n return response.blob()\r\n } else {\r\n const error = await response.text()\r\n throw new Error(error)\r\n }\r\n })\r\n .then((data) => {\r\n saveAs(data, 'psap-list.csv')\r\n })\r\n .catch((e) => {\r\n toast({\r\n level: 'error',\r\n message:\r\n 'Landing Page:' +\r\n (e.message\r\n ? e.message\r\n : 'Unable to connect to the server'),\r\n })\r\n setShowModal(true)\r\n })\r\n }\r\n\r\n return (\r\n <>\r\n {showModal ? (\r\n setShowModal(false)}\r\n header={alertHeader}\r\n footer={\r\n setShowModal(false)}\r\n className=\"button green\"\r\n >\r\n Ok\r\n \r\n }\r\n body={

{alertMessage}

}\r\n />\r\n ) : null}\r\n
\r\n \r\n \r\n )\r\n}\r\n\r\nexport default withConfig(NavBar)\r\n","import React, { useEffect } from 'react'\r\n\r\nimport urls from '../../../utils/constants/urls'\r\nimport Spinner from '../../elem/Spinner'\r\n\r\nconst CallbackComponent = () => {\r\n useEffect(() => {\r\n const t = setTimeout(() => {\r\n window.location = urls.home\r\n }, 5000)\r\n return () => clearTimeout(t)\r\n }, [])\r\n\r\n return \r\n}\r\n\r\nexport default CallbackComponent\r\n","import React from 'react'\r\nimport { Helmet , HelmetProvider } from 'react-helmet-async'\r\nimport withConfig from '../wrappers/withConfig'\r\n\r\nconst Header = ({ config }) => {\r\n const { APP_TITLE } = config\r\n return (\r\n \r\n \r\n {APP_TITLE}\r\n \r\n \r\n )\r\n}\r\n\r\nexport default withConfig(Header)","import React from 'react'\r\nimport { BrowserRouter as Router, Route, Switch } from 'react-router-dom'\r\nimport Login from './components/features/user/Login'\r\nimport PSAPListPage from './components/features/psap-list/PSAPListPage'\r\nimport DetailPage from './components/features/detail-page/DetailPage'\r\nimport RestrictedAccess from './components/features/user/RestrictedAccess'\r\nimport NavBar from './components/elem/NavBar'\r\nimport UserContextProvider from './components/wrappers/UserContext'\r\nimport CallbackComponent from './components/features/user/CallbackComponent'\r\nimport PSAPContextProvider from './components/wrappers/PSAPContext'\r\nimport Header from './components/elem/Header'\r\nimport { Toast as ToastContainer } from './components/elem/Toast'\r\nimport urls from './utils/constants/urls'\r\nimport APIRequestContextProvider from './components/wrappers/APIRequestContext'\r\nimport PSAPDetailContextProvider from './components/wrappers/PSAPDetailContext'\r\n\r\nconst App = () => (\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\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 App\r\n","import React from 'react';\r\nimport ReactDOM from 'react-dom';\r\nimport './styles/index.scss'\r\nimport App from './App';\r\n\r\nReactDOM.render(\r\n \r\n \r\n ,\r\n document.getElementById('root')\r\n)"],"sourceRoot":""}