Tags: hackforla/311-data
Tags
1486 fix address search in desktop menu (#1497) * added resetBoundaries and called it from onGeocoderResult to reset Boundaries input during an Address Search * added comments for address search and boundaries event handlers * initial debounce * moved debounce options to settings and added comments * removed console.log * removed unused code * refactored debounce to call wrapper with values defined in settings * initial map debounce * initial resetAddressSearch * renamed updateCouncilsFilter to dispatchUpdateCouncilsFilter in CouncilSelector * initial debouncedHandleDelete * initial toggleBoundaires to close boundaries selector box by dispatching click event to #boundaries * initial refactor to move SelectorBox local state to redux store * restored SelectorBox back to original since it is a common component and should remain reusable. Created a copy of SelectorBox called BoundariesSection that utilizes ui.boundaries.isOpen redux state instead of a local expanded state which is what SelectorBox uses. Using a redux state variable exposes the state of our BoundariesSection component to all other components, which is needed to perform event dispatches to toggle it open and closed from other components accordingly * boundaries section now closes from address search. closing the boundaries section from CouncilSelector when selecting a neighborhood council no longer utilizes a click event dispatch but instead makes use of redux closeBoundaries dispatch to set ui.boundaries.isOpen to false * reset address search input when a previously selected neighborhood council gets unselected from the council selector of the boundaries section * added code to reset address search input when clicking on a neighborhood district on map * added code to clear address search input and collapse boundaries section when zooming out of map. Also collapse boundaries section when clicking into a neightborhood district on the map * renamed dispatchUpdateCouncilsFilter to dispatchUpdateNcId in CouncilSelector to be consistent with other parts of codebase * added comments * added comments * initial fix to sync boundaries and address search * added comments * removed concole.log * added BoundariesSection component * refactor * implemented custom event handling in MapSearch to be able to clear the address search input from any component. this fixed a bug. searching A, selecting boundary B and searching A again now works. * added call to resetAddressSearch from map onClick to reset the address search input during zoom out when clicking outside of a zoomed in nc * refactored early return even though nothing wrong. do not want to have others think it is ok to do this in react class components. removed TODO comment and added optional chaining to addressSearchIsEmpty * added comment * removed commented code * updated comments and used webpack alias @components to refer to BoundariesSection in CouncilSelector/index.js instead of relative path * removed commented code