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.70.0 #423

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
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
10 changes: 10 additions & 0 deletions packages/map-template/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,22 @@ 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).

## [1.61.0] - 2024-12-10

### Added

- Limit the maximum number of search results to 100 to improve render performance.

### Fixed
- 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.

## [1.60.0] - 2024-12-10

### Added

- Upgrade UI on the Wayfinding page.


## [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
Loading