Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.60.0 #418

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/map-template/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

### Added

## [1.60.0] - 2024-12-09

ammapspeople marked this conversation as resolved.
Show resolved Hide resolved
- Limit the maximum number of search results to 100 to improve render performance.
- Fixed a bug where the selected venue (in case no venue was set otherwise) was picked alphabetically by Administrative ID rather than the displayed Venue name.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- Fixed a bug where the selected venue (in case no venue was set otherwise) was picked alphabetically by Administrative ID rather than the displayed Venue name.
- Fixed a bug where the selected venue (in case no venue was set otherwise) was picked alphabetically by Administrative ID rather than the displayed Venue name.


Lucaci-Andrei marked this conversation as resolved.
Show resolved Hide resolved
## [1.59.0] - 2024-11-26

### Added
Expand Down
11 changes: 8 additions & 3 deletions packages/map-template/src/components/Search/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ function Search({ onSetSize, isOpen }) {
/** Referencing the keyboard element */
const keyboardRef = useRef();

/** Maximum number of search results to show */
const MAX_RESULTS = 100;

const [searchDisabled, setSearchDisabled] = useState(true);
const [searchResults, setSearchResults] = useRecoilState(searchResultsState);
const categories = useRecoilValue(categoriesState);
Expand Down Expand Up @@ -137,9 +140,11 @@ function Search({ onSetSize, isOpen }) {
* @param {array} locations
*/
function onResults(locations) {
setSearchResults(locations);
setFilteredLocations(locations);
setShowNotFoundMessage(locations.length === 0);
const displayResults = locations.slice(0, MAX_RESULTS);

setSearchResults(displayResults);
setFilteredLocations(displayResults);
setShowNotFoundMessage(displayResults.length === 0);

// Handles updates to scroll buttons when the category changes.
// When a category changes, the scroll buttons need to have their enabled/disabled states updated.
Expand Down
2 changes: 1 addition & 1 deletion packages/map-template/src/hooks/useCurrentVenue.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ export const useCurrentVenue = () => {
}

// Else take first venue sorted alphabetically
return [...venuesInSolution].sort(function (a, b) { return (a.name > b.name) ? 1 : ((b.name > a.name) ? -1 : 0); })[0];
return [...venuesInSolution].sort(function (a, b) { return (a.venueInfo.name > b.venueInfo.name) ? 1 : ((b.venueInfo.name > a.venueInfo.name) ? -1 : 0); })[0];
};

/**
Expand Down