From e9892d7f32d739286c56e6852549ba2338df7708 Mon Sep 17 00:00:00 2001 From: Adam Gough Date: Sat, 17 May 2025 21:45:33 -0400 Subject: [PATCH] fix: removed comments --- .../sub-block/components/checkbox-list.tsx | 11 ----- .../components/sub-block/components/code.tsx | 13 +----- .../sub-block/components/condition-input.tsx | 18 ++++---- .../sub-block/components/date-input.tsx | 13 ------ .../sub-block/components/eval-input.tsx | 11 ----- .../file-selector/file-selector-input.tsx | 11 ----- .../sub-block/components/file-upload.tsx | 13 ------ .../components/folder-selector-input.tsx | 15 ++---- .../project-selector-input.tsx | 14 ++---- .../components/schedule/schedule-config.tsx | 12 ----- .../sub-block/components/slider-input.tsx | 13 ------ .../components/starter/input-format.tsx | 13 ------ .../sub-block/components/switch.tsx | 13 ------ .../components/sub-block/components/table.tsx | 13 ------ .../sub-block/components/time-input.tsx | 13 ------ .../sub-block/components/webhook/webhook.tsx | 13 ------ .../sub-block/hooks/use-sub-block-value.ts | 46 ------------------- .../components/sub-block/sub-block.tsx | 5 +- .../workflow-block/workflow-block.tsx | 16 ------- 19 files changed, 17 insertions(+), 259 deletions(-) diff --git a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/checkbox-list.tsx b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/checkbox-list.tsx index bd00e8235a..725a4d86ab 100644 --- a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/checkbox-list.tsx +++ b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/checkbox-list.tsx @@ -1,10 +1,8 @@ import { Checkbox } from '@/components/ui/checkbox' import { Label } from '@/components/ui/label' import { cn } from '@/lib/utils' -import { createLogger } from '@/lib/logs/console-logger' import { useSubBlockValue } from '../hooks/use-sub-block-value' -const logger = createLogger('CheckboxList') interface CheckboxListProps { blockId: string @@ -36,15 +34,6 @@ export function CheckboxList({ propValues?.[option.id] ) - // Log when in preview mode to verify it's working - if (isPreview) { - logger.info(`[PREVIEW] CheckboxList option ${option.id} for ${blockId}`, { - isPreview, - propValue: propValues?.[option.id], - value - }); - } - return (
{ - if (isPreview) { - logger.info(`[PREVIEW] Code for ${blockId}:${subBlockId}`, { - isPreview, - propValue, - storeValue - }); - } - }, [isPreview, propValue, storeValue, blockId, subBlockId]); + }, [code]) // Handlers const handleDrop = (e: React.DragEvent) => { diff --git a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/condition-input.tsx b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/condition-input.tsx index 8a00659a12..fb77d9e01c 100644 --- a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/condition-input.tsx +++ b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/condition-input.tsx @@ -512,15 +512,15 @@ export function ConditionInput({ blockId, subBlockId, isConnecting, isPreview = }, [conditionalBlocks.length]) // Log when in preview mode to verify it's working - useEffect(() => { - if (isPreview) { - logger.info(`[PREVIEW] ConditionInput for ${blockId}:${subBlockId}`, { - isPreview, - propValue, - storeValue - }); - } - }, [isPreview, propValue, storeValue, blockId, subBlockId]); + // useEffect(() => { + // if (isPreview) { + // logger.info(`[PREVIEW] ConditionInput for ${blockId}:${subBlockId}`, { + // isPreview, + // propValue, + // storeValue + // }); + // } + // }, [isPreview, propValue, storeValue, blockId, subBlockId]); // Show loading or empty state if not ready or no blocks if (!isReady || conditionalBlocks.length === 0) { diff --git a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/date-input.tsx b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/date-input.tsx index b66be5537d..e79bbbc254 100644 --- a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/date-input.tsx +++ b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/date-input.tsx @@ -7,11 +7,9 @@ import { Button } from '@/components/ui/button' import { Calendar } from '@/components/ui/calendar' import { Popover, PopoverContent, PopoverTrigger } from '@/components/ui/popover' import { cn } from '@/lib/utils' -import { createLogger } from '@/lib/logs/console-logger' import { useNotificationStore } from '@/stores/notifications/store' import { useSubBlockValue } from '../hooks/use-sub-block-value' -const logger = createLogger('DateInput') interface DateInputProps { blockId: string @@ -26,17 +24,6 @@ export function DateInput({ blockId, subBlockId, placeholder, isPreview = false, const addNotification = useNotificationStore((state) => state.addNotification) const date = value ? new Date(value) : undefined - // Log when in preview mode to verify it's working - React.useEffect(() => { - if (isPreview) { - logger.info(`[PREVIEW] DateInput for ${blockId}:${subBlockId}`, { - isPreview, - propValue, - value - }); - } - }, [isPreview, propValue, value, blockId, subBlockId]); - const isPastDate = React.useMemo(() => { if (!date) return false const today = new Date() diff --git a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/eval-input.tsx b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/eval-input.tsx index c05aa1c681..5fba41cb47 100644 --- a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/eval-input.tsx +++ b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/eval-input.tsx @@ -3,10 +3,8 @@ import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' import { Tooltip, TooltipContent, TooltipTrigger } from '@/components/ui/tooltip' -import { createLogger } from '@/lib/logs/console-logger' import { useSubBlockValue } from '../hooks/use-sub-block-value' -const logger = createLogger('EvalInput') interface EvalMetric { id: string @@ -38,15 +36,6 @@ export function EvalInput({ blockId, subBlockId, isPreview = false, value: propV const [value, setValue] = useSubBlockValue(blockId, subBlockId, false, isPreview, propValue) const metrics = value || [DEFAULT_METRIC] - // Log when in preview mode to verify it's working - if (isPreview) { - logger.info(`[PREVIEW] EvalInput for ${blockId}:${subBlockId}`, { - isPreview, - propValue, - value - }); - } - // Metric operations const addMetric = () => { const newMetric: EvalMetric = { diff --git a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/file-selector/file-selector-input.tsx b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/file-selector/file-selector-input.tsx index 03406d2cab..41bc89cd27 100644 --- a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/file-selector/file-selector-input.tsx +++ b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/file-selector/file-selector-input.tsx @@ -20,7 +20,6 @@ import { MicrosoftFileSelector } from './components/microsoft-file-selector' import type { TeamsMessageInfo } from './components/teams-message-selector' import { TeamsMessageSelector } from './components/teams-message-selector' -const logger = createLogger('FileSelectorInput') interface FileSelectorInputProps { blockId: string @@ -48,16 +47,6 @@ export function FileSelectorInput({ const [selectedMessageId, setSelectedMessageId] = useState('') const [messageInfo, setMessageInfo] = useState(null) - // Log when in preview mode to verify it's working - useEffect(() => { - if (isPreview) { - logger.info(`[PREVIEW] FileSelectorInput for ${blockId}:${subBlock.id}`, { - isPreview, - propValue - }); - } - }, [isPreview, propValue, blockId, subBlock.id]); - // Get provider-specific values const provider = subBlock.provider || 'google-drive' const isConfluence = provider === 'confluence' diff --git a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/file-upload.tsx b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/file-upload.tsx index 028da7e74a..0d09c800b3 100644 --- a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/file-upload.tsx +++ b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/file-upload.tsx @@ -4,14 +4,12 @@ import { useEffect, useRef, useState } from 'react' import { X } from 'lucide-react' import { Button } from '@/components/ui/button' import { Progress } from '@/components/ui/progress' -import { createLogger } from '@/lib/logs/console-logger' import { useNotificationStore } from '@/stores/notifications/store' import { useWorkflowRegistry } from '@/stores/workflows/registry/store' import { useSubBlockStore } from '@/stores/workflows/subblock/store' import { useWorkflowStore } from '@/stores/workflows/workflow/store' import { useSubBlockValue } from '../hooks/use-sub-block-value' -const logger = createLogger('FileUpload') interface FileUploadProps { blockId: string @@ -66,17 +64,6 @@ export function FileUpload({ const { addNotification } = useNotificationStore() const { activeWorkflowId } = useWorkflowRegistry() - // Log when in preview mode to verify it's working - useEffect(() => { - if (isPreview) { - logger.info(`[PREVIEW] FileUpload for ${blockId}:${subBlockId}`, { - isPreview, - propValue, - value - }); - } - }, [isPreview, propValue, value, blockId, subBlockId]); - /** * Opens file dialog * Prevents event propagation to avoid ReactFlow capturing the event diff --git a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/folder-selector/components/folder-selector-input.tsx b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/folder-selector/components/folder-selector-input.tsx index fab35f5a3d..828c8edc69 100644 --- a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/folder-selector/components/folder-selector-input.tsx +++ b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/folder-selector/components/folder-selector-input.tsx @@ -1,13 +1,14 @@ 'use client' import { useEffect, useState } from 'react' +<<<<<<< HEAD import type { SubBlockConfig } from '@/blocks/types' import { createLogger } from '@/lib/logs/console-logger' +======= +>>>>>>> 86800d81 (fix: removed comments) import { useSubBlockStore } from '@/stores/workflows/subblock/store' import { type FolderInfo, FolderSelector } from '../folder-selector' -const logger = createLogger('FolderSelectorInput') - interface FolderSelectorInputProps { blockId: string subBlock: SubBlockConfig @@ -27,16 +28,6 @@ export function FolderSelectorInput({ const [selectedFolderId, setSelectedFolderId] = useState('') const [_folderInfo, setFolderInfo] = useState(null) - // Log when in preview mode to verify it's working - useEffect(() => { - if (isPreview) { - logger.info(`[PREVIEW] FolderSelectorInput for ${blockId}:${subBlock.id}`, { - isPreview, - propValue - }); - } - }, [isPreview, propValue, blockId, subBlock.id]); - // Get the current value from the store or prop value if in preview mode useEffect(() => { if (isPreview && propValue !== undefined) { diff --git a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/project-selector/project-selector-input.tsx b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/project-selector/project-selector-input.tsx index efd6e5c3de..8ad73ca47b 100644 --- a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/project-selector/project-selector-input.tsx +++ b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/project-selector/project-selector-input.tsx @@ -2,15 +2,17 @@ import { useEffect, useState } from 'react' import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@/components/ui/tooltip' +<<<<<<< HEAD import type { SubBlockConfig } from '@/blocks/types' import { createLogger } from '@/lib/logs/console-logger' +======= +>>>>>>> 86800d81 (fix: removed comments) import { useSubBlockStore } from '@/stores/workflows/subblock/store' import { type DiscordServerInfo, DiscordServerSelector } from './components/discord-server-selector' import { type JiraProjectInfo, JiraProjectSelector } from './components/jira-project-selector' import { type LinearProjectInfo, LinearProjectSelector } from './components/linear-project-selector' import { type LinearTeamInfo, LinearTeamSelector } from './components/linear-team-selector' -const logger = createLogger('ProjectSelectorInput') interface ProjectSelectorInputProps { blockId: string @@ -33,16 +35,6 @@ export function ProjectSelectorInput({ const [selectedProjectId, setSelectedProjectId] = useState('') const [_projectInfo, setProjectInfo] = useState(null) - // Log when in preview mode to verify it's working - useEffect(() => { - if (isPreview) { - logger.info(`[PREVIEW] ProjectSelectorInput for ${blockId}:${subBlock.id}`, { - isPreview, - propValue - }); - } - }, [isPreview, propValue, blockId, subBlock.id]); - // Get provider-specific values const provider = subBlock.provider || 'jira' const isDiscord = provider === 'discord' diff --git a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/schedule/schedule-config.tsx b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/schedule/schedule-config.tsx index 3bdbbe8f26..1634673390 100644 --- a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/schedule/schedule-config.tsx +++ b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/schedule/schedule-config.tsx @@ -57,18 +57,6 @@ export function ScheduleConfig({ const [startWorkflow, setStartWorkflow] = useSubBlockValue(blockId, 'startWorkflow', false, isPreview, propValue?.startWorkflow) const isScheduleEnabled = startWorkflow === 'schedule' - // Log when in preview mode to verify it's working - useEffect(() => { - if (isPreview) { - logger.info(`[PREVIEW] ScheduleConfig for ${blockId}`, { - isPreview, - propValue, - scheduleType, - startWorkflow - }); - } - }, [isPreview, propValue, scheduleType, startWorkflow, blockId]); - // Function to check if schedule exists in the database const checkSchedule = async () => { setIsLoading(true) diff --git a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/slider-input.tsx b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/slider-input.tsx index 9047738482..6c6c43817f 100644 --- a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/slider-input.tsx +++ b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/slider-input.tsx @@ -1,9 +1,7 @@ import { useEffect, useMemo } from 'react' import { Slider } from '@/components/ui/slider' -import { createLogger } from '@/lib/logs/console-logger' import { useSubBlockValue } from '../hooks/use-sub-block-value' -const logger = createLogger('SliderInput') interface SliderInputProps { min?: number @@ -30,17 +28,6 @@ export function SliderInput({ }: SliderInputProps) { const [value, setValue] = useSubBlockValue(blockId, subBlockId, false, isPreview, propValue) - // Log when in preview mode to verify it's working - useEffect(() => { - if (isPreview) { - logger.info(`[PREVIEW] SliderInput for ${blockId}:${subBlockId}`, { - isPreview, - propValue, - value - }); - } - }, [isPreview, propValue, value, blockId, subBlockId]); - // Clamp the value within bounds while preserving relative position when possible const normalizedValue = useMemo(() => { if (value === null) return defaultValue diff --git a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/starter/input-format.tsx b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/starter/input-format.tsx index 740b59cb9e..dd6a60d6c2 100644 --- a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/starter/input-format.tsx +++ b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/starter/input-format.tsx @@ -11,10 +11,8 @@ import { import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' import { cn } from '@/lib/utils' -import { createLogger } from '@/lib/logs/console-logger' import { useSubBlockValue } from '../../hooks/use-sub-block-value' -const logger = createLogger('InputFormat') interface InputField { id: string @@ -43,17 +41,6 @@ export function InputFormat({ blockId, subBlockId, isPreview = false, value: pro const [value, setValue] = useSubBlockValue(blockId, subBlockId, false, isPreview, propValue) const fields = value || [DEFAULT_FIELD] - // Log when in preview mode to verify it's working - useEffect(() => { - if (isPreview) { - logger.info(`[PREVIEW] InputFormat for ${blockId}:${subBlockId}`, { - isPreview, - propValue, - value - }); - } - }, [isPreview, propValue, value, blockId, subBlockId]); - // Field operations const addField = () => { const newField: InputField = { diff --git a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/switch.tsx b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/switch.tsx index 3120bef461..a1bd360965 100644 --- a/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/switch.tsx +++ b/apps/sim/app/w/[id]/components/workflow-block/components/sub-block/components/switch.tsx @@ -1,10 +1,8 @@ import { useEffect } from 'react' import { Label } from '@/components/ui/label' import { Switch as UISwitch } from '@/components/ui/switch' -import { createLogger } from '@/lib/logs/console-logger' import { useSubBlockValue } from '../hooks/use-sub-block-value' -const logger = createLogger('Switch') interface SwitchProps { blockId: string @@ -23,17 +21,6 @@ export function Switch({ }: SwitchProps) { const [value, setValue] = useSubBlockValue(blockId, subBlockId, false, isPreview, propValue) - // Log when in preview mode to verify it's working - useEffect(() => { - if (isPreview) { - logger.info(`[PREVIEW] Switch for ${blockId}:${subBlockId}`, { - isPreview, - propValue, - value - }); - } - }, [isPreview, propValue, value, blockId, subBlockId]); - return (