From 60c665e1026f58c9175448a7ec033fcdc3ffabb9 Mon Sep 17 00:00:00 2001 From: "Bradley (Brad) Andrick" Date: Mon, 4 Mar 2024 08:33:30 -0500 Subject: [PATCH] Ba/correct readme config required keys (#339) * 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 --------- Co-authored-by: Phil Varner --- CHANGELOG.md | 3 ++- README.md | 2 +- config_helper/lint_config.py | 6 ++++-- src/components/Layout/PageHeader/PageHeader.jsx | 8 ++++++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c6d7f392..006f4b04 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/README.md b/README.md index ccdfaac6..66f72427 100644 --- a/README.md +++ b/README.md @@ -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 | @@ -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 | diff --git a/config_helper/lint_config.py b/config_helper/lint_config.py index a6a066fa..3df0180d 100644 --- a/config_helper/lint_config.py +++ b/config_helper/lint_config.py @@ -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 @@ -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:") diff --git a/src/components/Layout/PageHeader/PageHeader.jsx b/src/components/Layout/PageHeader/PageHeader.jsx index 8916501b..cfab6f75 100644 --- a/src/components/Layout/PageHeader/PageHeader.jsx +++ b/src/components/Layout/PageHeader/PageHeader.jsx @@ -28,8 +28,12 @@ const PageHeader = () => { > ) : ( FilmDrop default app name logo )}