From 610ef6e438d78a7aee33d2595dd48209bf83c14b Mon Sep 17 00:00:00 2001 From: ismay Date: Tue, 12 Mar 2024 16:52:04 +0100 Subject: [PATCH] feat: add skipPrograms field --- src/components/FormFields/ParameterFields.js | 7 +++++++ src/hooks/parameter-options/use-parameter-options.js | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/components/FormFields/ParameterFields.js b/src/components/FormFields/ParameterFields.js index f2b99831..0f439f0e 100644 --- a/src/components/FormFields/ParameterFields.js +++ b/src/components/FormFields/ParameterFields.js @@ -41,6 +41,13 @@ const getCustomComponent = (jobType, parameterName) => { return null case 'ANALYTICS_TABLE': + if (parameterName === 'skipTableTypes') { + return SkipTableTypesField + } else if (parameterName === 'skipPrograms') { + return LabeledOptionsField + } + + return null case 'CONTINUOUS_ANALYTICS_TABLE': if (parameterName === 'skipTableTypes') { return SkipTableTypesField diff --git a/src/hooks/parameter-options/use-parameter-options.js b/src/hooks/parameter-options/use-parameter-options.js index cda6f22d..03b1e8c7 100644 --- a/src/hooks/parameter-options/use-parameter-options.js +++ b/src/hooks/parameter-options/use-parameter-options.js @@ -37,6 +37,9 @@ const query = { receivers: { resource: 'userGroups', }, + programs: { + resource: 'programs', + } } const useParameterOptions = () => { @@ -53,6 +56,7 @@ const useParameterOptions = () => { const dataIntegrityChecks = fetch.data?.dataIntegrityChecks const dashboard = fetch.data?.dashboard?.dashboards const receivers = fetch.data?.receivers?.userGroups + const skipPrograms = fetch.data?.programs?.programs if ( !skipTableTypes || @@ -62,7 +66,8 @@ const useParameterOptions = () => { !predictorGroups || !dataIntegrityChecks || !dashboard || - !receivers + !receivers || + !skipPrograms ) { const error = new Error( 'Did not receive the expected parameter options' @@ -79,6 +84,7 @@ const useParameterOptions = () => { dataIntegrityChecks, dashboard, receivers, + skipPrograms } return { ...fetch, data }