Skip to content

Commit

Permalink
feat: add skipPrograms field
Browse files Browse the repository at this point in the history
  • Loading branch information
ismay committed Mar 12, 2024
1 parent 611b7b0 commit 610ef6e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/components/FormFields/ParameterFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 7 additions & 1 deletion src/hooks/parameter-options/use-parameter-options.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ const query = {
receivers: {
resource: 'userGroups',
},
programs: {
resource: 'programs',
}
}

const useParameterOptions = () => {
Expand All @@ -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 ||
Expand All @@ -62,7 +66,8 @@ const useParameterOptions = () => {
!predictorGroups ||
!dataIntegrityChecks ||
!dashboard ||
!receivers
!receivers ||
!skipPrograms
) {
const error = new Error(
'Did not receive the expected parameter options'
Expand All @@ -79,6 +84,7 @@ const useParameterOptions = () => {
dataIntegrityChecks,
dashboard,
receivers,
skipPrograms
}

return { ...fetch, data }
Expand Down

0 comments on commit 610ef6e

Please sign in to comment.