Skip to content

Commit 2afda0e

Browse files
committed
fix(circleback): scope dual-purpose action-item and search inputs per operation
1 parent 1ced906 commit 2afda0e

1 file changed

Lines changed: 79 additions & 14 deletions

File tree

apps/sim/blocks/blocks/circleback.ts

Lines changed: 79 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const CirclebackBlock: BlockConfig = {
3131
list_action_items: [
3232
'List action items',
3333
{ text: 'assigned to', field: 'assigneeType' },
34-
{ text: 'with status', field: 'status' },
34+
{ text: 'with status', field: 'statusFilter' },
3535
],
3636
update_action_item: [{ text: 'Update action item', field: 'actionItemId', core: true }],
3737
delete_action_item: [{ text: 'Delete action item', field: 'actionItemId', core: true }],
@@ -160,13 +160,21 @@ export const CirclebackBlock: BlockConfig = {
160160
title: 'Meeting IDs',
161161
type: 'short-input',
162162
placeholder: 'Comma-separated meeting IDs',
163-
description:
164-
'For Search Meetings, restricts the search to these meetings. For the tag operations, the meetings to update.',
163+
description: 'The meetings to add the tag to or remove it from.',
165164
condition: {
166165
field: 'operation',
167-
value: ['search_meetings', 'add_tag_to_meetings', 'remove_tag_from_meetings'],
166+
value: ['add_tag_to_meetings', 'remove_tag_from_meetings'],
168167
},
169168
},
169+
{
170+
id: 'searchMeetingIds',
171+
title: 'Meeting IDs',
172+
type: 'short-input',
173+
placeholder: 'Comma-separated meeting IDs',
174+
description: 'Restrict the search to these meetings.',
175+
condition: { field: 'operation', value: 'search_meetings' },
176+
mode: 'advanced',
177+
},
170178
{
171179
id: 'tagIds',
172180
title: 'Tag IDs',
@@ -218,8 +226,17 @@ export const CirclebackBlock: BlockConfig = {
218226
type: 'short-input',
219227
placeholder: 'e.g., 42',
220228
description:
221-
'For List Action Items, filters by this assignee. For Update Action Item, assigns to this profile, or the literal text null to remove the assignee.',
222-
condition: { field: 'operation', value: ['list_action_items', 'update_action_item'] },
229+
'The profile to assign the action item to, or the literal text null to remove the assignee.',
230+
condition: { field: 'operation', value: 'update_action_item' },
231+
mode: 'advanced',
232+
},
233+
{
234+
id: 'assigneeFilterProfileId',
235+
title: 'Assignee Profile ID',
236+
type: 'short-input',
237+
placeholder: 'e.g., 42',
238+
description: 'Only return action items assigned to this profile.',
239+
condition: { field: 'operation', value: 'list_action_items' },
223240
mode: 'advanced',
224241
},
225242
{
@@ -235,14 +252,27 @@ export const CirclebackBlock: BlockConfig = {
235252
title: 'Status',
236253
type: 'dropdown',
237254
options: [
238-
{ label: 'Leave unchanged / default', id: '' },
255+
{ label: 'Leave unchanged', id: '' },
239256
{ label: 'Pending', id: 'PENDING' },
240257
{ label: 'Done', id: 'DONE' },
241258
],
242259
value: () => '',
243-
description:
244-
'For List Action Items, the completion status to filter by (defaults to incomplete). For Update Action Item, the status to set.',
245-
condition: { field: 'operation', value: ['list_action_items', 'update_action_item'] },
260+
description: 'The completion status to set on the action item.',
261+
condition: { field: 'operation', value: 'update_action_item' },
262+
},
263+
{
264+
id: 'statusFilter',
265+
title: 'Status',
266+
type: 'dropdown',
267+
options: [
268+
{ label: 'Default (incomplete)', id: '' },
269+
{ label: 'Pending', id: 'PENDING' },
270+
{ label: 'Done', id: 'DONE' },
271+
],
272+
value: () => '',
273+
description: 'The completion status to filter by. Defaults to incomplete action items.',
274+
condition: { field: 'operation', value: 'list_action_items' },
275+
mode: 'advanced',
246276
},
247277
{
248278
id: 'actionItemId',
@@ -419,6 +449,22 @@ export const CirclebackBlock: BlockConfig = {
419449
],
420450
config: {
421451
tool: (params) => `circleback_${params.operation}`,
452+
params: (params) => {
453+
/* Filter variants live on their own subBlocks so an operation switch
454+
cannot leak a mutation input into a list filter; remap them onto the
455+
tool param names here. */
456+
const result: Record<string, unknown> = {}
457+
if (params.operation === 'list_action_items') {
458+
if (params.statusFilter) result.status = params.statusFilter
459+
if (params.assigneeFilterProfileId) {
460+
result.assigneeProfileId = params.assigneeFilterProfileId
461+
}
462+
}
463+
if (params.operation === 'search_meetings' && params.searchMeetingIds) {
464+
result.meetingIds = params.searchMeetingIds
465+
}
466+
return result
467+
},
422468
},
423469
},
424470

@@ -432,7 +478,14 @@ export const CirclebackBlock: BlockConfig = {
432478
searchTerm: { type: 'string', description: 'Text to search for across meetings' },
433479
ownership: { type: 'string', description: 'Which meetings to list: All, Mine, or Shared' },
434480
statuses: { type: 'string', description: 'Comma-separated meeting statuses to filter by' },
435-
meetingIds: { type: 'string', description: 'Comma-separated meeting IDs' },
481+
meetingIds: {
482+
type: 'string',
483+
description: 'Comma-separated IDs of the meetings to add the tag to or remove it from',
484+
},
485+
searchMeetingIds: {
486+
type: 'string',
487+
description: 'Comma-separated meeting IDs to restrict the search to',
488+
},
436489
tagIds: { type: 'string', description: 'Comma-separated tag IDs to filter by' },
437490
attendeeProfileIds: {
438491
type: 'string',
@@ -441,10 +494,18 @@ export const CirclebackBlock: BlockConfig = {
441494
assigneeType: { type: 'string', description: 'Assignee scope filter for action items' },
442495
assigneeProfileId: {
443496
type: 'string',
444-
description: 'Assignee profile ID to filter by or assign to',
497+
description: 'Profile to assign the action item to, or null to remove the assignee',
498+
},
499+
assigneeFilterProfileId: {
500+
type: 'string',
501+
description: 'Only return action items assigned to this profile',
445502
},
446503
assigneeTeamId: { type: 'string', description: 'Assignee team ID to filter by' },
447-
status: { type: 'string', description: 'Action item status, PENDING or DONE' },
504+
status: { type: 'string', description: 'The completion status to set, PENDING or DONE' },
505+
statusFilter: {
506+
type: 'string',
507+
description: 'The completion status to filter by, PENDING or DONE',
508+
},
448509
actionItemId: { type: 'string', description: 'Action item ID' },
449510
title: { type: 'string', description: 'New action item title' },
450511
description: { type: 'string', description: 'New action item description' },
@@ -525,7 +586,11 @@ export const CirclebackBlock: BlockConfig = {
525586
assignee: { type: 'json', description: 'Action item assignee, or null if unassigned' },
526587
completedAt: { type: 'string', description: 'When an action item was marked done' },
527588
meetingId: { type: 'string', description: 'The meeting an action item belongs to' },
528-
status: { type: 'string', description: 'Action item status, PENDING or DONE' },
589+
status: { type: 'string', description: 'The completion status to set, PENDING or DONE' },
590+
statusFilter: {
591+
type: 'string',
592+
description: 'The completion status to filter by, PENDING or DONE',
593+
},
529594
companyId: { type: 'number', description: 'The company a person belongs to' },
530595
companyName: { type: 'string', description: 'The company name of a person' },
531596
email: { type: 'string', description: 'A person email address' },

0 commit comments

Comments
 (0)