Skip to content

Commit

Permalink
ONI-255: Fetching allowed sources fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
wzgliniecki committed Jun 5, 2024
1 parent de4bd82 commit 220e3c6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const TASK_GROUP_PROJECTION = () => [
'code',
'completionPolicy',
'taskexecutorSet { edges { node { user { id username lastName } } } }',
'taskAllowedSources'

Check failure on line 20 in src/actions.js

View workflow job for this annotation

GitHub Actions / lint

Missing trailing comma
];

const TASK_FULL_PROJECTION = () => [
Expand Down Expand Up @@ -64,6 +65,7 @@ export const formatTaskGroupGQL = (taskGroup) => {
${taskGroup?.id ? `id: "${taskGroup.id}"` : ''}
${taskGroup?.taskexecutorSet ? `userIds: ${executorsString}` : 'userIds: []'}
${taskGroup?.taskSources ? `taskSources: ${taskSourcesString}` : 'taskSources: []'}
${taskGroup?.taskAllowedSources ? `taskAllowedSources: ${taskSourcesString}` : 'taskAllowedSources: []'}
`;
};

Expand Down Expand Up @@ -122,6 +124,7 @@ export function fetchTaskGroup(modulesManager, variables) {
completionPolicy
jsonExt
taskexecutorSet { edges { node { user { id username lastName } } } },
taskAllowedSources
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,9 @@ function reducer(
taskSources: taskGroup?.jsonExt
? JSON.parse(taskGroup.jsonExt).task_sources.map((source) => ({ id: source, name: source }))
: [],
taskAllowedSources: taskGroup?.taskAllowedSources
? JSON.parse(taskGroup?.taskAllowedSources).task_allowed_sources.map((source) => ({ id: source, name: source }))
: [],
}))?.[0],
fetchingTaskGroup: false,
errorTaskGroup: formatGraphQLError(action.payload),
Expand Down

0 comments on commit 220e3c6

Please sign in to comment.