From dd7edc224221686f1597f532f91b572aba5992b3 Mon Sep 17 00:00:00 2001 From: Sarah Rietkerk Date: Thu, 22 Feb 2024 12:20:03 -0800 Subject: [PATCH] Added hidden flag for catalog criteria --- teachertool/src/state/helpers.ts | 5 +++-- teachertool/src/types/criteria.ts | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/teachertool/src/state/helpers.ts b/teachertool/src/state/helpers.ts index c332620da6c9..93b9d5aead91 100644 --- a/teachertool/src/state/helpers.ts +++ b/teachertool/src/state/helpers.ts @@ -70,8 +70,9 @@ export function getSelectableCatalogCriteria(state: AppState): CatalogCriteria[] return ( state.catalog?.filter( catalogCriteria => - (catalogCriteria.parameters && catalogCriteria.parameters.length > 0) || - !usedCatalogCriteria.includes(catalogCriteria.id) + ((catalogCriteria.parameters && catalogCriteria.parameters.length > 0) || + !usedCatalogCriteria.includes(catalogCriteria.id)) && + !catalogCriteria.hideInCatalog ) ?? [] ); } diff --git a/teachertool/src/types/criteria.ts b/teachertool/src/types/criteria.ts index 7fd5657a8f2d..e9d87a2c5fb1 100644 --- a/teachertool/src/types/criteria.ts +++ b/teachertool/src/types/criteria.ts @@ -6,6 +6,7 @@ export interface CatalogCriteria { description: string | undefined; // More detailed description docPath: string | undefined; // Path to documentation parameters: CriteriaParameter[] | undefined; // Any parameters that affect the criteria + hideInCatalog?: boolean; // Whether the criteria should be hidden in the catalog } // An instance of a criteria in a rubric.