diff --git a/package.json b/package.json index 55d853dd5..3df8dfe37 100644 --- a/package.json +++ b/package.json @@ -65,30 +65,29 @@ "postcss-normalize": "^13.0.1", "postcss-preset-env": "^10.1.5", "prompts": "^2.4.2", - "prop-types": "^15.8.1", - "react": "^18.3.1", + "react": "^19.1.0", "react-app-polyfill": "^3.0.0", "react-bootstrap": "2.10.9", "react-collapsible": "^2.10.0", - "react-datepicker": "^7.5.0", + "react-datepicker": "^8.3.0", "react-debounce-render": "^8.0.2", "react-dev-utils": "^12.0.1", - "react-dom": "^18.3.1", - "react-error-boundary": "^4.1.2", + "react-dom": "^19.1.0", + "react-error-boundary": "^5.0.0", "react-fast-compare": "^3.2.2", "react-flip-toolkit": "^7.2.4", "react-ga4": "^2.1.0", "react-i18next": "^15.1.2", "react-infinite-scroller": "^1.2.6", "react-js-pagination": "^3.0.3", - "react-pin-field": "^3.1.5", + "react-pin-field": "^4.0.2", "react-redux": "^9.1.2", "react-refresh": "^0.17.0", "react-router-dom": "^7.0.1", "react-select": "^5.8.3", "react-spinners": "^0.15.0", - "react-to-print": "^3.0.2", - "react-toastify": "^10.0.6", + "react-to-print": "^3.0.6", + "react-toastify": "^11.0.5", "react-window": "^1.8.10", "redux": "^5.0.1", "redux-persist": "^5.10.0", @@ -128,11 +127,11 @@ "devDependencies": { "@babel/eslint-parser": "^7.27.0", "@babel/runtime": "^7.27.0", - "@testing-library/dom": "^8.1.0", - "@testing-library/jest-dom": "^5.14.1", - "@testing-library/react": "^12.0.0", + "@testing-library/dom": "^10.4.0", + "@testing-library/jest-dom": "^6.6.3", + "@testing-library/react": "^16.3.0", "@testing-library/react-hooks": "^8.0.1", - "@testing-library/user-event": "^13.0.16", + "@testing-library/user-event": "^14.6.1", "eslint-config-airbnb": "^19.0.4", "eslint-plugin-react": "^7.12.4", "eslint-plugin-react-hooks": "^5.2.0", @@ -145,7 +144,7 @@ "socket.io-mock": "^1.3.2", "stylelint": "^16.17.0", "stylelint-config-css-modules": "^4.4.0", - "stylelint-config-standard": "^37.0.0", + "stylelint-config-standard": "^38.0.0", "stylelint-scss": "^6.11.1", "undici": "5.0.0" }, diff --git a/src/AddAttachmentButton/index.js b/src/AddAttachmentButton/index.js index 04f2a9825..c065f9ad7 100644 --- a/src/AddAttachmentButton/index.js +++ b/src/AddAttachmentButton/index.js @@ -1,6 +1,5 @@ import React, { memo, useCallback, useContext, useRef, useState } from 'react'; import Button from 'react-bootstrap/Button'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { TrackerContext } from '../utils/analytics'; @@ -36,7 +35,7 @@ const ATTACHMENT_FILE_TYPES_ACCEPTED = [ '.wmv' ]; -const AddAttachmentButton = ({ className, onAddAttachments }) => { +const AddAttachmentButton = ({ className = '', onAddAttachments }) => { const fileInputRef = useRef(); const { t } = useTranslation('details-view'); @@ -111,13 +110,4 @@ const AddAttachmentButton = ({ className, onAddAttachments }) => { ; }; -AddAttachmentButton.defaultProps = { - className: '', -}; - -AddAttachmentButton.propTypes = { - className: PropTypes.string, - onAddAttachments: PropTypes.func.isRequired, -}; - export default memo(AddAttachmentButton); diff --git a/src/AddItemButton/AddItemModal/AddPatrolTab/index.js b/src/AddItemButton/AddItemModal/AddPatrolTab/index.js index 33808eec7..9f3358473 100644 --- a/src/AddItemButton/AddItemModal/AddPatrolTab/index.js +++ b/src/AddItemButton/AddItemModal/AddPatrolTab/index.js @@ -1,5 +1,4 @@ import React, { memo, useCallback, useContext, useMemo, useState } from 'react'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -62,8 +61,4 @@ const AddPatrolTab = ({ onHideModal }) => { ; }; -AddPatrolTab.propTypes = { - onHideModal: PropTypes.func.isRequired, -}; - export default memo(AddPatrolTab); diff --git a/src/AddItemButton/AddItemModal/TypesList/index.js b/src/AddItemButton/AddItemModal/TypesList/index.js index 5fa9fabbb..aa403a1ee 100644 --- a/src/AddItemButton/AddItemModal/TypesList/index.js +++ b/src/AddItemButton/AddItemModal/TypesList/index.js @@ -1,5 +1,4 @@ -import React, { forwardRef } from 'react'; -import PropTypes from 'prop-types'; +import React from 'react'; import EventTypeListItem from '../../../EventTypeListItem'; @@ -17,7 +16,7 @@ const CategoryList = ({ category, onClickType, showTitle }) =>
; -const TypesList = ({ filterText, onClickType, typesByCategory }, ref) => { +const TypesList = ({ filterText, onClickType, ref, typesByCategory }) => { const filterTextLowerCase = filterText.toLowerCase(); const filteredCategories = typesByCategory.reduce((accumulator, category) => { @@ -46,17 +45,4 @@ const TypesList = ({ filterText, onClickType, typesByCategory }, ref) => { ; }; -const TypesListForwardRef = forwardRef(TypesList); - -TypesListForwardRef.propTypes = { - filterText: PropTypes.string.isRequired, - onClickType: PropTypes.func.isRequired, - typesByCategory: PropTypes.arrayOf(PropTypes.shape({ - display: PropTypes.string, - id: PropTypes.string, - types: PropTypes.array, - value: PropTypes.string, - })).isRequired, -}; - -export default TypesListForwardRef; +export default TypesList; diff --git a/src/AddItemButton/AddItemModal/index.js b/src/AddItemButton/AddItemModal/index.js index f0a514c04..8f80d8c80 100644 --- a/src/AddItemButton/AddItemModal/index.js +++ b/src/AddItemButton/AddItemModal/index.js @@ -1,6 +1,5 @@ import React, { memo, useCallback, useContext, useEffect, useState } from 'react'; import Modal from 'react-bootstrap/Modal'; -import PropTypes from 'prop-types'; import Tab from 'react-bootstrap/Tab'; import Tabs from 'react-bootstrap/Tabs'; import { useSelector } from 'react-redux'; @@ -79,9 +78,4 @@ const AddItemModal = ({ onHide, show, ...restProps }) => { ; }; -AddItemModal.propTypes = { - onHide: PropTypes.func.isRequired, - show: PropTypes.bool.isRequired, -}; - export default memo(AddItemModal); diff --git a/src/AddNoteButton/index.js b/src/AddNoteButton/index.js index c99dc9d3a..22f217bae 100644 --- a/src/AddNoteButton/index.js +++ b/src/AddNoteButton/index.js @@ -1,13 +1,12 @@ import React, { useCallback, useContext, memo } from 'react'; import Button from 'react-bootstrap/Button'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { TrackerContext } from '../utils/analytics'; import { ReactComponent as NoteIcon } from '../common/images/icons/note.svg'; -const AddNoteButton = ({ className, onAddNote, ...rest }) => { +const AddNoteButton = ({ className = '', onAddNote, ...rest }) => { const analytics = useContext(TrackerContext); const { t } = useTranslation('details-view'); @@ -29,13 +28,4 @@ const AddNoteButton = ({ className, onAddNote, ...rest }) => { ; }; -AddNoteButton.defaultProps = { - className: '', -}; - -AddNoteButton.propTypes = { - className: PropTypes.string, - onAddNote: PropTypes.func.isRequired, -}; - export default memo(AddNoteButton); diff --git a/src/AddToIncidentModal/index.js b/src/AddToIncidentModal/index.js index 6fbab8814..6d0018048 100644 --- a/src/AddToIncidentModal/index.js +++ b/src/AddToIncidentModal/index.js @@ -2,7 +2,6 @@ import React, { memo, useEffect, useRef, useState } from 'react'; import Button from 'react-bootstrap/Button'; import InfiniteScroll from 'react-infinite-scroller'; import Modal from 'react-bootstrap/Modal'; -import PropTypes from 'prop-types'; import { useDispatch, useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -113,10 +112,4 @@ const AddToIncidentModal = ({ id, onAddToExistingIncident, onAddToNewIncident }) ; }; -AddToIncidentModal.propTypes = { - id: PropTypes.string.isRequired, - onAddToExistingIncident: PropTypes.func.isRequired, - onAddToNewIncident: PropTypes.func.isRequired, -}; - export default memo(AddToIncidentModal); diff --git a/src/AddToPatrolModal/index.js b/src/AddToPatrolModal/index.js index 770d28f31..5441ddf9e 100644 --- a/src/AddToPatrolModal/index.js +++ b/src/AddToPatrolModal/index.js @@ -1,6 +1,5 @@ import React, { memo, useRef, useEffect, useState, useReducer, useMemo, useCallback, useContext } from 'react'; import axios from 'axios'; -import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import Button from 'react-bootstrap/Button'; import Modal from 'react-bootstrap/Modal'; @@ -208,7 +207,3 @@ const AddToPatrolModal = (props) => { const mapStateToProps = ({ data: { patrolStore } }) => ({ patrolStore }); export default connect(mapStateToProps, { removeModal: id => removeModal(id), updatePatrolStore: patrols => updatePatrolStore(patrols) })(memo(AddToPatrolModal)); - -AddToPatrolModal.propTypes = { - onAddToPatrol: PropTypes.func.isRequired, -}; \ No newline at end of file diff --git a/src/AlertsModal/index.js b/src/AlertsModal/index.js index 13d3aa5ea..2ceaaf079 100644 --- a/src/AlertsModal/index.js +++ b/src/AlertsModal/index.js @@ -1,6 +1,5 @@ import React, { memo, useState } from 'react'; import Modal from 'react-bootstrap/Modal'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { DAS_HOST } from '../constants'; @@ -35,6 +34,4 @@ const AlertsModal = ({ title }) => { ; }; -AlertsModal.propTypes = { title: PropTypes.string.isRequired }; - export default memo(AlertsModal); diff --git a/src/AnalyzerLayerList/index.js b/src/AnalyzerLayerList/index.js index 1cbccf096..2c9165596 100644 --- a/src/AnalyzerLayerList/index.js +++ b/src/AnalyzerLayerList/index.js @@ -1,5 +1,4 @@ import React, { memo, useCallback, useMemo } from 'react'; -import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import Checkmark from '../Checkmark'; import Collapsible from 'react-collapsible'; @@ -29,7 +28,7 @@ const AnalyzerLayerList = memo(({ hiddenAnalyzerIDs, hideAnalyzers, showAnalyzers, - map, + map = {}, mapLayerFilter }) => { const { t } = useTranslation('layers', { keyPrefix: 'layerList' }); @@ -147,11 +146,3 @@ const mapStateToProps = (state) => ({ }); export default connect(mapStateToProps, { hideAnalyzers, showAnalyzers })(AnalyzerLayerList); - -AnalyzerLayerList.defaultProps = { - map: {}, -}; - -AnalyzerLayerList.propTypes = { - map: PropTypes.object, -}; diff --git a/src/CheckableList/index.js b/src/CheckableList/index.js index 18ec6c499..5014988be 100644 --- a/src/CheckableList/index.js +++ b/src/CheckableList/index.js @@ -1,42 +1,32 @@ import React, { memo } from 'react'; -import PropTypes from 'prop-types'; -import CheckMark from '../Checkmark'; import { hashCode } from '../utils/string'; -const CheckableList = (props) => { - const { items, itemProps, onCheckClick, itemFullyChecked, itemPartiallyChecked, itemComponent: ItemComponent, className } = props; - return ; +const CheckableList = ({ + className, + itemComponent: ItemComponent, + itemFullyChecked, + itemPartiallyChecked = null, + itemProps = {}, + items, + onCheckClick = null, +}) => ; -CheckableList.defaultProps = { - itemPartiallyChecked() { - return false; - }, - onCheckClick() { - }, - itemProps: {}, -}; - -CheckableList.propTypes = { - itemFullyChecked: PropTypes.func.isRequired, - itemPartiallyChecked: PropTypes.func, - itemComponent: PropTypes.oneOfType([PropTypes.object, PropTypes.func]).isRequired, - items: PropTypes.array.isRequired, - onCheckClick: PropTypes.func, - itemProps: PropTypes.object, -}; \ No newline at end of file +export default memo(CheckableList); diff --git a/src/CheckboxList/index.js b/src/CheckboxList/index.js index edb999cb6..a8c107cce 100644 --- a/src/CheckboxList/index.js +++ b/src/CheckboxList/index.js @@ -1,6 +1,5 @@ import React, { memo } from 'react'; import { InputGroup } from 'react-bootstrap'; -import PropTypes from 'prop-types'; import * as styles from './styles.module.scss'; @@ -15,15 +14,4 @@ const CheckboxList = ({ onItemChange, options, values }) => { ; }; -CheckboxList.propTypes = { - values: PropTypes.arrayOf(PropTypes.string), - options: PropTypes.arrayOf( - PropTypes.shape({ - id: PropTypes.string, - value: PropTypes.oneOfType([PropTypes.string, PropTypes.node]), - }).isRequired, - ), - onItemChange: PropTypes.func.isRequired, -}; - export default memo(CheckboxList); diff --git a/src/Checkmark/index.js b/src/Checkmark/index.js index 96ddcb567..e253b2465 100644 --- a/src/Checkmark/index.js +++ b/src/Checkmark/index.js @@ -1,12 +1,11 @@ import React, { memo } from 'react'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { ReactComponent as CheckIcon } from '../common/images/icons/check.svg'; import * as styles from './styles.module.scss'; -const CheckMark = ({ fullyChecked, partiallyChecked, ...restProps }) => { +const CheckMark = ({ fullyChecked, partiallyChecked = false, ...restProps }) => { const { t } = useTranslation('components', { keyPrefix: 'checkMark' }); return { />; }; -CheckMark.defaultProps = { - partiallyChecked: false, -}; - -CheckMark.propTypes = { - fullyChecked: PropTypes.bool.isRequired, - partiallyChecked: PropTypes.bool, -}; - export default memo(CheckMark); diff --git a/src/ClustersLayer/index.js b/src/ClustersLayer/index.js index 13452ee01..48933aa0e 100644 --- a/src/ClustersLayer/index.js +++ b/src/ClustersLayer/index.js @@ -1,6 +1,5 @@ import React, { memo, useCallback, useContext, useMemo, useRef } from 'react'; import { featureCollection } from '@turf/turf'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { addNewClusterMarkers, getRenderedClustersData, removeOldClusterMarkers } from './utils'; @@ -102,6 +101,4 @@ const ClustersLayer = ({ onShowClusterSelectPopup }) => { return null; }; -ClustersLayer.propTypes = { onShowClusterSelectPopup: PropTypes.func.isRequired }; - -export default memo(ClustersLayer); \ No newline at end of file +export default memo(ClustersLayer); diff --git a/src/ColumnSort/index.js b/src/ColumnSort/index.js index dcb5ea6a9..367edf7a8 100644 --- a/src/ColumnSort/index.js +++ b/src/ColumnSort/index.js @@ -3,7 +3,6 @@ import Button from 'react-bootstrap/Button'; import ListGroup from 'react-bootstrap/ListGroup'; import OverlayTrigger from 'react-bootstrap/OverlayTrigger'; import Popover from 'react-bootstrap/Popover'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { ReactComponent as ArrowDown } from '../common/images/icons/arrow-down.svg'; @@ -15,7 +14,7 @@ import { DEFAULT_EVENT_SORT, SORT_DIRECTION } from '../constants'; import * as styles from './styles.module.scss'; -const ColumnSort = ({ className, sortOptions, orderOptions, value, onChange }) => { +const ColumnSort = ({ className = '', sortOptions, orderOptions, value, onChange }) => { const { t } = useTranslation('reports', { keyPrefix: 'columnSort' }); const [isSortUp, setSortDirection] = useState(value === SORT_DIRECTION.up); @@ -117,20 +116,4 @@ const ColumnSort = ({ className, sortOptions, orderOptions, value, onChange }) = ; }; -ColumnSort.defaultProps= { - className: '', -}; - -ColumnSort.propTypes= { - className: PropTypes.string, - onChange: PropTypes.func.isRequired, - orderOptions: PropTypes.arrayOf(PropTypes.shape({ - value: PropTypes.string, - })).isRequired, - sortOptions: PropTypes.arrayOf(PropTypes.shape({ - value: PropTypes.string, - })).isRequired, - value: PropTypes.array.isRequired, -}; - export default ColumnSort; diff --git a/src/ContextMenu/index.js b/src/ContextMenu/index.js index 3f26d67ae..89e0ef5fa 100644 --- a/src/ContextMenu/index.js +++ b/src/ContextMenu/index.js @@ -1,10 +1,9 @@ import React, { memo, useCallback, useEffect, useRef, useState } from 'react'; import Dropdown from 'react-bootstrap/Dropdown'; -import PropTypes from 'prop-types'; import * as styles from './styles.module.scss'; -const ContextMenu = ({ children, className, disabled, options }) => { +const ContextMenu = ({ children, className = '', disabled = false, options }) => { const areaRef = useRef(); const [contextMenuPosition, setContextMenuPosition] = useState(null); @@ -62,16 +61,4 @@ const ContextMenu = ({ children, className, disabled, options }) => { ; }; -ContextMenu.defaultProps = { - className: '', - disabled: false, -}; - -ContextMenu.propTypes = { - children: PropTypes.node.isRequired, - className: PropTypes.string, - disabled: PropTypes.bool, - options: PropTypes.element.isRequired, -}; - export default memo(ContextMenu); diff --git a/src/CursorGpsDisplay/MenuPopover/index.js b/src/CursorGpsDisplay/MenuPopover/index.js index 89f6d2ad8..758b94e29 100644 --- a/src/CursorGpsDisplay/MenuPopover/index.js +++ b/src/CursorGpsDisplay/MenuPopover/index.js @@ -1,4 +1,4 @@ -import React, { forwardRef, useCallback, useEffect, useRef, useState } from 'react'; +import React, { useCallback, useEffect, useRef, useState } from 'react'; import Popover from 'react-bootstrap/Popover'; import { useDispatch } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -12,7 +12,7 @@ import GpsInput from '../../GpsInput'; import * as styles from './styles.module.scss'; -const MenuPopover = ({ buttonRef, className, onClose, ...otherProps }, ref) => { +const MenuPopover = ({ buttonRef, className, onClose, ref, ...otherProps }) => { const dispatch = useDispatch(); const jumpToLocation = useJumpToLocation(); const { t } = useTranslation('map-controls', { keyPrefix: 'cursorGPSDisplay.menuPopover' }); @@ -134,4 +134,4 @@ const MenuPopover = ({ buttonRef, className, onClose, ...otherProps }, ref) => { ; }; -export default forwardRef(MenuPopover); +export default MenuPopover; diff --git a/src/DasIcon/index.js b/src/DasIcon/index.js index b7282f1f6..f60148570 100644 --- a/src/DasIcon/index.js +++ b/src/DasIcon/index.js @@ -1,5 +1,4 @@ import React, { memo } from 'react'; -import PropTypes from 'prop-types'; const spriteMappings = { events: { @@ -37,13 +36,3 @@ const DasIcon = ({ type, iconId, color = 'gray', dispatch: _dispatch, className, }; export default memo(DasIcon); - -DasIcon.defaultProps = { - color: 'white', -}; - -DasIcon.propTypes = { - type: PropTypes.string.isRequired, - iconId: PropTypes.string.isRequired, - color: PropTypes.string, -}; diff --git a/src/DataExportModal/index.js b/src/DataExportModal/index.js index 35d618fc1..0104f5f3a 100644 --- a/src/DataExportModal/index.js +++ b/src/DataExportModal/index.js @@ -2,7 +2,6 @@ import React, { memo, useEffect, useState } from 'react'; import Button from 'react-bootstrap/Button'; import { CancelToken } from 'axios'; import Modal from 'react-bootstrap/Modal'; -import PropTypes from 'prop-types'; import { useDispatch } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -15,7 +14,7 @@ import LoadingOverlay from '../LoadingOverlay'; const reportExportTracker = trackEventFactory(REPORT_EXPORT_CATEGORY); -const DataExportModal = ({ children, id, params, paramString, title, url }) => { +const DataExportModal = ({ children = null, id, params = {}, paramString = '', title, url }) => { const dispatch = useDispatch(); const { t } = useTranslation('menu-drawer', { keyPrefix: 'dataExportModal' }); @@ -72,19 +71,4 @@ const DataExportModal = ({ children, id, params, paramString, title, url }) => { ; }; -DataExportModal.defaultProps = { - children: null, - params: {}, - paramString: '', -}; - -DataExportModal.propTypes = { - children: PropTypes.node, - id: PropTypes.string.isRequired, - params: PropTypes.object, - paramString: PropTypes.string, - title: PropTypes.string.isRequired, - url: PropTypes.string.isRequired, -}; - export default memo(DataExportModal); diff --git a/src/DatePicker/CalendarPopper/MonthPicker/index.js b/src/DatePicker/CalendarPopper/MonthPicker/index.js index 1a446c1b2..29283866b 100644 --- a/src/DatePicker/CalendarPopper/MonthPicker/index.js +++ b/src/DatePicker/CalendarPopper/MonthPicker/index.js @@ -1,4 +1,4 @@ -import React, { forwardRef, useRef, useState } from 'react'; +import React, { useRef, useState } from 'react'; import DatePicker from 'react-datepicker'; import { getMonth, getYear } from 'date-fns'; import { useTranslation } from 'react-i18next'; @@ -10,17 +10,17 @@ import { getCurrentLocale } from '../../../utils/datetime'; import * as styles from './styles.module.scss'; -// eslint-disable-next-line react/display-name -const Input = forwardRef(({ +const Input = ({ className, date, isMonthCalendarOpen, onClick, // We ignore the react-datepicker internals for the keydown event and just handle the Escape ourselves. onKeyDown: _onKeyDown, + ref, setIsMonthCalendarOpen, ...otherProps -}, ref) => { +}) => { const { i18n, t } = useTranslation('components', { keyPrefix: 'datePicker.calendarPopper.monthPicker' }); const onButtonClick = (event) => { @@ -52,7 +52,7 @@ const Input = forwardRef(({
; -}); +}; const Header = ({ date, diff --git a/src/DatePicker/CalendarPopper/index.js b/src/DatePicker/CalendarPopper/index.js index c070d68ba..c266a21cd 100644 --- a/src/DatePicker/CalendarPopper/index.js +++ b/src/DatePicker/CalendarPopper/index.js @@ -1,4 +1,4 @@ -import React, { forwardRef, useMemo, useRef } from 'react'; +import React, { useMemo, useRef } from 'react'; import DatePicker from 'react-datepicker'; import { useTranslation } from 'react-i18next'; @@ -10,16 +10,16 @@ import MonthPicker from './MonthPicker'; import 'react-datepicker/dist/react-datepicker.css'; import * as styles from './styles.module.scss'; -// eslint-disable-next-line react/display-name -const Input = forwardRef(({ +const Input = ({ className, isOpen, onClick, // We ignore the react-datepicker internals for the keydown event and just handle the Escape ourselves. onKeyDown: _onKeyDown, + ref, setIsOpen, ...otherProps -}, ref) => { +}) => { const { t } = useTranslation('components', { keyPrefix: 'datePicker.calendarPopper' }); const onButtonClick = (event) => { @@ -49,7 +49,7 @@ const Input = forwardRef(({ >
; -}); +}; // eslint-disable-next-line react/display-name const getRenderCustomHeader = (maxDate, minDate, onKeyDown) => ({ diff --git a/src/DatePicker/index.js b/src/DatePicker/index.js index 33eeea836..6b4c4ca1a 100644 --- a/src/DatePicker/index.js +++ b/src/DatePicker/index.js @@ -1,4 +1,4 @@ -import React, { forwardRef, memo, useEffect, useImperativeHandle, useRef, useState } from 'react'; +import React, { memo, useEffect, useImperativeHandle, useRef, useState } from 'react'; import { parseISO } from 'date-fns'; import { useTranslation } from 'react-i18next'; @@ -37,10 +37,11 @@ const DatePicker = ({ onFocus = null, reactDatePickerProps = {}, readOnly = false, + ref, required = false, value, ...otherProps -}, ref) => { +}) => { const { t } = useTranslation('components', { keyPrefix: 'datePicker' }); const dayInputRef = useRef(); @@ -381,4 +382,4 @@ const DatePicker = ({ export { EMPTY_DATE_VALUE }; -export default memo(forwardRef(DatePicker)); +export default memo(DatePicker); diff --git a/src/DateRangeSelector/index.js b/src/DateRangeSelector/index.js index 7847240d7..d30998137 100644 --- a/src/DateRangeSelector/index.js +++ b/src/DateRangeSelector/index.js @@ -1,6 +1,5 @@ import React, { memo, useCallback, useEffect, useRef, useState } from 'react'; import Button from 'react-bootstrap/Button'; -import PropTypes from 'prop-types'; import { isValid, parseISO, subSeconds } from 'date-fns'; import DateTimePicker, { EMPTY_DATE_TIME_VALUE } from '../DateTimePicker'; @@ -20,17 +19,17 @@ import DateRangeSelectionString from './DateRangeSelectionString'; import { useTranslation } from 'react-i18next'; const DateRangeSelector = ({ + maxDate = new Date(), + requireStart = false, + requireEnd = false, + onClickDateRangePreset = null, + showPresets = false, startDate, endDate, endMaxDate, onStartDateChange, onEndDateChange, - onClickDateRangePreset, onFilterSettingsToggle, - maxDate, - requireStart, - requireEnd, - showPresets, isAtDefault = false, defaultFriendlyString, startDateNullMessage, @@ -90,7 +89,7 @@ const DateRangeSelector = ({ }; const onDateRangePresetButtonClick = (lower, upper, label) => { - onClickDateRangePreset({ lower, upper }, label); + onClickDateRangePreset?.({ lower, upper }, label); if (!upper) { setEndDateTime(EMPTY_DATE_TIME_VALUE); @@ -209,31 +208,4 @@ const DateRangeSelector = ({
; }; -DateRangeSelector.defaultProps = { - maxDate: new Date(), - requireStart: false, - requireEnd: false, - format: 'yyyy-MM-dd HH:mm', - onClickDateRangePreset: () => null, - showPresets: false, -}; - -DateRangeSelector.propTypes = { - endDate: PropTypes.instanceOf(Date), - endDateLabel: PropTypes.string, - endDateLabelClass: PropTypes.string, - endDateNullMessage: PropTypes.string, - maxDate: PropTypes.instanceOf(Date), - onEndDateChange: PropTypes.func.isRequired, - onStartDateChange: PropTypes.func.isRequired, - onClickDateRangePreset: PropTypes.func, - requireStart: PropTypes.bool, - requireEnd: PropTypes.bool, - showPresets: PropTypes.bool, - startDate: PropTypes.instanceOf(Date), - startDateLabel: PropTypes.string, - startDateLabelClass: PropTypes.string, - startDateNullMessage: PropTypes.string, -}; - export default memo(DateRangeSelector); diff --git a/src/DateTime/index.js b/src/DateTime/index.js index 482813104..a84ff789f 100644 --- a/src/DateTime/index.js +++ b/src/DateTime/index.js @@ -1,12 +1,11 @@ import React from 'react'; -import PropTypes from 'prop-types'; import TimeAgo from '../TimeAgo'; import { STANDARD_DATE_FORMAT, generateCurrentTimeZoneTitle, format } from '../utils/datetime'; import * as styles from './styles.module.scss'; -const DateTime = ({ date, showElapsed, className, ...rest }) => { +const DateTime = ({ date, showElapsed = true, className = '', ...rest }) => { if (!date){ return null; @@ -22,15 +21,4 @@ const DateTime = ({ date, showElapsed, className, ...rest }) => {
; }; -DateTime.defaultProps = { - showElapsed: true, - className: '' -}; - -DateTime.propTypes = { - className: PropTypes.string, - date: PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]).isRequired, - showElapsed: PropTypes.bool, -}; - export default DateTime; diff --git a/src/DateTimePicker/index.js b/src/DateTimePicker/index.js index 9ab9a6fbe..55bfc39e2 100644 --- a/src/DateTimePicker/index.js +++ b/src/DateTimePicker/index.js @@ -1,4 +1,4 @@ -import React, { forwardRef, memo, useImperativeHandle, useRef } from 'react'; +import React, { memo, useImperativeHandle, useRef } from 'react'; import { getMaxDateAndTime, getMinDateAndTime } from './utils'; @@ -20,11 +20,12 @@ const DateTimePicker = ({ onChange, onFocus = null, readOnly = false, + ref, required = false, timePickerProps = {}, value, ...otherProps -}, ref) => { +}) => { const datePickerRef = useRef(); const innerRef = useRef(); @@ -76,4 +77,4 @@ const DateTimePicker = ({ ; }; -export default memo(forwardRef(DateTimePicker)); +export default memo(DateTimePicker); diff --git a/src/DelayedUnmount/index.js b/src/DelayedUnmount/index.js index f90cca738..df21ea1e1 100644 --- a/src/DelayedUnmount/index.js +++ b/src/DelayedUnmount/index.js @@ -1,5 +1,4 @@ import { memo, useRef, useState, useEffect } from 'react'; -import PropTypes from 'prop-types'; const DelayedUnmount = (props) => { const { children, isMounted, delay = 400 } = props; @@ -26,9 +25,4 @@ const DelayedUnmount = (props) => { }; -DelayedUnmount.propTypes = { - isMounted: PropTypes.bool, - delay: PropTypes.number, -}; - -export default memo(DelayedUnmount); \ No newline at end of file +export default memo(DelayedUnmount); diff --git a/src/DetailViewComponents/ActivitySection/AttachmentListItem/index.js b/src/DetailViewComponents/ActivitySection/AttachmentListItem/index.js index def45bb7c..a885ea5d6 100644 --- a/src/DetailViewComponents/ActivitySection/AttachmentListItem/index.js +++ b/src/DetailViewComponents/ActivitySection/AttachmentListItem/index.js @@ -1,6 +1,5 @@ -import React, { forwardRef, useCallback, useContext, useEffect, useMemo, useState } from 'react'; +import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react'; import Collapse from 'react-bootstrap/Collapse'; -import PropTypes from 'prop-types'; import { useDispatch } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -24,7 +23,14 @@ import ItemActionButton from '../ItemActionButton'; import * as styles from '../styles.module.scss'; -const AttachmentListItem = ({ attachment, cardsExpanded, onCollapse, onDelete, onExpand }, ref) => { +const AttachmentListItem = ({ + attachment, + cardsExpanded = [], + onCollapse = null, + onDelete = null, + onExpand = null, + ref, +}) => { const dispatch = useDispatch(); const tracker = useContext(TrackerContext); @@ -182,29 +188,4 @@ const AttachmentListItem = ({ attachment, cardsExpanded, onCollapse, onDelete, o ; }; -const AttachmentListItemForwardRef = forwardRef(AttachmentListItem); - -AttachmentListItemForwardRef.defaultProps = { - cardsExpanded: [], - onCollapse: null, - onDelete: null, - onExpand: null, -}; - -AttachmentListItemForwardRef.propTypes = { - attachment: PropTypes.shape({ - id: PropTypes.string, - name: PropTypes.string, - url: PropTypes.string, - filename: PropTypes.string, - updates: PropTypes.arrayOf(PropTypes.shape({ - time: PropTypes.string, - })), - }).isRequired, - cardsExpanded: PropTypes.array, - onCollapse: PropTypes.func, - onDelete: PropTypes.func, - onExpand: PropTypes.func, -}; - -export default AttachmentListItemForwardRef; +export default AttachmentListItem; diff --git a/src/DetailViewComponents/ActivitySection/ItemActionButton/index.js b/src/DetailViewComponents/ActivitySection/ItemActionButton/index.js index 65c612f1c..23426fb95 100644 --- a/src/DetailViewComponents/ActivitySection/ItemActionButton/index.js +++ b/src/DetailViewComponents/ActivitySection/ItemActionButton/index.js @@ -1,6 +1,5 @@ import React from 'react'; import OverlayTrigger from 'react-bootstrap/OverlayTrigger'; -import PropTypes from 'prop-types'; import Tooltip from 'react-bootstrap/Tooltip'; import * as styles from './styles.module.scss'; @@ -8,7 +7,7 @@ import * as styles from './styles.module.scss'; const TOOLTIP_SHOW_TIME = 400; const TOOLTIP_HIDE_TIME = 200; -const ItemActionButton = ({ children, onClick, tooltip, ...restProps }) => tooltip ? {tooltip} :
} @@ -18,15 +17,4 @@ const ItemActionButton = ({ children, onClick, tooltip, ...restProps }) => ; -ItemActionButton.defaultProps = { - onClick: null, - tooltip: null, -}; - -ItemActionButton.propTypes = { - children: PropTypes.node.isRequired, - onClick: PropTypes.func, - tooltip: PropTypes.string, -}; - export default ItemActionButton; diff --git a/src/DetailViewComponents/ActivitySection/NoteListItem/index.js b/src/DetailViewComponents/ActivitySection/NoteListItem/index.js index df1789f74..ba6d10b6c 100644 --- a/src/DetailViewComponents/ActivitySection/NoteListItem/index.js +++ b/src/DetailViewComponents/ActivitySection/NoteListItem/index.js @@ -1,7 +1,6 @@ -import React, { forwardRef, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'; +import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'; import Button from 'react-bootstrap/Button'; import Collapse from 'react-bootstrap/Collapse'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { ReactComponent as ArrowDownSimpleIcon } from '../../../common/images/icons/arrow-down-simple.svg'; @@ -23,11 +22,12 @@ const NoteListItem = ({ note, onCollapse, onChange, - onDelete, + onDelete = null, onCancel, onDone, onExpand, -}, ref) => { + ref, +}) => { const textareaRef = useRef(); const tracker = useContext(TrackerContext); const isNew = useMemo(() => !note.id, [note.id]); @@ -178,27 +178,4 @@ const NoteListItem = ({ ; }; -const NoteListItemForwardRef = forwardRef(NoteListItem); - -NoteListItemForwardRef.defaultProps = { - onDelete: null, -}; - -NoteListItemForwardRef.propTypes = { - cardsExpanded: PropTypes.array.isRequired, - note: PropTypes.shape({ - id: PropTypes.string, - text: PropTypes.string, - updates: PropTypes.arrayOf(PropTypes.shape({ - time: PropTypes.string, - })), - }).isRequired, - onCollapse: PropTypes.func.isRequired, - onChange: PropTypes.func.isRequired, - onCancel: PropTypes.func.isRequired, - onDelete: PropTypes.func, - onDone: PropTypes.func.isRequired, - onExpand: PropTypes.func.isRequired, -}; - -export default NoteListItemForwardRef; +export default NoteListItem; diff --git a/src/DetailViewComponents/ActivitySection/index.js b/src/DetailViewComponents/ActivitySection/index.js index 3b22b0954..e8b747996 100644 --- a/src/DetailViewComponents/ActivitySection/index.js +++ b/src/DetailViewComponents/ActivitySection/index.js @@ -1,6 +1,5 @@ -import React, { forwardRef, useCallback, useContext, useEffect, useMemo, useState } from 'react'; +import React, { useCallback, useContext, useEffect, useMemo, useState } from 'react'; import Button from 'react-bootstrap/Button'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { ReactComponent as BulletListIcon } from '../../common/images/icons/bullet-list.svg'; @@ -26,7 +25,7 @@ const ActivitySection = ({ attachments, attachmentsToAdd, containedReports, - endTime, + endTime = null, notes, notesToAdd, onDeleteAttachment, @@ -34,8 +33,9 @@ const ActivitySection = ({ onDeleteNote, onChangeNote, onDoneNote, - startTime, -}, ref) => { + ref, + startTime = null, +}) => { const tracker = useContext(TrackerContext); const { t } = useTranslation('details-view', { keyPrefix: 'activitySection' }); @@ -223,44 +223,4 @@ const ActivitySection = ({
; }; -const ActivitySectionForwardRef = forwardRef(ActivitySection); - -ActivitySectionForwardRef.defaultProps = { - endTime: null, - startTime: null, -}; - -ActivitySectionForwardRef.propTypes = { - attachments: PropTypes.arrayOf(PropTypes.shape({ - created_at: PropTypes.string, - id: PropTypes.string, - updated_at: PropTypes.string, - })).isRequired, - attachmentsToAdd: PropTypes.arrayOf(PropTypes.shape({ - creationDate: PropTypes.string, - file: PropTypes.shape({ - name: PropTypes.string, - }), - })).isRequired, - containedReports: PropTypes.arrayOf(PropTypes.shape({ - id: PropTypes.string, - })).isRequired, - endTime: PropTypes.instanceOf(Date), - notes: PropTypes.arrayOf(PropTypes.shape({ - created_at: PropTypes.string, - id: PropTypes.string, - updated_at: PropTypes.string, - })).isRequired, - notesToAdd: PropTypes.arrayOf(PropTypes.shape({ - creationDate: PropTypes.string, - text: PropTypes.string, - })).isRequired, - onDeleteAttachment: PropTypes.func.isRequired, - onDeleteNote: PropTypes.func.isRequired, - onChangeNote: PropTypes.func.isRequired, - onCancelNote: PropTypes.func.isRequired, - onDoneNote: PropTypes.func.isRequired, - startTime: PropTypes.instanceOf(Date), -}; - -export default ActivitySectionForwardRef; +export default ActivitySection; diff --git a/src/DetailViewComponents/AddReportButton/index.js b/src/DetailViewComponents/AddReportButton/index.js index e139bd039..76d63465c 100644 --- a/src/DetailViewComponents/AddReportButton/index.js +++ b/src/DetailViewComponents/AddReportButton/index.js @@ -1,5 +1,4 @@ import React, { memo } from 'react'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { ReactComponent as DocumentIcon } from '../../common/images/icons/document.svg'; @@ -21,6 +20,4 @@ const AddReportButton = ({ className, ...rest }) => { />; }; -AddReportButton.propTypes = { className: PropTypes.string }; - export default memo(AddReportButton); diff --git a/src/DetailViewComponents/HistorySection/UpdateListItem/index.js b/src/DetailViewComponents/HistorySection/UpdateListItem/index.js index f39008afd..ee6ec54ee 100644 --- a/src/DetailViewComponents/HistorySection/UpdateListItem/index.js +++ b/src/DetailViewComponents/HistorySection/UpdateListItem/index.js @@ -1,5 +1,4 @@ import React, { memo } from 'react'; -import PropTypes from 'prop-types'; import DateTime from '../../../DateTime'; @@ -16,13 +15,4 @@ const UpdateListItem = ({ message, time, user }) =>
  • ; -UpdateListItem.propTypes = { - message: PropTypes.string.isRequired, - time: PropTypes.string.isRequired, - user: PropTypes.shape({ - first_name: PropTypes.string, - last_name: PropTypes.string, - }).isRequired, -}; - export default memo(UpdateListItem); diff --git a/src/DetailViewComponents/HistorySection/index.js b/src/DetailViewComponents/HistorySection/index.js index 92402dc8e..ebde57cb1 100644 --- a/src/DetailViewComponents/HistorySection/index.js +++ b/src/DetailViewComponents/HistorySection/index.js @@ -1,5 +1,4 @@ import React, { memo, useCallback, useContext, useMemo } from 'react'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { ReactComponent as HistoryIcon } from '../../common/images/icons/history.svg'; @@ -13,7 +12,7 @@ import * as styles from './styles.module.scss'; const FILTERED_UPDATE_MESSAGES = ['Updated fields: ', 'Note Updated: ']; -const HistorySection = ({ className, updates }) => { +const HistorySection = ({ className = '', updates }) => { const tracker = useContext(TrackerContext); const { t } = useTranslation('details-view', { keyPrefix: 'historySection' }); @@ -58,17 +57,4 @@ const HistorySection = ({ className, updates }) => { ; }; -HistorySection.defaultProps = { - className: '', -}; - -HistorySection.propTypes = { - className: PropTypes.string, - updates: PropTypes.arrayOf(PropTypes.shape({ - message: PropTypes.string, - time: PropTypes.string, - user: PropTypes.object, - })).isRequired, -}; - export default memo(HistorySection); diff --git a/src/DroppedMarkerPopup/index.js b/src/DroppedMarkerPopup/index.js index 57087bfef..0dccce381 100644 --- a/src/DroppedMarkerPopup/index.js +++ b/src/DroppedMarkerPopup/index.js @@ -1,5 +1,4 @@ import React, { memo, useCallback } from 'react'; -import PropTypes from 'prop-types'; import { useDispatch } from 'react-redux'; import { hidePopup } from '../ducks/popup'; @@ -32,8 +31,4 @@ const DroppedMarkerPopup = ({ data: { location }, id }) => { ; }; -DroppedMarkerPopup.propTypes = { - data: PropTypes.object.isRequired, -}; - export default memo(DroppedMarkerPopup); diff --git a/src/EarthRangerLogo/index.js b/src/EarthRangerLogo/index.js index 0da29a867..adc90e4db 100644 --- a/src/EarthRangerLogo/index.js +++ b/src/EarthRangerLogo/index.js @@ -1,5 +1,4 @@ import React, { memo } from 'react'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; const SOURCES = { @@ -8,7 +7,7 @@ const SOURCES = { vertical: '#earth-ranger-logo-vertical', }; -const EarthRangerLogo = ({ type, ...restProps }) => { +const EarthRangerLogo = ({ type = 'horizontalWhite', ...restProps }) => { const { t } = useTranslation('components', { keyPrefix: 'earthRangerLogo' }); return @@ -18,12 +17,4 @@ const EarthRangerLogo = ({ type, ...restProps }) => { ; }; -EarthRangerLogo.defaultProps = { - type: 'horizontalWhite', -}; - -EarthRangerLogo.propTypes = { - type: PropTypes.string, -}; - export default memo(EarthRangerLogo); diff --git a/src/EarthRangerMap/index.js b/src/EarthRangerMap/index.js index f4eb184da..c93a85e59 100644 --- a/src/EarthRangerMap/index.js +++ b/src/EarthRangerMap/index.js @@ -1,83 +1,72 @@ +import React, { memo, useCallback, useContext, useEffect, useRef, useState } from 'react'; import mapboxgl from 'mapbox-gl'; -import React, { Fragment, forwardRef, memo, useCallback, useRef, useState, useEffect } from 'react'; -import { connect, useSelector } from 'react-redux'; +import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; -import { MapContext } from '../App'; -import MapTerrain from '../MapTerrain'; -import SkyLayer from '../SkyLayer'; import mapLabel from '../common/images/icons/symbol-label-outline.png'; -import { REACT_APP_MAPBOX_TOKEN, REACT_APP_BASE_MAP_STYLES, MIN_ZOOM, MAX_ZOOM, MAPBOX_STYLE_LAYER_SOURCE_TYPES } from '../constants'; +import { MapContext } from '../App'; +import { + MAPBOX_STYLE_LAYER_SOURCE_TYPES, + MAX_ZOOM, + MIN_ZOOM, + REACT_APP_BASE_MAP_STYLES, + REACT_APP_MAPBOX_TOKEN, +} from '../constants'; + +import Attribution from './Attribution'; +import BaseLayerRenderer from '../BaseLayerRenderer'; +import MapTerrain from '../MapTerrain'; +import SkyLayer from '../SkyLayer'; import 'mapbox-gl/dist/mapbox-gl.css'; import '../Map/Map.scss'; -import BaseLayerRenderer from '../BaseLayerRenderer'; -import Attribution from './Attribution'; mapboxgl.accessToken = REACT_APP_MAPBOX_TOKEN; -export function withMap(Component) { - return forwardRef((props, ref) => {map => }); // eslint-disable-line react/display-name -} - -const getStartingMapPositionValues = (savedMapPosition = {}) => { - if (savedMapPosition?.center && savedMapPosition?.zoom) { - const { bearing, center, pitch, zoom } = savedMapPosition; - - return { - bearing, - center, - pitch, - zoom, - }; - } +// eslint-disable-next-line react/display-name +export const withMap = (Component) => (props) => { + const map = useContext(MapContext); - return {}; + return ; }; -const EarthRangerMap = (props) => { - const { currentBaseLayer, children, controls, onMapLoaded, dispatch: _dispatch, ...rest } = props; +const getStartingMapPositionValues = (mapPosition) => mapPosition?.center && mapPosition.zoom + ? { bearing: mapPosition.bearing, center: mapPosition.center, pitch: mapPosition.pitch, zoom: mapPosition.zoom } + : {}; +const EarthRangerMap = ({ children, controls, onMapLoaded, ...otherProps }) => { const { t } = useTranslation('map-controls', { keyPrefix: 'earthRangerMap' }); + const currentBaseLayer = useSelector(state => state.view.currentBaseLayer); const mapPosition = useSelector(state => state.data.mapPosition); - const [mapLoaded, setMapLoaded] = useState(false); const baseStyleRef = useRef(REACT_APP_BASE_MAP_STYLES); + const mapContainerRef = useRef(null); + const mapRef = useRef(null); + + const [mapLoaded, setMapLoaded] = useState(false); const onLoad = useCallback(({ target: map }) => { map.loadImage(mapLabel, (_err, img) => { - map.addImage('name-label-78-sdf', img, { - sdf: true, - }); + map.addImage('name-label-78-sdf', img, { sdf: true }); - const scale = new mapboxgl.ScaleControl({ - maxWidth: 80, - }); + const scale = new mapboxgl.ScaleControl({ maxWidth: 80 }); map.addControl(new mapboxgl.NavigationControl({ showZoom: false }), 'top-right'); map.addControl(new mapboxgl.NavigationControl({ showCompass: false }), 'bottom-right'); map.addControl(scale, 'bottom-right'); - }); onMapLoaded && onMapLoaded(map); + setMapLoaded(true); }, [onMapLoaded]); - const map = useRef(null); - const mapContainer = useRef(null); - useEffect(() => { - if (!map.current) { - const initialMapPositionOptions = getStartingMapPositionValues(mapPosition); - - map.current = new mapboxgl.Map({ - container: mapContainer.current, - style: REACT_APP_BASE_MAP_STYLES, - minZoom: MIN_ZOOM, - maxZoom: MAX_ZOOM, + if (!mapRef.current) { + mapRef.current = new mapboxgl.Map({ + container: mapContainerRef.current, locale: { 'Map.Title': t('mapTitle'), 'NavigationControl.ResetBearing': t('navigationResetBearing'), @@ -85,44 +74,48 @@ const EarthRangerMap = (props) => { 'NavigationControl.ZoomOut': t('navigationZoomOut'), }, logoPosition: 'bottom-left', - ...initialMapPositionOptions, + maxZoom: MAX_ZOOM, + minZoom: MIN_ZOOM, + style: REACT_APP_BASE_MAP_STYLES, + ...getStartingMapPositionValues(mapPosition), }); - map.current.on('load', onLoad); + + mapRef.current.on('load', onLoad); } }, [mapPosition, onLoad, t]); useEffect(() => { - if (map.current && currentBaseLayer && MAPBOX_STYLE_LAYER_SOURCE_TYPES.includes(currentBaseLayer.attributes.type)) { + if (mapRef.current + && currentBaseLayer + && MAPBOX_STYLE_LAYER_SOURCE_TYPES.includes(currentBaseLayer.attributes.type)) { const value = currentBaseLayer.attributes.styleUrl || currentBaseLayer.attributes.url; if (value !== baseStyleRef.current) { - map.current.setStyle(currentBaseLayer.attributes.styleUrl || currentBaseLayer.attributes.url); + mapRef.current.setStyle(currentBaseLayer.attributes.styleUrl || currentBaseLayer.attributes.url); baseStyleRef.current = value; } } }, [currentBaseLayer]); - return + return
    -
    -
    - {mapLoaded && - - -
    - {controls} -
    +
    + + {mapLoaded && <> + + + + +
    {controls}
    + {children} + + - } + }
    ; }; - -const mapStateToProps = ({ view: { currentBaseLayer } }) => ({ - currentBaseLayer, -}); - -export default connect(mapStateToProps, null)(memo(EarthRangerMap)); +export default memo(EarthRangerMap); diff --git a/src/EditableItem/AttachmentControls.js b/src/EditableItem/AttachmentControls.js index b31adca1b..fe820ff58 100644 --- a/src/EditableItem/AttachmentControls.js +++ b/src/EditableItem/AttachmentControls.js @@ -1,14 +1,11 @@ import React, { memo, useRef, useState } from 'react'; import { connect } from 'react-redux'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { convertFileListToArray } from '../utils/file'; import { addModal } from '../ducks/modals'; -import { analyticsMetadataProps } from '../proptypes'; - import NoteModal from '../NoteModal'; import { trackEvent } from '../utils/analytics'; @@ -27,7 +24,7 @@ const AttachmentControls = ({ addModal, analyticsMetadata, children, - allowMultipleFiles, + allowMultipleFiles = true, onAddFiles, onSaveNote }) => { @@ -107,14 +104,3 @@ const AttachmentControls = ({ export default connect(null, { addModal })(memo(AttachmentControls)); export { AttachmentButton }; - -AttachmentControls.defaultProps = { - allowMultipleFiles: true, -}; - -AttachmentControls.propTypes = { - analyticsMetadata: analyticsMetadataProps, - allowMultipleFiles: PropTypes.bool, - onAddFiles: PropTypes.func.isRequired, - onSaveNote: PropTypes.func.isRequired, -}; diff --git a/src/EditableItem/AttachmentList.js b/src/EditableItem/AttachmentList.js index 21efd4b61..069b668f9 100644 --- a/src/EditableItem/AttachmentList.js +++ b/src/EditableItem/AttachmentList.js @@ -1,5 +1,4 @@ import React, { memo } from 'react'; -import PropTypes from 'prop-types'; import DateTime from '../DateTime'; import { ReactComponent as AttachmentIcon } from '../common/images/icons/attachment.svg'; @@ -8,7 +7,6 @@ import { ReactComponent as ClearIcon } from '../common/images/icons/close-icon.s import * as styles from './styles.module.scss'; - const AttachmentList = (props) => { const { className = '', files, notes, onDeleteFile, onDeleteNote, onClickFile, onClickNote } = props; const hasItems = !!(files.length || notes.length); @@ -51,13 +49,4 @@ const AttachmentList = (props) => { ; }; -AttachmentList.propTypes = { - files: PropTypes.array.isRequired, - notes: PropTypes.array.isRequired, - onClickFile: PropTypes.func.isRequired, - onClickNote: PropTypes.func.isRequired, - onDeleteFile: PropTypes.func.isRequired, - onDeleteNote: PropTypes.func.isRequired, -}; - -export default memo(AttachmentList); \ No newline at end of file +export default memo(AttachmentList); diff --git a/src/EditableItem/Body.js b/src/EditableItem/Body.js index d49e170af..612595519 100644 --- a/src/EditableItem/Body.js +++ b/src/EditableItem/Body.js @@ -1,13 +1,12 @@ -import React, { forwardRef, memo } from 'react'; +import React, { memo } from 'react'; import * as styles from './styles.module.scss'; -const Body = (props, ref) => { - const { children, className = '' } = props; +const Body = ({ children, className = '', ref }) =>
    + {children} +
    ; - return
    - {children} -
    ; -}; - -export default memo(forwardRef(Body)); \ No newline at end of file +export default memo(Body); diff --git a/src/EditableItem/Footer.js b/src/EditableItem/Footer.js index ab2e8d776..eaea2f4fb 100644 --- a/src/EditableItem/Footer.js +++ b/src/EditableItem/Footer.js @@ -1,5 +1,4 @@ import React, { memo } from 'react'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import Button from 'react-bootstrap/Button'; @@ -47,12 +46,3 @@ const Footer = ({ }; export default memo(Footer); - -Footer.propTypes = { - cancelTitle: PropTypes.string, - onCancel: PropTypes.func.isRequired, - onSave: PropTypes.func.isRequired, - onStateToggle: PropTypes.func, - data: PropTypes.object.isRequired, - isActiveState: PropTypes.bool.isRequired, -}; \ No newline at end of file diff --git a/src/EditableItem/Header.js b/src/EditableItem/Header.js index eae45b901..b232f5fd3 100644 --- a/src/EditableItem/Header.js +++ b/src/EditableItem/Header.js @@ -1,10 +1,8 @@ -import React, { forwardRef, memo, useCallback, useContext, useMemo, useState, useRef } from 'react'; +import React, { memo, useCallback, useContext, useMemo, useState, useRef } from 'react'; import Overlay from 'react-bootstrap/Overlay'; import Popover from 'react-bootstrap/Popover'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; -import { analyticsMetadataProps } from '../proptypes'; import { BREAKPOINTS } from '../constants'; import { FormDataContext } from './context'; import { trackEvent } from '../utils/analytics'; @@ -95,8 +93,7 @@ const EditableItemHeader = ({ ; - // eslint-disable-next-line react/display-name - const HistoryPopover = forwardRef((props, ref) => + const HistoryPopover = (props) => {t('sectionTitle')} @@ -119,7 +116,7 @@ const EditableItemHeader = ({ )} - ); + ; return

    @@ -179,16 +176,4 @@ const EditableItemHeader = ({

    ; }; -EditableItemHeader.propTypes = { - afterMenuToggle: PropTypes.func, - analyticsMetadata: analyticsMetadataProps, - data: PropTypes.object, - Icon: PropTypes.oneOfType([PropTypes.element, PropTypes.node]), - maxTitleLength: PropTypes.number, - MenuContent: PropTypes.oneOfType([PropTypes.element, PropTypes.node]), - onTitleChange: PropTypes.func.isRequired, - priority: PropTypes.number, - title: PropTypes.string, -}; - export default memo(EditableItemHeader); diff --git a/src/EditableItem/context.js b/src/EditableItem/context.js index 09d743115..6e84843de 100644 --- a/src/EditableItem/context.js +++ b/src/EditableItem/context.js @@ -1,12 +1,13 @@ -import React, { createContext, useContext, forwardRef } from 'react'; +import React, { createContext, useContext } from 'react'; const FormDataContext = createContext(); -const withFormDataContext = Component => forwardRef((props, ref) => { /* eslint-disable-line react/display-name */ +// eslint-disable-next-line react/display-name +const withFormDataContext = Component => ({ ref, ...otherProps }) => { const data = useContext(FormDataContext); const optionalProps = {}; if (ref) optionalProps.ref = ref; - return ; -}); + return ; +}; export { FormDataContext, withFormDataContext }; \ No newline at end of file diff --git a/src/EditableItem/index.js b/src/EditableItem/index.js index 7afbca7da..d6abb7f60 100644 --- a/src/EditableItem/index.js +++ b/src/EditableItem/index.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import EditableItemModal from './Modal'; import EditableItemHeader from './Header'; @@ -26,7 +25,3 @@ EditableItem.Footer = withFormDataContext(EditableItemFooter); EditableItem.ContextProvider = FormDataContext.Provider; export default EditableItem; - -EditableItem.propTypes = { - data: PropTypes.any.isRequired, -}; \ No newline at end of file diff --git a/src/ErrorBoundary/index.js b/src/ErrorBoundary/index.js index 8adc65224..83bb2447f 100644 --- a/src/ErrorBoundary/index.js +++ b/src/ErrorBoundary/index.js @@ -1,7 +1,6 @@ import React from 'react'; import Button from 'react-bootstrap/Button'; import { ErrorBoundary } from 'react-error-boundary'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import ErrorMessage from '../ErrorMessage'; @@ -22,8 +21,4 @@ const ErrorBoundaryComponent = ({ children }) => { ; }; -ErrorBoundaryComponent.proptTypes = { - children: PropTypes.node.isRequired, -}; - export default ErrorBoundaryComponent; diff --git a/src/ErrorMessage/index.js b/src/ErrorMessage/index.js index a3ecad3f6..15c659ec4 100644 --- a/src/ErrorMessage/index.js +++ b/src/ErrorMessage/index.js @@ -1,11 +1,10 @@ import React, { memo, useState } from 'react'; import Button from 'react-bootstrap/Button'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import * as styles from './styles.module.scss'; -const ErrorMessage = ({ details, message }) => { +const ErrorMessage = ({ details = '', message = null }) => { const { t } = useTranslation('components', { keyPrefix: 'errorMessage' }); const [detailsShown, showDetails] = useState(false); @@ -32,14 +31,4 @@ const ErrorMessage = ({ details, message }) => { ; }; -ErrorMessage.defaultProps = { - details: '', - message: null, -}; - -ErrorMessage.propTypes = { - details: PropTypes.string, - message: PropTypes.string, -}; - export default memo(ErrorMessage); diff --git a/src/ErrorMessages/index.js b/src/ErrorMessages/index.js index d5eb22a79..5616eb940 100644 --- a/src/ErrorMessages/index.js +++ b/src/ErrorMessages/index.js @@ -2,7 +2,6 @@ import React, { memo, useState } from 'react'; import Accordion from 'react-bootstrap/Accordion'; import Alert from 'react-bootstrap/Alert'; import Button from 'react-bootstrap/Button'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import * as styles from './styles.module.scss'; @@ -36,10 +35,4 @@ const ErrorMessages = ({ errorData, onClose, title }) => { ; }; -ErrorMessages.propTypes = { - errorData: PropTypes.array.isRequired, - onClose: PropTypes.func.isRequired, - title: PropTypes.string.isRequired, -}; - export default memo(ErrorMessages); diff --git a/src/EventFilter/DateFilter/index.js b/src/EventFilter/DateFilter/index.js index 948c969d5..20f91323b 100644 --- a/src/EventFilter/DateFilter/index.js +++ b/src/EventFilter/DateFilter/index.js @@ -1,7 +1,6 @@ import React, { memo } from 'react'; import Popover from 'react-bootstrap/Popover'; import Button from 'react-bootstrap/Button'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { ReactComponent as ClockIcon } from '../../common/images/icons/clock-icon.svg'; @@ -27,9 +26,4 @@ const DateFilter = ({ onClearDateRange, isDateRangeModified }) => { ; }; -DateFilter.propTypes = { - onClearDateRange: PropTypes.func.isRequired, - isDateRangeModified: PropTypes.bool.isRequired -}; - export default memo(DateFilter); diff --git a/src/EventFilter/Filters/index.js b/src/EventFilter/Filters/index.js index 9fdcbca44..6cdc69d57 100644 --- a/src/EventFilter/Filters/index.js +++ b/src/EventFilter/Filters/index.js @@ -4,7 +4,6 @@ import Button from 'react-bootstrap/Button'; import intersection from 'lodash-es/intersection'; import isEqual from 'react-fast-compare'; import uniq from 'lodash-es/uniq'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { ReactComponent as UserIcon } from '../../common/images/icons/user-profile.svg'; @@ -236,23 +235,4 @@ const Filters = ({ ; }; -Filters.propTypes = { - priority: PropTypes.string.isRequired, - reportTypeFilterText: PropTypes.string.isRequired, - isFilterModified: PropTypes.bool.isRequired, - isReportedByFilterModified: PropTypes.bool.isRequired, - isEventTypeFilterEmpty: PropTypes.bool.isRequired, - isPriorityFilterModified: PropTypes.bool.isRequired, - isStateFilterModified: PropTypes.bool.isRequired, - currentFilterReportTypes: PropTypes.array.isRequired, - reporters: PropTypes.array.isRequired, - reportedByFilter: PropTypes.array.isRequired, - eventFilterTracker: PropTypes.object.isRequired, - updateEventFilter: PropTypes.func.isRequired, - eventTypes: PropTypes.array.isRequired, - state: PropTypes.object.isRequired, - onResetPopoverFilters: PropTypes.func.isRequired, - setReportTypeFilterText: PropTypes.func.isRequired -}; - export default memo(Filters); diff --git a/src/EventGeometryLayer/index.js b/src/EventGeometryLayer/index.js index a6899dfed..30991db85 100644 --- a/src/EventGeometryLayer/index.js +++ b/src/EventGeometryLayer/index.js @@ -1,7 +1,6 @@ import { useContext } from 'react'; import { featureCollection } from '@turf/turf'; import { MapContext } from '../App'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { getMapEventFeatureCollectionByTypeWithVirtualDate } from '../selectors/events'; @@ -81,8 +80,4 @@ const EventGeometryLayer = ({ onClick }) => { return null; }; -EventGeometryLayer.propTypes = { - onClick: PropTypes.func.isRequired, -}; - export default EventGeometryLayer; diff --git a/src/EventIcon/index.js b/src/EventIcon/index.js index 848b0966f..72ec62a29 100644 --- a/src/EventIcon/index.js +++ b/src/EventIcon/index.js @@ -1,4 +1,4 @@ -import React, { memo, forwardRef, useMemo } from 'react'; +import React, { memo, useMemo } from 'react'; import isObject from 'lodash/isObject'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -10,7 +10,7 @@ import DasIcon from '../DasIcon'; import * as styles from './styles.module.scss'; -const EventIcon = ({ report, ...rest }, ref) => { +const EventIcon = ({ ref, report, ...rest }) => { const { t } = useTranslation('reports', { keyPrefix: 'eventIcon' }); const eventTypes = useSelector(selectDisplayEventTypes); @@ -50,4 +50,4 @@ const EventIcon = ({ report, ...rest }, ref) => { ; }; -export default memo(forwardRef(EventIcon)); +export default memo(EventIcon); diff --git a/src/EventTypeListItem/index.js b/src/EventTypeListItem/index.js index d4ffdd86b..6eae0d4aa 100644 --- a/src/EventTypeListItem/index.js +++ b/src/EventTypeListItem/index.js @@ -1,5 +1,4 @@ import React, { memo } from 'react'; -import PropTypes from 'prop-types'; import { calcIconColorByPriority } from '../utils/event-types'; @@ -11,11 +10,4 @@ const EventTypeListItem = ({ default_priority, display, icon_id, value }) => ; -EventTypeListItem.propTypes = { - default_priority: PropTypes.number.isRequired, - display: PropTypes.string.isRequired, - icon_id: PropTypes.string.isRequired, - value: PropTypes.string.isRequired, -}; - export default memo(EventTypeListItem); diff --git a/src/EventsLayer/index.js b/src/EventsLayer/index.js index 04b7e9e5e..32352411e 100644 --- a/src/EventsLayer/index.js +++ b/src/EventsLayer/index.js @@ -1,6 +1,5 @@ import React, { memo, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'; import { featureCollection } from '@turf/turf'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import ClusterIcon from '../common/images/icons/cluster-icon.svg'; @@ -61,8 +60,8 @@ const SYMBOL_LAYER_FILTER = [ ]; const EventsLayer = ({ - bounceEventIDs, - mapImages, + bounceEventIDs = [], + mapImages = {}, mapUserLayoutConfig, mapUserLayoutConfigByLayerId, minZoom, @@ -286,18 +285,4 @@ const EventsLayer = ({ ; }; -EventsLayer.defaultProps = { - bounceEventIDs: [], - mapImages: {}, -}; - -EventsLayer.propTypes = { - bounceEventIDs: PropTypes.string, - mapImages: PropTypes.object, - mapUserLayoutConfig: PropTypes.object.isRequired, - mapUserLayoutConfigByLayerId: PropTypes.func.isRequired, - minZoom: PropTypes.number.isRequired, - onEventClick: PropTypes.func.isRequired, -}; - export default memo(withMapViewConfig(EventsLayer)); diff --git a/src/FeatureLayer/FeatureSymbolPopup/index.js b/src/FeatureLayer/FeatureSymbolPopup/index.js index 5fdddf735..a23bb4047 100644 --- a/src/FeatureLayer/FeatureSymbolPopup/index.js +++ b/src/FeatureLayer/FeatureSymbolPopup/index.js @@ -1,5 +1,4 @@ import React, { memo, useCallback } from 'react'; -import PropTypes from 'prop-types'; import { useDispatch } from 'react-redux'; import { hidePopup } from '../../ducks/popup'; @@ -36,9 +35,4 @@ const FeatureSymbolPopup = ({ data, id }) => { ); }; -FeatureSymbolPopup.propTypes = { - data: PropTypes.object.isRequired, - id: PropTypes.string.isRequired, -}; - export default memo(FeatureSymbolPopup); diff --git a/src/FeatureLayer/index.js b/src/FeatureLayer/index.js index 4de0940ae..8b54a0245 100644 --- a/src/FeatureLayer/index.js +++ b/src/FeatureLayer/index.js @@ -1,5 +1,4 @@ import React, { memo, useCallback, useEffect } from 'react'; -import PropTypes from 'prop-types'; import { withMap } from '../EarthRangerMap'; import withMapViewConfig from '../WithMapViewConfig'; @@ -156,10 +155,4 @@ const FeatureLayer = ({ symbols, lines, polygons, onFeatureSymbolClick, mapUserL return null; }; -FeatureLayer.propTypes = { - symbols: PropTypes.object.isRequired, - lines: PropTypes.object.isRequired, - polygons: PropTypes.object.isRequired, -}; - -export default memo(withMap(withMapViewConfig(FeatureLayer))); \ No newline at end of file +export default memo(withMap(withMapViewConfig(FeatureLayer))); diff --git a/src/FeatureLayerList/Content.js b/src/FeatureLayerList/Content.js index 960fdfe56..895151f5f 100644 --- a/src/FeatureLayerList/Content.js +++ b/src/FeatureLayerList/Content.js @@ -1,5 +1,4 @@ import React, { memo } from 'react'; -// import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import Collapsible from 'react-collapsible'; import intersection from 'lodash/intersection'; diff --git a/src/FeedListItem/index.js b/src/FeedListItem/index.js index 6d03842e6..2dc36b247 100644 --- a/src/FeedListItem/index.js +++ b/src/FeedListItem/index.js @@ -1,5 +1,4 @@ import React, { memo, useMemo } from 'react'; -import PropTypes from 'prop-types'; import { adjustColorLightnessByPercentage } from '../utils/colors'; @@ -36,13 +35,3 @@ const FeedListItem = (props) => { }; export default memo(FeedListItem); - -FeedListItem.propTypes = { - className: PropTypes.string, - themeColor: PropTypes.string.isRequired, - themeBgColor: PropTypes.string, - IconComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.string]), - TitleComponent: PropTypes.element.isRequired, - DateComponent: PropTypes.element, - ControlsComponent: PropTypes.element, -}; \ No newline at end of file diff --git a/src/FilterSettingsControl/index.js b/src/FilterSettingsControl/index.js index 2fecaeac8..bdb59f7f3 100644 --- a/src/FilterSettingsControl/index.js +++ b/src/FilterSettingsControl/index.js @@ -1,11 +1,10 @@ -import React, { forwardRef, memo, useCallback, useEffect } from 'react'; +import React, { memo, useCallback, useEffect } from 'react'; import Overlay from 'react-bootstrap/Overlay'; import Popover from 'react-bootstrap/Popover'; import * as styles from './styles.module.scss'; -// eslint-disable-next-line react/display-name -const FilterSettingsControl = forwardRef(({ isOpen, hideFilterSettings, target, container, children }, ref) => { +const FilterSettingsControl = ({ isOpen, hideFilterSettings, target, container, children, ref }) => { const handleKeyDown = useCallback((event) => { event.stopPropagation(); event.preventDefault(); @@ -45,10 +44,6 @@ const FilterSettingsControl = forwardRef(({ isOpen, hideFilterSettings, target,
    ; -}); - -FilterSettingsControl.defaultProps = { - defaultSearchSetting: 'start_dates', }; export default (memo(FilterSettingsControl)); diff --git a/src/FriendlyFilterString/index.js b/src/FriendlyFilterString/index.js index 1ba6eca71..32c224aaf 100644 --- a/src/FriendlyFilterString/index.js +++ b/src/FriendlyFilterString/index.js @@ -1,5 +1,4 @@ import React, { memo, useMemo } from 'react'; -import PropTypes from 'prop-types'; import isEqual from 'react-fast-compare'; import pluralize from 'pluralize'; import { useTranslation } from 'react-i18next'; @@ -48,23 +47,4 @@ const FriendlyFilterString = ({ children, className, dateRange, isFiltered, sort

    ; }; -FriendlyFilterString.propTypes = { - children: null, - className: null, - isFiltered: false, - sortConfig: null, -}; - -FriendlyFilterString.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - dateRange: PropTypes.shape({ - lower: PropTypes.string, - upper: PropTypes.string, - }).isRequired, - isFiltered: PropTypes.bool, - sortConfig: PropTypes.array, - totalFeedCount: PropTypes.number, -}; - export default memo(FriendlyFilterString); diff --git a/src/GetUserLocationButton/index.js b/src/GetUserLocationButton/index.js index 214061d36..e064cd9a4 100644 --- a/src/GetUserLocationButton/index.js +++ b/src/GetUserLocationButton/index.js @@ -1,4 +1,4 @@ -import React, { forwardRef, memo, useState } from 'react'; +import React, { memo, useState } from 'react'; import { toast } from 'react-toastify'; import { useDispatch, useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -12,7 +12,7 @@ import LoadingOverlay from '../LoadingOverlay'; import * as styles from './styles.module.scss'; -const GetUserLocationButton = ({ onClick = null, onGet, renderContent = null, ...otherProps }, ref) => { +const GetUserLocationButton = ({ onClick = null, onGet, ref, renderContent = null, ...otherProps }) => { const dispatch = useDispatch(); const { t } = useTranslation('components', { keyPrefix: 'getUserLocationButton' }); @@ -68,4 +68,4 @@ const GetUserLocationButton = ({ onClick = null, onGet, renderContent = null, .. ; }; -export default memo(forwardRef(GetUserLocationButton)); +export default memo(GetUserLocationButton); diff --git a/src/GpsFormatToggle/index.js b/src/GpsFormatToggle/index.js index f291949a9..2a645f610 100644 --- a/src/GpsFormatToggle/index.js +++ b/src/GpsFormatToggle/index.js @@ -1,4 +1,4 @@ -import React, { forwardRef, memo, useEffect, useImperativeHandle, useRef } from 'react'; +import React, { memo, useEffect, useImperativeHandle, useRef } from 'react'; import { useDispatch, useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -12,7 +12,7 @@ import * as styles from './styles.module.scss'; const gpsFormatTracker = trackEventFactory(GPS_FORMAT_CATEGORY); -const GpsFormatToggle = ({ lat = null, lng = null, name, showGpsString = true, ...otherProps }, ref) => { +const GpsFormatToggle = ({ lat = null, lng = null, name, ref, showGpsString = true, ...otherProps }) => { const dispatch = useDispatch(); const { t } = useTranslation('components', { keyPrefix: 'gpsFormatToggle' }); @@ -81,4 +81,4 @@ const GpsFormatToggle = ({ lat = null, lng = null, name, showGpsString = true, . ; }; -export default memo(forwardRef(GpsFormatToggle)); +export default memo(GpsFormatToggle); diff --git a/src/GpsInput/index.js b/src/GpsInput/index.js index 3a06adc41..61d304a95 100644 --- a/src/GpsInput/index.js +++ b/src/GpsInput/index.js @@ -1,4 +1,4 @@ -import React, { forwardRef, memo, useEffect, useRef, useState } from 'react'; +import React, { memo, useEffect, useRef, useState } from 'react'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -18,10 +18,11 @@ const GpsInput = ({ id, inputRef = null, onChange, + ref, renderButton = null, value = null, ...otherProps -}, ref) => { +}) => { const { t } = useTranslation('components', { keyPrefix: 'gpsInput' }); const gpsFormat = useSelector((state) => state.view.userPreferences.gpsFormat); @@ -119,4 +120,4 @@ const GpsInput = ({ ; }; -export default memo(forwardRef(GpsInput)); +export default memo(GpsInput); diff --git a/src/HamburgerMenuIcon/index.js b/src/HamburgerMenuIcon/index.js index de58d4983..0bfa8a9d3 100644 --- a/src/HamburgerMenuIcon/index.js +++ b/src/HamburgerMenuIcon/index.js @@ -1,9 +1,8 @@ -import React, { forwardRef } from 'react'; -import PropTypes from 'prop-types'; +import React from 'react'; import * as styles from './styles.module.scss'; -const HamburgerMenuIcon = ({ className, isOpen, ...restProps }, ref) => ; -const HamburgerMenuIconForwardRef = forwardRef(HamburgerMenuIcon); - -HamburgerMenuIconForwardRef.defaultProps = { - className: '', - isOpen: false, -}; - -HamburgerMenuIconForwardRef.propTypes = { - className: PropTypes.string, - isOpen: PropTypes.bool, -}; - -export default HamburgerMenuIconForwardRef; \ No newline at end of file +export default HamburgerMenuIcon; diff --git a/src/HeatLayer/index.js b/src/HeatLayer/index.js index e9193b99e..5d3f58c4b 100644 --- a/src/HeatLayer/index.js +++ b/src/HeatLayer/index.js @@ -1,6 +1,5 @@ import { memo, useMemo, useRef } from 'react'; import { centroid } from '@turf/turf'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { LAYER_IDS, MAX_ZOOM } from '../constants'; @@ -45,8 +44,4 @@ const HeatLayer = ({ points }) => { return null; }; -HeatLayer.propTypes = { - points: PropTypes.object.isRequired, -}; - export default memo(HeatLayer); diff --git a/src/HeatmapLegend/index.js b/src/HeatmapLegend/index.js index 77a615268..1e854a174 100644 --- a/src/HeatmapLegend/index.js +++ b/src/HeatmapLegend/index.js @@ -1,5 +1,4 @@ import React, { isValidElement, memo } from 'react'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { MAP_INTERACTION_CATEGORY, trackEventFactory } from '../utils/analytics'; @@ -36,11 +35,4 @@ const HeatmapLegend = ({ dayCount, onClose, pointCount, title }) => { />; }; -HeatmapLegend.propTypes = { - dayCount: PropTypes.number.isRequired, - onClose: PropTypes.func.isRequired, - pointCount: PropTypes.number.isRequired, - title: PropTypes.oneOfType([PropTypes.element, PropTypes.node]).isRequired, -}; - export default memo(HeatmapLegend); diff --git a/src/HeatmapToggleButton/index.js b/src/HeatmapToggleButton/index.js index c8ec00e79..547028a00 100644 --- a/src/HeatmapToggleButton/index.js +++ b/src/HeatmapToggleButton/index.js @@ -1,13 +1,17 @@ import React, { memo } from 'react'; -import noop from 'lodash/noop'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import * as styles from './styles.module.scss'; import SubjectControlButton from '../SubjectControls/button'; -const HeatmapToggleButton = ({ className, heatmapVisible, heatmapPartiallyVisible, onButtonClick, ...restProps }) => { +const HeatmapToggleButton = ({ + className = '', + heatmapVisible, + heatmapPartiallyVisible = false, + onButtonClick = null, + ...restProps +}) => { const { t } = useTranslation('heatmap', { keyPrefix: 'heatmapToggleButton' }); const visibilityClassName = heatmapVisible ? 'visible' : heatmapPartiallyVisible ? 'partial' : ''; @@ -21,17 +25,4 @@ const HeatmapToggleButton = ({ className, heatmapVisible, heatmapPartiallyVisibl />; }; -HeatmapToggleButton.defaultProps = { - className: '', - heatmapPartiallyVisible: false, - onButtonClick: noop, -}; - -HeatmapToggleButton.propTypes = { - className: PropTypes.string, - heatmapVisible: PropTypes.bool.isRequired, - heatmapPartiallyVisible: PropTypes.bool, - onButtonClick: PropTypes.func, -}; - export default memo(HeatmapToggleButton); diff --git a/src/ImageModal/index.js b/src/ImageModal/index.js index 0677d7053..9963ddf2b 100644 --- a/src/ImageModal/index.js +++ b/src/ImageModal/index.js @@ -1,6 +1,5 @@ import React, { memo, useCallback, useEffect, useRef, useState } from 'react'; import Modal from 'react-bootstrap/Modal'; -import PropTypes from 'prop-types'; import { useDispatch } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -93,10 +92,3 @@ const ImageModal = ({ id, src, title, url, tracker }) => { }; export default memo(ImageModal); - -ImageModal.propTypes = { - id: PropTypes.string.isRequired, - src: PropTypes.string.isRequired, - title: PropTypes.string.isRequired, - url: PropTypes.string.isRequired, -}; diff --git a/src/InlineEditable/index.js b/src/InlineEditable/index.js index 89276c05a..49c93345e 100644 --- a/src/InlineEditable/index.js +++ b/src/InlineEditable/index.js @@ -1,5 +1,4 @@ import React, { memo, useEffect, useCallback, useRef, useState } from 'react'; -import PropTypes from 'prop-types'; import Checkmark from '../Checkmark'; @@ -12,7 +11,7 @@ const InlineEditable = ({ onClick, onEsc, onSave, - showCancel, + showCancel = true, value: originalValue, ...restProps }) => { @@ -76,22 +75,4 @@ const InlineEditable = ({ : {originalValue}; }; -InlineEditable.defaultProps = { - showCancel: true, -}; - -InlineEditable.propTypes = { - editing: PropTypes.bool.isRequired, - onCancel: PropTypes.func.isRequired, - onChange: PropTypes.func.isRequired, - onClick: PropTypes.func.isRequired, - onEsc: PropTypes.func.isRequired, - onSave: PropTypes.func.isRequired, - showCancel: PropTypes.bool, - value: PropTypes.oneOfType([ - PropTypes.string, - PropTypes.number, - ]), -}; - export default memo(InlineEditable); diff --git a/src/KebabMenu/index.js b/src/KebabMenu/index.js index f45ca7e21..93fa5773f 100644 --- a/src/KebabMenu/index.js +++ b/src/KebabMenu/index.js @@ -1,6 +1,5 @@ -import React, { forwardRef, useCallback, useState } from 'react'; +import React, { useCallback, useState } from 'react'; import { Dropdown } from 'react-bootstrap'; -import PropTypes from 'prop-types'; import KebabMenuIcon from '../KebabMenuIcon'; @@ -12,7 +11,7 @@ const Option = ({ className = '', children, ...rest }) => ( ); -const Menu = ({ children, className, defaultShow, ...rest }, ref) => { +const KebabMenu = ({ children, className = '', defaultShow = false, ref, ...rest }) => { const [show, setShow] = useState(defaultShow); const onKeyDown = useCallback((event) => { @@ -41,22 +40,7 @@ const Menu = ({ children, className, defaultShow, ...rest }, ref) => { ); }; -const MenuForwardRef = forwardRef(Menu); -MenuForwardRef.defaultProps = { - className: '', - defaultShow: false, -}; - -MenuForwardRef.propTypes = { - children: PropTypes.oneOfType([PropTypes.array, PropTypes.element]).isRequired, - defaultShow: PropTypes.bool, - className: PropTypes.string, -}; - -const KebabMenu = { - ...MenuForwardRef, - Option: Option -}; +KebabMenu.Option = Option; export default KebabMenu; diff --git a/src/KebabMenuIcon/index.js b/src/KebabMenuIcon/index.js index 20de6f075..ad1f6fef8 100644 --- a/src/KebabMenuIcon/index.js +++ b/src/KebabMenuIcon/index.js @@ -1,26 +1,13 @@ -import React, { forwardRef, memo } from 'react'; -import PropTypes from 'prop-types'; +import React, { memo } from 'react'; import * as styles from './styles.module.scss'; -// eslint-disable-next-line react/display-name -const KebabMenuIcon = forwardRef(({ isOpen, className, ...rest }, ref) =>
    -
    -); - -KebabMenuIcon.defaultProps = { - className: '', - isOpen: false, -}; - -KebabMenuIcon.propTypes = { - className: PropTypes.string, - isOpen: PropTypes.bool, -}; +
    ; export default memo(KebabMenuIcon); diff --git a/src/LabeledSymbolLayer/index.js b/src/LabeledSymbolLayer/index.js index 8d6f4c6a9..a91d2d7eb 100644 --- a/src/LabeledSymbolLayer/index.js +++ b/src/LabeledSymbolLayer/index.js @@ -1,5 +1,4 @@ -import React, { memo, useCallback, useEffect } from 'react'; -import PropTypes from 'prop-types'; +import { memo, useCallback, useEffect } from 'react'; import { DEFAULT_SYMBOL_LAYOUT, DEFAULT_SYMBOL_PAINT } from '../constants'; import { withMap } from '../EarthRangerMap'; @@ -8,10 +7,22 @@ import withMapViewConfig from '../WithMapViewConfig'; import { useMapEventBinding } from '../hooks'; import useMapLayers from '../hooks/useMapLayers'; -const LabeledSymbolLayer = ( - { before, paint, layout, textPaint, textLayout, id, sourceId, map, mapUserLayoutConfigByLayerId, onClick, onInit, - onMouseEnter, onMouseLeave, filter } -) => { +const LabeledSymbolLayer = ({ + before, + filter, + id, + layout, + map, + mapUserLayoutConfigByLayerId, + onClick, + onInit = null, + onMouseEnter, + onMouseLeave, + paint, + sourceId, + textLayout, + textPaint, +}) => { const textLayerId = `${id}-labels`; const handleMouseEnter = (e) => { @@ -32,12 +43,10 @@ const LabeledSymbolLayer = ( onClick?.(e); }, [onClick]); - useEffect(() => { - onInit([id, textLayerId]); + onInit?.([id, textLayerId]); }, [id, onInit, textLayerId]); - const labelLayout = { ...DEFAULT_SYMBOL_LAYOUT, ...textLayout, @@ -102,15 +111,3 @@ const LabeledSymbolLayer = ( }; export default memo(withMapViewConfig(withMap(LabeledSymbolLayer))); - -LabeledSymbolLayer.defaultProps = { - onInit() { - return null; - }, -}; - -LabeledSymbolLayer.propTypes = { - sourceId: PropTypes.string.isRequired, - id: PropTypes.string.isRequired, - onInit: PropTypes.func, -}; \ No newline at end of file diff --git a/src/LayerSelectorPopup/index.js b/src/LayerSelectorPopup/index.js index 696c85546..d1aa64e52 100644 --- a/src/LayerSelectorPopup/index.js +++ b/src/LayerSelectorPopup/index.js @@ -1,5 +1,4 @@ import React, { memo, useCallback, useEffect, useMemo, useState } from 'react'; -import PropTypes from 'prop-types'; import { useDispatch, useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -89,24 +88,4 @@ const LayerSelectorPopup = ({ data, id }) => { ; }; -LayerSelectorPopup.propTypes = { - data: PropTypes.shape({ - layers: PropTypes.arrayOf(PropTypes.shape({ - properties: PropTypes.shape({ - display_title: PropTypes.string, - height: PropTypes.string, - id: PropTypes.string, - image: PropTypes.string, - image_url: PropTypes.string, - name: PropTypes.string, - title: PropTypes.string, - width: PropTypes.string, - }), - })), - onSelectSubject: PropTypes.func, - onSelectEvent: PropTypes.func, - }).isRequired, - id: PropTypes.string.isRequired, -}; - export default memo(LayerSelectorPopup); diff --git a/src/LocationJumpButton/index.js b/src/LocationJumpButton/index.js index c452716d4..9e58b0e4b 100644 --- a/src/LocationJumpButton/index.js +++ b/src/LocationJumpButton/index.js @@ -1,5 +1,4 @@ import React, { memo, useCallback, useMemo } from 'react'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { ReactComponent as MarkerIcon } from '../common/images/icons/marker-feed.svg'; @@ -13,13 +12,13 @@ import { validateLngLat } from '../utils/location'; import * as styles from './styles.module.scss'; const LocationJumpButton = ({ - bypassLocationValidation, - className, - clickAnalytics, - coordinates, - isMulti, - onClick, - zoom, + bypassLocationValidation = false, + className = '', + clickAnalytics = null, + coordinates = null, + isMulti = false, + onClick = null, + zoom = 14, ...restProps }) => { const jumpToLocation = useJumpToLocation(); @@ -83,24 +82,4 @@ const LocationJumpButton = ({ ; }; -LocationJumpButton.defaultProps = { - bypassLocationValidation: false, - className: '', - clickAnalytics: null, - coordinates: null, - isMulti: false, - onClick: null, - zoom: 14, -}; - -LocationJumpButton.propTypes = { - bypassLocationValidation: PropTypes.bool, - className: PropTypes.string, - clickAnalytics: PropTypes.arrayOf(PropTypes.string), - coordinates: PropTypes.array, - isMulti: PropTypes.bool, - onClick: PropTypes.func, - zoom: PropTypes.number, -}; - export default memo(LocationJumpButton); diff --git a/src/LocationPicker/MenuPopover/index.js b/src/LocationPicker/MenuPopover/index.js index fb352687d..ed36b7a3f 100644 --- a/src/LocationPicker/MenuPopover/index.js +++ b/src/LocationPicker/MenuPopover/index.js @@ -1,4 +1,4 @@ -import React, { forwardRef, useEffect, useRef } from 'react'; +import React, { useEffect, useRef } from 'react'; import Popover from 'react-bootstrap/Popover'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -26,12 +26,13 @@ const MenuPopover = ({ onBlur, onChange, onClose, + ref, setLocationButtonRef, style, target, value, ...otherProps -}, ref) => { +}) => { const { t } = useTranslation('components', { keyPrefix: 'locationPicker.menuPopover' }); const isPickingLocation = useSelector((state) => state.view.mapLocationSelection.isPickingLocation); @@ -193,4 +194,4 @@ const MenuPopover = ({ ; }; -export default forwardRef(MenuPopover); +export default MenuPopover; diff --git a/src/LocationPicker/index.js b/src/LocationPicker/index.js index d1a9ca8b2..40afd4395 100644 --- a/src/LocationPicker/index.js +++ b/src/LocationPicker/index.js @@ -1,4 +1,4 @@ -import React, { forwardRef, memo, useImperativeHandle, useRef, useState } from 'react'; +import React, { memo, useImperativeHandle, useRef, useState } from 'react'; import Overlay from 'react-bootstrap/Overlay'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -25,10 +25,11 @@ const LocationPicker = ({ onFocus = null, placeholder = null, readOnly = false, + ref, required = false, value, ...otherProps -}, ref) => { +}) => { const jumpToLocation = useJumpToLocation(); const { t } = useTranslation('components', { keyPrefix: 'locationPicker' }); @@ -128,4 +129,4 @@ const LocationPicker = ({ ; }; -export default memo(forwardRef(LocationPicker)); +export default memo(LocationPicker); diff --git a/src/MapDrawingTools/index.js b/src/MapDrawingTools/index.js index 72097126e..bd3235bec 100644 --- a/src/MapDrawingTools/index.js +++ b/src/MapDrawingTools/index.js @@ -1,5 +1,4 @@ import React, { memo, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'; -import PropTypes from 'prop-types'; import debounce from 'lodash/debounce'; import noop from 'lodash/noop'; import isEqual from 'react-fast-compare'; @@ -7,7 +6,6 @@ import { useTranslation } from 'react-i18next'; import { BREAKPOINTS } from '../constants'; import { calcPositiveBearing } from '../utils/location'; -import { childrenPropType, mapDrawToolsDisplayConfigPropType } from '../proptypes'; import { LAYER_IDS, SOURCE_IDS } from './MapLayers'; import { MapContext } from '../App'; import { useDrawToolGeoJson } from './hooks'; @@ -199,20 +197,6 @@ const MapDrawingTools = ({ export default memo(MapDrawingTools); -PropTypes.propTypes = { - displayConfig: mapDrawToolsDisplayConfigPropType, - children: childrenPropType, - drawing: PropTypes.bool, - drawingMode: PropTypes.oneOf(Object.values(DRAWING_MODES)), - onChange: PropTypes.func, - onClickFill: PropTypes.func, - onClickLabel: PropTypes.func, - onClickLine: PropTypes.func, - onClickPoint: PropTypes.func, - points: PropTypes.array, - renderCursorPopup: PropTypes.func, -}; - const DefaultCursorPopup = ({ coords, drawing, isHoveringMidpoint, lineLength, points }) => { const map = useContext(MapContext); const { t } = useTranslation('map-controls', { keyPrefix: 'mapDrawingTools' }); diff --git a/src/MapLocationSelectionOverview/index.js b/src/MapLocationSelectionOverview/index.js index 8469f7217..b095e5022 100644 --- a/src/MapLocationSelectionOverview/index.js +++ b/src/MapLocationSelectionOverview/index.js @@ -2,7 +2,6 @@ import React, { memo, useCallback, useContext, useState } from 'react'; import Button from 'react-bootstrap/Button'; import Collapse from 'react-bootstrap/Collapse'; import OverlayTrigger from 'react-bootstrap/OverlayTrigger'; -import PropTypes from 'prop-types'; import Tooltip from 'react-bootstrap/Tooltip'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -29,11 +28,11 @@ const TOOLTIP_SHOW_TIME = 500; const TOOLTIP_HIDE_TIME = 150; const MapLocationSelectionOverview = ({ - isDiscardButtonDisabled, - isUndoButtonDisabled, - onClickDiscard: onClickDiscardCallback, - onClickUndo: onClickUndoCallback, - onShowInformation, + isDiscardButtonDisabled = false, + isUndoButtonDisabled = false, + onClickDiscard: onClickDiscardCallback = null, + onClickUndo: onClickUndoCallback = null, + onShowInformation = null, }) => { const { t } = useTranslation('components', { keyPrefix: 'mapLocationSelectionOverview' }); @@ -158,20 +157,4 @@ const MapLocationSelectionOverview = ({ ; }; -MapLocationSelectionOverview.defaultProps = { - isDiscardButtonDisabled: false, - isUndoButtonDisabled: false, - onClickDiscard: null, - onClickUndo: null, - onShowInformation: null, -}; - -MapLocationSelectionOverview.propTypes = { - isDiscardButtonDisabled: PropTypes.bool, - isUndoButtonDisabled: PropTypes.bool, - onClickDiscard: PropTypes.func, - onClickUndo: PropTypes.func, - onShowInformation: PropTypes.func, -}; - export default memo(MapLocationSelectionOverview); diff --git a/src/MapMarkerDropper/index.js b/src/MapMarkerDropper/index.js index c7006edb7..500e1d003 100644 --- a/src/MapMarkerDropper/index.js +++ b/src/MapMarkerDropper/index.js @@ -1,6 +1,5 @@ import React, { Fragment, memo, useState, useEffect, useRef } from 'react'; import throttle from 'lodash/throttle'; -import PropTypes from 'prop-types'; import { addMapImage } from '../utils/map'; import { MAP_INTERACTION_CATEGORY, trackEventFactory } from '../utils/analytics'; @@ -17,7 +16,7 @@ import * as styles from './styles.module.scss'; const mapInteractionTracker = trackEventFactory(MAP_INTERACTION_CATEGORY); -const MapMarkerDropper = ({ map, onMarkerDropped, showMarkerPopup = true, ...rest }) => { +const MapMarkerDropper = ({ map, onMarkerDropped = null, showMarkerPopup = true, ...rest }) => { const [moving, setMovingState] = useState(false); const [location, setMarkerLocation] = useState({}); const [shouldCleanUpOnNextMapClick, setCleanupState] = useState(false); @@ -59,7 +58,7 @@ const MapMarkerDropper = ({ map, onMarkerDropped, showMarkerPopup = true, ...res }, [map]); useEffect(() => { - if (!moving && isValidLocation) { + if (onMarkerDropped && !moving && isValidLocation) { onMarkerDropped(location); } }, [isValidLocation, location, moving, onMarkerDropped]); @@ -121,12 +120,3 @@ const MapMarkerDropper = ({ map, onMarkerDropped, showMarkerPopup = true, ...res }; export default memo(withMap(MapMarkerDropper)); - -MapMarkerDropper.defaultProps = { - onMarkerDropped() { - }, -}; - -MapMarkerDropper.propTypes = { - onMarkerDropped: PropTypes.func, -}; \ No newline at end of file diff --git a/src/MessageBadgeLayer/index.js b/src/MessageBadgeLayer/index.js index 7233448d4..219629491 100644 --- a/src/MessageBadgeLayer/index.js +++ b/src/MessageBadgeLayer/index.js @@ -1,5 +1,4 @@ import React, { useEffect, useContext, useReducer, useRef, memo } from 'react'; -import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { bboxPolygon, booleanContains, featureCollection } from '@turf/turf'; @@ -197,8 +196,3 @@ const mapStateToProps = (state) => ({ }); export default connect(mapStateToProps, null)(memo(withMap(MessageBadgeLayer))); - -MessageBadgeLayer.propTypes = { - messages: PropTypes.array, - subjectFeatureCollection: PropTypes.object.isRequired, -}; \ No newline at end of file diff --git a/src/MessageInput/index.js b/src/MessageInput/index.js index fd76f1bc1..caeea14b9 100644 --- a/src/MessageInput/index.js +++ b/src/MessageInput/index.js @@ -1,6 +1,5 @@ import React, { memo, useCallback, useEffect, useRef, useState } from 'react'; import Button from 'react-bootstrap/Button'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -59,8 +58,4 @@ const MessageInput = ({ subjectId }) => { : null; }; -MessageInput.propTypes = { - subjectId: PropTypes.string.isRequired, -}; - export default memo(MessageInput); diff --git a/src/MessageList/ParamFedMessageList.js b/src/MessageList/ParamFedMessageList.js index 8e3bd0c39..0437807ac 100644 --- a/src/MessageList/ParamFedMessageList.js +++ b/src/MessageList/ParamFedMessageList.js @@ -1,5 +1,4 @@ import React, { memo, useCallback, useContext, useEffect, useMemo, useReducer, useRef, useState } from 'react'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { @@ -19,7 +18,7 @@ import MessageList from './'; import * as styles from './styles.module.scss'; -const ParamFedMessageList = ({ isReverse, params, ...restProps }) => { +const ParamFedMessageList = ({ isReverse = false, params = null, ...restProps }) => { const { t } = useTranslation('components', { keyPrefix: 'messageList.paramFedMessageList' }); const socket = useContext(SocketContext); @@ -101,16 +100,4 @@ const ParamFedMessageList = ({ isReverse, params, ...restProps }) => { ; }; -ParamFedMessageList.defaultProps = { - isReverse: false, - params: null, -}; - -ParamFedMessageList.propTypes = { - isReverse: PropTypes.bool, - params: PropTypes.shape({ - subject_id: PropTypes.string, - }), -}; - export default memo(ParamFedMessageList); diff --git a/src/MessageList/index.js b/src/MessageList/index.js index efbe03fa8..6740fa9ae 100644 --- a/src/MessageList/index.js +++ b/src/MessageList/index.js @@ -1,8 +1,6 @@ import React, { memo, useMemo, useState } from 'react'; -import PropTypes from 'prop-types'; import { isSameDay, isToday, isYesterday } from 'date-fns'; import { useTranslation } from 'react-i18next'; -import noop from 'lodash/noop'; import InfiniteScroll from 'react-infinite-scroller'; @@ -32,19 +30,19 @@ export const MESSAGE_LIST_TYPES = { }; const MessageList = ({ - className, - containerRef, - emptyMessage, - hasMore, - isReverse, + className = '', + containerRef = null, + emptyMessage = null, + hasMore = false, + isReverse = false, messages, - onMessageClick, - onMessageSubjectClick, - onScroll, - readMessageClassName, - senderDetailStyle, - type, - unreadMessageClassName, + onMessageClick = null, + onMessageSubjectClick = null, + onScroll = null, + readMessageClassName = '', + senderDetailStyle = SENDER_DETAIL_STYLES.FULL, + type = MESSAGE_LIST_TYPES.GENERAL, + unreadMessageClassName = '', }) => { const { i18n, t } = useTranslation('components', { keyPrefix: 'messageList' }); @@ -113,40 +111,4 @@ const MessageList = ({ ; }; -MessageList.defaultProps = { - className: '', - containerRef: null, - emptyMessage: null, - hasMore: false, - isReverse: false, - onMessageClick: noop, - onMessageSubjectClick: noop, - onScroll: noop, - readMessageClassName: '', - senderDetailStyle: SENDER_DETAIL_STYLES.FULL, - type: MESSAGE_LIST_TYPES.GENERAL, - unreadMessageClassName: '', -}; - -MessageList.propTypes = { - className: PropTypes.string, - containerRef: PropTypes.shape({ - current: PropTypes.any, - }), - emptyMessage: PropTypes.string, - hasMore: PropTypes.bool, - isReverse: PropTypes.bool, - messages: PropTypes.arrayOf(PropTypes.shape({ - message_time: PropTypes.string, - sender: PropTypes.object, - })).isRequired, - onMessageClick: PropTypes.func, - onMessageSubjectClick: PropTypes.func, - onScroll: PropTypes.func, - readMessageClassName: PropTypes.string, - senderDetailStyle: PropTypes.oneOf(Object.values(SENDER_DETAIL_STYLES)), - type: PropTypes.oneOf(Object.values(MESSAGE_LIST_TYPES)), - unreadMessageClassName: PropTypes.string, -}; - export default memo(MessageList); diff --git a/src/MessagesModal/index.js b/src/MessagesModal/index.js index f7ebc505e..001ec1b64 100644 --- a/src/MessagesModal/index.js +++ b/src/MessagesModal/index.js @@ -1,7 +1,6 @@ import React, { memo, useEffect, useMemo, useState } from 'react'; import Button from 'react-bootstrap/Button'; import Modal from 'react-bootstrap/Modal'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -24,7 +23,7 @@ const BODY_STYLES ={ width: '100vw', }; -const MessagesModal = ({ onSelectSubject, selectedSubject }) => { +const MessagesModal = ({ onSelectSubject, selectedSubject = null }) => { const { t } = useTranslation('top-bar', { keyPrefix: 'messagesModal' }); const subjectStore = useSelector((state) => state.data.subjectStore); @@ -105,17 +104,4 @@ const MessagesModal = ({ onSelectSubject, selectedSubject }) => { ; }; -MessagesModal.defaultProps = { - selectedSubject: null, -}; - -MessagesModal.propTypes = { - onSelectSubject: PropTypes.func.isRequired, - selectedSubject: PropTypes.shape({ - id: PropTypes.string, - messaging: PropTypes.array, - name: PropTypes.string, - }), -}; - export default memo(MessagesModal); diff --git a/src/MessagingSelect/index.js b/src/MessagingSelect/index.js index e4504f2cd..e60bfa8e3 100644 --- a/src/MessagingSelect/index.js +++ b/src/MessagingSelect/index.js @@ -1,6 +1,5 @@ import React, { memo, useEffect, useMemo, useRef } from 'react'; import { components } from 'react-select'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -58,8 +57,4 @@ const MessagingSelect = ({ onChange }) => { />; }; -MessagingSelect.propTypes = { - onChange: PropTypes.func.isRequired, -}; - export default memo(MessagingSelect); diff --git a/src/MouseMarkerPopup/index.js b/src/MouseMarkerPopup/index.js index 2c1dd8c65..5a32029e6 100644 --- a/src/MouseMarkerPopup/index.js +++ b/src/MouseMarkerPopup/index.js @@ -1,6 +1,5 @@ import React, { memo } from 'react'; import { calcGpsDisplayString } from '../utils/location'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -10,7 +9,7 @@ import Popup from '../Popup'; import * as styles from './styles.module.scss'; -const MouseMarkerPopup = ({ location, ...rest }) => { +const MouseMarkerPopup = ({ location = null, ...rest }) => { const { t } = useTranslation('map-popups', { keyPrefix: 'mouseMarkerPopup' }); const gpsFormat = useSelector((state) => state.view.userPreferences.gpsFormat); @@ -28,15 +27,4 @@ const MouseMarkerPopup = ({ location, ...rest }) => { ; }; -MouseMarkerPopup.defaultProps = { - location: null, -}; - -MouseMarkerPopup.propTypes = { - location: PropTypes.shape({ - lat: PropTypes.number, - lng: PropTypes.number, - }), -}; - export default memo(MouseMarkerPopup); diff --git a/src/Nav/NavHomeMenu/index.js b/src/Nav/NavHomeMenu/index.js index 2ba61add9..0f170bfc9 100644 --- a/src/Nav/NavHomeMenu/index.js +++ b/src/Nav/NavHomeMenu/index.js @@ -1,6 +1,5 @@ import React, { memo } from 'react'; import Dropdown from 'react-bootstrap/Dropdown'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -61,15 +60,4 @@ const NavHomeMenu = function NavHomeMenu({ maps, onCurrentLocationClick, onMapSe ; }; -NavHomeMenu.propTypes = { - maps: PropTypes.arrayOf(PropTypes.shape({ - id: PropTypes.string, - })).isRequired, - onCurrentLocationClick: PropTypes.func.isRequired, - onMapSelect: PropTypes.func.isRequired, - selectedMap: PropTypes.shape({ - id: PropTypes.string, - }).isRequired, -}; - export default memo(NavHomeMenu); diff --git a/src/NavigationPromptModal/index.js b/src/NavigationPromptModal/index.js index bd83587b5..e5200582e 100644 --- a/src/NavigationPromptModal/index.js +++ b/src/NavigationPromptModal/index.js @@ -1,7 +1,6 @@ import React, { memo, useCallback } from 'react'; import Button from 'react-bootstrap/Button'; import Modal from 'react-bootstrap/Modal'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { ReactComponent as TrashCanIcon } from '../common/images/icons/trash-can.svg'; @@ -12,8 +11,8 @@ import useNavigationBlocker from '../hooks/useNavigationBlocker'; import * as styles from './styles.module.scss'; const NavigationPromptModal = ({ - onCancel, - onContinue, + onCancel = null, + onContinue = null, when, ...restProps }) => { @@ -77,20 +76,4 @@ const NavigationPromptModal = ({ ; }; -NavigationPromptModal.defaultProps = { - onCancel: null, - onContinue: null, -}; - -NavigationPromptModal.propTypes = { - cancelNavigationButtonText: PropTypes.string, - continueNavigationNegativeButtonText: PropTypes.string, - continueNavigationPositiveButtonText: PropTypes.string, - description: PropTypes.string, - onCancel: PropTypes.func, - onContinue: PropTypes.func, - title: PropTypes.string, - when: PropTypes.bool.isRequired, -}; - export default memo(NavigationPromptModal); diff --git a/src/NumericInput/index.js b/src/NumericInput/index.js index 30e6bde9f..1b6bfad4f 100644 --- a/src/NumericInput/index.js +++ b/src/NumericInput/index.js @@ -1,4 +1,4 @@ -import React, { forwardRef, useState } from 'react'; +import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; import { ReactComponent as ArrowUpSimpleIcon } from '../common/images/icons/arrow-up-simple.svg'; @@ -33,12 +33,12 @@ const NumericInput = ({ placeholder = '', required = false, readOnly = false, + ref, blockOutOfRangeValues = true, title = '', value = '', ...otherProps -}, -ref) => { +}) => { const [numberConfig, setNumberConfig] = useState({ amountOfZeros: 0, amountOfZerosAfterLastPositiveNumber: 0, @@ -161,6 +161,4 @@ ref) => { ; }; -const NumericInputWithRef = forwardRef(NumericInput); - -export default NumericInputWithRef; +export default NumericInput; diff --git a/src/PatrolDetailView/Header/index.js b/src/PatrolDetailView/Header/index.js index 7fd64a8ab..7a2ad98fe 100644 --- a/src/PatrolDetailView/Header/index.js +++ b/src/PatrolDetailView/Header/index.js @@ -1,6 +1,5 @@ import React, { memo, useCallback, useMemo, useRef } from 'react'; import Button from 'react-bootstrap/Button'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { ReactComponent as PlayIcon } from '../../common/images/icons/play.svg'; @@ -173,9 +172,4 @@ const Header = ({ onChangeTitle, patrol, setRedirectTo, printableContentRef }) = ; }; -Header.propTypes = { - onChangeTitle: PropTypes.func.isRequired, - patrol: PropTypes.object.isRequired, -}; - export default memo(Header); diff --git a/src/PatrolDetailView/InvalidDatesModal/index.js b/src/PatrolDetailView/InvalidDatesModal/index.js index 36fe1f3e0..9ab12a358 100644 --- a/src/PatrolDetailView/InvalidDatesModal/index.js +++ b/src/PatrolDetailView/InvalidDatesModal/index.js @@ -1,7 +1,6 @@ import React, { memo, useCallback } from 'react'; import { useTranslation } from 'react-i18next'; -import PropTypes from 'prop-types'; import Modal from 'react-bootstrap/Modal'; import Button from 'react-bootstrap/Button'; @@ -26,9 +25,4 @@ const InvalidDatesModal = ({ onHide, show }) => { ; }; -InvalidDatesModal.propTypes = { - onHide: PropTypes.func.isRequired, - show: PropTypes.bool.isRequired, -}; - export default memo(InvalidDatesModal); diff --git a/src/PatrolDetailView/PlanSection/index.js b/src/PatrolDetailView/PlanSection/index.js index 4955d293b..43436891b 100644 --- a/src/PatrolDetailView/PlanSection/index.js +++ b/src/PatrolDetailView/PlanSection/index.js @@ -1,7 +1,6 @@ import React, { memo, useCallback, useEffect, useMemo, useState } from 'react'; import Form from 'react-bootstrap/Form'; import { format, isFuture, isValid, parseISO } from 'date-fns'; -import PropTypes from 'prop-types'; import { useDispatch, useSelector } from 'react-redux'; import { ReactComponent as CalendarIcon } from '../../common/images/icons/calendar.svg'; @@ -289,14 +288,4 @@ const PlanSection = ({ ; }; -PlanSection.propTypes = { - onPatrolEndDateChange: PropTypes.func.isRequired, - onPatrolEndLocationChange: PropTypes.func.isRequired, - onPatrolObjectiveChange: PropTypes.func.isRequired, - onPatrolReportedByChange: PropTypes.func.isRequired, - onPatrolStartDateChange: PropTypes.func.isRequired, - onPatrolStartLocationChange: PropTypes.func.isRequired, - patrolForm: PropTypes.object.isRequired, -}; - export default memo(PlanSection); diff --git a/src/PatrolFilter/DateRangePopover/index.js b/src/PatrolFilter/DateRangePopover/index.js index 4985a9b3e..35efc2d84 100644 --- a/src/PatrolFilter/DateRangePopover/index.js +++ b/src/PatrolFilter/DateRangePopover/index.js @@ -2,7 +2,6 @@ import React, { memo, useCallback } from 'react'; import Button from 'react-bootstrap/Button'; import isEqual from 'react-fast-compare'; import Popover from 'react-bootstrap/Popover'; -import PropTypes from 'prop-types'; import { useDispatch, useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -21,7 +20,7 @@ const patrolFilterTracker = trackEventFactory(PATROL_FILTER_CATEGORY); const PATROL_FILTER_BY_DATE_RANGE_OVERLAP = 'overlap_dates'; -const DateRangePopover = React.forwardRef(({ containerRef, ...rest }, ref) => { +const DateRangePopover = ({ containerRef, ref, ...rest }) => { const dispatch = useDispatch(); const { t } = useTranslation('filters', { keyPrefix: 'patrolFilters.dateRangePopover' }); const patrolFilter = useSelector((state) => state.data.patrolFilter); @@ -72,10 +71,6 @@ const DateRangePopover = React.forwardRef(({ containerRef, ...rest }, ref) => { /> ; -}); - -DateRangePopover.propTypes = { containerRef: PropTypes.any }; - -DateRangePopover.displayName = 'DateRangePopover'; +}; export default memo(DateRangePopover); diff --git a/src/PatrolFilter/FiltersPopover/index.js b/src/PatrolFilter/FiltersPopover/index.js index a43f6394b..95661f076 100644 --- a/src/PatrolFilter/FiltersPopover/index.js +++ b/src/PatrolFilter/FiltersPopover/index.js @@ -1,11 +1,10 @@ import React, { memo, useCallback, useEffect } from 'react'; import Button from 'react-bootstrap/Button'; -import { connect } from 'react-redux'; import isEmpty from 'lodash/isEmpty'; import isEqual from 'react-fast-compare'; import Popover from 'react-bootstrap/Popover'; -import PropTypes from 'prop-types'; import uniq from 'lodash/uniq'; +import { useDispatch, useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; import { fetchTrackedBySchema } from '../../ducks/trackedby'; @@ -44,86 +43,82 @@ const calculateNewCheckedItems = (clickedItemId, checkedItemIds) => { return [...checkedItemIds, clickedItemId]; }; -const FiltersPopover = React.forwardRef(({ - fetchTrackedBySchema, - patrolFilter, - patrolLeaderSchema, - patrolTypes, - updatePatrolFilter, - ...rest -}, ref) => { - const { status: selectedStatusIds } = patrolFilter; - const { - tracked_by: selectedLeaderIds, - patrol_type: selectedPatrolTypeIds, - } = patrolFilter.filter; +const FiltersPopover = ({ ref, ...rest }) => { + const dispatch = useDispatch(); const { t } = useTranslation('filters', { keyPrefix: 'patrolFilters.filtersPopover' }); + const patrolFilter = useSelector((state) => state.data.patrolFilter); + const patrolLeaderSchema = useSelector((state) => state.data.patrolLeaderSchema); + const patrolTypes = useSelector((state) => state.data.patrolTypes); + + const { status: selectedStatusIds } = patrolFilter; + const { patrol_type: selectedPatrolTypeIds, tracked_by: selectedLeaderIds } = patrolFilter.filter; + const onLeadersFilterChange = useCallback((leadersSelected) => { const isAnyLeaderSelected = !!leadersSelected?.length; - updatePatrolFilter({ + dispatch(updatePatrolFilter({ filter: { tracked_by: isAnyLeaderSelected ? uniq(leadersSelected.map(({ id }) => id)) : [] } - }); + })); patrolFilterTracker.track( `${isAnyLeaderSelected ? 'Set' : 'Clear'} 'Tracked By' Filter`, isAnyLeaderSelected ? `${leadersSelected.length} trackers` : null ); - }, [updatePatrolFilter]); + }, [dispatch]); const onStatusFilterChange = useCallback((clickedStatus) => { const checkedStatus = calculateNewCheckedItems(clickedStatus.id, selectedStatusIds); - updatePatrolFilter({ status: checkedStatus }); + dispatch(updatePatrolFilter({ status: checkedStatus })); const isAnyStatusChecked = checkedStatus[0] !== CHECKBOX_LIST_ALL_OPTION_ID; patrolFilterTracker.track( `${isAnyStatusChecked ? 'Set' : 'Clear'} 'Status' Filter`, isAnyStatusChecked ? `${selectedStatusIds.length} status` : null ); - }, [selectedStatusIds, updatePatrolFilter]); + }, [dispatch, selectedStatusIds]); const onPatrolTypesFilterChange = useCallback((clickedPatrolType) => { const checkedPatrolTypes = calculateNewCheckedItems(clickedPatrolType.id, selectedPatrolTypeIds); - updatePatrolFilter({ filter: { patrol_type: checkedPatrolTypes } }); + dispatch(updatePatrolFilter({ filter: { patrol_type: checkedPatrolTypes } })); const isAnyPatrolTypeSelected = !!selectedPatrolTypeIds.length; patrolFilterTracker.track( `${isAnyPatrolTypeSelected ? 'Set' : 'Clear'} 'Patrol Types' Filter`, isAnyPatrolTypeSelected ? `${selectedPatrolTypeIds.length} types` : null ); - }, [selectedPatrolTypeIds, updatePatrolFilter]); + }, [dispatch, selectedPatrolTypeIds]); const resetFilters = useCallback(() => { - updatePatrolFilter({ + dispatch(updatePatrolFilter({ filter: { tracked_by: INITIAL_FILTER_STATE.filter.tracked_by, patrol_type: INITIAL_FILTER_STATE.filter.patrol_type, }, status: INITIAL_FILTER_STATE.status, - }); + })); patrolFilterTracker.track('Click Reset All Filters'); - }, [updatePatrolFilter]); + }, [dispatch]); const resetFilter = useCallback((filterToReset) => (e) => { e.stopPropagation(); - updatePatrolFilter({ filter: { [filterToReset]: INITIAL_FILTER_STATE.filter[filterToReset] } }); + dispatch(updatePatrolFilter({ filter: { [filterToReset]: INITIAL_FILTER_STATE.filter[filterToReset] } })); patrolFilterTracker.track(`Click reset ${filterToReset} filter`); - }, [updatePatrolFilter]); + }, [dispatch]); const resetStatusFilter = useCallback((e) => { e.stopPropagation(); - updatePatrolFilter({ status: INITIAL_FILTER_STATE.status }); + dispatch(updatePatrolFilter({ status: INITIAL_FILTER_STATE.status })); patrolFilterTracker.track('Click reset status'); - }, [updatePatrolFilter]); + }, [dispatch]); useEffect(() => { if (isEmpty(patrolLeaderSchema)){ - fetchTrackedBySchema(); + dispatch(fetchTrackedBySchema()); } - }, [fetchTrackedBySchema, patrolLeaderSchema]); + }, [dispatch, patrolLeaderSchema]); const patrolLeaderFilterOptions = patrolLeaderSchema?.trackedbySchema?.properties?.leader?.enum_ext?.map(({ value }) => value) || []; @@ -266,44 +261,6 @@ const FiltersPopover = React.forwardRef(({ ; -}); - -FiltersPopover.propTypes = { - fetchTrackedBySchema: PropTypes.func.isRequired, - patrolFilter: PropTypes.shape({ - filters: PropTypes.shape({ - patrol_type: PropTypes.arrayOf(PropTypes.string), - tracked_by: PropTypes.arrayOf(PropTypes.string), - }), - }).isRequired, - patrolLeaderSchema: PropTypes.shape({ - trackedbySchema: PropTypes.shape({ - properties: PropTypes.shape({ - leader: PropTypes.shape({ - enum_ext: PropTypes.arrayOf(PropTypes.shape({ value: PropTypes.object })), - }), - }), - }), - }).isRequired, - patrolTypes: PropTypes.arrayOf(PropTypes.shape({ - display: PropTypes.string, - id: PropTypes.string, - icon_id: PropTypes.string, - })).isRequired, - updatePatrolFilter: PropTypes.func.isRequired, }; -FiltersPopover.displayName = 'FiltersPopover'; - -const mapStateToProps = (state) => ({ - patrolFilter: state.data.patrolFilter, - patrolLeaderSchema: state.data.patrolLeaderSchema, - patrolTypes: state.data.patrolTypes, -}); - -export default connect( - mapStateToProps, - { fetchTrackedBySchema, updatePatrolFilter }, - null, - { forwardRef: true } -)(memo(FiltersPopover)); +export default memo(FiltersPopover); diff --git a/src/PatrolFilter/index.js b/src/PatrolFilter/index.js index d5f3052e6..20c615ace 100644 --- a/src/PatrolFilter/index.js +++ b/src/PatrolFilter/index.js @@ -4,7 +4,6 @@ import Button from 'react-bootstrap/Button'; import debounce from 'lodash/debounce'; import isEqual from 'react-fast-compare'; import OverlayTrigger from 'react-bootstrap/OverlayTrigger'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { caseInsensitiveCompare } from '../utils/string'; @@ -30,7 +29,7 @@ export const PATROL_TEXT_FILTER_DEBOUNCE_TIME = 200; const patrolFilterTracker = trackEventFactory(PATROL_FILTER_CATEGORY); -const PatrolFilter = ({ className }) => { +const PatrolFilter = ({ className = '' }) => { const containerRef = useRef(null); const { t } = useTranslation('filters', { keyPrefix: 'patrolFilters' }); const dispatch = useDispatch(); @@ -174,12 +173,4 @@ const PatrolFilter = ({ className }) => { ; }; -PatrolFilter.defaultProps = { - className: '', -}; - -PatrolFilter.propTypes = { - className: PropTypes.string, -}; - export default PatrolFilter; diff --git a/src/PatrolList/index.js b/src/PatrolList/index.js index ea5a33136..430307323 100644 --- a/src/PatrolList/index.js +++ b/src/PatrolList/index.js @@ -1,5 +1,4 @@ -import React, { forwardRef, memo, useCallback, useContext } from 'react'; -import PropTypes from 'prop-types'; +import React, { memo, useCallback, useContext } from 'react'; import { Flipper, Flipped } from 'react-flip-toolkit'; import MoonLoader from 'react-spinners/MoonLoader'; import { useTranslation } from 'react-i18next'; @@ -14,9 +13,7 @@ import PatrolListItem from '../PatrolListItem'; const patrolListItemTracker = trackEventFactory(PATROL_LIST_ITEM_CATEGORY); -const ListItem = forwardRef((props, ref) => { /* eslint-disable-line react/display-name */ - const { map, patrol, onItemClick, ...rest } = props; - +const ListItem = ({ map, patrol, onItemClick, ref, ...rest }) => { const onClick = useCallback(() => { patrolListItemTracker.track('Click patrol list item to open patrol modal'); onItemClick(patrol.id); @@ -30,7 +27,7 @@ const ListItem = forwardRef((props, ref) => { /* eslint-disable-line react/displ map={map} {...rest} /> ; -}); +}; const PatrolList = ({ patrols = [], loading, onItemClick }) => { const map = useContext(MapContext); @@ -66,8 +63,3 @@ const PatrolList = ({ patrols = [], loading, onItemClick }) => { }; export default memo(PatrolList); - -PatrolList.propTypes = { - patrols: PropTypes.array, - loading: PropTypes.bool, -}; diff --git a/src/PatrolListItem/index.js b/src/PatrolListItem/index.js index ea98d39b9..1e1f5bc09 100644 --- a/src/PatrolListItem/index.js +++ b/src/PatrolListItem/index.js @@ -1,6 +1,5 @@ -import React, { forwardRef, memo, useCallback, useEffect, useMemo, useRef } from 'react'; +import React, { memo, useCallback, useEffect, useMemo, useRef } from 'react'; import Button from 'react-bootstrap/Button'; -import PropTypes from 'prop-types'; import { calcPatrolState } from '../utils/patrols'; import { fetchTracksIfNecessary } from '../utils/tracks'; @@ -24,14 +23,15 @@ const TRACK_FETCH_DEBOUNCE_DELAY = 150; const PatrolListItem = ({ className, dispatch: _dispatch, - onClick, + onClick = null, onSelfManagedStateChange, patrol: patrolFromProps, - showControls, - showStateTitle, - showTitleDetails, + ref, + showControls = true, + showStateTitle = true, + showTitleDetails = true, ...rest -}, ref) => { +}) => { const { patrolData, @@ -242,20 +242,4 @@ const PatrolListItem = ({ />; }; -const PatrolListItemForwardRef = forwardRef(PatrolListItem); - -PatrolListItemForwardRef.defaultProps = { - onClick: null, - showControls: true, - showStateTitle: true, - showTitleDetails: true, -}; - -PatrolListItemForwardRef.propTypes = { - onClick: PropTypes.func, - showControls: PropTypes.bool, - showStateTitle: PropTypes.bool, - showTitleDetails: PropTypes.bool, -}; - -export default memo(PatrolListItemForwardRef); +export default memo(PatrolListItem); diff --git a/src/PatrolMenu/index.js b/src/PatrolMenu/index.js index 0622b589c..3e5c891ff 100644 --- a/src/PatrolMenu/index.js +++ b/src/PatrolMenu/index.js @@ -1,5 +1,4 @@ import React, { memo, useMemo, useCallback } from 'react'; -import PropTypes from 'prop-types'; import { useReactToPrint } from 'react-to-print'; import { useTranslation } from 'react-i18next'; @@ -28,10 +27,10 @@ const PatrolMenu = ({ onPatrolChange, menuRef, printableContentRef, - patrolTitle, - isPatrolCancelled, - showPatrolPrintOption, - className, + patrolTitle = '', + isPatrolCancelled = false, + showPatrolPrintOption = true, + className = '', ...rest }) => { const { t } = useTranslation('patrols', { keyPrefix: 'patrolMenu' }); @@ -148,21 +147,4 @@ const PatrolMenu = ({ ; }; -PatrolMenu.defaultProps = { - patrolTitle: '', - className: '', - isPatrolCancelled: false, - showPatrolPrintOption: true, -}; - -PatrolMenu.propTypes = { - patrol: PropTypes.object.isRequired, - patrolState: PropTypes.object, - className: PropTypes.string, - onPatrolChange: PropTypes.func.isRequired, - patrolTitle: PropTypes.string, - isPatrolCancelled: PropTypes.bool, - showPatrolPrintOption: PropTypes.bool, -}; - export default memo(PatrolMenu); diff --git a/src/PatrolStartStopLayer/index.js b/src/PatrolStartStopLayer/index.js index 49f3fab25..703a2722b 100644 --- a/src/PatrolStartStopLayer/index.js +++ b/src/PatrolStartStopLayer/index.js @@ -26,9 +26,3 @@ const mapStateToProps = (state) => ({ export default connect(mapStateToProps, null)(withMap( memo(PatrolStartStopLayer), )); - -PatrolStartStopLayer.defaultProps = { - onPointClick(_layer) { - }, - showTimepoints: true, -}; diff --git a/src/PatrolTrackControls/index.js b/src/PatrolTrackControls/index.js index f1db0f585..050d542bc 100644 --- a/src/PatrolTrackControls/index.js +++ b/src/PatrolTrackControls/index.js @@ -1,5 +1,4 @@ import React, { useCallback, useContext, useRef } from 'react'; -import PropTypes from 'prop-types'; import { fitMapBoundsForAnalyzer } from '../utils/analyzers'; import { MapContext } from '../App'; @@ -10,7 +9,7 @@ import PatrolAwareTrackToggleButton from '../TrackToggleButton/PatrolAwareTrackT import * as styles from './styles.module.scss'; -const PatrolTrackControls = ({ className, onLocationClick, patrol }) => { +const PatrolTrackControls = ({ className = '', onLocationClick, patrol }) => { const { patrolData, patrolTrackState, @@ -54,14 +53,4 @@ const PatrolTrackControls = ({ className, onLocationClick, patrol }) => { ; }; -PatrolTrackControls.defaultProps = { - className: '', -}; - -PatrolTrackControls.propTypes = { - className: PropTypes.string, - onLocationClick: PropTypes.func.isRequired, - patrol: PropTypes.object.isRequired, -}; - export default PatrolTrackControls; diff --git a/src/PatrolTrackLayer/index.js b/src/PatrolTrackLayer/index.js index 0168268d8..337ac96a9 100644 --- a/src/PatrolTrackLayer/index.js +++ b/src/PatrolTrackLayer/index.js @@ -1,5 +1,4 @@ import React, { memo, useContext, useMemo } from 'react'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { selectPatrolData } from '../selectors/patrols'; @@ -40,13 +39,4 @@ const PatrolTrackLayer = ({ onPointClick, patrol: patrolFromProps, trackTimeEnve /> : null; }; -PatrolTrackLayer.propTypes = { - onPointClick: PropTypes.func.isRequired, - patrol: PropTypes.func.isRequired, - trackTimeEnvelope: PropTypes.shape({ - from: PropTypes.any, - until: PropTypes.any, - }).isRequired, -}; - export default memo(PatrolTrackLayer); diff --git a/src/Patrols/DistanceCovered.js b/src/Patrols/DistanceCovered.js index ca284b693..cfef8467c 100644 --- a/src/Patrols/DistanceCovered.js +++ b/src/Patrols/DistanceCovered.js @@ -1,6 +1,5 @@ import { memo, useMemo } from 'react'; import { length } from '@turf/turf'; -import PropTypes from 'prop-types'; import { patrolStateAllowsTrackDisplay } from '../utils/patrols'; @@ -24,9 +23,4 @@ const PatrolDistanceCovered = ({ patrolsData = [], suffix='km' }) => { return `${patrolTrackLength ? patrolTrackLength.toFixed(2) : 0}${suffix}`; }; - export default memo(PatrolDistanceCovered); - -PatrolDistanceCovered.propTypes = { - trackData: PropTypes.object, -}; \ No newline at end of file diff --git a/src/PickMapLocationButton/index.js b/src/PickMapLocationButton/index.js index cee9b0fed..62ecc1a3f 100644 --- a/src/PickMapLocationButton/index.js +++ b/src/PickMapLocationButton/index.js @@ -1,4 +1,4 @@ -import React, { forwardRef, memo, useCallback, useContext, useEffect, useState } from 'react'; +import React, { memo, useCallback, useContext, useEffect, useState } from 'react'; import { useDispatch } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -17,10 +17,11 @@ const PickMapLocationButton = ({ onCancel = null, onClick = null, onPick, + ref, renderContent = null, showInstructionsPopup = true, ...otherProps -}, ref) => { +}) => { const dispatch = useDispatch(); const { t } = useTranslation('components', { keyPrefix: 'pickMapLocationButton' }); @@ -97,4 +98,4 @@ const PickMapLocationButton = ({ ; }; -export default memo(forwardRef(PickMapLocationButton)); +export default memo(PickMapLocationButton); diff --git a/src/Popup/index.js b/src/Popup/index.js index d7bac0e91..79ee6c2da 100644 --- a/src/Popup/index.js +++ b/src/Popup/index.js @@ -1,14 +1,11 @@ import React, { Fragment, useEffect, useRef } from 'react'; import { withMap } from '../EarthRangerMap'; import { createPortal } from 'react-dom'; -import PropTypes from 'prop-types'; import mapboxgl from 'mapbox-gl'; import xor from 'lodash/xor'; -const Popup = (props) => { - const { className, trackPointer, offset, coordinates, anchor, children, map } = props; - +const Popup = ({ className = '', trackPointer = false, offset, coordinates, anchor, children, map }) => { const classNameRef = useRef(''); const popupRef = useRef(null); @@ -81,26 +78,4 @@ const Popup = (props) => { ); }; -Popup.propTypes = { - anchor: PropTypes.string, - children: PropTypes.oneOfType([ - PropTypes.arrayOf(PropTypes.node), - PropTypes.node, - PropTypes.exact(null), - ]), - className: PropTypes.string, - coordinates: PropTypes.array.isRequired, - map: PropTypes.object.isRequired, - offset: PropTypes.oneOfType([ - PropTypes.array, - PropTypes.object, - ]), - trackPointer: PropTypes.bool, -}; - -Popup.defaultProps = { - clasName: '', - trackPointer: false, -}; - export default withMap(Popup); diff --git a/src/PopupLayer/index.js b/src/PopupLayer/index.js index 28a4a9575..0aaeef9b2 100644 --- a/src/PopupLayer/index.js +++ b/src/PopupLayer/index.js @@ -1,5 +1,4 @@ import React, { memo, useContext, useEffect, useState } from 'react'; -import PropTypes from 'prop-types'; import { calculatePopoverPlacement } from '../utils/map'; import { MapContext } from '../App'; @@ -97,8 +96,4 @@ const PopupLayer = ({ popup, ...rest }) => { : null; }; -PopupLayer.propTypes = { - popup: PropTypes.object.isRequired, -}; - export default memo(PopupLayer); diff --git a/src/PriorityPicker/index.js b/src/PriorityPicker/index.js index 72fda932c..fd0dd1076 100644 --- a/src/PriorityPicker/index.js +++ b/src/PriorityPicker/index.js @@ -1,5 +1,4 @@ import React, { memo } from 'react'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { REPORT_PRIORITIES } from '../constants'; @@ -12,7 +11,7 @@ const PRIORITY_CLASSNAMES = { 300: 'highPriority', }; -const PriorityPicker = ({ className, isMulti, onSelect, selected }) => { +const PriorityPicker = ({ className = '', isMulti = false, onSelect = null, selected = 0 }) => { const { t } = useTranslation('components', { keyPrefix: 'priorityPicker' }); const isSelected = (value) => isMulti ? selected.some((v) => v === value) : selected === value; @@ -32,21 +31,4 @@ const PriorityPicker = ({ className, isMulti, onSelect, selected }) => { ; }; -PriorityPicker.defaultProps = { - className: '', - isMulti: false, - onSelect: null, - selected: 0, -}; - -PriorityPicker.propTypes = { - className: PropTypes.string, - isMulti: PropTypes.bool, - onSelect: PropTypes.func, - selected: PropTypes.oneOfType([ - PropTypes.number, - PropTypes.array - ]), -}; - export default memo(PriorityPicker); diff --git a/src/PrioritySelect/index.js b/src/PrioritySelect/index.js index ad753741f..f904c7aba 100644 --- a/src/PrioritySelect/index.js +++ b/src/PrioritySelect/index.js @@ -1,6 +1,5 @@ import React, { memo, useCallback, useState } from 'react'; import { components } from 'react-select'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { @@ -40,7 +39,7 @@ const Option = ({ data, ...props }) => ; -const PrioritySelect = ({ className, isDisabled, onChange, placeholder, priority }) => { +const PrioritySelect = ({ className = '', isDisabled = false, onChange, placeholder = '', priority = null }) => { const { t } = useTranslation('reports', { keyPrefix: 'prioritySelect' }); const [isMenuOpen, setMenuOpen] = useState(false); @@ -84,19 +83,4 @@ const PrioritySelect = ({ className, isDisabled, onChange, placeholder, priority />; }; -PrioritySelect.defaultProps = { - className: '', - isDisabled: false, - placeholder: '', - priority: null, -}; - -PrioritySelect.propTypes = { - className: PropTypes.string, - isDisabled: PropTypes.bool, - onChange: PropTypes.func.isRequired, - placeholder: PropTypes.string, - priority: PropTypes.number, -}; - export default memo(PrioritySelect); diff --git a/src/ProfilePINModal/index.js b/src/ProfilePINModal/index.js index 96232b6ee..957a5ecbd 100644 --- a/src/ProfilePINModal/index.js +++ b/src/ProfilePINModal/index.js @@ -2,7 +2,6 @@ import React, { memo, useCallback, useEffect, useRef, useState } from 'react'; import Form from 'react-bootstrap/Form'; import Modal from 'react-bootstrap/Modal'; import PinField from 'react-pin-field'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import ConfirmationCheck from '../ConfirmationCheck'; @@ -56,10 +55,10 @@ const ProfilePINModal = ({ onSuccess, profile }) => { length={PIN_LENGTH} onChange={onChange} onComplete={onComplete} + pattern={PIN_VALIDATION_RULES} ref={pinInputsRef} role="input" type="password" - validate={PIN_VALIDATION_RULES} /> {success && } @@ -71,12 +70,4 @@ const ProfilePINModal = ({ onSuccess, profile }) => { ; }; -ProfilePINModal.propTypes = { - onSuccess: PropTypes.func.isRequired, - profile: PropTypes.shape({ - username: PropTypes.string.isRequired, - pin: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired, - }).isRequired, -}; - export default memo(ProfilePINModal); diff --git a/src/QuickLinks/index.js b/src/QuickLinks/index.js index b58438f11..adc8d4e36 100644 --- a/src/QuickLinks/index.js +++ b/src/QuickLinks/index.js @@ -1,5 +1,4 @@ import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'; -import PropTypes from 'prop-types'; import useOnScreen from '../hooks/useOnScreen'; @@ -7,7 +6,7 @@ import * as styles from './styles.module.scss'; export const QuickLinksContext = createContext(); -const QuickLinks = ({ children, scrollTopOffset }) => { +const QuickLinks = ({ children, scrollTopOffset = 0 }) => { const sectionsWrapperRef = useRef(); const [sectionElements, setSectionElements] = useState({}); @@ -34,33 +33,14 @@ const QuickLinks = ({ children, scrollTopOffset }) => { ; }; -QuickLinks.defaultProps = { scrollTopOffset: 0, sectionWrapperRef: null }; -QuickLinks.propTypes = { - children: PropTypes.node.isRequired, - scrollTopOffset: PropTypes.number, - sectionWrapperRef: PropTypes.shape({ - current: PropTypes.any, - }), -}; - - -const NavigationBar = ({ children, className }) =>
    {children}
    ; -NavigationBar.defaultProps = { - clasName: '', -}; - -NavigationBar.propTypes = { - clasName: PropTypes.string, - children: PropTypes.node.isRequired, -}; - QuickLinks.NavigationBar = NavigationBar; @@ -87,12 +67,10 @@ const Anchor = ({ anchorTitle, onClick: onClickCallback = null, iconComponent })
    : null; }; -Anchor.propTypes = { anchorTitle: PropTypes.string.isRequired, iconComponent: PropTypes.node.isRequired }; - QuickLinks.Anchor = Anchor; -const SectionsWrapper = ({ className, children }) => { +const SectionsWrapper = ({ className = '', children }) => { const { sectionsWrapperRef } = useContext(QuickLinksContext); return
    {
    ; }; -SectionsWrapper.defaultProps = { - clasName: '' -}; - -SectionsWrapper.propTypes = { - className: PropTypes.string, - children: PropTypes.node.isRequired -}; - QuickLinks.SectionsWrapper = SectionsWrapper; -const Section = ({ anchorTitle, className, children, hidden }) => { +const Section = ({ anchorTitle, className = '', children, hidden = false }) => { const { getSectionElement, onSectionElementChange } = useContext(QuickLinksContext); const [sectionElement, setSectionElement] = useState(); @@ -134,18 +103,6 @@ const Section = ({ anchorTitle, className, children, hidden }) => { : null; }; -Section.defaultProps = { - className: '', - hidden: false, -}; - -Section.propTypes = { - anchorTitle: PropTypes.string.isRequired, - className: PropTypes.string, - children: PropTypes.node.isRequired, - hidden: PropTypes.bool, -}; - QuickLinks.Section = Section; diff --git a/src/ReportFormSummary/index.js b/src/ReportFormSummary/index.js index e71875b57..70de21336 100644 --- a/src/ReportFormSummary/index.js +++ b/src/ReportFormSummary/index.js @@ -1,6 +1,5 @@ import React, { memo, useMemo } from 'react'; import Form from '@rjsf/bootstrap-4'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import useReport from '../hooks/useReport'; @@ -75,11 +74,4 @@ const ReportFormSummary = ({ className, report, schema, uiSchema }) => { ; }; -ReportFormSummary.propTypes = { - className: PropTypes.string.isRequired, - report: PropTypes.object.isRequired, - schema: PropTypes.object.isRequired, - uiSchema: PropTypes.object.isRequired, -}; - export default memo(ReportFormSummary); diff --git a/src/ReportGeometryDrawer/CancelationConfirmationModal/index.js b/src/ReportGeometryDrawer/CancelationConfirmationModal/index.js index 244e7a618..adcc5185d 100644 --- a/src/ReportGeometryDrawer/CancelationConfirmationModal/index.js +++ b/src/ReportGeometryDrawer/CancelationConfirmationModal/index.js @@ -1,7 +1,6 @@ import React, { memo, useContext } from 'react'; import Button from 'react-bootstrap/Button'; import Modal from 'react-bootstrap/Modal'; -import PropTypes from 'prop-types'; import { useDispatch } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -56,9 +55,4 @@ const CancelationConfirmationModal = ({ onHide, show }) => { ; }; -CancelationConfirmationModal.propTypes = { - onHide: PropTypes.func.isRequired, - show: PropTypes.bool.isRequired, -}; - export default memo(CancelationConfirmationModal); diff --git a/src/ReportGeometryDrawer/Footer/index.js b/src/ReportGeometryDrawer/Footer/index.js index 2c36a013b..e5ec126cc 100644 --- a/src/ReportGeometryDrawer/Footer/index.js +++ b/src/ReportGeometryDrawer/Footer/index.js @@ -1,7 +1,6 @@ import React, { memo } from 'react'; import Button from 'react-bootstrap/Button'; import OverlayTrigger from 'react-bootstrap/OverlayTrigger'; -import PropTypes from 'prop-types'; import Tooltip from 'react-bootstrap/Tooltip'; import { useTranslation } from 'react-i18next'; @@ -34,11 +33,4 @@ const Footer = ({ isDrawing, isGeometryAValidPolygon, onCancel, onSave }) => { ; }; -Footer.propTypes = { - isDrawing: PropTypes.bool.isRequired, - isGeometryAValidPolygon: PropTypes.bool.isRequired, - onCancel: PropTypes.func.isRequired, - onSave: PropTypes.func.isRequired, -}; - export default memo(Footer); diff --git a/src/ReportGeometryDrawer/InformationModal/index.js b/src/ReportGeometryDrawer/InformationModal/index.js index 6ef3dc642..9d7759db7 100644 --- a/src/ReportGeometryDrawer/InformationModal/index.js +++ b/src/ReportGeometryDrawer/InformationModal/index.js @@ -1,6 +1,5 @@ import React, { memo } from 'react'; import Modal from 'react-bootstrap/Modal'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import * as styles from './styles.module.scss'; @@ -32,9 +31,4 @@ const InformationModal = ({ onHide, show }) => { ; }; -InformationModal.propTypes = { - onHide: PropTypes.func.isRequired, - show: PropTypes.bool.isRequired, -}; - export default memo(InformationModal); diff --git a/src/ReportListItem/index.js b/src/ReportListItem/index.js index 8c9f93a40..9905b8ac5 100644 --- a/src/ReportListItem/index.js +++ b/src/ReportListItem/index.js @@ -1,5 +1,4 @@ import React, { memo, useCallback, useRef } from 'react'; -import PropTypes from 'prop-types'; import { useDispatch } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -28,13 +27,13 @@ const HOVER_EFFECTS = { }; const ReportListItem = ({ - className, - displayTime, - onIconClick, - onTitleClick, + className = '', + displayTime = null, + onIconClick = null, + onTitleClick = null, report, - showElapsedTime, - showJumpButton, + showElapsedTime = true, + showJumpButton = true, }) => { const dispatch = useDispatch(); const { t } = useTranslation('reports', { keyPrefix: 'reportListItem' }); @@ -105,23 +104,4 @@ const ReportListItem = ({ />; }; -ReportListItem.defaultProps = { - className: '', - displayTime: null, - onIconClick: null, - onTitleClick: null, - showElapsedTime: true, - showJumpButton: true, -}; - -ReportListItem.propTypes = { - className: PropTypes.string, - displayTime: PropTypes.string, - onIconClick: PropTypes.func, - onTitleClick: PropTypes.func, - report: PropTypes.object.isRequired, - showElapsedTime: PropTypes.bool, - showJumpButton: PropTypes.bool, -}; - export default memo(ReportListItem); diff --git a/src/ReportManager/DetailsSection/AreaSelectorInput/GeometryPreview/index.js b/src/ReportManager/DetailsSection/AreaSelectorInput/GeometryPreview/index.js index 46056ca8b..215a9ed42 100644 --- a/src/ReportManager/DetailsSection/AreaSelectorInput/GeometryPreview/index.js +++ b/src/ReportManager/DetailsSection/AreaSelectorInput/GeometryPreview/index.js @@ -1,7 +1,6 @@ import React, { memo, useMemo } from 'react'; import { bbox, rewind, simplify } from '@turf/turf'; import Button from 'react-bootstrap/Button'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -19,7 +18,7 @@ const MAPBOX_MAXIMUM_LATITUDE = 85.0511; const STATIC_MAP_WIDTH = 296; const STATIC_MAP_HEGHT = 130; -const GeometryPreview = ({ className, event, onAreaSelectStart, onDeleteArea }) => { +const GeometryPreview = ({ className = '', event, onAreaSelectStart = null, onDeleteArea = null }) => { const { t } = useTranslation('reports', { keyPrefix: 'reportManager' }); const originalEvent = useSelector((state) => state.data.eventStore[event.id]); @@ -99,17 +98,4 @@ const GeometryPreview = ({ className, event, onAreaSelectStart, onDeleteArea }) ; }; -GeometryPreview.defaultProps = { - className: '', - onAreaSelectStart: null, - onDeleteArea: null, -}; - -GeometryPreview.propTypes = { - className: PropTypes.string, - event: PropTypes.object.isRequired, - onAreaSelectStart: PropTypes.func, - onDeleteArea: PropTypes.func, -}; - export default memo(GeometryPreview); diff --git a/src/ReportManager/DetailsSection/AreaSelectorInput/index.js b/src/ReportManager/DetailsSection/AreaSelectorInput/index.js index 228d47dbc..e84cbe053 100644 --- a/src/ReportManager/DetailsSection/AreaSelectorInput/index.js +++ b/src/ReportManager/DetailsSection/AreaSelectorInput/index.js @@ -2,7 +2,6 @@ import React, { memo, useCallback, useContext, useEffect, useRef, useState } fro import debounceRender from 'react-debounce-render'; import Overlay from 'react-bootstrap/Overlay'; import Popover from 'react-bootstrap/Popover'; -import PropTypes from 'prop-types'; import { useDispatch, useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -24,7 +23,7 @@ const eventReportTracker = trackEventFactory(EVENT_REPORT_CATEGORY); const GEOMETRY_PROVENANCE_WEB = 'web'; -const AreaSelectorInput = ({ event, onGeometryChange, originalEvent }) => { +const AreaSelectorInput = ({ event, onGeometryChange = null, originalEvent = null }) => { const dispatch = useDispatch(); const { t } = useTranslation('reports', { keyPrefix: 'reportManager' }); @@ -179,14 +178,3 @@ const AreaSelectorInput = ({ event, onGeometryChange, originalEvent }) => { }; export default debounceRender(memo(AreaSelectorInput)); - -AreaSelectorInput.defaultProps = { - onGeometryChange: null, - originalEvent: null, -}; - -AreaSelectorInput.propTypes = { - event: PropTypes.object.isRequired, - onGeometryChange: PropTypes.func.isRequired, - originalEvent: PropTypes.object.isRequired, -}; diff --git a/src/ReportManager/DetailsSection/SchemaForm/fields/Collection/SortableList/Item/index.js b/src/ReportManager/DetailsSection/SchemaForm/fields/Collection/SortableList/Item/index.js index be2f6fb7e..11e392e03 100644 --- a/src/ReportManager/DetailsSection/SchemaForm/fields/Collection/SortableList/Item/index.js +++ b/src/ReportManager/DetailsSection/SchemaForm/fields/Collection/SortableList/Item/index.js @@ -1,4 +1,4 @@ -import React, { forwardRef, useEffect, useRef } from 'react'; +import React, { useEffect, useRef } from 'react'; import Collapse from 'react-bootstrap/Collapse'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -32,11 +32,12 @@ const Item = ({ isFormPreviewOpen, onChange = null, onDelete = null, + ref, renderField = null, setIsFormModalOpen = null, setIsFormPreviewOpen = null, ...otherProps -}, ref) => { +}) => { const { i18n, t } = useTranslation('reports', { keyPrefix: 'reportManager.detailsSection.schemaForm.fields.collection.sortableList.item', }); @@ -219,4 +220,4 @@ const Item = ({ ; }; -export default forwardRef(Item); +export default Item; diff --git a/src/ReportManager/DetailsSection/index.js b/src/ReportManager/DetailsSection/index.js index 9bcc7d649..863609e43 100644 --- a/src/ReportManager/DetailsSection/index.js +++ b/src/ReportManager/DetailsSection/index.js @@ -1,4 +1,4 @@ -import React, { forwardRef, memo, useCallback, useContext, useEffect, useState } from 'react'; +import React, { memo, useCallback, useContext, useEffect, useState } from 'react'; import Dropdown from 'react-bootstrap/Dropdown'; import Form from '@rjsf/bootstrap-4'; import { format, isToday, isValid as isValidDate, parseISO } from 'date-fns'; @@ -64,9 +64,10 @@ const DetailsSection = ({ onReportLocationChange, onReportStateChange, originalReport, + ref, reportForm, submitFormButtonRef, -}, ref) => { +}) => { const dispatch = useDispatch(); const { t } = useTranslation('reports', { keyPrefix: 'reportManager.detailsSection' }); @@ -316,4 +317,4 @@ const DetailsSection = ({ ; }; -export default memo(forwardRef(DetailsSection)); +export default memo(DetailsSection); diff --git a/src/ReportManager/Header/ReportMenu/index.js b/src/ReportManager/Header/ReportMenu/index.js index b76971df0..0d20f926e 100644 --- a/src/ReportManager/Header/ReportMenu/index.js +++ b/src/ReportManager/Header/ReportMenu/index.js @@ -1,5 +1,4 @@ import React, { memo, useContext } from 'react'; -import PropTypes from 'prop-types'; import { useDispatch } from 'react-redux'; import { useReactToPrint } from 'react-to-print'; import { useTranslation } from 'react-i18next'; @@ -129,15 +128,4 @@ const ReportMenu = ({ onSaveReport, printableContentRef, report, setRedirectTo } ; }; -ReportMenu.propTypes = { - onSaveReport: PropTypes.func.isRequired, - printableContentRef: PropTypes.shape({ current: PropTypes.instanceOf(Element) }).isRequired, - report: PropTypes.shape({ - id: PropTypes.string, - is_collection: PropTypes.bool, - priority: PropTypes.number, - }).isRequired, - setRedirectTo: PropTypes.func.isRequired, -}; - export default memo(ReportMenu); diff --git a/src/ReportManager/Header/index.js b/src/ReportManager/Header/index.js index f7902dbe3..8af4d11aa 100644 --- a/src/ReportManager/Header/index.js +++ b/src/ReportManager/Header/index.js @@ -1,5 +1,4 @@ import React, { memo, useCallback, useContext, useRef } from 'react'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { collectionHasMultipleValidLocations, PRIORITY_COLOR_MAP } from '../../utils/events'; @@ -14,7 +13,7 @@ import ReportMenu from './ReportMenu'; import * as styles from './styles.module.scss'; const Header = ({ - isReadOnly, + isReadOnly = false, onChangeTitle, onSaveReport, printableContentRef, @@ -110,17 +109,4 @@ const Header = ({ ; }; -Header.defaultProps = { - isReadOnly: false, -}; - -Header.propTypes = { - isReadOnly: PropTypes.bool, - onChangeTitle: PropTypes.func.isRequired, - onSaveReport: PropTypes.func.isRequired, - printableContentRef: PropTypes.shape({ current: PropTypes.instanceOf(Element) }).isRequired, - report: PropTypes.object.isRequired, - setRedirectTo: PropTypes.func.isRequired, -}; - export default memo(Header); diff --git a/src/ReportManager/LinksSection/LinkItem/index.js b/src/ReportManager/LinksSection/LinkItem/index.js index e1e1d24fd..548900578 100644 --- a/src/ReportManager/LinksSection/LinkItem/index.js +++ b/src/ReportManager/LinksSection/LinkItem/index.js @@ -1,5 +1,4 @@ import React, { memo, useCallback, useContext } from 'react'; -import PropTypes from 'prop-types'; import { TrackerContext } from '../../../utils/analytics'; @@ -43,9 +42,4 @@ const LinkItem = ({ item, to, type }) => { return null; }; -LinkItem.propTypes = { - item: PropTypes.object.isRequired, - type: PropTypes.string.isRequired, -}; - export default memo(LinkItem); diff --git a/src/ReportManager/LinksSection/index.js b/src/ReportManager/LinksSection/index.js index 42435096f..cc6983390 100644 --- a/src/ReportManager/LinksSection/index.js +++ b/src/ReportManager/LinksSection/index.js @@ -1,5 +1,4 @@ import React, { memo } from 'react'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { ReactComponent as LinkIcon } from '../../common/images/icons/link.svg'; @@ -10,7 +9,7 @@ import LinkItem from './LinkItem'; import * as styles from './styles.module.scss'; -const LinksSection = ({ linkedPatrols, linkedReports }) => { +const LinksSection = ({ linkedPatrols = [], linkedReports = [] }) => { const { t } = useTranslation('reports', { keyPrefix: 'reportManager' }); return
    @@ -38,18 +37,4 @@ const LinksSection = ({ linkedPatrols, linkedReports }) => {
    ; }; -LinksSection.defaultProps = { - linkedPatrols: [], - linkedReports: [], -}; - -LinksSection.propTypes = { - linkedPatrols: PropTypes.arrayOf(PropTypes.shape({ - id: PropTypes.string, - })), - linkedReports: PropTypes.arrayOf(PropTypes.shape({ - id: PropTypes.string, - })), -}; - export default memo(LinksSection); diff --git a/src/ReportManager/index.js b/src/ReportManager/index.js index 94f6ab202..32c47c8d3 100644 --- a/src/ReportManager/index.js +++ b/src/ReportManager/index.js @@ -1,6 +1,5 @@ import React, { memo, useCallback, useContext, useEffect, useState } from 'react'; import { useDispatch, useSelector } from 'react-redux'; -import PropTypes from 'prop-types'; import { useLocation, useSearchParams } from 'react-router'; import { @@ -31,7 +30,7 @@ const shouldFetchEventDetails = (eventId, eventStore) => || !eventStore[eventId].notes || !eventStore[eventId].updates; -const ReportManager = ({ onReportBeingAdded }) => { +const ReportManager = ({ onReportBeingAdded = null }) => { const dispatch = useDispatch(); const location = useLocation(); const navigate = useNavigate(); @@ -148,12 +147,4 @@ const ReportManager = ({ onReportBeingAdded }) => { ; }; -ReportManager.defaultProps = { - onReportBeingAdded: null, -}; - -ReportManager.propTypes = { - onReportBeingAdded: PropTypes.func, -}; - export default memo(ReportManager); diff --git a/src/ReportedBySelect/index.js b/src/ReportedBySelect/index.js index 5023f7151..c93ed4954 100644 --- a/src/ReportedBySelect/index.js +++ b/src/ReportedBySelect/index.js @@ -1,7 +1,6 @@ import React, { memo, useCallback, useMemo, useState } from 'react'; import { components } from 'react-select'; import { FixedSizeList } from 'react-window'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -137,15 +136,15 @@ const MenuList = ({ options, children, maxHeight, getValue }) => { }; const ReportedBySelect = ({ - className, - isDisabled, - isMulti, - menuRef, - numberOfRecentRadiosToShow, + className = '', + isDisabled = false, + isMulti = false, + menuRef = null, + numberOfRecentRadiosToShow = 5, onChange, - options: optionsFromProps, - placeholder, - value, + options: optionsFromProps = null, + placeholder = null, + value = null, }) => { const { t } = useTranslation('components', { keyPrefix: 'reportedBySelect' }); @@ -252,34 +251,4 @@ const ReportedBySelect = ({ />; }; -ReportedBySelect.defaultProps = { - className: '', - isDisabled: false, - isMulti: false, - menuRef: null, - numberOfRecentRadiosToShow: 5, - options: null, - placeholder: null, - value: null, -}; - -ReportedBySelect.propTypes = { - className: PropTypes.string, - isDisabled: PropTypes.bool, - isMulti: PropTypes.bool, - menuRef: PropTypes.shape({ - current: PropTypes.any, - }), - numberOfRecentRadiosToShow: PropTypes.number, - onChange: PropTypes.func.isRequired, - options: PropTypes.arrayOf(PropTypes.shape({ - id: PropTypes.string, - })), - placeholder: PropTypes.string, - value: PropTypes.oneOfType([ - PropTypes.object, - PropTypes.array, - ]), -}; - export default memo(ReportedBySelect); diff --git a/src/ReportsHeatmapLegend/index.js b/src/ReportsHeatmapLegend/index.js index 7f3d5cc32..5824759bd 100644 --- a/src/ReportsHeatmapLegend/index.js +++ b/src/ReportsHeatmapLegend/index.js @@ -1,5 +1,4 @@ import React, { memo } from 'react'; -import PropTypes from 'prop-types'; import { differenceInCalendarDays } from 'date-fns'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -29,8 +28,4 @@ const ReportsHeatmapLegend = ({ onClose }) => { />; }; -ReportsHeatmapLegend.propTypes = { - onClose: PropTypes.func.isRequired, -}; - export default memo(ReportsHeatmapLegend); diff --git a/src/SearchBar/index.js b/src/SearchBar/index.js index 276e5f973..c6f3a87f5 100644 --- a/src/SearchBar/index.js +++ b/src/SearchBar/index.js @@ -1,5 +1,4 @@ import React, { memo, useState } from 'react'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { ReactComponent as ClearIcon } from '../common/images/icons/close-icon.svg'; @@ -7,7 +6,7 @@ import { ReactComponent as SearchIcon } from '../common/images/icons/search-icon import * as styles from './styles.module.scss'; -const SearchBar = ({ className, onChange, onClear, placeholder, value, ...restProps }) => { +const SearchBar = ({ className = '', onChange, onClear = null, placeholder = null, value, ...restProps }) => { const { t } = useTranslation('components', { keyPrefix: 'searchBar' }); const [isActive, setIsActiveState] = useState(false); @@ -35,18 +34,4 @@ const SearchBar = ({ className, onChange, onClear, placeholder, value, ...restPr ; }; -SearchBar.defaultProps = { - className: '', - onClear: null, - placeholder: null, -}; - -SearchBar.propTypes = { - className: PropTypes.string, - onChange: PropTypes.func.isRequired, - onClear: PropTypes.func, - placeholder: PropTypes.string, - value: PropTypes.string.isRequired, -}; - -export default memo(SearchBar); \ No newline at end of file +export default memo(SearchBar); diff --git a/src/Select/index.js b/src/Select/index.js index cef15794c..66e65f518 100644 --- a/src/Select/index.js +++ b/src/Select/index.js @@ -1,4 +1,4 @@ -import React, { forwardRef, useMemo } from 'react'; +import React, { useMemo } from 'react'; import ReactSelect, { components } from 'react-select'; import * as colorVars from '../common/styles/vars/colors.module.scss'; @@ -15,7 +15,7 @@ const IndicatorsContainer = ({ className, ...rest }) => ; -const Select = ({ styles: customStyles, components, ...rest }, ref) => { +const Select = ({ styles: customStyles, components, ref, ...rest }) => { const selectStyles = useMemo(() => ({ ...customStyles, option: (styles, state) => { @@ -51,6 +51,4 @@ const Select = ({ styles: customStyles, components, ...rest }, ref) => { />; }; -const SelectForwardRef = forwardRef(Select); - -export default SelectForwardRef; +export default Select; diff --git a/src/SelectListGroup/SelectableItem/index.js b/src/SelectListGroup/SelectableItem/index.js index 6a1dec8b8..06828187e 100644 --- a/src/SelectListGroup/SelectableItem/index.js +++ b/src/SelectListGroup/SelectableItem/index.js @@ -1,4 +1,4 @@ -import React, { forwardRef } from 'react'; +import React from 'react'; import * as styles from './styles.module.scss'; @@ -26,9 +26,9 @@ const SelectableItem = ({ readOnly = false, value, isMulti = true, + ref, ...otherProps -}, ref) => { - +}) => { const handleOnChange = (event) => { if (!readOnly && !disabled){ event?.preventDefault(); @@ -56,4 +56,4 @@ const SelectableItem = ({ ; }; -export default forwardRef(SelectableItem); +export default SelectableItem; diff --git a/src/SidebarScrollContext/index.js b/src/SidebarScrollContext/index.js index 2052569d1..84e066a42 100644 --- a/src/SidebarScrollContext/index.js +++ b/src/SidebarScrollContext/index.js @@ -1,5 +1,4 @@ -import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState, forwardRef } from 'react'; -import PropTypes from 'prop-types'; +import React, { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react'; export const SidebarScrollContext = createContext(); @@ -7,36 +6,36 @@ const getElement = (ref) => ref?.current?.el ?? ref?.current; export const SidebarScrollProvider = ({ children }) => { const scrollRef = useRef(null); + const [scrollPositionValues, setScrollPositionValues] = useState({}); const setScrollPosition = useCallback((tab, position = null) => { const element = getElement(scrollRef); - const value = position ?? element.scrollTop; - setScrollPositionValues({ - ...scrollPositionValues, - [tab]: value - }); + + setScrollPositionValues({ ...scrollPositionValues, [tab]: position ?? element.scrollTop }); }, [scrollPositionValues]); const scrollToLastPosition = useCallback((tab) => { const element = getElement(scrollRef); if (element?.scrollTo){ - element.scrollTo({ - top: scrollPositionValues[tab] - }); + element.scrollTo({ top: scrollPositionValues[tab] }); } }, [scrollPositionValues]); - const scrollContextValue = useMemo(() => ({ setScrollPosition, scrollToLastPosition, scrollRef, scrollPositionValues }), [scrollToLastPosition, setScrollPosition, scrollPositionValues]); + const scrollContextValue = useMemo( + () => ({ setScrollPosition, scrollToLastPosition, scrollRef, scrollPositionValues }), + [scrollToLastPosition, setScrollPosition, scrollPositionValues] + ); return {children} ; }; -export const ScrollRestoration = ({ Component, namespace, children, ...props }) => { +export const ScrollRestoration = ({ Component = 'div', namespace, children, ...props }) => { const { scrollRef, setScrollPosition, scrollToLastPosition } = useContext(SidebarScrollContext); + const onScrollFeed = useCallback(() => setScrollPosition(namespace), [setScrollPosition, namespace]); useEffect(() => { @@ -60,18 +59,3 @@ export const ScrollRestoration = ({ Component, namespace, children, ...props }) {children}
    ; }; - -ScrollRestoration.defaultProps = { - // eslint-disable-next-line react/display-name - Component: forwardRef(({ children, ...otherProps }, ref) => { - return
    - {children} -
    ; - }), -}; - -ScrollRestoration.propTypes = { - Component: PropTypes.oneOfType([PropTypes.object, PropTypes.element, PropTypes.array, PropTypes.func]), - namespace: PropTypes.string.isRequired, - children: PropTypes.oneOfType([PropTypes.element, PropTypes.array]).isRequired, -}; diff --git a/src/SleepDetector/index.js b/src/SleepDetector/index.js index 1d72df5f7..f5b9fe7bd 100644 --- a/src/SleepDetector/index.js +++ b/src/SleepDetector/index.js @@ -1,5 +1,4 @@ import React, { useEffect, useRef, memo } from 'react'; /* eslint-disable-line no-unused-vars */ -import PropTypes from 'prop-types'; const DEFAULT_INTERVAL = 240000; const DEFAULT_TOLERANCE = 2000; @@ -26,9 +25,3 @@ const SleepDetector = (props) => { }; export default memo(SleepDetector); - -SleepDetector.propTypes = { - onSleepDetected: PropTypes.func.isRequired, - interval: PropTypes.number, - tolerance: PropTypes.number, -}; \ No newline at end of file diff --git a/src/StateManagedSocketConsumer/index.js b/src/StateManagedSocketConsumer/index.js index ebe36b6f2..f88e774e6 100644 --- a/src/StateManagedSocketConsumer/index.js +++ b/src/StateManagedSocketConsumer/index.js @@ -1,5 +1,4 @@ import React, { useContext, useEffect, useRef, memo } from 'react'; -import PropTypes from 'prop-types'; import noop from 'lodash/noop'; import { SocketContext } from '../withSocketConnection'; @@ -40,9 +39,3 @@ const StateManagedSocketConsumer = (props) => { }; export default memo(StateManagedSocketConsumer); - -StateManagedSocketConsumer.propTypes = { - type: PropTypes.string.isRequired, - callback: PropTypes.func.isRequired, - onStateMismatch: PropTypes.func, -}; \ No newline at end of file diff --git a/src/SubjectControls/button.js b/src/SubjectControls/button.js index 68f895822..5b80ed668 100644 --- a/src/SubjectControls/button.js +++ b/src/SubjectControls/button.js @@ -1,35 +1,25 @@ -import React, { forwardRef, memo } from 'react'; -import noop from 'lodash/noop'; -import PropTypes from 'prop-types'; +import React, { memo } from 'react'; + import LoadingOverlay from '../LoadingOverlay'; -import * as styles from './styles.module.scss'; -const SubjectControlButton = (props, ref) => { - const { buttonClassName = '', containerClassName = '', disabled = false, labelText, onClick, showLabel, loading, ...rest } = props; +import * as styles from './styles.module.scss'; - return
    +const SubjectControlButton = ({ + buttonClassName = '', + containerClassName = '', + disabled = false, + labelText, + onClick = null, + showLabel = true, + loading = false, + ref, + ...rest +}) => { + return
    {loading && } {showLabel && labelText && {labelText}}
    ; }; -const memoizedSubjectControlButton = memo(forwardRef(SubjectControlButton)); - -export default memoizedSubjectControlButton; - -memoizedSubjectControlButton.defaultProps = { - onClick: noop, - showLabel: true, - loading: false, -}; - -memoizedSubjectControlButton.propTypes = { - buttonClassName: PropTypes.string, - containerClassName: PropTypes.string, - disabled: PropTypes.bool, - labelText: PropTypes.string, - onClick: PropTypes.func, - showLabel: PropTypes.bool, - loading: PropTypes.bool, -}; \ No newline at end of file +export default memo(SubjectControlButton); diff --git a/src/SubjectControls/index.js b/src/SubjectControls/index.js index d7486bb03..808287600 100644 --- a/src/SubjectControls/index.js +++ b/src/SubjectControls/index.js @@ -1,5 +1,4 @@ import React, { lazy, memo, useState } from 'react'; -import PropTypes from 'prop-types'; import { useDispatch, useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -26,15 +25,15 @@ const SubjectHistoricalDataModal = lazy(() => import('../SubjectHistoricalDataMo const mapLayerTracker = trackEventFactory(MAP_LAYERS_CATEGORY); const SubjectControls = ({ - children, - className, - showHeatmapButton, - showHistoryButton, - showJumpButton, - showLabels, - showMessageButton, - showTitles, - showTrackButton, + children = null, + className = '', + showHeatmapButton = true, + showHistoryButton = false, + showJumpButton = true, + showLabels = true, + showMessageButton = true, + showTitles = true, + showTrackButton = true, subject, ...restProps }) => { @@ -139,35 +138,4 @@ const SubjectControls = ({
    : null; }; -SubjectControls.defaultProps = { - children: null, - className: '', - showHeatmapButton: true, - showHistoryButton: false, - showJumpButton: true, - showLabels: true, - showMessageButton: true, - showTitles: true, - showTrackButton: true, -}; - -SubjectControls.propTypes = { - children: PropTypes.node, - className: PropTypes.string, - showHeatmapButton: PropTypes.bool, - showHistoryButton: PropTypes.bool, - showJumpButton: PropTypes.bool, - showLabels: PropTypes.bool, - showMessageButton: PropTypes.bool, - showTitles: PropTypes.bool, - showTrackButton: PropTypes.bool, - subject: PropTypes.shape({ - device_status_properties: PropTypes.array, - id: PropTypes.string, - messaging: PropTypes.array, - name: PropTypes.string, - subject_type: PropTypes.string, - }).isRequired, -}; - export default memo(SubjectControls); diff --git a/src/SubjectGroupList/Content.js b/src/SubjectGroupList/Content.js index 4830fbdd1..5645c2016 100644 --- a/src/SubjectGroupList/Content.js +++ b/src/SubjectGroupList/Content.js @@ -1,5 +1,4 @@ import React, { memo, useEffect, useState } from 'react'; -import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import Collapsible from 'react-collapsible'; import intersection from 'lodash/intersection'; @@ -151,16 +150,3 @@ const mapStateToProps = (state, ownProps) => subjectGroupHeatmapControlState(sta const ConnectedComponent = connect(mapStateToProps, { addHeatmapSubjects, removeHeatmapSubjects })(memo(ContentComponent)); export default ConnectedComponent; - - -ContentComponent.defaultProps = { - itemProps: {}, -}; - -ContentComponent.propTypes = { - subgroups: PropTypes.array.isRequired, - itemProps: PropTypes.object, - subjects: PropTypes.array.isRequired, - name: PropTypes.string.isRequired, - hiddenSubjectIDs: PropTypes.array, -}; diff --git a/src/SubjectGroupList/index.js b/src/SubjectGroupList/index.js index ef1f26876..607b2a84d 100644 --- a/src/SubjectGroupList/index.js +++ b/src/SubjectGroupList/index.js @@ -1,5 +1,4 @@ import React, { memo, useCallback, useMemo } from 'react'; -import PropTypes from 'prop-types'; import { connect } from 'react-redux'; import { hideSubjects, showSubjects } from '../ducks/map-layer-filter'; @@ -13,9 +12,7 @@ import * as listStyles from '../SideBar/styles.module.scss'; const mapLayerTracker = trackEventFactory(MAP_LAYERS_CATEGORY); -const SubjectGroupList = (props) => { - const { subjectGroups, mapLayerFilter, hideSubjects, showSubjects, map } = props; - +const SubjectGroupList = ({ subjectGroups, mapLayerFilter, hideSubjects, showSubjects, map = {} }) => { const { hiddenSubjectIDs } = mapLayerFilter; const searchText = useMemo(() => mapLayerFilter.text || '', [mapLayerFilter.text]); @@ -87,11 +84,3 @@ const mapStateToProps = (state) => { }; export default connect(mapStateToProps, { hideSubjects, showSubjects })(memo(SubjectGroupList)); - -SubjectGroupList.defaultProps = { - map: {}, -}; - -SubjectGroupList.propTypes = { - map: PropTypes.object, -}; diff --git a/src/SubjectHeatmapLegend/index.js b/src/SubjectHeatmapLegend/index.js index 3fad029e6..769139ca2 100644 --- a/src/SubjectHeatmapLegend/index.js +++ b/src/SubjectHeatmapLegend/index.js @@ -2,7 +2,6 @@ import React, { memo } from 'react'; import Button from 'react-bootstrap/Button'; import OverlayTrigger from 'react-bootstrap/OverlayTrigger'; import Popover from 'react-bootstrap/Popover'; -import PropTypes from 'prop-types'; import { useDispatch, useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -100,8 +99,4 @@ const SubjectHeatmapLegend = ({ onClose }) => { />; }; -SubjectHeatmapLegend.propTypes = { - onClose: PropTypes.func.isRequired, -}; - export default memo(SubjectHeatmapLegend); diff --git a/src/SubjectHistoricalDataModal/index.js b/src/SubjectHistoricalDataModal/index.js index ad7e2b44d..a257e988b 100644 --- a/src/SubjectHistoricalDataModal/index.js +++ b/src/SubjectHistoricalDataModal/index.js @@ -2,7 +2,6 @@ import React, { memo, useEffect, useState } from 'react'; import flatten from 'lodash/flatten'; import Modal from 'react-bootstrap/Modal'; import Pagination from 'react-js-pagination'; -import PropTypes from 'prop-types'; import startCase from 'lodash/startCase'; import Table from 'react-bootstrap/Table'; import unionBy from 'lodash/unionBy'; @@ -125,10 +124,4 @@ const SubjectHistoricalDataModal = ({ subjectId, subjectIsStatic, title }) => { ; }; -SubjectHistoricalDataModal.propTypes = { - subjectId: PropTypes.string.isRequired, - subjectIsStatic: PropTypes.bool.isRequired, - title: PropTypes.string.isRequired, -}; - export default memo(SubjectHistoricalDataModal); diff --git a/src/SubjectHistoryButton/index.js b/src/SubjectHistoryButton/index.js index c71120ae5..2ac137cc1 100644 --- a/src/SubjectHistoryButton/index.js +++ b/src/SubjectHistoryButton/index.js @@ -1,20 +1,19 @@ -import React, { forwardRef, memo } from 'react'; +import React, { memo } from 'react'; import { useTranslation } from 'react-i18next'; import SubjectControlButton from '../SubjectControls/button'; import * as styles from './styles.module.scss'; -const SubjectHistoryButton = (props, ref) => { +const SubjectHistoryButton = (props) => { const { t } = useTranslation('subjects', { keyPrefix: 'subjectHistoryButton' }); return ; }; -export default memo(forwardRef(SubjectHistoryButton)); +export default memo(SubjectHistoryButton); diff --git a/src/SubjectMessagePopup/index.js b/src/SubjectMessagePopup/index.js index 5a5bcc354..802e60a38 100644 --- a/src/SubjectMessagePopup/index.js +++ b/src/SubjectMessagePopup/index.js @@ -1,5 +1,4 @@ import React, { memo } from 'react'; -import PropTypes from 'prop-types'; import { ReactComponent as ChatIcon } from '../common/images/icons/chat-icon.svg'; @@ -30,20 +29,4 @@ const SubjectMessagePopup = ({ data }) => { ; }; -SubjectMessagePopup.propTypes = { - data: PropTypes.shape({ - message: PropTypes.shape({ - device_location: PropTypes.shape({ - latitude: PropTypes.number, - longitude: PropTypes.number, - }), - message_time: PropTypes.string, - text: PropTypes.string, - }), - subject: PropTypes.shape({ - name: PropTypes.string, - }), - }).isRequired, -}; - export default memo(SubjectMessagePopup); diff --git a/src/SubjectMessagesPopover/index.js b/src/SubjectMessagesPopover/index.js index ec1d9cf78..2d41c8c4e 100644 --- a/src/SubjectMessagesPopover/index.js +++ b/src/SubjectMessagesPopover/index.js @@ -1,7 +1,6 @@ import React, { memo } from 'react'; import OverlayTrigger from 'react-bootstrap/OverlayTrigger'; import Popover from 'react-bootstrap/Popover'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { ReactComponent as ChatIcon } from '../common/images/icons/chat-icon.svg'; @@ -16,7 +15,7 @@ import SubjectControlButton from '../SubjectControls/button'; import * as styles from './styles.module.scss'; -const SubjectMessagesPopover = ({ className, subject, ...restProps }) => { +const SubjectMessagesPopover = ({ className = '', subject = null, ...restProps }) => { const { t } = useTranslation('subjects', { keyPrefix: 'subjectMessagesPopover' }); const hasMessagingWritePermissions = usePermissions(PERMISSION_KEYS.MESSAGING, PERMISSIONS.CREATE); @@ -60,17 +59,4 @@ const SubjectMessagesPopover = ({ className, subject, ...restProps }) => {
    ; }; -SubjectMessagesPopover.defaultProps = { - className: '', - subject: null, -}; - -SubjectMessagesPopover.propTypes = { - className: PropTypes.string, - subject: PropTypes.shape({ - id: PropTypes.string, - name: PropTypes.string, - }), -}; - export default memo(SubjectMessagesPopover); diff --git a/src/SubjectMessagesPopup/index.js b/src/SubjectMessagesPopup/index.js index 35abc5c51..7e36d5a4a 100644 --- a/src/SubjectMessagesPopup/index.js +++ b/src/SubjectMessagesPopup/index.js @@ -1,5 +1,4 @@ import React, { memo } from 'react'; -import PropTypes from 'prop-types'; import { ReactComponent as ChatIcon } from '../common/images/icons/chat-icon.svg'; @@ -35,13 +34,4 @@ const SubjectMessagesPopup = ({ data }) => { ; }; -SubjectMessagesPopup.propTypes = { - data: PropTypes.shape({ - properties: PropTypes.shape({ - id: PropTypes.string, - name: PropTypes.string, - }), - }).isRequired, -}; - export default memo(SubjectMessagesPopup); diff --git a/src/SubjectPopup/index.js b/src/SubjectPopup/index.js index 7447a5360..6619f4a49 100644 --- a/src/SubjectPopup/index.js +++ b/src/SubjectPopup/index.js @@ -1,5 +1,4 @@ import React, { memo, useCallback, useState } from 'react'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; import Button from 'react-bootstrap/Button'; @@ -156,22 +155,4 @@ const SubjectPopup = ({ data }) => { ; }; -SubjectPopup.propTypes = { - data: PropTypes.shape({ - geometry: PropTypes.shape({ - coordinates: PropTypes.arrayOf(PropTypes.number) - }), - properties: PropTypes.shape({ - coordinateProperties: PropTypes.oneOfType([PropTypes.string, PropTypes.object]), - default_status_value: PropTypes.string, - device_status_properties: PropTypes.oneOfType([PropTypes.string, PropTypes.array]), - id: PropTypes.string, - image: PropTypes.string, - last_voice_call_start_at: PropTypes.string, - name: PropTypes.string, - tracks_available: PropTypes.bool, - }) - }).isRequired, -}; - export default memo(SubjectPopup); diff --git a/src/SubjectsLayer/index.js b/src/SubjectsLayer/index.js index 0b56fb723..603dd9b84 100644 --- a/src/SubjectsLayer/index.js +++ b/src/SubjectsLayer/index.js @@ -1,6 +1,5 @@ import React, { memo, useCallback, useContext, useEffect, useMemo, useState } from 'react'; import { featureCollection } from '@turf/turf'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { addFeatureCollectionImagesToMap } from '../utils/map'; @@ -32,7 +31,7 @@ const UNCLUSTERED_FILTER = [ const UNCLUSTERED_LAYER_ID = `${SUBJECT_SYMBOLS}-unclustered`; const UNCLUSTERED_SOURCE_ID = 'subject-symbol-source'; -const SubjectsLayer = ({ mapImages, onSubjectClick }) => { +const SubjectsLayer = ({ mapImages = {}, onSubjectClick }) => { const map = useContext(MapContext); const shouldSubjectsBeClustered = useSelector(getShouldSubjectsBeClustered); @@ -97,13 +96,4 @@ const SubjectsLayer = ({ mapImages, onSubjectClick }) => { ; }; -SubjectsLayer.defaultProps = { - mapImages: {}, -}; - -SubjectsLayer.propTypes = { - mapImages: PropTypes.object, - onSubjectClick: PropTypes.func.isRequired, -}; - export default memo(withMapViewConfig(SubjectsLayer)); diff --git a/src/TimeInput/index.js b/src/TimeInput/index.js deleted file mode 100644 index 7f3a4d51c..000000000 --- a/src/TimeInput/index.js +++ /dev/null @@ -1,70 +0,0 @@ -import React, { memo, useCallback, useEffect, useState, forwardRef } from 'react'; - -import * as styles from './styles.module.scss'; - -const MIN_VALUE = 0; -const MAX_HOUR = 23; -const MAX_MINUTE = 59; - -const NUMBER_INPUT_ATTRS = { - type: 'number', - pattern: '0-9]*', - min: MIN_VALUE, - step: 1, -}; - -const numberToTimeString = (value) => { - if (!value) return '00'; - - const asString = value.toString(); - - return asString.length > 1 ? asString : `0${asString}`; -}; - -// TODO: Remove this unused code -const TimeInput = (props, ref) => { - const { disabled, onChange, value } = props; - - const [hourValue, setHourValue] = useState('00'); - const [minuteValue, setMinuteValue] = useState('00'); - - useEffect(() => { - let [hour, minute] = value.split(':'); - - if (hour.length === 1) { - hour = `0${hour}`; - } - - if (minute.length === 1) { - minute = `0${minute}`; - } - - setHourValue(hour); - setMinuteValue(minute); - }, [value]); - - - const onHourChange = useCallback(({ target: { value } }) => { - if (parseFloat(value) > MAX_HOUR) return; - - const hourString = numberToTimeString(value); - const minuteString = numberToTimeString(minuteValue); - - onChange(`${hourString}:${minuteString}`); - }, [minuteValue, onChange]); - - const onMinuteChange = useCallback(({ target: { value } }) => { - if (parseFloat(value) > MAX_MINUTE) return; - - const minuteString = numberToTimeString(value); - const hourString = numberToTimeString(hourValue); - - onChange(`${hourString}:${minuteString}`); - }, [hourValue, onChange]); - - return
    - : -
    ; -}; - -export default memo(forwardRef(TimeInput)); \ No newline at end of file diff --git a/src/TimeInput/styles.module.scss b/src/TimeInput/styles.module.scss deleted file mode 100644 index 5bf6e8299..000000000 --- a/src/TimeInput/styles.module.scss +++ /dev/null @@ -1,12 +0,0 @@ -@import '../common/styles/inputs'; - -.input { - @include defaultTextInput; - border: none; - font-weight: 500; - text-align: center; - padding: 0.5rem 0; - &:hover { - background: rgba(black, 0.05); - } -} diff --git a/src/TimePicker/OptionsPopover/index.js b/src/TimePicker/OptionsPopover/index.js index c8833bcdb..c67d4ab8c 100644 --- a/src/TimePicker/OptionsPopover/index.js +++ b/src/TimePicker/OptionsPopover/index.js @@ -1,4 +1,4 @@ -import React, { forwardRef, useEffect, useMemo, useRef, useState } from 'react'; +import React, { useEffect, useMemo, useRef, useState } from 'react'; import { addMinutes, differenceInMilliseconds } from 'date-fns'; import Popover from 'react-bootstrap/Popover'; import { useTranslation } from 'react-i18next'; @@ -25,12 +25,13 @@ const OptionsPopover = ({ onChange, onClose, optionsPopoverButtonRef, + ref, showDurationFromMin, style, target, value, ...otherProps -}, ref) => { +}) => { const { t } = useTranslation('dates', { keyPrefix: 'timeUnitAbbreviations' }); const listRef = useRef(); @@ -249,4 +250,4 @@ const OptionsPopover = ({ ; }; -export default forwardRef(OptionsPopover); +export default OptionsPopover; diff --git a/src/TimePicker/index.js b/src/TimePicker/index.js index 80d16214c..e5a99e55c 100644 --- a/src/TimePicker/index.js +++ b/src/TimePicker/index.js @@ -1,4 +1,4 @@ -import React, { forwardRef, memo, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'; +import React, { memo, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react'; import Overlay from 'react-bootstrap/Overlay'; import { useTranslation } from 'react-i18next'; @@ -44,11 +44,12 @@ const TimePicker = ({ onChange, onFocus = null, readOnly = false, + ref, required = false, showDurationFromMin = false, value, ...otherProps -}, ref) => { +}) => { const { i18n, t } = useTranslation('components', { keyPrefix: 'timePicker' }); const hourInputRef = useRef(); @@ -493,4 +494,4 @@ const TimePicker = ({ export { EMPTY_TIME_VALUE, isValidTime }; -export default memo(forwardRef(TimePicker)); +export default memo(TimePicker); diff --git a/src/TimepointPopup/index.js b/src/TimepointPopup/index.js index f98b450ff..9e9214365 100644 --- a/src/TimepointPopup/index.js +++ b/src/TimepointPopup/index.js @@ -1,5 +1,4 @@ import React from 'react'; -import PropTypes from 'prop-types'; import { MAP_INTERACTION_CATEGORY } from '../utils/analytics'; @@ -34,18 +33,4 @@ const TimepointPopup = ({ data }) => <> /> ; -TimepointPopup.propTypes = { - data: PropTypes.shape({ - geometry: PropTypes.shape({ - coordinates: PropTypes.arrayOf(PropTypes.number) - }), - properties: PropTypes.shape({ - id: PropTypes.string, - name: PropTypes.string, - time: PropTypes.string, - title: PropTypes.string, - }), - }).isRequired, -}; - export default TimepointPopup; diff --git a/src/ToastBody/index.js b/src/ToastBody/index.js index cc59b8e17..650264f72 100644 --- a/src/ToastBody/index.js +++ b/src/ToastBody/index.js @@ -1,11 +1,10 @@ import React, { useState } from 'react'; import Button from 'react-bootstrap/Button'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import * as styles from './styles.module.scss'; -const ToastBody = ({ details, link, message, showDetailsByDefault }) => { +const ToastBody = ({ details = '', link = null, message = null, showDetailsByDefault = false }) => { const { t } = useTranslation('components', { keyPrefix: 'toastBody' }); const [detailsShown, showDetails] = useState(showDetailsByDefault); @@ -40,18 +39,4 @@ const ToastBody = ({ details, link, message, showDetailsByDefault }) => { ; }; -ToastBody.defaultProps = { - details: '', - link: null, - message: null, - showDetailsByDefault: false, -}; - -ToastBody.propTypes = { - details: PropTypes.node, - link: PropTypes.object, - message: PropTypes.node, - showDetailsByDefault: PropTypes.bool, -}; - export default ToastBody; diff --git a/src/TrackLength/index.js b/src/TrackLength/index.js index 4bbf24050..6ba4d993c 100644 --- a/src/TrackLength/index.js +++ b/src/TrackLength/index.js @@ -1,12 +1,11 @@ import React, { useEffect, useState } from 'react'; import { length } from '@turf/turf'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { useTranslation } from 'react-i18next'; import { selectSubjectTracksTrimmedToTrackTimeEnvelopeWithTimeOfDayPeriod } from '../selectors/tracks'; -const TrackLength = ({ className, trackId }) => { +const TrackLength = ({ className = '', trackId }) => { const { t } = useTranslation('tracks', { keyPrefix: 'trackLength' }); const tracks = useSelector(selectSubjectTracksTrimmedToTrackTimeEnvelopeWithTimeOfDayPeriod); @@ -30,13 +29,4 @@ const TrackLength = ({ className, trackId }) => { : null; }; -TrackLength.defaultProps = { - className: '', -}; - -TrackLength.propTypes = { - className: PropTypes.string, - trackId: PropTypes.string.isRequired, -}; - export default TrackLength; diff --git a/src/TrackToggleButton/index.js b/src/TrackToggleButton/index.js index df9fda7f1..1e47e2c8a 100644 --- a/src/TrackToggleButton/index.js +++ b/src/TrackToggleButton/index.js @@ -1,12 +1,18 @@ -import React, { forwardRef, memo } from 'react'; -import PropTypes from 'prop-types'; +import React, { memo } from 'react'; import { useTranslation } from 'react-i18next'; import SubjectControlButton from '../SubjectControls/button'; import * as styles from './styles.module.scss'; -const TrackToggleButton = ({ className, trackVisible, trackPinned, showTransparentIcon, ...restProps }, ref) => { +const TrackToggleButton = ({ + className = '', + ref, + showTransparentIcon = false, + trackPinned, + trackVisible, + ...restProps +}) => { const { t } = useTranslation('patrols', { keyPrefix: 'trackToggleButton' }); let containerClasses = styles.container; @@ -32,18 +38,4 @@ const TrackToggleButton = ({ className, trackVisible, trackPinned, showTranspare />; }; -const TrackToggleButtonForwardRef = forwardRef(TrackToggleButton); - -TrackToggleButtonForwardRef.defaultProps = { - className: '', - showTransparentIcon: false, -}; - -TrackToggleButtonForwardRef.propTypes = { - className: PropTypes.string, - showTransparentIcon: PropTypes.bool, - trackPinned: PropTypes.bool.isRequired, - trackVisible: PropTypes.bool.isRequired, -}; - -export default memo(TrackToggleButtonForwardRef); +export default memo(TrackToggleButton); diff --git a/src/TracksLayer/index.js b/src/TracksLayer/index.js index 0cfa6aec7..67195808c 100644 --- a/src/TracksLayer/index.js +++ b/src/TracksLayer/index.js @@ -1,5 +1,4 @@ import React, { memo, useCallback, useContext, useEffect } from 'react'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { addMapImage } from '../utils/map'; @@ -14,7 +13,7 @@ const ARROW_IMG_ID = 'track_arrow'; const mapLayerTracker = trackEventFactory(MAP_LAYERS_CATEGORY); -const TracksLayer = ({ onPointClick, showTimepoints }) => { +const TracksLayer = ({ onPointClick, showTimepoints = true }) => { const map = useContext(MapContext); const subjectTracksWithPatrolTrackShownFlag = useSelector(selectSubjectTracksWithPatrolTrackShownFlag); @@ -45,13 +44,4 @@ const TracksLayer = ({ onPointClick, showTimepoints }) => { : null; }; -TracksLayer.defaultProps = { - showTimepoints: true, -}; - -TracksLayer.propTypes = { - onPointClick: PropTypes.func.isRequired, - showTimepoints: PropTypes.bool, -}; - export default memo(TracksLayer); diff --git a/src/TracksLayer/track.js b/src/TracksLayer/track.js index 98680fd13..9c631ebef 100644 --- a/src/TracksLayer/track.js +++ b/src/TracksLayer/track.js @@ -1,5 +1,4 @@ import { memo, useContext, useMemo } from 'react'; -import PropTypes from 'prop-types'; import { LAYER_IDS, MAP_ICON_SCALE } from '../constants'; import { MapContext } from '../App'; @@ -46,7 +45,15 @@ const TIMEPOINT_LAYER_PAINT = { ], }; -const TrackLayer = ({ before, id, lineLayout, linePaint, onPointClick, showTimepoints, trackData }) => { +const TrackLayer = ({ + before = null, + id = null, + lineLayout = {}, + linePaint = {}, + onPointClick, + showTimepoints = true, + trackData, +}) => { const map = useContext(MapContext); const { isTimeOfDayColoringActive } = useSelector(selectTrackSettings); @@ -114,25 +121,4 @@ const TrackLayer = ({ before, id, lineLayout, linePaint, onPointClick, showTimep return null; }; -TrackLayer.defaultProps = { - before: null, - id: null, - lineLayout: {}, - linePaint: {}, - showTimepoints: true, -}; - -TrackLayer.propTypes = { - before: PropTypes.string, - id: PropTypes.string, - lineLayout: PropTypes.object, - linePaint: PropTypes.object, - onPointClick: PropTypes.func.isRequired, - showTimepoints: PropTypes.bool, - trackData: PropTypes.shape({ - points: PropTypes.object, - track: PropTypes.object, - }).isRequired, -}; - export default memo(TrackLayer); diff --git a/src/UserCurrentLocationLayer/index.js b/src/UserCurrentLocationLayer/index.js index c14ce3fb7..89da88f3e 100644 --- a/src/UserCurrentLocationLayer/index.js +++ b/src/UserCurrentLocationLayer/index.js @@ -1,6 +1,5 @@ import { memo, useCallback, useContext, useEffect, useMemo, useState } from 'react'; import { booleanContains, point } from '@turf/turf'; -import PropTypes from 'prop-types'; import { useSelector } from 'react-redux'; import { addMapImage } from '../utils/map'; @@ -128,8 +127,4 @@ const UserCurrentLocationLayer = ({ onIconClick }) => { return null; }; -UserCurrentLocationLayer.propTypes = { - onIconClick: PropTypes.func.isRequired, -}; - export default memo(UserCurrentLocationLayer); diff --git a/src/UserCurrentLocationPopup/index.js b/src/UserCurrentLocationPopup/index.js index 5feca6242..2424cbd60 100644 --- a/src/UserCurrentLocationPopup/index.js +++ b/src/UserCurrentLocationPopup/index.js @@ -1,6 +1,5 @@ import React, { memo, useCallback } from 'react'; import isEqual from 'react-fast-compare'; -import PropTypes from 'prop-types'; import { useDispatch } from 'react-redux'; import { useTranslation } from 'react-i18next'; @@ -48,13 +47,6 @@ const UserCurrentLocationPopup = ({ data, id }) => { ; }; -UserCurrentLocationPopup.propTypes = { - data: PropTypes.shape({ - location: PropTypes.object, - }).isRequired, - id: PropTypes.string.isRequired, -}; - export default memo( UserCurrentLocationPopup, (oldProps, newProps) => isEqual(oldProps.data.location, newProps.data.location) diff --git a/src/UserMenu/index.js b/src/UserMenu/index.js index d097622d3..e92d31b20 100644 --- a/src/UserMenu/index.js +++ b/src/UserMenu/index.js @@ -1,6 +1,5 @@ import React, { useRef } from 'react'; import Dropdown from 'react-bootstrap/Dropdown'; -import PropTypes from 'prop-types'; import { useTranslation } from 'react-i18next'; import { ReactComponent as UserIcon } from '../common/images/icons/user-profile.svg'; @@ -11,7 +10,14 @@ import * as styles from './styles.module.scss'; const mainToolbarTracker = trackEventFactory(MAIN_TOOLBAR_CATEGORY); -const UserMenu = ({ onLogOutClick, onProfileClick, selectedUserProfile, user, userProfiles, ...restProps }) => { +const UserMenu = ({ + onLogOutClick, + onProfileClick, + selectedUserProfile = null, + user, + userProfiles = [], + ...restProps +}) => { const { t } = useTranslation('top-bar', { keyPrefix: 'userMenu' }); const cookieSettingsRef = useRef(); @@ -61,25 +67,4 @@ const UserMenu = ({ onLogOutClick, onProfileClick, selectedUserProfile, user, us ; }; -UserMenu.defaultProps = { - userProfiles: [], - selectedUserProfile: null, -}; - -UserMenu.propTypes = { - onLogOutClick: PropTypes.func.isRequired, - onProfileClick: PropTypes.func.isRequired, - selectedUserProfile: PropTypes.shape({ - username: PropTypes.string, - }), - user: PropTypes.shape({ - id: PropTypes.string, - username: PropTypes.string, - }).isRequired, - userProfiles: PropTypes.arrayOf(PropTypes.shape({ - id: PropTypes.string, - username: PropTypes.string, - })), -}; - export default UserMenu; diff --git a/src/proptypes/index.js b/src/proptypes/index.js deleted file mode 100644 index 709c30f04..000000000 --- a/src/proptypes/index.js +++ /dev/null @@ -1,31 +0,0 @@ -import PropTypes from 'prop-types'; - -export const analyticsMetadataProps = PropTypes.shape({ - category: PropTypes.string.isRequired, - location: PropTypes.string, -}); - -export const mapDrawToolsDisplayConfigPropType = PropTypes.shape({ - linePaint: PropTypes.object, - lineLayout: PropTypes.object, - circlePaint: PropTypes.object, - fillLayout: PropTypes.object, - fillPaint: PropTypes.object, - symbolPaint: PropTypes.object, - lineSymbolLayout: PropTypes.object, - polygonSymbolLayout: PropTypes.object -}); - -export const childrenPropType = PropTypes.oneOfType([ - PropTypes.arrayOf(PropTypes.node), - PropTypes.node -]); - - -export const addReportFormProps = PropTypes.shape({ - hidePatrols: PropTypes.bool, - isPatrolReport: PropTypes.bool, - onSaveError: PropTypes.func, - onSaveSuccess: PropTypes.func, - relationshipButtonDisabled: PropTypes.bool, -}); \ No newline at end of file diff --git a/src/setupTests.js b/src/setupTests.js index 20d58d42f..9cbf7912c 100644 --- a/src/setupTests.js +++ b/src/setupTests.js @@ -1,4 +1,4 @@ -import '@testing-library/jest-dom/extend-expect'; +import '@testing-library/jest-dom'; import 'jest-webgl-canvas-mock'; import { fetch, FormData, Headers, Response, Request } from 'undici'; import ReactGA4 from 'react-ga4'; diff --git a/yarn.lock b/yarn.lock index 8c6ec2e91..cd41ba850 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,7 +2,7 @@ # yarn lockfile v1 -"@adobe/css-tools@^4.0.1": +"@adobe/css-tools@^4.4.0": version "4.4.2" resolved "https://registry.yarnpkg.com/@adobe/css-tools/-/css-tools-4.4.2.tgz#c836b1bd81e6d62cd6cdf3ee4948bcdce8ea79c8" integrity sha512-baYZExFpsdkBNuvGKTKWCwKH57HRZLVtycZS05WTQNVOiXVSeAki3nU35zlRbToeMW8aHlJfyS+1C4BOv27q0A== @@ -1049,7 +1049,7 @@ "@babel/plugin-transform-modules-commonjs" "^7.26.3" "@babel/plugin-transform-typescript" "^7.27.0" -"@babel/runtime@^7.0.0", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.0", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.3", "@babel/runtime@^7.18.3", "@babel/runtime@^7.22.15", "@babel/runtime@^7.23.2", "@babel/runtime@^7.24.7", "@babel/runtime@^7.25.0", "@babel/runtime@^7.26.0", "@babel/runtime@^7.26.10", "@babel/runtime@^7.27.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7", "@babel/runtime@^7.9.2": +"@babel/runtime@^7.0.0", "@babel/runtime@^7.11.2", "@babel/runtime@^7.12.0", "@babel/runtime@^7.12.5", "@babel/runtime@^7.16.3", "@babel/runtime@^7.18.3", "@babel/runtime@^7.22.15", "@babel/runtime@^7.23.2", "@babel/runtime@^7.24.7", "@babel/runtime@^7.25.0", "@babel/runtime@^7.26.0", "@babel/runtime@^7.26.10", "@babel/runtime@^7.27.0", "@babel/runtime@^7.5.5", "@babel/runtime@^7.6.3", "@babel/runtime@^7.8.4", "@babel/runtime@^7.8.7": version "7.27.0" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.27.0.tgz#fbee7cf97c709518ecc1f590984481d5460d4762" integrity sha512-VtPOkrdPHZsKc/clNqyi9WUA8TINkZ4cGk63UUE3u4pmB2k+ZMQRDuIOagv8UVd6j7k0T3+RRIb7beKTebNbcw== @@ -1626,10 +1626,10 @@ dependencies: "@floating-ui/dom" "^1.0.0" -"@floating-ui/react@^0.27.0": - version "0.27.6" - resolved "https://registry.yarnpkg.com/@floating-ui/react/-/react-0.27.6.tgz#f1636698dfd5e8c3d22d3323cf4e8e1405fbeb90" - integrity sha512-9GLOPbW8jTeboR2ar9uMMUDUZjpTLscUvOjNvRw2EgppgoLHLUh/P/OW9evULosnvDjhYf2Gwk/gMOP9KvXD2A== +"@floating-ui/react@^0.27.3": + version "0.27.7" + resolved "https://registry.yarnpkg.com/@floating-ui/react/-/react-0.27.7.tgz#dd5512f84528b849a99d93266b963b84c83bd201" + integrity sha512-5V9pwFeiv+95Jlowq/7oiGISSrdXMTs2jfoSy8k+WM6oI/Skm1WWjPdJWeporN2O4UGcsaCJdirKffKayMoPgw== dependencies: "@floating-ui/react-dom" "^2.1.2" "@floating-ui/utils" "^0.2.9" @@ -1775,13 +1775,6 @@ "@types/node" "*" jest-mock "^27.5.1" -"@jest/expect-utils@^29.7.0": - version "29.7.0" - resolved "https://registry.yarnpkg.com/@jest/expect-utils/-/expect-utils-29.7.0.tgz#023efe5d26a8a70f21677d0a1afc0f0a44e3a1c6" - integrity sha512-GlsNBWiFQFCVi9QVSx7f5AgMeLxe9YCCs5PuP2O2LdjDAA8Jh9eX7lA1Jq/xdXw3Wb3hyvlFNfZIfcRetSzYcA== - dependencies: - jest-get-type "^29.6.3" - "@jest/fake-timers@^27.5.1": version "27.5.1" resolved "https://registry.yarnpkg.com/@jest/fake-timers/-/fake-timers-27.5.1.tgz#76979745ce0579c8a94a4678af7a748eda8ada74" @@ -2533,33 +2526,31 @@ dependencies: tslib "^2.8.0" -"@testing-library/dom@^8.0.0", "@testing-library/dom@^8.1.0": - version "8.20.1" - resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-8.20.1.tgz#2e52a32e46fc88369eef7eef634ac2a192decd9f" - integrity sha512-/DiOQ5xBxgdYRC8LNk7U+RWat0S3qRLeIw3ZIkMQ9kkVlRmwD/Eg8k8CqIpD6GW7u20JIUOfMKbxtiLutpjQ4g== +"@testing-library/dom@^10.4.0": + version "10.4.0" + resolved "https://registry.yarnpkg.com/@testing-library/dom/-/dom-10.4.0.tgz#82a9d9462f11d240ecadbf406607c6ceeeff43a8" + integrity sha512-pemlzrSESWbdAloYml3bAJMEfNh1Z7EduzqPKprCH5S341frlpYnUEW0H72dLxa6IsYr+mPno20GiSm+h9dEdQ== dependencies: "@babel/code-frame" "^7.10.4" "@babel/runtime" "^7.12.5" "@types/aria-query" "^5.0.1" - aria-query "5.1.3" + aria-query "5.3.0" chalk "^4.1.0" dom-accessibility-api "^0.5.9" lz-string "^1.5.0" pretty-format "^27.0.2" -"@testing-library/jest-dom@^5.14.1": - version "5.17.0" - resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-5.17.0.tgz#5e97c8f9a15ccf4656da00fecab505728de81e0c" - integrity sha512-ynmNeT7asXyH3aSVv4vvX4Rb+0qjOhdNHnO/3vuZNqPmhDpV/+rCSGwQ7bLcmU2cJ4dvoheIO85LQj0IbJHEtg== +"@testing-library/jest-dom@^6.6.3": + version "6.6.3" + resolved "https://registry.yarnpkg.com/@testing-library/jest-dom/-/jest-dom-6.6.3.tgz#26ba906cf928c0f8172e182c6fe214eb4f9f2bd2" + integrity sha512-IteBhl4XqYNkM54f4ejhLRJiZNqcSCoXUOG2CPK7qbD322KjQozM4kHQOfkG2oln9b9HTYqs+Sae8vBATubxxA== dependencies: - "@adobe/css-tools" "^4.0.1" - "@babel/runtime" "^7.9.2" - "@types/testing-library__jest-dom" "^5.9.1" + "@adobe/css-tools" "^4.4.0" aria-query "^5.0.0" chalk "^3.0.0" css.escape "^1.5.1" - dom-accessibility-api "^0.5.6" - lodash "^4.17.15" + dom-accessibility-api "^0.6.3" + lodash "^4.17.21" redent "^3.0.0" "@testing-library/react-hooks@^8.0.1": @@ -2570,21 +2561,17 @@ "@babel/runtime" "^7.12.5" react-error-boundary "^3.1.0" -"@testing-library/react@^12.0.0": - version "12.1.5" - resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-12.1.5.tgz#bb248f72f02a5ac9d949dea07279095fa577963b" - integrity sha512-OfTXCJUFgjd/digLUuPxa0+/3ZxsQmE7ub9kcbW/wi96Bh3o/p5vrETcBGfP17NWPGqeYYl5LTRpwyGoMC4ysg== +"@testing-library/react@^16.3.0": + version "16.3.0" + resolved "https://registry.yarnpkg.com/@testing-library/react/-/react-16.3.0.tgz#3a85bb9bdebf180cd76dba16454e242564d598a6" + integrity sha512-kFSyxiEDwv1WLl2fgsq6pPBbw5aWKrsY2/noi1Id0TK0UParSF62oFQFGHXIyaG4pp2tEub/Zlel+fjjZILDsw== dependencies: "@babel/runtime" "^7.12.5" - "@testing-library/dom" "^8.0.0" - "@types/react-dom" "<18.0.0" -"@testing-library/user-event@^13.0.16": - version "13.5.0" - resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-13.5.0.tgz#69d77007f1e124d55314a2b73fd204b333b13295" - integrity sha512-5Kwtbo3Y/NowpkbRuSepbyMFkZmHgD+vPzYB/RJ4oxt5Gj/avFFBYjhw27cqSVPVw/3a67NK1PbiIr9k4Gwmdg== - dependencies: - "@babel/runtime" "^7.12.5" +"@testing-library/user-event@^14.6.1": + version "14.6.1" + resolved "https://registry.yarnpkg.com/@testing-library/user-event/-/user-event-14.6.1.tgz#13e09a32d7a8b7060fe38304788ebf4197cd2149" + integrity sha512-vq7fv0rnt+QTXgPxr5Hjc210p6YKq2kmdziLgnsZGgLJ9e6VAShx1pACLuRjd/AS/sr7phAR58OIIpf0LlmQNw== "@tootallnate/once@1": version "1.1.2" @@ -4276,14 +4263,6 @@ dependencies: "@types/istanbul-lib-report" "*" -"@types/jest@*": - version "29.5.14" - resolved "https://registry.yarnpkg.com/@types/jest/-/jest-29.5.14.tgz#2b910912fa1d6856cadcd0c1f95af7df1d6049e5" - integrity sha512-ZN+4sdnLUbo8EVvVc2ao0GFW6oVrQRPn4K2lglySj7APvSrgzxHiNNK99us4WDMi57xxA2yggblIAMNhXOotLQ== - dependencies: - expect "^29.0.0" - pretty-format "^29.0.0" - "@types/json-schema@*", "@types/json-schema@^7.0.4", "@types/json-schema@^7.0.5", "@types/json-schema@^7.0.8", "@types/json-schema@^7.0.9": version "7.0.15" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.15.tgz#596a1747233694d50f6ad8a7869fcb6f56cf5841" @@ -4357,11 +4336,6 @@ resolved "https://registry.yarnpkg.com/@types/range-parser/-/range-parser-1.2.7.tgz#50ae4353eaaddc04044279812f52c8c65857dbcb" integrity sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ== -"@types/react-dom@<18.0.0": - version "17.0.26" - resolved "https://registry.yarnpkg.com/@types/react-dom/-/react-dom-17.0.26.tgz#fa7891ba70fd39ddbaa7e85b6ff9175bb546bc1b" - integrity sha512-Z+2VcYXJwOqQ79HreLU/1fyQ88eXSSFh6I3JdrEHQIfYSI0kCQpTGvOrbE6jFGGYXKsHuwY9tBa/w5Uo6KzrEg== - "@types/react-transition-group@^4.4.0", "@types/react-transition-group@^4.4.6": version "4.4.12" resolved "https://registry.yarnpkg.com/@types/react-transition-group/-/react-transition-group-4.4.12.tgz#b5d76568485b02a307238270bfe96cb51ee2a044" @@ -4437,13 +4411,6 @@ dependencies: "@types/geojson" "*" -"@types/testing-library__jest-dom@^5.9.1": - version "5.14.9" - resolved "https://registry.yarnpkg.com/@types/testing-library__jest-dom/-/testing-library__jest-dom-5.14.9.tgz#0fb1e6a0278d87b6737db55af5967570b67cb466" - integrity sha512-FSYhIjFlfOpGSRyVoMBMuS3ws5ehFQODymf3vlI7U1K8c7PHwWwFY7VREfmsuzHSOnoKs/9/Y983ayOs7eRzqw== - dependencies: - "@types/jest" "*" - "@types/tough-cookie@^4.0.5": version "4.0.5" resolved "https://registry.yarnpkg.com/@types/tough-cookie/-/tough-cookie-4.0.5.tgz#cb6e2a691b70cb177c6e3ae9c1d2e8b2ea8cd304" @@ -4977,19 +4944,19 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== -aria-query@5.1.3: - version "5.1.3" - resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.1.3.tgz#19db27cd101152773631396f7a95a3b58c22c35e" - integrity sha512-R5iJ5lkuHybztUfuOAznmboyjWq8O6sqNqtK7CLOqdydi54VNbORp49mb14KbWgG1QD3JFO9hJdZ+y4KutfdOQ== +aria-query@5.3.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.3.0.tgz#650c569e41ad90b51b3d7df5e5eed1c7549c103e" + integrity sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A== dependencies: - deep-equal "^2.0.5" + dequal "^2.0.3" aria-query@^5.0.0, aria-query@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.3.2.tgz#93f81a43480e33a338f19163a3d10a50c01dcd59" integrity sha512-COROpnaoap1E2F000S62r6A60uHZnmlvomhfyT2DlTcrY1OrBKn2UhH7qn5wTC9zMvD0AY7csdPSNwKP+7WiQw== -array-buffer-byte-length@^1.0.0, array-buffer-byte-length@^1.0.1, array-buffer-byte-length@^1.0.2: +array-buffer-byte-length@^1.0.1, array-buffer-byte-length@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/array-buffer-byte-length/-/array-buffer-byte-length-1.0.2.tgz#384d12a37295aec3769ab022ad323a18a51ccf8b" integrity sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw== @@ -5561,7 +5528,7 @@ call-bind-apply-helpers@^1.0.0, call-bind-apply-helpers@^1.0.1, call-bind-apply- es-errors "^1.3.0" function-bind "^1.1.2" -call-bind@^1.0.2, call-bind@^1.0.5, call-bind@^1.0.7, call-bind@^1.0.8: +call-bind@^1.0.7, call-bind@^1.0.8: version "1.0.8" resolved "https://registry.yarnpkg.com/call-bind/-/call-bind-1.0.8.tgz#0736a9660f537e3388826f440d5ec45f744eaa4c" integrity sha512-oKlSFMcMwpUg2ednkhQ454wfWiU/ul3CkJe/PEHcTKuiX6RpbehUiFMXu13HalGZxfUwCQzZG747YXBn1im9ww== @@ -5618,9 +5585,9 @@ caniuse-api@^3.0.0: lodash.uniq "^4.5.0" caniuse-lite@^1.0.0, caniuse-lite@^1.0.30001688, caniuse-lite@^1.0.30001702: - version "1.0.30001712" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001712.tgz#41ee150f12de11b5f57c5889d4f30deb451deedf" - integrity sha512-MBqPpGYYdQ7/hfKiet9SCI+nmN5/hp4ZzveOJubl5DTAMa5oggjAuoi0Z4onBpKPFI2ePGnQuQIzF3VxDjDJig== + version "1.0.30001713" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001713.tgz#6b33a8857e6c7dcb41a0caa2dd0f0489c823a52d" + integrity sha512-wCIWIg+A4Xr7NfhTuHdX+/FKh3+Op3LBbSp2N5Pfx6T/LhdQy3GTyoTg48BReaW/MyMNZAkTadsBtai3ldWK0Q== case-sensitive-paths-webpack-plugin@^2.4.0: version "2.4.0" @@ -5752,7 +5719,7 @@ clone@^1.0.2: resolved "https://registry.yarnpkg.com/clone/-/clone-1.0.4.tgz#da309cc263df15994c688ca902179ca3c7cd7c7e" integrity sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg== -clsx@^2.1.0, clsx@^2.1.1: +clsx@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/clsx/-/clsx-2.1.1.tgz#eed397c9fd8bd882bfb18deab7102049a2f32999" integrity sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA== @@ -6311,11 +6278,6 @@ data-view-byte-offset@^1.0.1: es-errors "^1.3.0" is-data-view "^1.0.1" -date-fns@^3.6.0: - version "3.6.0" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-3.6.0.tgz#f20ca4fe94f8b754951b24240676e8618c0206bf" - integrity sha512-fRHTG8g/Gif+kSh50gaGEdToemgfj74aRX3swtiouboip5JDLAyDE9F11nHMIcvOaXeOC6D7SpNhi7uFyB7Uww== - date-fns@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-4.1.0.tgz#64b3d83fff5aa80438f5b1a633c2e83b8a1c2d14" @@ -6366,30 +6328,6 @@ dedent@^0.7.0: resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha512-Q6fKUPqnAHAyhiUgFU7BUzLiv0kd8saH9al7tnu5Q/okj6dnupxyTgFIBjVzJATdfIAm9NAsvXNzjaKa+bxVyA== -deep-equal@^2.0.5: - version "2.2.3" - resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-2.2.3.tgz#af89dafb23a396c7da3e862abc0be27cf51d56e1" - integrity sha512-ZIwpnevOurS8bpT4192sqAowWM76JDKSHYzMLty3BZGSswgq6pBaH3DhCSW5xVAZICZyKdOBPjwww5wfgT/6PA== - dependencies: - array-buffer-byte-length "^1.0.0" - call-bind "^1.0.5" - es-get-iterator "^1.1.3" - get-intrinsic "^1.2.2" - is-arguments "^1.1.1" - is-array-buffer "^3.0.2" - is-date-object "^1.0.5" - is-regex "^1.1.4" - is-shared-array-buffer "^1.0.2" - isarray "^2.0.5" - object-is "^1.1.5" - object-keys "^1.1.1" - object.assign "^4.1.4" - regexp.prototype.flags "^1.5.1" - side-channel "^1.0.4" - which-boxed-primitive "^1.0.2" - which-collection "^1.0.1" - which-typed-array "^1.1.13" - deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" @@ -6592,11 +6530,6 @@ diff-sequences@^27.5.1: resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-27.5.1.tgz#eaecc0d327fd68c8d9672a1e64ab8dccb2ef5327" integrity sha512-k1gCAXAsNgLwEL+Y8Wvl+M6oEFj5bgazfZULpS5CneoPPXRaCCW7dm+q21Ky2VEE5X+VeRDBVg1Pcvvsr4TtNQ== -diff-sequences@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921" - integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q== - dir-glob@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" @@ -6625,11 +6558,16 @@ doctrine@^3.0.0: dependencies: esutils "^2.0.2" -dom-accessibility-api@^0.5.6, dom-accessibility-api@^0.5.9: +dom-accessibility-api@^0.5.9: version "0.5.16" resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.5.16.tgz#5a7429e6066eb3664d911e33fb0e45de8eb08453" integrity sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg== +dom-accessibility-api@^0.6.3: + version "0.6.3" + resolved "https://registry.yarnpkg.com/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz#993e925cc1d73f2c662e7d75dd5a5445259a8fd8" + integrity sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w== + dom-converter@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/dom-converter/-/dom-converter-0.2.0.tgz#6721a9daee2e293682955b6afe416771627bb768" @@ -6764,9 +6702,9 @@ ejs@^3.1.6: jake "^10.8.5" electron-to-chromium@^1.5.73: - version "1.5.134" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.134.tgz#d90008c4f8a506c1a6d1b329f922d83e18904101" - integrity sha512-zSwzrLg3jNP3bwsLqWHmS5z2nIOQ5ngMnfMZOWWtXnqqQkPVyOipxK98w+1beLw1TB+EImPNcG8wVP/cLVs2Og== + version "1.5.135" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.135.tgz#6d835020fa0c7f02f30d7608c2f3c0a764236699" + integrity sha512-8gXUdEmvb+WCaYUhA0Svr08uSeRjM2w3x5uHOc1QbaEVzJXB8rgm5eptieXzyKoVEtinLvW6MtTcurA65PeS1Q== emittery@^0.10.2: version "0.10.2" @@ -6951,21 +6889,6 @@ es-errors@^1.3.0: resolved "https://registry.yarnpkg.com/es-errors/-/es-errors-1.3.0.tgz#05f75a25dab98e4fb1dcd5e1472c0546d5057c8f" integrity sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw== -es-get-iterator@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/es-get-iterator/-/es-get-iterator-1.1.3.tgz#3ef87523c5d464d41084b2c3c9c214f1199763d6" - integrity sha512-sPZmqHBe6JIiTfN5q2pEi//TwxmAFHwj/XEuYjTuse78i8KxaqMTTzxPoFKuzRpDpTJ+0NAbpfenkmH2rePtuw== - dependencies: - call-bind "^1.0.2" - get-intrinsic "^1.1.3" - has-symbols "^1.0.3" - is-arguments "^1.1.1" - is-map "^2.0.2" - is-set "^2.0.2" - is-string "^1.0.7" - isarray "^2.0.5" - stop-iteration-iterator "^1.0.0" - es-iterator-helpers@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/es-iterator-helpers/-/es-iterator-helpers-1.2.1.tgz#d1dd0f58129054c0ad922e6a9a1e65eef435fe75" @@ -7415,17 +7338,6 @@ expect@^27.5.1: jest-matcher-utils "^27.5.1" jest-message-util "^27.5.1" -expect@^29.0.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/expect/-/expect-29.7.0.tgz#578874590dcb3214514084c08115d8aee61e11bc" - integrity sha512-2Zks0hf1VLFYI1kbh0I5jP3KHHyCHpkfyHBzsSXRFgl/Bg9mWYfMW8oD+PdMPlEwy5HNsR9JutYy6pMeOh61nw== - dependencies: - "@jest/expect-utils" "^29.7.0" - jest-get-type "^29.6.3" - jest-matcher-utils "^29.7.0" - jest-message-util "^29.7.0" - jest-util "^29.7.0" - express@^4.21.2: version "4.21.2" resolved "https://registry.yarnpkg.com/express/-/express-4.21.2.tgz#cf250e48362174ead6cea4a566abef0162c1ec32" @@ -7831,7 +7743,7 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-intrinsic@^1.1.3, get-intrinsic@^1.2.2, get-intrinsic@^1.2.4, get-intrinsic@^1.2.5, get-intrinsic@^1.2.6, get-intrinsic@^1.2.7, get-intrinsic@^1.3.0: +get-intrinsic@^1.2.4, get-intrinsic@^1.2.5, get-intrinsic@^1.2.6, get-intrinsic@^1.2.7, get-intrinsic@^1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.3.0.tgz#743f0e3b6964a93a5491ed1bffaae054d7f98d01" integrity sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ== @@ -8090,9 +8002,9 @@ hoist-non-react-statics@^3.3.1, hoist-non-react-statics@^3.3.2: react-is "^16.7.0" hookified@^1.8.1: - version "1.8.1" - resolved "https://registry.yarnpkg.com/hookified/-/hookified-1.8.1.tgz#74a8c97d36e5f8004d230ee2156a607cc84c358c" - integrity sha512-GrO2l93P8xCWBSTBX9l2BxI78VU/MAAYag+pG8curS3aBGy0++ZlxrQ7PdUOUVMbn5BwkGb6+eRrnf43ipnFEA== + version "1.8.2" + resolved "https://registry.yarnpkg.com/hookified/-/hookified-1.8.2.tgz#b365a89dfce3da43e790673a6a97d3b896ae5fa7" + integrity sha512-5nZbBNP44sFCDjSoB//0N7m508APCgbQ4mGGo1KJGBYyCKNHfry1Pvd0JVHZIxjdnqn8nFRBAN/eFB6Rk/4w5w== hoopy@^0.1.4: version "0.1.4" @@ -8218,9 +8130,9 @@ http-proxy-agent@^4.0.1: debug "4" http-proxy-middleware@^2.0.7: - version "2.0.7" - resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6" - integrity sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA== + version "2.0.9" + resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.9.tgz#e9e63d68afaa4eee3d147f39149ab84c0c2815ef" + integrity sha512-c1IyJYLYppU574+YI7R4QyX2ystMtVXZwIdzazUIPIJsHuWNd+mho2j+bKoHftndicGj9yh+xjd+l0yj7VeT1Q== dependencies: "@types/http-proxy" "^1.17.8" http-proxy "^1.18.1" @@ -8436,15 +8348,7 @@ ipaddr.js@^2.1.0: resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-2.2.0.tgz#d33fa7bac284f4de7af949638c9d68157c6b92e8" integrity sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA== -is-arguments@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.2.0.tgz#ad58c6aecf563b78ef2bf04df540da8f5d7d8e1b" - integrity sha512-7bVbi0huj/wrIAOzb8U1aszg9kdi3KN/CyU19CTI7tAoZYEZoL9yCDXpbXN+uPsuWnP02cyug1gleqq+TU+YCA== - dependencies: - call-bound "^1.0.2" - has-tostringtag "^1.0.2" - -is-array-buffer@^3.0.2, is-array-buffer@^3.0.4, is-array-buffer@^3.0.5: +is-array-buffer@^3.0.4, is-array-buffer@^3.0.5: version "3.0.5" resolved "https://registry.yarnpkg.com/is-array-buffer/-/is-array-buffer-3.0.5.tgz#65742e1e687bd2cc666253068fd8707fe4d44280" integrity sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A== @@ -8581,7 +8485,7 @@ is-interactive@^1.0.0: resolved "https://registry.yarnpkg.com/is-interactive/-/is-interactive-1.0.0.tgz#cea6e6ae5c870a7b0a0004070b7b587e0252912e" integrity sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w== -is-map@^2.0.2, is-map@^2.0.3: +is-map@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/is-map/-/is-map-2.0.3.tgz#ede96b7fe1e270b3c4465e3a465658764926d62e" integrity sha512-1Qed0/Hr2m+YqxnM09CjA2d/i6YZNfF6R2oRAOj36eUdS6qIV/huPJNSEpKbupewFs+ZsJlxsjjPbc0/afW6Lw== @@ -8644,7 +8548,7 @@ is-promise@^2.1.0: resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== -is-regex@^1.1.4, is-regex@^1.2.1: +is-regex@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.2.1.tgz#76d70a3ed10ef9be48eb577887d74205bf0cad22" integrity sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g== @@ -8664,12 +8568,12 @@ is-root@^2.1.0: resolved "https://registry.yarnpkg.com/is-root/-/is-root-2.1.0.tgz#809e18129cf1129644302a4f8544035d51984a9c" integrity sha512-AGOriNp96vNBd3HtU+RzFEc75FfR5ymiYv8E553I71SCeXBiMsVDUtdio1OEFvrPyLIQ9tVR5RxXIFe5PUFjMg== -is-set@^2.0.2, is-set@^2.0.3: +is-set@^2.0.3: version "2.0.3" resolved "https://registry.yarnpkg.com/is-set/-/is-set-2.0.3.tgz#8ab209ea424608141372ded6e0cb200ef1d9d01d" integrity sha512-iPAjerrse27/ygGLxw+EBR9agv9Y6uLeYVJMu+QNCoouJ1/1ri0mGrcWpfCqFZuzzx3WjtwxG098X+n4OuRkPg== -is-shared-array-buffer@^1.0.2, is-shared-array-buffer@^1.0.4: +is-shared-array-buffer@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/is-shared-array-buffer/-/is-shared-array-buffer-1.0.4.tgz#9b67844bd9b7f246ba0708c3a93e34269c774f6f" integrity sha512-ISWac8drv4ZGfwKl5slpHG9OwPNty4jOWPRIhBpxOoD+hqITiwuipOQ2bNthAzwA3B4fIjO4Nln74N0S9byq8A== @@ -8942,16 +8846,6 @@ jest-diff@^27.5.1: jest-get-type "^27.5.1" pretty-format "^27.5.1" -jest-diff@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-diff/-/jest-diff-29.7.0.tgz#017934a66ebb7ecf6f205e84699be10afd70458a" - integrity sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw== - dependencies: - chalk "^4.0.0" - diff-sequences "^29.6.3" - jest-get-type "^29.6.3" - pretty-format "^29.7.0" - jest-docblock@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-27.5.1.tgz#14092f364a42c6108d42c33c8cf30e058e25f6c0" @@ -9000,11 +8894,6 @@ jest-get-type@^27.5.1: resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-27.5.1.tgz#3cd613c507b0f7ace013df407a1c1cd578bcb4f1" integrity sha512-2KY95ksYSaK7DMBWQn6dQz3kqAf3BB64y2udeG+hv4KfSOb9qwcYQstTJc1KCbsix+wLZWZYN8t7nwX3GOBLRw== -jest-get-type@^29.6.3: - version "29.6.3" - resolved "https://registry.yarnpkg.com/jest-get-type/-/jest-get-type-29.6.3.tgz#36f499fdcea197c1045a127319c0481723908fd1" - integrity sha512-zrteXnqYxfQh7l5FHyL38jL39di8H8rHoecLH3JNxH3BwOrBsNeabdap5e0I23lD4HHI8W5VFBZqG4Eaq5LNcw== - jest-haste-map@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-27.5.1.tgz#9fd8bd7e7b4fa502d9c6164c5640512b4e811e7f" @@ -9085,16 +8974,6 @@ jest-matcher-utils@^27.5.1: jest-get-type "^27.5.1" pretty-format "^27.5.1" -jest-matcher-utils@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-matcher-utils/-/jest-matcher-utils-29.7.0.tgz#ae8fec79ff249fd592ce80e3ee474e83a6c44f12" - integrity sha512-sBkD+Xi9DtcChsI3L3u0+N0opgPYnCRPtGcQYrgXmR+hmt/fYfWAL0xRXYU8eWOdfuLgBe0YCW3AFtnRLagq/g== - dependencies: - chalk "^4.0.0" - jest-diff "^29.7.0" - jest-get-type "^29.6.3" - pretty-format "^29.7.0" - jest-message-util@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-27.5.1.tgz#bdda72806da10d9ed6425e12afff38cd1458b6cf" @@ -9125,21 +9004,6 @@ jest-message-util@^28.1.3: slash "^3.0.0" stack-utils "^2.0.3" -jest-message-util@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/jest-message-util/-/jest-message-util-29.7.0.tgz#8bc392e204e95dfe7564abbe72a404e28e51f7f3" - integrity sha512-GBEV4GRADeP+qtB2+6u61stea8mGcOT4mCtrYISZwfu9/ISHFJ/5zOMXYbpBE9RsS5+Gb63DW4FgmnKJ79Kf6w== - dependencies: - "@babel/code-frame" "^7.12.13" - "@jest/types" "^29.6.3" - "@types/stack-utils" "^2.0.0" - chalk "^4.0.0" - graceful-fs "^4.2.9" - micromatch "^4.0.4" - pretty-format "^29.7.0" - slash "^3.0.0" - stack-utils "^2.0.3" - jest-mock@^27.5.1: version "27.5.1" resolved "https://registry.yarnpkg.com/jest-mock/-/jest-mock-27.5.1.tgz#19948336d49ef4d9c52021d34ac7b5f36ff967d6" @@ -9777,7 +9641,7 @@ lodash.uniq@^4.5.0: resolved "https://registry.yarnpkg.com/lodash.uniq/-/lodash.uniq-4.5.0.tgz#d0225373aeb652adc1bc82e4945339a842754773" integrity sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ== -lodash@^4.17.15, lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.7.0: +lodash@^4.17.20, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.7.0: version "4.17.21" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== @@ -10265,14 +10129,6 @@ object-inspect@^1.13.3: resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.13.4.tgz#8375265e21bc20d0fa582c22e1b13485d6e00213" integrity sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew== -object-is@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/object-is/-/object-is-1.1.6.tgz#1a6a53aed2dd8f7e6775ff870bea58545956ab07" - integrity sha512-F8cZ+KfGlSGi09lJT7/Nd6KJZ9ygtvYC0/UYYLI9nmQKLMnydpB9yvbv9K1uSkEu7FU9vYPmVwLg328tX+ot3Q== - dependencies: - call-bind "^1.0.7" - define-properties "^1.2.1" - object-keys@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" @@ -11308,15 +11164,6 @@ pretty-format@^28.1.3: ansi-styles "^5.0.0" react-is "^18.0.0" -pretty-format@^29.0.0, pretty-format@^29.7.0: - version "29.7.0" - resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-29.7.0.tgz#ca42c758310f365bfa71a0bda0a807160b776812" - integrity sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ== - dependencies: - "@jest/schemas" "^29.6.3" - ansi-styles "^5.0.0" - react-is "^18.0.0" - pretty-ms@^7.0.1: version "7.0.1" resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-7.0.1.tgz#7d903eaab281f7d8e03c66f867e239dc32fb73e8" @@ -11517,14 +11364,14 @@ react-collapsible@^2.10.0: resolved "https://registry.yarnpkg.com/react-collapsible/-/react-collapsible-2.10.0.tgz#57330f9f4f968a41ece49c651b56cf30f9a06d19" integrity sha512-kEVsmlFfXBMTCnU5gwIv19MdmPAhbIPzz5Er37TiJSzRKS0IHrqAKQyQeHEmtoGIQMTcVI46FzE4z3NlVTx77A== -react-datepicker@^7.5.0: - version "7.6.0" - resolved "https://registry.yarnpkg.com/react-datepicker/-/react-datepicker-7.6.0.tgz#6171988c6a9dbd4f49a45a06e3510035884b6b74" - integrity sha512-9cQH6Z/qa4LrGhzdc3XoHbhrxNcMi9MKjZmYgF/1MNNaJwvdSjv3Xd+jjvrEEbKEf71ZgCA3n7fQbdwd70qCRw== +react-datepicker@^8.3.0: + version "8.3.0" + resolved "https://registry.yarnpkg.com/react-datepicker/-/react-datepicker-8.3.0.tgz#21d51294a953755bcc273d411fe10d12918a6f51" + integrity sha512-DhfrIJnTPJTUVRtXU7c7zooug40rD6q+Fc8UTCt19dYEotLpDQgTN98MfocY6Rc4S99oOFFEoxyanOM/TKauuw== dependencies: - "@floating-ui/react" "^0.27.0" + "@floating-ui/react" "^0.27.3" clsx "^2.1.1" - date-fns "^3.6.0" + date-fns "^4.1.0" react-debounce-render@^8.0.2: version "8.0.2" @@ -11564,13 +11411,12 @@ react-dev-utils@^12.0.1: strip-ansi "^6.0.1" text-table "^0.2.0" -react-dom@^18.3.1: - version "18.3.1" - resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-18.3.1.tgz#c2265d79511b57d479b3dd3fdfa51536494c5cb4" - integrity sha512-5m4nQKp+rZRb09LNH59GM4BxTh9251/ylbKIbpe7TpGxfJ+9kv6BLkLBXIjjspbgbnIBNqlI23tRnTWT0snUIw== +react-dom@^19.1.0: + version "19.1.0" + resolved "https://registry.yarnpkg.com/react-dom/-/react-dom-19.1.0.tgz#133558deca37fa1d682708df8904b25186793623" + integrity sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g== dependencies: - loose-envify "^1.1.0" - scheduler "^0.23.2" + scheduler "^0.26.0" react-error-boundary@^3.1.0: version "3.1.4" @@ -11579,10 +11425,10 @@ react-error-boundary@^3.1.0: dependencies: "@babel/runtime" "^7.12.5" -react-error-boundary@^4.1.2: - version "4.1.2" - resolved "https://registry.yarnpkg.com/react-error-boundary/-/react-error-boundary-4.1.2.tgz#bc750ad962edb8b135d6ae922c046051eb58f289" - integrity sha512-GQDxZ5Jd+Aq/qUxbCm1UtzmL/s++V7zKgE8yMktJiCQXCCFZnMZh9ng+6/Ne6PjNSXH0L9CjeOEREfRnq6Duag== +react-error-boundary@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/react-error-boundary/-/react-error-boundary-5.0.0.tgz#6b6c7e075c922afb0283147e5b084efa44e68570" + integrity sha512-tnjAxG+IkpLephNcePNA7v6F/QpWLH8He65+DmedchDwg162JZqx4NmbXj0mlAYVVEd81OW7aFhmbsScYfiAFQ== dependencies: "@babel/runtime" "^7.12.5" @@ -11656,12 +11502,10 @@ react-lifecycles-compat@^3.0.4: resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA== -react-pin-field@^3.1.5: - version "3.1.5" - resolved "https://registry.yarnpkg.com/react-pin-field/-/react-pin-field-3.1.5.tgz#aef73bb06513e3db523a8612b23044ba4ef9f669" - integrity sha512-0WqQkLP3SdBEI08ykZxRNAPnZLEZ7iOm/EE/MNQuFmJAYcUfeNbjc7KB2VvcE/b1iWnS/spmFHpd9eSxvJJQ+g== - dependencies: - react-use-bireducer "^1.1.1" +react-pin-field@^4.0.2: + version "4.0.2" + resolved "https://registry.yarnpkg.com/react-pin-field/-/react-pin-field-4.0.2.tgz#1cd9b5c9ee93648fa01a84d43ac7812ca4ceb413" + integrity sha512-PsNViTx8M4jNjpr6d7Zd5egd5YdAQCIXFVWpbeDYA8TdO8L6KBhS/jtTwocQrtbFIhxodOHC7sYjLRVm8aXOHw== react-redux@^9.1.2: version "9.2.0" @@ -11713,17 +11557,17 @@ react-spinners@^0.15.0: resolved "https://registry.yarnpkg.com/react-spinners/-/react-spinners-0.15.0.tgz#bb9536a3839ab4e1513bb98847d79cc1fc930b93" integrity sha512-ZO3/fNB9Qc+kgpG3SfdlMnvTX6LtLmTnOogb3W6sXIaU/kZ1ydEViPfZ06kSOaEsor58C/tzXw2wROGQu3X2pA== -react-to-print@^3.0.2: - version "3.0.5" - resolved "https://registry.yarnpkg.com/react-to-print/-/react-to-print-3.0.5.tgz#7569f9ac5e7854dbec79f449501fedf28cda82ab" - integrity sha512-Z15MwMOzYCHWi26CZeFNwflAg7Nr8uWD6FTj+EkfIOjYyjr0MXGbI0c7rF4Fgrbj3XG9hFndb1ourxpPz2RAiA== +react-to-print@^3.0.6: + version "3.0.6" + resolved "https://registry.yarnpkg.com/react-to-print/-/react-to-print-3.0.6.tgz#5044f8c6603218d1869350054d805141f9e4286d" + integrity sha512-K/jFxkUifbfVnu1XyinM6AB6zAq0VMw0lH/6WJpkdlChoqqvEOE/BGOxYN2xOmu8f72isTTU5DNatK/j0Lfc+Q== -react-toastify@^10.0.6: - version "10.0.6" - resolved "https://registry.yarnpkg.com/react-toastify/-/react-toastify-10.0.6.tgz#19c364b1150f495522c738d592d1dcc93879ade1" - integrity sha512-yYjp+omCDf9lhZcrZHKbSq7YMuK0zcYkDFTzfRFgTXkTFHZ1ToxwAonzA4JI5CxA91JpjFLmwEsZEgfYfOqI1A== +react-toastify@^11.0.5: + version "11.0.5" + resolved "https://registry.yarnpkg.com/react-toastify/-/react-toastify-11.0.5.tgz#ce4c42d10eeb433988ab2264d3e445c4e9d13313" + integrity sha512-EpqHBGvnSTtHYhCPLxML05NLY2ZX0JURbAdNYa6BUkk+amz4wbKBQvoKQAB0ardvSarUBuY4Q4s1sluAzZwkmA== dependencies: - clsx "^2.1.0" + clsx "^2.1.1" react-transition-group@^4.3.0, react-transition-group@^4.4.5: version "4.4.5" @@ -11735,11 +11579,6 @@ react-transition-group@^4.3.0, react-transition-group@^4.4.5: loose-envify "^1.4.0" prop-types "^15.6.2" -react-use-bireducer@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/react-use-bireducer/-/react-use-bireducer-1.1.1.tgz#9d79bf09a1c85a6c1687bc48c717aa05685d52ed" - integrity sha512-FysDYTxA9TQnzt4HURQBvB2FdFqyNytjIGzvzj3qv7YlOkcDnkJQPNlzcC7RbfDiepxdtbxCgovvLGm/DHjzUA== - react-window@^1.8.10: version "1.8.11" resolved "https://registry.yarnpkg.com/react-window/-/react-window-1.8.11.tgz#a857b48fa85bd77042d59cc460964ff2e0648525" @@ -11757,12 +11596,10 @@ react-window@^1.8.10: object-assign "^4.1.1" prop-types "^15.6.2" -react@^18.3.1: - version "18.3.1" - resolved "https://registry.yarnpkg.com/react/-/react-18.3.1.tgz#49ab892009c53933625bd16b2533fc754cab2891" - integrity sha512-wS+hAgJShR0KhEvPJArfuPVN1+Hz1t0Y6n5jLrGQbkb4urgPE/0Rve+1kMB1v/oWgHgm4WIcV+i7F2pTVj+2iQ== - dependencies: - loose-envify "^1.1.0" +react@^19.1.0: + version "19.1.0" + resolved "https://registry.yarnpkg.com/react/-/react-19.1.0.tgz#926864b6c48da7627f004795d6cce50e90793b75" + integrity sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg== readable-stream@^2.0.1: version "2.3.8" @@ -11891,7 +11728,7 @@ regex-parser@^2.2.11: resolved "https://registry.yarnpkg.com/regex-parser/-/regex-parser-2.3.1.tgz#ee3f70e50bdd81a221d505242cb9a9c275a2ad91" integrity sha512-yXLRqatcCuKtVHsWrNg0JL3l1zGfdXeEvDa0bdu4tCDQw0RpMDZsqbkyRTUnKMR0tXF627V2oEWjBEaEdqTwtQ== -regexp.prototype.flags@^1.5.1, regexp.prototype.flags@^1.5.3: +regexp.prototype.flags@^1.5.3: version "1.5.4" resolved "https://registry.yarnpkg.com/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz#1ad6c62d44a259007e55b3970e00f746efbcaa19" integrity sha512-dYqgNSZbDwkaJ2ceRd9ojCGjBq+mOm9LmtXnAnEGyHhN/5R7iDW2TRw3h+o/jCFxus3P2LfWIIiwowAjANm7IA== @@ -12186,12 +12023,10 @@ saxes@^5.0.1: dependencies: xmlchars "^2.2.0" -scheduler@^0.23.2: - version "0.23.2" - resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.23.2.tgz#414ba64a3b282892e944cf2108ecc078d115cdc3" - integrity sha512-UOShsPwz7NrMUqhR6t0hWjFduvOzbtv7toDH1/hIrfRNIDBnnBWd0CwJTGvTpngVlmwGCdP9/Zl/tVrDqcuYzQ== - dependencies: - loose-envify "^1.1.0" +scheduler@^0.26.0: + version "0.26.0" + resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.26.0.tgz#4ce8a8c2a2095f13ea11bf9a445be50c555d6337" + integrity sha512-NlHwttCI/l5gCPR3D1nNXtWABUmBwvZpEQiD4IXSbIDq8BzLIK/7Ir5gTFSGZDUu37K5cMNp0hFtzO38sC7gWA== schema-utils@2.7.0: version "2.7.0" @@ -12390,7 +12225,7 @@ side-channel-weakmap@^1.0.2: object-inspect "^1.13.3" side-channel-map "^1.0.1" -side-channel@^1.0.4, side-channel@^1.0.6, side-channel@^1.1.0: +side-channel@^1.0.6, side-channel@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/side-channel/-/side-channel-1.1.0.tgz#c3fcff9c4da932784873335ec9765fa94ff66bc9" integrity sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw== @@ -12611,14 +12446,6 @@ statuses@2.0.1, statuses@^2.0.1: resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" integrity sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA== -stop-iteration-iterator@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz#f481ff70a548f6124d0312c3aa14cbfa7aa542ad" - integrity sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ== - dependencies: - es-errors "^1.3.0" - internal-slot "^1.1.0" - stream-to-array@^2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/stream-to-array/-/stream-to-array-2.3.0.tgz#bbf6b39f5f43ec30bc71babcb37557acecf34353" @@ -12823,17 +12650,17 @@ stylelint-config-css-modules@^4.4.0: optionalDependencies: stylelint-scss "^6.0.0" -stylelint-config-recommended@^15.0.0: - version "15.0.0" - resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-15.0.0.tgz#93d48db401215708b724f078533864e52085a07b" - integrity sha512-9LejMFsat7L+NXttdHdTq94byn25TD+82bzGRiV1Pgasl99pWnwipXS5DguTpp3nP1XjvLXVnEJIuYBfsRjRkA== +stylelint-config-recommended@^16.0.0: + version "16.0.0" + resolved "https://registry.yarnpkg.com/stylelint-config-recommended/-/stylelint-config-recommended-16.0.0.tgz#0221f19902816fe7d53d9a01eb0be4cc7b4fe80a" + integrity sha512-4RSmPjQegF34wNcK1e1O3Uz91HN8P1aFdFzio90wNK9mjgAI19u5vsU868cVZboKzCaa5XbpvtTzAAGQAxpcXA== -stylelint-config-standard@^37.0.0: - version "37.0.0" - resolved "https://registry.yarnpkg.com/stylelint-config-standard/-/stylelint-config-standard-37.0.0.tgz#55e75c7215d5398b096d2f75af6a16693c18532d" - integrity sha512-+6eBlbSTrOn/il2RlV0zYGQwRTkr+WtzuVSs1reaWGObxnxLpbcspCUYajVQHonVfxVw2U+h42azGhrBvcg8OA== +stylelint-config-standard@^38.0.0: + version "38.0.0" + resolved "https://registry.yarnpkg.com/stylelint-config-standard/-/stylelint-config-standard-38.0.0.tgz#9d673ec1f35d7569476ee4b0582e7dd5faebf036" + integrity sha512-uj3JIX+dpFseqd/DJx8Gy3PcRAJhlEZ2IrlFOc4LUxBX/PNMEQ198x7LCOE2Q5oT9Vw8nyc4CIL78xSqPr6iag== dependencies: - stylelint-config-recommended "^15.0.0" + stylelint-config-recommended "^16.0.0" stylelint-scss@^6.0.0, stylelint-scss@^6.11.1: version "6.11.1" @@ -13794,7 +13621,7 @@ whatwg-url@^8.0.0, whatwg-url@^8.5.0: tr46 "^2.1.0" webidl-conversions "^6.1.0" -which-boxed-primitive@^1.0.2, which-boxed-primitive@^1.1.0, which-boxed-primitive@^1.1.1: +which-boxed-primitive@^1.1.0, which-boxed-primitive@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/which-boxed-primitive/-/which-boxed-primitive-1.1.1.tgz#d76ec27df7fa165f18d5808374a5fe23c29b176e" integrity sha512-TbX3mj8n0odCBFVlY8AxkqcHASw3L60jIuF8jFP78az3C2YhmGvqbHBpAjTRH2/xqYunrJ9g1jSyjCjpoWzIAA== @@ -13824,7 +13651,7 @@ which-builtin-type@^1.2.1: which-collection "^1.0.2" which-typed-array "^1.1.16" -which-collection@^1.0.1, which-collection@^1.0.2: +which-collection@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/which-collection/-/which-collection-1.0.2.tgz#627ef76243920a107e7ce8e96191debe4b16c2a0" integrity sha512-K4jVyjnBdgvc86Y6BkaLZEN933SwYOuBFkdmBu9ZfkcAbdVbpITnDmjvZ/aQjRXQrv5EPkTnD1s39GiiqbngCw== @@ -13834,7 +13661,7 @@ which-collection@^1.0.1, which-collection@^1.0.2: is-weakmap "^2.0.2" is-weakset "^2.0.3" -which-typed-array@^1.1.13, which-typed-array@^1.1.16, which-typed-array@^1.1.18: +which-typed-array@^1.1.16, which-typed-array@^1.1.18: version "1.1.19" resolved "https://registry.yarnpkg.com/which-typed-array/-/which-typed-array-1.1.19.tgz#df03842e870b6b88e117524a4b364b6fc689f956" integrity sha512-rEvr90Bck4WZt9HHFC4DJMsjvu7x+r6bImz0/BrbWb7A2djJ8hnZMrWnHo9F8ssv0OMErasDhftrfROTyqSDrw==