-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds feature to allow ENV to reorder & filter aggs
** Why are these changes being introduced: While the API provides a large number of possible options for users to filter and aggregate their search results, not every instance of the application will want to use every category (GeoData and the basic Search application will likely use different sets, for example). One good option for enabling these differences is to leverage environment variables. ** Relevant ticket(s): * https://mitlibraries.atlassian.net/browse/gdt-128 ** How does this address that need: This adds a new environment variable to the application, ACTIVE_FILTERS. This is meant to be a list of the filter categories which should be displayed in the application. The variable is optional - without it, the application should include every available category, in the order they appear in the query model. The env variable is loaded and processed in the search controller, which is then used to order and filter the categories returned from the API before sending the result to the user in the UI. The tests added in this commit demonstrate the impact of this change. ** Document any side effects to this change: Because the env var is optional, I'm not adding it to app.json. I'm leaning toward adding it to the Heroku pipeline, to preserve the current behavior (only content type and source being shown). Also, the next commit will show a quick refactoring that is motivated by codeclimate feedback. starting
- Loading branch information
1 parent
2b6ae5c
commit 205db6a
Showing
3 changed files
with
52 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters