-
Notifications
You must be signed in to change notification settings - Fork 46
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
Feature/1374 configurable search options #1496
Conversation
This commit introduces a new JSON structure in the client for managing and controlling which search functionalities are enabled. The updated structure utilizes an array named `enabledSearchOptions`, including the following options: - matchCase - activeSpatialFilter - wildcardAtStart - searchInVisibleLayers - wildcardAtEnd - enableLabelOnHighlight This approach allows for centralized management of search options, making it easy to enable or disable specific functionalities directly through the admin UI. To ensure these settings always take effect when changed, they are not stored in `localStorage`.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well!
The code could be refactored though. For example the following is repeated in several places:
onChange={(e) => {
const { checked } = e.target;
this.setState((prevState) => {
const enabledSearchOptions = new Set(
prevState.enabledSearchOptions
);
if (checked) {
enabledSearchOptions.add("searchInVisibleLayers");
} else {
enabledSearchOptions.delete("searchInVisibleLayers");
}
return {
enabledSearchOptions: Array.from(enabledSearchOptions),
};
});
}}
Refactor repeated `onChange` logic into a reusable method `handleOnChange`.
# Conflicts: # apps/client/src/components/Search/SearchSettings.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've merged develop and updated the changelog. Tested with Node backend and seems to work fine. @jacobwod @jesade-vbg @Albinahmetaj @OlofSvahnVbg do you want to test it before merge?
Tested it (with Node backend) and it seems to be working! |
Closes #1374.