Skip to content

Commit

Permalink
[sc-11395] Prevent task list from breaking when there is unsupported …
Browse files Browse the repository at this point in the history
…tasks (#1913)
  • Loading branch information
operramon authored Jan 14, 2025
1 parent 748aa1e commit e3f9338
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function mapBatchToOneTimeTask(task: TaskOnBatch): OneTimeTask {
export function mapOnGoingToAutomatedTask(task: TaskOnGoing): AutomatedTask {
return {
id: task.id,
taskName: task.task.name,
taskName: task.task.name || '',
type: 'automated',
creationDate: task.defined_at ? `${task.defined_at}+00:00` : '',
...mapParameters(task.parameters),
Expand All @@ -49,10 +49,10 @@ export function mapOnGoingToAutomatedTask(task: TaskOnGoing): AutomatedTask {

function mapParameters(parameters: TaskParameters): TaskConfiguration {
return {
title: parameters.name,
title: parameters.name || '',
filters: [
{ label: 'contains', count: parameters.filter.contains?.length || 0 },
{ label: 'field_types', count: parameters.filter.field_types?.length || 0 },
{ label: 'contains', count: parameters.filter?.contains?.length || 0 },
{ label: 'field_types', count: parameters.filter?.field_types?.length || 0 },
],
hasPrompt: false, // TODO: extract prompt from parameters
labelSets: (parameters.operations || [])
Expand Down

0 comments on commit e3f9338

Please sign in to comment.