Skip to content

Commit f0ae08d

Browse files
committed
feat: added Hidden handling for indicators
1 parent 5d730db commit f0ae08d

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/eodash_catalog/generate_indicators.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ def process_indicator_file(
179179
parent_indicator,
180180
options,
181181
"Disable" in indicator_config and collection in indicator_config["Disable"],
182+
"Hidden" in indicator_config and collection in indicator_config["Hidden"],
182183
coll_path_rel_to_root_catalog,
183184
)
184185
else:
@@ -205,6 +206,7 @@ def process_collection_file(
205206
catalog: Catalog | Collection,
206207
options: Options,
207208
disable=False,
209+
hidden=False,
208210
coll_path_rel_to_root_catalog: str = "",
209211
):
210212
LOGGER.info(f"Processing collection: {file_path}")
@@ -333,7 +335,7 @@ def process_collection_file(
333335
if not options.gp:
334336
add_single_item_if_collection_empty(endpoint_config, collection)
335337
add_projection_info(endpoint_config, collection)
336-
add_to_catalog(collection, catalog, endpoint_config, collection_config, disable)
338+
add_to_catalog(collection, catalog, endpoint_config, collection_config, disable, hidden)
337339
else:
338340
raise Exception(f"No collection was generated for resource {endpoint_config}")
339341
except Exception as e:
@@ -370,6 +372,7 @@ def process_collection_file(
370372
parent_collection,
371373
options,
372374
False,
375+
False,
373376
coll_path_rel_to_root_catalog,
374377
)
375378
# find link in parent collection to update metadata
@@ -434,7 +437,7 @@ def process_collection_file(
434437

435438

436439
def add_to_catalog(
437-
collection: Collection, catalog: Catalog, endpoint: dict, collection_config: dict, disable=False
440+
collection: Collection, catalog: Catalog, endpoint: dict, collection_config: dict, disable=False, hidden=False
438441
):
439442
# check if already in catalog, if it is do not re-add it
440443
# TODO: probably we should add to the catalog only when creating
@@ -475,6 +478,8 @@ def add_to_catalog(
475478
# Check for summaries and bubble up info
476479
if disable:
477480
link.extra_fields["roles"] = ["disable"]
481+
if hidden:
482+
link.extra_fields["roles"] = ["hidden"]
478483
if collection.summaries.lists:
479484
for summary in collection.summaries.lists:
480485
link.extra_fields[summary] = collection.summaries.lists[summary]

0 commit comments

Comments
 (0)