From ab641152dd97d86c4357fd37ce12aa10afa78e13 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 1 Jun 2026 22:01:38 +0300 Subject: [PATCH 1/4] Update FE config to fail the build for ts errors --- packages/react-ui/project.json | 6 ++++ .../src/app/common/hooks/flags-hooks.ts | 2 +- .../src/app/common/hooks/project-hooks.ts | 2 +- .../features/ai/lib/assistant-ui-chat-hook.ts | 5 ++- .../react-ui/src/app/features/ai/lib/types.ts | 2 +- .../benchmark/components/benchmark-wizard.tsx | 14 ++++++-- .../block-operations-suggestions.tsx | 8 +++-- .../components/install-block-dialog.tsx | 9 +++++- .../app/features/blocks/lib/blocks-hook.ts | 10 +++--- .../dynamic-block-property.tsx | 6 ++-- .../dynamic-dropdown-block-property.tsx | 6 ++-- .../text-input-with-mentions/index.tsx | 4 +-- .../text-input-utils.ts | 14 +++++--- .../src/app/features/builder/builder-hooks.ts | 2 +- .../data-selector/data-selector-utils.ts | 5 ++- .../builder/flow-canvas/flow-drag-layer.tsx | 11 +++++-- .../apply-operation-and-push-to-history.ts | 1 + .../push-flow-version-to-version-history.ts | 18 ++++++++--- .../flow-versions/flow-versions-card.tsx | 9 +----- .../features/builder/step-settings/index.tsx | 5 ++- .../split-settings/edit-branch-name.tsx | 5 ++- .../test-step/test-trigger-section.tsx | 2 ++ .../components/connection-table.tsx | 7 ++-- .../flow-runs/components/step-status-icon.tsx | 3 +- .../flow-runs/hooks/useRunsTableColumns.tsx | 32 +++++++++---------- .../execute-risky-flow-dialog/utils.ts | 13 ++++++-- .../import-flow-dialog-content.tsx | 8 +++-- .../component/add-new-folder-dialog.tsx | 6 ++-- .../component/create-subfolder-dialog.tsx | 6 ++-- .../component/rename-folder-dialog.tsx | 6 ++-- .../navigation/side-menu/side-menu-footer.tsx | 2 +- .../connections-picker/connections-picker.tsx | 5 +-- ...c-flow-template-filter-sidebar-wrapper.tsx | 2 +- .../select-flow-template-dialog.tsx | 2 +- .../src/app/lib/authentication-api.ts | 9 ++++++ .../src/app/routes/home-demo/index.tsx | 3 ++ .../react-ui/src/app/routes/runs/index.tsx | 13 +++----- .../app/routes/settings/appearance/index.tsx | 3 +- .../src/app/routes/settings/blocks/index.tsx | 4 +-- packages/react-ui/vite.config.ts | 4 ++- .../dto/authentication-response.ts | 1 + .../generate-code-tool/generate-code-tool.tsx | 7 +++- ...p-settings-assistant-ui-chat-container.tsx | 2 +- .../tool-fallback/tool-fallback.tsx | 2 +- .../tool-fallback/tool-json-parser.ts | 6 +++- .../benchmark/benchmark-ready-step.tsx | 2 +- .../components/code-editor/code-editor.tsx | 2 +- .../src/components/flow-template/types.ts | 14 ++------ 48 files changed, 192 insertions(+), 118 deletions(-) diff --git a/packages/react-ui/project.json b/packages/react-ui/project.json index 674ee7d8fb..0bac88c248 100644 --- a/packages/react-ui/project.json +++ b/packages/react-ui/project.json @@ -5,6 +5,12 @@ "projectType": "application", "tags": [], "targets": { + "build": { + "dependsOn": ["typecheck", "^build"] + }, + "serve": { + "dependsOn": ["typecheck"] + }, "test": { "executor": "@nx/jest:jest", "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], diff --git a/packages/react-ui/src/app/common/hooks/flags-hooks.ts b/packages/react-ui/src/app/common/hooks/flags-hooks.ts index aab0800b28..6090053033 100644 --- a/packages/react-ui/src/app/common/hooks/flags-hooks.ts +++ b/packages/react-ui/src/app/common/hooks/flags-hooks.ts @@ -60,7 +60,7 @@ export const flagsHooks = { // Fetch cloud templates when cloud connection page is disabled // OR when federated login is enabled - return !cloudConnectionPageEnabled || federatedLoginEnabled; + return Boolean(!cloudConnectionPageEnabled || federatedLoginEnabled); }, useShouldShowCloudUserInMenu: () => { diff --git a/packages/react-ui/src/app/common/hooks/project-hooks.ts b/packages/react-ui/src/app/common/hooks/project-hooks.ts index 585672f93b..fb906a712a 100644 --- a/packages/react-ui/src/app/common/hooks/project-hooks.ts +++ b/packages/react-ui/src/app/common/hooks/project-hooks.ts @@ -39,7 +39,7 @@ export const projectHooks = { cursor: undefined, limit: 100, }); - return results.data; + return results.data as Project[]; }, }); }, diff --git a/packages/react-ui/src/app/features/ai/lib/assistant-ui-chat-hook.ts b/packages/react-ui/src/app/features/ai/lib/assistant-ui-chat-hook.ts index 0e342047ef..2fee6fd6b8 100644 --- a/packages/react-ui/src/app/features/ai/lib/assistant-ui-chat-hook.ts +++ b/packages/react-ui/src/app/features/ai/lib/assistant-ui-chat-hook.ts @@ -298,7 +298,10 @@ export const useAssistantChat = ({ // eslint-disable-next-line react-hooks/exhaustive-deps }, [chatId, isLoading, openChatResponse?.messages]); - const runtime = useAISDKRuntime(chat); + // Cast needed: root `ai` package version may differ from @assistant-ui/react-ai-sdk's nested copy. + const runtime = useAISDKRuntime( + chat as Parameters[0], + ); runtimeRef.current = runtime; const lastConnectionRef = useRef(undefined); diff --git a/packages/react-ui/src/app/features/ai/lib/types.ts b/packages/react-ui/src/app/features/ai/lib/types.ts index 03e45bbf81..ba19da5dbb 100644 --- a/packages/react-ui/src/app/features/ai/lib/types.ts +++ b/packages/react-ui/src/app/features/ai/lib/types.ts @@ -1,5 +1,5 @@ -import { UIMessage } from '@ai-sdk/ui-utils'; // Fix this import { OpenChatResponse } from '@openops/shared'; +import { UIMessage } from 'ai'; export type ServerMessage = NonNullable[number]; export type MessageType = ServerMessage | UIMessage; diff --git a/packages/react-ui/src/app/features/benchmark/components/benchmark-wizard.tsx b/packages/react-ui/src/app/features/benchmark/components/benchmark-wizard.tsx index 909bb069e6..6ba680d10a 100644 --- a/packages/react-ui/src/app/features/benchmark/components/benchmark-wizard.tsx +++ b/packages/react-ui/src/app/features/benchmark/components/benchmark-wizard.tsx @@ -18,7 +18,11 @@ import { useNavigate } from 'react-router-dom'; import { DynamicFormValidationProvider } from '@/app/features/builder/dynamic-form-validation/dynamic-form-validation-context'; import { CreateOrEditConnectionDialog } from '@/app/features/connections/components/create-edit-connection-dialog'; -import { CloudProvider, getProviderByValue } from '../cloud-providers'; +import { + CloudProvider, + CloudProviderValue, + getProviderByValue, +} from '../cloud-providers'; import { useBenchmarkRun } from '../use-benchmark-run'; import { useBenchmarkWizardNavigation } from '../use-benchmark-wizard-navigation'; import { useProviderConnections } from '../use-provider-connections'; @@ -94,8 +98,12 @@ export const BenchmarkWizard = ({ lastRunId, } = useBenchmarkRun(benchmarkCreateResult); - const connectingProviderConfig = getProviderByValue(connectingProvider); - const selectedProviderConfig = getProviderByValue(selectedProvider ?? null); + const connectingProviderConfig = getProviderByValue( + connectingProvider as CloudProviderValue | null, + ); + const selectedProviderConfig = getProviderByValue( + (selectedProvider ?? null) as CloudProviderValue | null, + ); const providerName = selectedProviderConfig?.name ?? ''; const handleConnectionSaved = async () => { diff --git a/packages/react-ui/src/app/features/blocks/components/block-operations-suggestions.tsx b/packages/react-ui/src/app/features/blocks/components/block-operations-suggestions.tsx index b3c41c4540..54c2c99252 100644 --- a/packages/react-ui/src/app/features/blocks/components/block-operations-suggestions.tsx +++ b/packages/react-ui/src/app/features/blocks/components/block-operations-suggestions.tsx @@ -1,5 +1,6 @@ import { BlockSelectorOperation, + BlockStepMetadataWithSuggestions, CardListItem, ItemListMetadata, StepMetadata, @@ -24,15 +25,16 @@ const BlockOperationSuggestions = ({ handleSelectOperationSuggestion, operation, }: BlockOperationSuggestionsProps) => { + const blockSuggestions = blockMetadata as BlockStepMetadataWithSuggestions; const suggestions = operation.type === FlowOperationType.UPDATE_TRIGGER - ? blockMetadata.suggestedTriggers - : blockMetadata.suggestedActions; + ? blockSuggestions.suggestedTriggers + : blockSuggestions.suggestedActions; return ( <>
- {suggestions?.map((suggestion) => ( + {suggestions?.map((suggestion: ItemListMetadata) => ( { +import { BlockScope } from '@openops/shared'; + +type InstallBlockDialogProps = { + onInstallBlock: () => void; + scope: BlockScope; +}; + +const InstallBlockDialog = (_props: InstallBlockDialogProps) => { return null; }; diff --git a/packages/react-ui/src/app/features/blocks/lib/blocks-hook.ts b/packages/react-ui/src/app/features/blocks/lib/blocks-hook.ts index 0b12829cd6..cf706b62dd 100644 --- a/packages/react-ui/src/app/features/blocks/lib/blocks-hook.ts +++ b/packages/react-ui/src/app/features/blocks/lib/blocks-hook.ts @@ -15,6 +15,7 @@ import { SuggestionType, Trigger, TriggerType, + TriggerWithOptionalId, } from '@openops/shared'; import { @@ -31,7 +32,8 @@ type UseBlockProps = { version?: string; enabled?: boolean; }; -type Step = Action | Trigger; + +type Step = Action | Trigger | TriggerWithOptionalId; type UseStepsMetadata = Step[]; @@ -40,7 +42,7 @@ type UseMultipleBlocksProps = { }; type UseBlockMetadata = { - step: Action | Trigger | undefined; + step: Step | undefined; enabled?: boolean; }; @@ -84,7 +86,7 @@ export const blocksHooks = { const blockVersion = step?.settings?.blockVersion; const query = useQuery({ queryKey: [QueryKeys.block, step?.type, blockName, blockVersion], - queryFn: () => blocksApi.getMetadata(step!), + queryFn: () => blocksApi.getMetadata(step! as Action | Trigger), staleTime: Infinity, enabled: enabled && !isNil(step), }); @@ -220,7 +222,7 @@ function stepMetadataQueryBuilder(step: Step) { const blockVersion = isBlockStep ? step.settings.blockVersion : undefined; return { queryKey: [QueryKeys.block, step.type, blockName, blockVersion], - queryFn: () => blocksApi.getMetadata(step), + queryFn: () => blocksApi.getMetadata(step as Action | Trigger), staleTime: Infinity, }; } diff --git a/packages/react-ui/src/app/features/builder/block-properties/dynamic-block-property.tsx b/packages/react-ui/src/app/features/builder/block-properties/dynamic-block-property.tsx index 1ff0d8b5d5..ccf3e82d52 100644 --- a/packages/react-ui/src/app/features/builder/block-properties/dynamic-block-property.tsx +++ b/packages/react-ui/src/app/features/builder/block-properties/dynamic-block-property.tsx @@ -92,7 +92,9 @@ const DynamicProperties = React.memo((props: DynamicPropertiesProps) => { const input: Record = {}; newRefreshers.forEach((refresher, index) => { input[refresher] = refresherValues[index]; - input.auth = form.getValues('settings.input.auth'); + input.auth = (form.getValues as (name: string) => unknown)( + 'settings.input.auth', + ); }); mutate( @@ -120,7 +122,7 @@ const DynamicProperties = React.memo((props: DynamicPropertiesProps) => { allowDynamicValues, props.propertyName, props.inputName, - ).map((input) => form.watch(input)); + ).map((input) => (form.watch as (field: string) => unknown)(input)); useEffect(() => { if ( diff --git a/packages/react-ui/src/app/features/builder/block-properties/dynamic-dropdown-block-property.tsx b/packages/react-ui/src/app/features/builder/block-properties/dynamic-dropdown-block-property.tsx index 84ea00a91d..d3dd389981 100644 --- a/packages/react-ui/src/app/features/builder/block-properties/dynamic-dropdown-block-property.tsx +++ b/packages/react-ui/src/app/features/builder/block-properties/dynamic-dropdown-block-property.tsx @@ -112,13 +112,15 @@ const DynamicDropdownBlockProperty = React.memo( allowDynamicValues, props.propertyName, props.inputName, - ).map((input) => form.watch(input)); + ).map((input) => (form.watch as (field: string) => unknown)(input)); const refresh = () => { const input: Record = {}; newRefreshers.forEach((refresher, index) => { input[refresher] = refresherValues[index]; - input.auth = form.getValues('settings.input.auth'); + input.auth = (form.getValues as (name: string) => unknown)( + 'settings.input.auth', + ); }); mutate( diff --git a/packages/react-ui/src/app/features/builder/block-properties/text-input-with-mentions/index.tsx b/packages/react-ui/src/app/features/builder/block-properties/text-input-with-mentions/index.tsx index 82fbb84c26..a210e60c37 100644 --- a/packages/react-ui/src/app/features/builder/block-properties/text-input-with-mentions/index.tsx +++ b/packages/react-ui/src/app/features/builder/block-properties/text-input-with-mentions/index.tsx @@ -1,7 +1,7 @@ import Document from '@tiptap/extension-document'; import HardBreak from '@tiptap/extension-hard-break'; import History from '@tiptap/extension-history'; -import Mention, { MentionNodeAttrs } from '@tiptap/extension-mention'; +import Mention from '@tiptap/extension-mention'; import Paragraph from '@tiptap/extension-paragraph'; import Placeholder from '@tiptap/extension-placeholder'; import Text from '@tiptap/extension-text'; @@ -17,7 +17,7 @@ import { cn } from '@openops/components/ui'; import { useBuilderStateContext } from '../../builder-hooks'; import { useEffect } from 'react'; -import { textMentionUtils } from './text-input-utils'; +import { MentionNodeAttrs, textMentionUtils } from './text-input-utils'; type TextInputWithMentionsProps = { className?: string; diff --git a/packages/react-ui/src/app/features/builder/block-properties/text-input-with-mentions/text-input-utils.ts b/packages/react-ui/src/app/features/builder/block-properties/text-input-with-mentions/text-input-utils.ts index 0d8918f6be..cfd106ceae 100644 --- a/packages/react-ui/src/app/features/builder/block-properties/text-input-with-mentions/text-input-utils.ts +++ b/packages/react-ui/src/app/features/builder/block-properties/text-input-with-mentions/text-input-utils.ts @@ -1,14 +1,16 @@ -import { MentionNodeAttrs } from '@tiptap/extension-mention'; import { JSONContent } from '@tiptap/react'; import { StepMetadata } from '@openops/components/ui'; import { Action, Trigger, + TriggerWithOptionalId, assertNotNullOrUndefined, isNil, } from '@openops/shared'; +type FlowStep = Action | Trigger | TriggerWithOptionalId; + const removeIntroplationBrackets = (text: string) => { return text.slice(2, text.length - 2); }; @@ -30,7 +32,9 @@ const keysWithinPath = (path: string) => { .map((key) => removeQuotes(key)); }; -type MentionNodeAttrs = { +export type MentionNodeAttrs = { + id?: string; + label?: string; logoUrl?: string; displayText: string; serverValue: string; @@ -91,7 +95,7 @@ function parseMentionNodeFromText(request: ParseMentionNodeFromText) { type StepMetadataWithDisplayName = StepMetadata & { stepDisplayName: string }; const getStepMetadataFromPath = ( path: string, - steps: (Action | Trigger)[], + steps: FlowStep[], stepsMetadata: (StepMetadataWithDisplayName | undefined)[], ) => { const stepPath = removeIntroplationBrackets(path); @@ -105,7 +109,7 @@ const getStepMetadataFromPath = ( function convertTextToTipTapJsonContent( userInputText: string, - steps: (Action | Trigger)[], + steps: FlowStep[], stepsMetadata: (StepMetadataWithDisplayName | undefined)[], ): { type: TipTapNodeTypes.paragraph; @@ -149,7 +153,7 @@ function convertTextToTipTapJsonContent( function createMentionNodeFromText( mention: string, - steps: (Action | Trigger)[], + steps: FlowStep[], stepsMetadata: (StepMetadataWithDisplayName | undefined)[], ) { const { stepMetadata, dfsIndex } = getStepMetadataFromPath( diff --git a/packages/react-ui/src/app/features/builder/builder-hooks.ts b/packages/react-ui/src/app/features/builder/builder-hooks.ts index ab82ba7c35..4fb205cf7c 100644 --- a/packages/react-ui/src/app/features/builder/builder-hooks.ts +++ b/packages/react-ui/src/app/features/builder/builder-hooks.ts @@ -538,7 +538,7 @@ const applyMidpanelAction = (state: BuilderState, action: MidpanelAction) => { showAiChat: true, aiContainerSize: AI_CHAT_CONTAINER_SIZES.DOCKED, dataSelectorSize: DataSelectorSizeState.COLLAPSED, - aiChatProperty: action.property, + aiChatProperty: action.property as MidpanelState['aiChatProperty'], }; break; case 'ADD_CODE_TO_INJECT': diff --git a/packages/react-ui/src/app/features/builder/data-selector/data-selector-utils.ts b/packages/react-ui/src/app/features/builder/data-selector/data-selector-utils.ts index 48abfc8218..61734adf5a 100644 --- a/packages/react-ui/src/app/features/builder/data-selector/data-selector-utils.ts +++ b/packages/react-ui/src/app/features/builder/data-selector/data-selector-utils.ts @@ -6,6 +6,7 @@ import { StepOutputWithData, StepWithIndex, Trigger, + TriggerWithOptionalId, } from '@openops/shared'; export type MentionTreeNode = { @@ -189,7 +190,9 @@ const getAllStepsMentions = ( }); }; -const hasStepSampleData = (step: Action | Trigger | undefined) => { +const hasStepSampleData = ( + step: Action | Trigger | TriggerWithOptionalId | undefined, +) => { const sampleData = step?.settings?.inputUiInfo?.sampleData; return ( !isNil(sampleData) && diff --git a/packages/react-ui/src/app/features/builder/flow-canvas/flow-drag-layer.tsx b/packages/react-ui/src/app/features/builder/flow-canvas/flow-drag-layer.tsx index 5b0def849e..0171cb5d33 100644 --- a/packages/react-ui/src/app/features/builder/flow-canvas/flow-drag-layer.tsx +++ b/packages/react-ui/src/app/features/builder/flow-canvas/flow-drag-layer.tsx @@ -12,7 +12,12 @@ import { import { Edge, UNSAVED_CHANGES_TOAST, useToast } from '@openops/components/ui'; import { t } from 'i18next'; -import { flowHelper, FlowOperationType } from '@openops/shared'; +import { + Action, + flowHelper, + FlowOperationType, + Trigger, +} from '@openops/shared'; import { useBuilderStateContext } from '../builder-hooks'; @@ -92,7 +97,7 @@ const FlowDragLayer = ({ children, cursorPosition }: FlowDragLayerProps) => { const edgeData: Edge['data'] = e.over.data.current as Edge['data']; if (edgeData && edgeData.parentStep && draggedStep) { const isPartOfInnerFlow = flowHelper.isPartOfInnerFlow({ - parentStep: draggedStep, + parentStep: draggedStep as Action | Trigger, childName: edgeData.parentStep, }); if (isPartOfInnerFlow) { @@ -143,7 +148,7 @@ const FlowDragLayer = ({ children, cursorPosition }: FlowDragLayerProps) => { {draggedStep && ( )} diff --git a/packages/react-ui/src/app/features/builder/flow-version-undo-redo/hooks/apply-operation-and-push-to-history.ts b/packages/react-ui/src/app/features/builder/flow-version-undo-redo/hooks/apply-operation-and-push-to-history.ts index 03d5dac4ee..a43b29e4d1 100644 --- a/packages/react-ui/src/app/features/builder/flow-version-undo-redo/hooks/apply-operation-and-push-to-history.ts +++ b/packages/react-ui/src/app/features/builder/flow-version-undo-redo/hooks/apply-operation-and-push-to-history.ts @@ -15,6 +15,7 @@ const getSpotlightStepName = ( case FlowOperationType.DUPLICATE_ACTION: return request.stepName; case FlowOperationType.ADD_ACTION: + case FlowOperationType.PASTE_ACTIONS: return request.parentStep; default: return request.name; diff --git a/packages/react-ui/src/app/features/builder/flow-version-undo-redo/push-flow-version-to-version-history.ts b/packages/react-ui/src/app/features/builder/flow-version-undo-redo/push-flow-version-to-version-history.ts index 66bf81cd6a..f70760fb7a 100644 --- a/packages/react-ui/src/app/features/builder/flow-version-undo-redo/push-flow-version-to-version-history.ts +++ b/packages/react-ui/src/app/features/builder/flow-version-undo-redo/push-flow-version-to-version-history.ts @@ -1,10 +1,18 @@ -import { BuilderState } from '@/app/features/builder/builder-types'; +import { FlowVersionUndoRedoHistoryItem } from '@/app/features/builder/flow-version-undo-redo/types'; +import { FlowVersion } from '@openops/shared'; +type UndoRedoStack = { + clear: () => void; + push: (item: FlowVersionUndoRedoHistoryItem) => void; +}; + +/** @deprecated Use useFlowVersionUndoRedo().addToUndoHistory instead. */ export const pushFlowVersionToVersionHistory = ( - currentState: Pick< - BuilderState, - 'flowVersion' | 'undoFlowVersionHistory' | 'redoFlowVersionHistory' - >, + currentState: { + flowVersion: { id: string; trigger: FlowVersion['trigger'] }; + undoFlowVersionHistory: UndoRedoStack; + redoFlowVersionHistory: UndoRedoStack; + }, spotlightStepName?: string, ) => { const { flowVersion, undoFlowVersionHistory, redoFlowVersionHistory } = diff --git a/packages/react-ui/src/app/features/builder/flow-versions/flow-versions-card.tsx b/packages/react-ui/src/app/features/builder/flow-versions/flow-versions-card.tsx index 38862090b7..061c6ed256 100644 --- a/packages/react-ui/src/app/features/builder/flow-versions/flow-versions-card.tsx +++ b/packages/react-ui/src/app/features/builder/flow-versions/flow-versions-card.tsx @@ -187,14 +187,7 @@ const FlowVersionDetailsCard = React.memo( return ( {flowVersion.updatedByUser && ( - + )}

diff --git a/packages/react-ui/src/app/features/builder/step-settings/index.tsx b/packages/react-ui/src/app/features/builder/step-settings/index.tsx index 02ec128860..fca44aed88 100644 --- a/packages/react-ui/src/app/features/builder/step-settings/index.tsx +++ b/packages/react-ui/src/app/features/builder/step-settings/index.tsx @@ -158,7 +158,10 @@ const StepSettingsContainer = React.memo(() => { }); useUpdateEffect(() => { - form.setValue('valid', form.formState.isValid); + (form.setValue as (name: 'valid', value: boolean) => void)( + 'valid', + form.formState.isValid, + ); }, [form.formState.isValid]); const inputChanges = useWatch({ diff --git a/packages/react-ui/src/app/features/builder/step-settings/split-settings/edit-branch-name.tsx b/packages/react-ui/src/app/features/builder/step-settings/split-settings/edit-branch-name.tsx index 5b80ea4135..d46ebda0a0 100644 --- a/packages/react-ui/src/app/features/builder/step-settings/split-settings/edit-branch-name.tsx +++ b/packages/react-ui/src/app/features/builder/step-settings/split-settings/edit-branch-name.tsx @@ -54,7 +54,10 @@ const EditBranchName = ({ })} value={name} onValueChange={(value) => { - form.setValue(formInputName, value); + (form.setValue as (name: string, value: string) => void)( + formInputName, + value, + ); }} readonly={readonly} containerRef={containerRef} diff --git a/packages/react-ui/src/app/features/builder/test-step/test-trigger-section.tsx b/packages/react-ui/src/app/features/builder/test-step/test-trigger-section.tsx index 45574094d6..8482693967 100644 --- a/packages/react-ui/src/app/features/builder/test-step/test-trigger-section.tsx +++ b/packages/react-ui/src/app/features/builder/test-step/test-trigger-section.tsx @@ -215,6 +215,7 @@ const TestTriggerSection = React.memo( stepTestOutputCache.setStepData(formValues.id, { output: formatUtils.formatStepInputOrOutput(data.payload), lastTestDate: dayjs().toISOString(), + success: null, }); setStepOutputCache({ stepId: formValues.id, @@ -222,6 +223,7 @@ const TestTriggerSection = React.memo( output: data.payload, input: data.input, queryClient, + success: true, }); } diff --git a/packages/react-ui/src/app/features/connections/components/connection-table.tsx b/packages/react-ui/src/app/features/connections/components/connection-table.tsx index 13ccf88d1f..a077db88ff 100644 --- a/packages/react-ui/src/app/features/connections/components/connection-table.tsx +++ b/packages/react-ui/src/app/features/connections/components/connection-table.tsx @@ -19,6 +19,7 @@ import { AppConnection, AppConnectionSortBy, AppConnectionStatus, + AppConnectionWithoutSensitiveData, MinimalFlow, Permission, } from '@openops/shared'; @@ -74,7 +75,7 @@ const MenuConnectionColumn = ({ row, setRefresh, }: { - row: RowDataWithActions; + row: RowDataWithActions; setRefresh: Dispatch>; }) => { const [linkedFlows, setLinkedFlows] = useState([]); @@ -167,7 +168,9 @@ const MenuConnectionColumn = ({ }; const columns: ( setRefresh: Dispatch>, -) => ColumnDef>[] = (setRefresh) => { +) => ColumnDef>[] = ( + setRefresh, +) => { return [ { accessorKey: 'authProviderKey', diff --git a/packages/react-ui/src/app/features/flow-runs/components/step-status-icon.tsx b/packages/react-ui/src/app/features/flow-runs/components/step-status-icon.tsx index 82aeb96a2c..f3bd35c316 100644 --- a/packages/react-ui/src/app/features/flow-runs/components/step-status-icon.tsx +++ b/packages/react-ui/src/app/features/flow-runs/components/step-status-icon.tsx @@ -15,12 +15,13 @@ type StepStatusIconProps = { size: '3' | '4' | '5'; }; -const statusText = { +const statusText: Record = { [StepOutputStatus.RUNNING]: t('Step running'), [StepOutputStatus.PAUSED]: t('Step paused'), [StepOutputStatus.STOPPED]: t('Step Stopped'), [StepOutputStatus.SUCCEEDED]: t('Step Succeeded'), [StepOutputStatus.FAILED]: t('Step Failed'), + [StepOutputStatus.EXECUTION_LIMIT_REACHED]: t('Execution limit reached'), }; const StepStatusIcon = React.memo(({ status, size }: StepStatusIconProps) => { diff --git a/packages/react-ui/src/app/features/flow-runs/hooks/useRunsTableColumns.tsx b/packages/react-ui/src/app/features/flow-runs/hooks/useRunsTableColumns.tsx index 1f6f5cc97c..d19a679d19 100644 --- a/packages/react-ui/src/app/features/flow-runs/hooks/useRunsTableColumns.tsx +++ b/packages/react-ui/src/app/features/flow-runs/hooks/useRunsTableColumns.tsx @@ -23,7 +23,7 @@ import { isRunningState, } from '@openops/shared'; import { useMutation } from '@tanstack/react-query'; -import { ColumnDef } from '@tanstack/react-table'; +import { CellContext, ColumnDef, HeaderContext } from '@tanstack/react-table'; import { t } from 'i18next'; import { CircleStop, EllipsisVertical, RefreshCw } from 'lucide-react'; import { useMemo, useState } from 'react'; @@ -32,15 +32,13 @@ import { RunType } from '@/app/features/flow-runs/components/run-type'; import { StopRunDialog } from '@/app/features/flow-runs/components/stop-run-dialog'; import { flowRunUtils, shouldHideRunActions } from '../lib/flow-run-utils'; -type Column = ColumnDef> & { - accessorKey: string; -}; +type RunTableRow = RowDataWithActions; export const useRunsTableColumns = ({ refetch, }: { refetch: () => void; -}): Column[] => { +}): ColumnDef[] => { const durationEnabled = flagsHooks.useFlag( FlagId.SHOW_DURATION, ).data; @@ -76,15 +74,15 @@ export const useRunsTableColumns = ({ }, }); - return useMemo( + return useMemo[]>( () => [ { accessorKey: 'flowId', - header: ({ column }) => ( + header: ({ column }: HeaderContext) => ( ), - cell: ({ row }) => { + cell: ({ row }: CellContext) => { return (

{row.original.flowDisplayName}
); @@ -92,10 +90,10 @@ export const useRunsTableColumns = ({ }, { accessorKey: 'status', - header: ({ column }) => ( + header: ({ column }: HeaderContext) => ( ), - cell: ({ row }) => { + cell: ({ row }: CellContext) => { const status = row.original.status; const { variant, Icon } = flowRunUtils.getStatusIcon(status); const explanation = flowRunUtils.getStatusExplanation(status); @@ -113,10 +111,10 @@ export const useRunsTableColumns = ({ }, { accessorKey: 'triggerSource', - header: ({ column }) => ( + header: ({ column }: HeaderContext) => ( ), - cell: ({ row }: { row: { original: FlowRun } }) => { + cell: ({ row }: CellContext) => { const status = row.original.triggerSource; return ; @@ -124,10 +122,10 @@ export const useRunsTableColumns = ({ }, { accessorKey: 'created', - header: ({ column }) => ( + header: ({ column }: HeaderContext) => ( ), - cell: ({ row }) => { + cell: ({ row }: CellContext) => { return (
{formatUtils.formatDate(new Date(row.original.startTime))} @@ -138,10 +136,10 @@ export const useRunsTableColumns = ({ { accessorKey: 'duration', enableSorting: false, - header: ({ column }) => ( + header: ({ column }: HeaderContext) => ( ), - cell: ({ row }) => { + cell: ({ row }: CellContext) => { return (
{row.original.finishTime && @@ -154,7 +152,7 @@ export const useRunsTableColumns = ({ accessorKey: 'actions', enableSorting: false, header: () => null, - cell: ({ row }) => { + cell: ({ row }: CellContext) => { const isFailed = isFailedState(row.original.status); const isRunning = isRunningState(row.original.status); const isSuccessfulRun = diff --git a/packages/react-ui/src/app/features/flows/components/execute-risky-flow-dialog/utils.ts b/packages/react-ui/src/app/features/flows/components/execute-risky-flow-dialog/utils.ts index 38256e7b57..d8fdb65163 100644 --- a/packages/react-ui/src/app/features/flows/components/execute-risky-flow-dialog/utils.ts +++ b/packages/react-ui/src/app/features/flows/components/execute-risky-flow-dialog/utils.ts @@ -1,11 +1,18 @@ import { flowsUtils } from '@/app/features/flows/lib/flows-utils'; import { StepMetadataWithSuggestions } from '@openops/components/ui'; -import { Action, ActionType, RiskLevel, Trigger } from '@openops/shared'; +import { + Action, + ActionType, + RiskLevel, + Trigger, + TriggerWithOptionalId, +} from '@openops/shared'; -type ActionOrTriggerWithIndex = (Action | Trigger) & { index: number }; +type FlowStep = Action | Trigger | TriggerWithOptionalId; +type ActionOrTriggerWithIndex = FlowStep & { index: number }; export const getRiskyActionFormattedNames = ( - allSteps: (Action | Trigger)[], + allSteps: FlowStep[], metadata: StepMetadataWithSuggestions[] | undefined, riskLevel: RiskLevel, ) => diff --git a/packages/react-ui/src/app/features/flows/components/import-flow-dialog/import-flow-dialog-content.tsx b/packages/react-ui/src/app/features/flows/components/import-flow-dialog/import-flow-dialog-content.tsx index c8db748c3e..483a3fd83c 100644 --- a/packages/react-ui/src/app/features/flows/components/import-flow-dialog/import-flow-dialog-content.tsx +++ b/packages/react-ui/src/app/features/flows/components/import-flow-dialog/import-flow-dialog-content.tsx @@ -8,13 +8,17 @@ import { FlowTemplateMetadataWithIntegrations, Input, } from '@openops/components/ui'; -import { AppConnectionsWithSupportedBlocks, Trigger } from '@openops/shared'; +import { + AppConnectionsWithSupportedBlocks, + Trigger, + TriggerWithOptionalId, +} from '@openops/shared'; import { t } from 'i18next'; import React, { useMemo, useRef, useState } from 'react'; type ImportFlowDialogContentProps = { templateWithIntegrations: FlowTemplateMetadataWithIntegrations | null; - templateTrigger: Trigger | undefined; + templateTrigger: Trigger | TriggerWithOptionalId | undefined; resetDialog: () => void; isUseTemplateLoading: boolean; onUseTemplate: (connections: AppConnectionsWithSupportedBlocks[]) => void; diff --git a/packages/react-ui/src/app/features/folders/component/add-new-folder-dialog.tsx b/packages/react-ui/src/app/features/folders/component/add-new-folder-dialog.tsx index a44948ebdd..82a1fdb911 100644 --- a/packages/react-ui/src/app/features/folders/component/add-new-folder-dialog.tsx +++ b/packages/react-ui/src/app/features/folders/component/add-new-folder-dialog.tsx @@ -102,10 +102,8 @@ const AddNewFolderDialog = ({ updateSearchParams }: Props) => { const errorMessages = [ form?.formState?.errors?.root?.serverError?.message, - form.getValues().displayName.length - ? form?.formState?.errors?.displayName?.message?.pattern - : form?.formState?.errors?.displayName?.message?.minLength, - ]; + form?.formState?.errors?.displayName?.message, + ].filter((message): message is string => Boolean(message)); return (
diff --git a/packages/react-ui/src/app/features/folders/component/create-subfolder-dialog.tsx b/packages/react-ui/src/app/features/folders/component/create-subfolder-dialog.tsx index 6463cac342..643aad1f7f 100644 --- a/packages/react-ui/src/app/features/folders/component/create-subfolder-dialog.tsx +++ b/packages/react-ui/src/app/features/folders/component/create-subfolder-dialog.tsx @@ -103,10 +103,8 @@ const CreateSubfolderDialog = ({ const errorMessages = [ form?.formState?.errors?.root?.serverError?.message, - form.getValues().displayName.length - ? form?.formState?.errors?.displayName?.message?.pattern - : form?.formState?.errors?.displayName?.message?.minLength, - ]; + form?.formState?.errors?.displayName?.message, + ].filter((message): message is string => Boolean(message)); return ( diff --git a/packages/react-ui/src/app/features/folders/component/rename-folder-dialog.tsx b/packages/react-ui/src/app/features/folders/component/rename-folder-dialog.tsx index a224e2a35a..805ed2b986 100644 --- a/packages/react-ui/src/app/features/folders/component/rename-folder-dialog.tsx +++ b/packages/react-ui/src/app/features/folders/component/rename-folder-dialog.tsx @@ -100,10 +100,8 @@ const RenameFolderDialog = ({ const errorMessages = [ form?.formState?.errors?.root?.serverError?.message, - form.getValues().displayName.length - ? form?.formState?.errors?.displayName?.message?.pattern - : form?.formState?.errors?.displayName?.message?.minLength, - ]; + form?.formState?.errors?.displayName?.message, + ].filter((message): message is string => Boolean(message)); return ( diff --git a/packages/react-ui/src/app/features/navigation/side-menu/side-menu-footer.tsx b/packages/react-ui/src/app/features/navigation/side-menu/side-menu-footer.tsx index 1ce5a36af8..6dd7a05bc3 100644 --- a/packages/react-ui/src/app/features/navigation/side-menu/side-menu-footer.tsx +++ b/packages/react-ui/src/app/features/navigation/side-menu/side-menu-footer.tsx @@ -110,7 +110,7 @@ const SideMenuFooter = ({ isMinimized }: Props) => { email: cloudUser.email, } : undefined, - isCloudLoginEnabled: useCloudTemplates && shouldShowCloudUserInMenu, + isCloudLoginEnabled: !!useCloudTemplates && shouldShowCloudUserInMenu, onCloudLogin, logoUrl: branding.logos.logoIconPositiveUrl, }} diff --git a/packages/react-ui/src/app/features/templates/components/connections-picker/connections-picker.tsx b/packages/react-ui/src/app/features/templates/components/connections-picker/connections-picker.tsx index fe84d1796b..2fd987a8e3 100644 --- a/packages/react-ui/src/app/features/templates/components/connections-picker/connections-picker.tsx +++ b/packages/react-ui/src/app/features/templates/components/connections-picker/connections-picker.tsx @@ -21,6 +21,7 @@ import { isNil, Permission, Trigger, + TriggerWithOptionalId, } from '@openops/shared'; import { t } from 'i18next'; import { ArrowLeft, TriangleAlert } from 'lucide-react'; @@ -33,7 +34,7 @@ import { type ConnectionsPickerProps = { name: string; - trigger?: Trigger; + trigger?: Trigger | TriggerWithOptionalId; integrations: BlockMetadataModelSummary[]; isLoading: boolean; close: () => void; @@ -102,7 +103,7 @@ const ConnectionsPicker = ({ ) { isConnectionListPreselected.current = true; const usedConnectionNames: { [key: string]: string | undefined } = trigger - ? flowHelper.getUsedConnections(trigger) + ? flowHelper.getUsedConnections(trigger as Trigger) : {}; const connections: Record< diff --git a/packages/react-ui/src/app/features/templates/components/public-flow-template-filter-sidebar-wrapper.tsx b/packages/react-ui/src/app/features/templates/components/public-flow-template-filter-sidebar-wrapper.tsx index 4fb3a4926b..8f24451362 100644 --- a/packages/react-ui/src/app/features/templates/components/public-flow-template-filter-sidebar-wrapper.tsx +++ b/packages/react-ui/src/app/features/templates/components/public-flow-template-filter-sidebar-wrapper.tsx @@ -56,7 +56,7 @@ const PublicFlowTemplateFilterSidebarWrapper = ({ showDomains = true, newDomains = [], }: FlowTemplateFilterSidebarProps & { showDomains?: boolean }) => { - const useCloudTemplates = flagsHooks.useShouldFetchCloudTemplates(); + const useCloudTemplates = !!flagsHooks.useShouldFetchCloudTemplates(); const { domains, diff --git a/packages/react-ui/src/app/features/templates/components/select-flow-template-dialog.tsx b/packages/react-ui/src/app/features/templates/components/select-flow-template-dialog.tsx index 4e3a774cc9..b3418c2d4c 100644 --- a/packages/react-ui/src/app/features/templates/components/select-flow-template-dialog.tsx +++ b/packages/react-ui/src/app/features/templates/components/select-flow-template-dialog.tsx @@ -86,7 +86,7 @@ const SelectFlowTemplateDialog = ({ } }, [preselectedTab]); - const useCloudTemplates = flagsHooks.useShouldFetchCloudTemplates(); + const useCloudTemplates = !!flagsHooks.useShouldFetchCloudTemplates(); const [debouncedSearchText] = useDebounceValue( searchText, diff --git a/packages/react-ui/src/app/lib/authentication-api.ts b/packages/react-ui/src/app/lib/authentication-api.ts index ed6b0e7574..df4dc19207 100644 --- a/packages/react-ui/src/app/lib/authentication-api.ts +++ b/packages/react-ui/src/app/lib/authentication-api.ts @@ -34,4 +34,13 @@ export const authenticationApi = { }, ); }, + resetPassword(request: { otp: string; userId: string; newPassword: string }) { + return api.post('/v1/authentication/reset-password', request); + }, + sendOtpEmail(request: { email: string; type: string }) { + return api.post('/v1/authentication/send-otp', request); + }, + verifyEmail(request: { otp: string; userId: string }) { + return api.post('/v1/authentication/verify-email', request); + }, }; diff --git a/packages/react-ui/src/app/routes/home-demo/index.tsx b/packages/react-ui/src/app/routes/home-demo/index.tsx index 0698cef685..4a82b69b30 100644 --- a/packages/react-ui/src/app/routes/home-demo/index.tsx +++ b/packages/react-ui/src/app/routes/home-demo/index.tsx @@ -25,6 +25,7 @@ const HomeDemoPage = () => { isLoadingFlows, existingFlowsResponse, refetchFlows, + refetchRuns, } = useDashboardData(); const { overviewResponse, isOverviewLoading } = useAnalyticsOverview(); @@ -80,11 +81,13 @@ const HomeDemoPage = () => { flowsExist={flowsExist} loading={isLoadingFlows} refetch={refetchFlows} + onExploreTemplatesClick={() => navigate('/templates')} />
diff --git a/packages/react-ui/src/app/routes/runs/index.tsx b/packages/react-ui/src/app/routes/runs/index.tsx index 827ff9f2e7..78c17ef88e 100644 --- a/packages/react-ui/src/app/routes/runs/index.tsx +++ b/packages/react-ui/src/app/routes/runs/index.tsx @@ -32,19 +32,14 @@ const toFlowRunSortBy = (sortBy?: string): FlowRunSortBy | undefined => { }; const fetchData = async ( - params: { - flowId: string[]; - triggerSource: FlowRunTriggerSource[]; - status: FlowRunStatus[]; - created: string; - }, + filters: Record, pagination: PaginationParams, ) => { - const status = params.status; + const status = filters.status as FlowRunStatus[]; return flowRunsApi.list({ status, - flowId: params.flowId, - triggerSource: params.triggerSource, + flowId: filters.flowId as string[], + triggerSource: filters.triggerSource as FlowRunTriggerSource[], cursor: pagination.cursor, limit: pagination.limit ?? 10, createdAfter: pagination.createdAfter, diff --git a/packages/react-ui/src/app/routes/settings/appearance/index.tsx b/packages/react-ui/src/app/routes/settings/appearance/index.tsx index 4a6d05c086..17e7dbfba4 100644 --- a/packages/react-ui/src/app/routes/settings/appearance/index.tsx +++ b/packages/react-ui/src/app/routes/settings/appearance/index.tsx @@ -2,12 +2,13 @@ import { RadioGroup, RadioGroupItem, Separator } from '@openops/components/ui'; import { t } from 'i18next'; import { useTheme } from '@/app/common/providers/theme-provider'; +import { Theme } from '@openops/components/ui'; export default function AppearancePage() { const { theme, setTheme } = useTheme(); const handleThemeChange = (value: 'dark' | 'light') => { - setTheme(value); + setTheme(value === 'dark' ? Theme.DARK : Theme.LIGHT); }; return ( diff --git a/packages/react-ui/src/app/routes/settings/blocks/index.tsx b/packages/react-ui/src/app/routes/settings/blocks/index.tsx index 2ebece1c64..31a3124f8c 100644 --- a/packages/react-ui/src/app/routes/settings/blocks/index.tsx +++ b/packages/react-ui/src/app/routes/settings/blocks/index.tsx @@ -110,7 +110,7 @@ const fetchData = async () => { }; const ProjectBlocksPage = () => { - const [refresh, setRefresh] = useState(0); + const [refresh, setRefresh] = useState(false); const { data: installBlocksEnabled } = flagsHooks.useFlag( FlagId.INSTALL_PROJECT_BLOCKS_ENABLED, @@ -124,7 +124,7 @@ const ProjectBlocksPage = () => {
{installBlocksEnabled && ( setRefresh(refresh + 1)} + onInstallBlock={() => setRefresh((prev) => !prev)} scope={BlockScope.PROJECT} /> )} diff --git a/packages/react-ui/vite.config.ts b/packages/react-ui/vite.config.ts index 6ff6666219..b7c7bf36fd 100644 --- a/packages/react-ui/vite.config.ts +++ b/packages/react-ui/vite.config.ts @@ -50,7 +50,9 @@ export default defineConfig({ react(), nxViteTsPaths(), checker({ - typescript: true, + typescript: { + tsconfigPath: 'tsconfig.app.json', + }, }), circleDependency({ exclude: ['**/node_modules/**', '**/auto-properties-form.tsx'], diff --git a/packages/shared/src/lib/authentication/dto/authentication-response.ts b/packages/shared/src/lib/authentication/dto/authentication-response.ts index 06206597eb..4b947cbd32 100644 --- a/packages/shared/src/lib/authentication/dto/authentication-response.ts +++ b/packages/shared/src/lib/authentication/dto/authentication-response.ts @@ -20,6 +20,7 @@ export type AuthenticationResponse = { projectRole: string; organizationId: string | null; organizationRole: OrganizationRole; + verified?: boolean; }; export const createAuthResponse = ( diff --git a/packages/ui-components/src/components/assistant-ui/generate-code-tool/generate-code-tool.tsx b/packages/ui-components/src/components/assistant-ui/generate-code-tool/generate-code-tool.tsx index 2837f74eae..a538852feb 100644 --- a/packages/ui-components/src/components/assistant-ui/generate-code-tool/generate-code-tool.tsx +++ b/packages/ui-components/src/components/assistant-ui/generate-code-tool/generate-code-tool.tsx @@ -1,4 +1,4 @@ -import { TextContentPart, ToolCallMessagePartProps } from '@assistant-ui/react'; +import { ToolCallMessagePartProps } from '@assistant-ui/react'; import { t } from 'i18next'; import { CodeEditor, @@ -11,6 +11,11 @@ import { CodeActions } from '../../code-actions'; import { useThreadExtraContext } from '../thread-extra-context'; import { toolStatusUtils } from '../tool-status'; +type TextContentPart = { + type: 'text'; + text: string; +}; + type CodeResult = { code: string; packageJson: string; diff --git a/packages/ui-components/src/components/assistant-ui/step-settings-assistant-ui-chat-container.tsx b/packages/ui-components/src/components/assistant-ui/step-settings-assistant-ui-chat-container.tsx index 590e78d9d8..69635513db 100644 --- a/packages/ui-components/src/components/assistant-ui/step-settings-assistant-ui-chat-container.tsx +++ b/packages/ui-components/src/components/assistant-ui/step-settings-assistant-ui-chat-container.tsx @@ -1,10 +1,10 @@ -import { Theme } from '@/lib/theme'; import { AssistantRuntime } from '@assistant-ui/react'; import { SourceCode } from '@openops/shared'; import { t } from 'i18next'; import { ExpandIcon, MinimizeIcon } from 'lucide-react'; import { useRef } from 'react'; import { cn } from '../../lib/cn'; +import { Theme } from '../../lib/theme'; import { Button } from '../../ui/button'; import { AiModelSelectorProps } from '../ai-chat-container/ai-model-selector'; import { diff --git a/packages/ui-components/src/components/assistant-ui/tool-fallback/tool-fallback.tsx b/packages/ui-components/src/components/assistant-ui/tool-fallback/tool-fallback.tsx index f21e38faf7..a8b6d991e0 100644 --- a/packages/ui-components/src/components/assistant-ui/tool-fallback/tool-fallback.tsx +++ b/packages/ui-components/src/components/assistant-ui/tool-fallback/tool-fallback.tsx @@ -72,7 +72,7 @@ const extractResultStatus = ( return { type: TOOL_STATUS_TYPES.REQUIRES_ACTION, reason: 'tool-calls', - }; + } as unknown as MessagePartStatus; } if (hasDirectError(result) || hasContentError(result)) { diff --git a/packages/ui-components/src/components/assistant-ui/tool-fallback/tool-json-parser.ts b/packages/ui-components/src/components/assistant-ui/tool-fallback/tool-json-parser.ts index eb2e15b24b..1777d93d6c 100644 --- a/packages/ui-components/src/components/assistant-ui/tool-fallback/tool-json-parser.ts +++ b/packages/ui-components/src/components/assistant-ui/tool-fallback/tool-json-parser.ts @@ -1,6 +1,10 @@ -import { TextContentPart } from '@assistant-ui/react'; import { tryParseJson } from '../../../lib/json-utils'; +type TextContentPart = { + type: 'text'; + text: string; +}; + type ContentStructure = { content: TextContentPart[]; }; diff --git a/packages/ui-components/src/components/benchmark/benchmark-ready-step.tsx b/packages/ui-components/src/components/benchmark/benchmark-ready-step.tsx index 18d20e3cb4..83f6448915 100644 --- a/packages/ui-components/src/components/benchmark/benchmark-ready-step.tsx +++ b/packages/ui-components/src/components/benchmark/benchmark-ready-step.tsx @@ -1,7 +1,7 @@ -import { BenchmarkRunPhase } from '@/lib/types'; import { BenchmarkCreationResult } from '@openops/shared'; import { t } from 'i18next'; import { Link } from 'react-router-dom'; +import { BenchmarkRunPhase } from '../../lib/types'; import { StepDescription } from '../../ui/multi-step-form/multi-step-form-step-parts'; import { BenchmarkAnalyticsPhase } from './benchmark-analytics-phase'; import { BenchmarkFailedPhase } from './benchmark-failed-phase'; diff --git a/packages/ui-components/src/components/code-editor/code-editor.tsx b/packages/ui-components/src/components/code-editor/code-editor.tsx index b3966dcf5e..7b0c48bb77 100644 --- a/packages/ui-components/src/components/code-editor/code-editor.tsx +++ b/packages/ui-components/src/components/code-editor/code-editor.tsx @@ -1,4 +1,3 @@ -import { Theme } from '@/lib/theme'; import Editor from '@monaco-editor/react'; import { SourceCode } from '@openops/shared'; import { t } from 'i18next'; @@ -12,6 +11,7 @@ import React, { useState, } from 'react'; import { cn } from '../../lib/cn'; +import { Theme } from '../../lib/theme'; import { convertToString, isSourceCodeObject } from './code-utils'; import { MonacoLanguage } from './types'; diff --git a/packages/ui-components/src/components/flow-template/types.ts b/packages/ui-components/src/components/flow-template/types.ts index 7b7cd28f89..7b6871a34e 100644 --- a/packages/ui-components/src/components/flow-template/types.ts +++ b/packages/ui-components/src/components/flow-template/types.ts @@ -1,17 +1,9 @@ import { BlockMetadataModelSummary } from '@openops/blocks-framework'; import { FlowTemplateMetadata } from '@openops/shared'; -import { Static, Type } from '@sinclair/typebox'; -export const FlowTemplateMetadataWithIntegrations = Type.Composite([ - FlowTemplateMetadata, - Type.Object({ - integrations: Type.Array(BlockMetadataModelSummary), - }), -]); - -export type FlowTemplateMetadataWithIntegrations = Static< - typeof FlowTemplateMetadataWithIntegrations ->; +export type FlowTemplateMetadataWithIntegrations = FlowTemplateMetadata & { + integrations: BlockMetadataModelSummary[]; +}; export type TemplateSidebarCategory = { name: string; From 9a62fd8c5a7653aa4c91606671bba61abc3c856b Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 1 Jun 2026 22:13:43 +0300 Subject: [PATCH 2/4] Fix generateMentionHtmlElement to include displayText as valid DOMOutputSpec child --- .../text-input-with-mentions/text-input-utils.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/react-ui/src/app/features/builder/block-properties/text-input-with-mentions/text-input-utils.ts b/packages/react-ui/src/app/features/builder/block-properties/text-input-with-mentions/text-input-utils.ts index c737654714..1e43c09722 100644 --- a/packages/react-ui/src/app/features/builder/block-properties/text-input-with-mentions/text-input-utils.ts +++ b/packages/react-ui/src/app/features/builder/block-properties/text-input-with-mentions/text-input-utils.ts @@ -226,9 +226,14 @@ const generateMentionHtmlElement = ( { src: apMentionNodeAttrs.logoUrl, class: 'object-fit w-4 h-4' }, ]); } - children.push(apMentionNodeAttrs.displayText); - return ['span', attrs, ...children]; + // Text nodes are valid DOMOutputSpec children; newer @tiptap/pm types omit `string`. + return [ + 'span', + attrs, + ...children, + apMentionNodeAttrs.displayText, + ] as DOMOutputSpec; }; const inputThatUsesMentionClass = 'ap-text-with-mentions'; From 94e9ea52297bb6bb391c674f6b1928a13d01ee07 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 1 Jun 2026 22:25:48 +0300 Subject: [PATCH 3/4] Remove unused import of AppConnection in connection-table component --- .../src/app/features/connections/components/connection-table.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/react-ui/src/app/features/connections/components/connection-table.tsx b/packages/react-ui/src/app/features/connections/components/connection-table.tsx index a077db88ff..25b7faad23 100644 --- a/packages/react-ui/src/app/features/connections/components/connection-table.tsx +++ b/packages/react-ui/src/app/features/connections/components/connection-table.tsx @@ -16,7 +16,6 @@ import { StatusIconWithText, } from '@openops/components/ui'; import { - AppConnection, AppConnectionSortBy, AppConnectionStatus, AppConnectionWithoutSensitiveData, From 7db744cec8b035f24239c750b9af8ab5cf2215e7 Mon Sep 17 00:00:00 2001 From: Roman Date: Mon, 8 Jun 2026 22:36:39 +0300 Subject: [PATCH 4/4] Refactor authentication API methods to return resolved promises instead of API calls. Update imports in AppearancePage component to include necessary UI elements. --- packages/react-ui/src/app/lib/authentication-api.ts | 12 +++++++++--- .../src/app/routes/settings/appearance/index.tsx | 8 ++++++-- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/packages/react-ui/src/app/lib/authentication-api.ts b/packages/react-ui/src/app/lib/authentication-api.ts index df4dc19207..cc24a25df1 100644 --- a/packages/react-ui/src/app/lib/authentication-api.ts +++ b/packages/react-ui/src/app/lib/authentication-api.ts @@ -35,12 +35,18 @@ export const authenticationApi = { ); }, resetPassword(request: { otp: string; userId: string; newPassword: string }) { - return api.post('/v1/authentication/reset-password', request); + return new Promise((resolve) => { + resolve(); + }); }, sendOtpEmail(request: { email: string; type: string }) { - return api.post('/v1/authentication/send-otp', request); + return new Promise((resolve) => { + resolve(); + }); }, verifyEmail(request: { otp: string; userId: string }) { - return api.post('/v1/authentication/verify-email', request); + return new Promise((resolve) => { + resolve(); + }); }, }; diff --git a/packages/react-ui/src/app/routes/settings/appearance/index.tsx b/packages/react-ui/src/app/routes/settings/appearance/index.tsx index 17e7dbfba4..40ed2cdce5 100644 --- a/packages/react-ui/src/app/routes/settings/appearance/index.tsx +++ b/packages/react-ui/src/app/routes/settings/appearance/index.tsx @@ -1,8 +1,12 @@ -import { RadioGroup, RadioGroupItem, Separator } from '@openops/components/ui'; import { t } from 'i18next'; import { useTheme } from '@/app/common/providers/theme-provider'; -import { Theme } from '@openops/components/ui'; +import { + RadioGroup, + RadioGroupItem, + Separator, + Theme, +} from '@openops/components/ui'; export default function AppearancePage() { const { theme, setTheme } = useTheme();