Skip to content

Commit

Permalink
Ba/correct readme config required keys (#339)
Browse files Browse the repository at this point in the history
* update readme to correctly show required config keys

* update config lint script to handle changed required keys

* update changelog

* fix bug in required keys script

* resolve issue with public URL not need to be required

* fix required keys in lint script

* Update config_helper/lint_config.py

Co-authored-by: Phil Varner <[email protected]>

---------

Co-authored-by: Phil Varner <[email protected]>
  • Loading branch information
bradleyandrick and Phil Varner authored Mar 4, 2024
1 parent 753ceb7 commit 60c665e
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Changed

- Moved example config out of public so it doesn't get added to build
- Moved example config out of public so it doesn't get added to build.
- Update readme for config keys showing as `required` to correctly reflect app run requirements.

## 5.0.0 - 2024-02-27

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ The file `config_helper/config.example.json` is included in this repository as r
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| STAC_API_URL | URL for STAC API | Required |
| PUBLIC_URL | URL for the FilmDrop UI. Useful when using a CDN to host application. | Optional |
| SEARCH_MIN_ZOOM_LEVELS | Per-collection configuration for minimum zoom levels needed for grid code aggregated results (medium zoom level) and single scene search results (high zoom level). Example: [config.example.json](config_helper/config.example.json). If no grid code aggregation, set value for `medium` to be the same value as `high` and hex aggregations will be used until the zoom level is reached when individual scenes become available. | Required |
| LOGO_URL | URL for your custom logo | Optional |
| LOGO_ALT | Alt image description for your custom logo | Optional |
| DASHBOARD_BTN_URL | URL for the Dashboard button at the top right of the UI. If not set, the button will not be visible. | Optional |
Expand All @@ -90,7 +91,6 @@ The file `config_helper/config.example.json` is included in this repository as r
| MOSAIC_TILER_URL | URL for mosaic tiling. If not set, the View Mode selector will not be visible. The app requires the use of the [NASA IMPACT TiTiler fork](https://github.com/NASA-IMPACT/titiler) as it contains the mosaicjson endpoints needed. | Optional |
| MOSAIC_TILER_PARAMS | Per-collection configuration of TiTiler mosaic `assets`, `color_formula`, `bidx`, `rescale`, `expression`, and `colormap_name` parameters. Example in [config.example.json](config_helper/config.example.json) | Optional |
| MOSAIC_MAX_ITEMS | Maximum number of items in mosaic. If not set, the default max items will be 100. | Optional |
| SEARCH_MIN_ZOOM_LEVELS | Per-collection configuration for minimum zoom levels needed for grid code aggregated results (medium zoom level) and single scene search results (high zoom level). Example: [config.example.json](config_helper/config.example.json). If no grid code aggregation, set value for `medium` to be the same value as `high` and hex aggregations will be used until the zoom level is reached when individual scenes become available. | Optional |
| CONFIG_COLORMAP | Color map used in low level hex grid search results. Complete list of colormaps are available here: [bpostlethwaite/colormap](https://github.com/bpostlethwaite/colormap). If not set, the default colormap will be "viridis". | Optional |
| BASEMAP_URL | URL to specify a basemap provider used by the leaflet map. Must be a raster tile provider as vector tiles are not supported. If not set, the default colormap will be `https://tile.openstreetmap.org/{z}/{x}/{y}.png`. | Optional |
| BASEMAP_DARK_THEME | Boolean value. If set to `true` or not included in config, a dark theme is applied to the basemap. If set to `false`, the dark theme will not be applied to basemap and the default basemap provider style is used. | Optional |
Expand Down
6 changes: 4 additions & 2 deletions config_helper/lint_config.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
"""
Usage: python3 lint_config.py path/to/config.json
Purpose: Lints a config.json configuration file used by a depolyment of the Filmdrop UI application (https://github.com/Element84/filmdrop-ui).
Purpose: Lints a config.json configuration file used by a deployment of the Filmdrop UI application (https://github.com/Element84/filmdrop-ui).
Checks for missing required keys, extra keys, type errors, and optional keys not included.
Supported console version this works for: 5.0.0
"""

import sys
Expand Down Expand Up @@ -63,7 +65,7 @@ def lint_config(file_path):
print("*********************************************************************")

# Check for missing required keys
required_keys = ["STAC_API_URL"]
required_keys = ["STAC_API_URL","SEARCH_MIN_ZOOM_LEVELS"]
missing_required_keys = [key for key in required_keys if key not in config]
if missing_required_keys:
print("Required key(s) missing:")
Expand Down
8 changes: 6 additions & 2 deletions src/components/Layout/PageHeader/PageHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ const PageHeader = () => {
></img>
) : (
<img
src={_appConfig.PUBLIC_URL + '/logo.png'}
alt="FilmDrop default app name logo"
src={
_appConfig.PUBLIC_URL
? _appConfig.PUBLIC_URL + '/logo.png'
: './logo.png'
}
alt="FilmDrop default app logo"
className="headerLogoImage"
/>
)}
Expand Down

0 comments on commit 60c665e

Please sign in to comment.