Repository navigation
Release: Staging to Production - 2025.10.31 #649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| import React from 'react' | ||
| import { Box, Typography, Chip } from '@mui/material' | ||
| import { IconSparkles } from '@tabler/icons-react' | ||
|
|
||
| interface FollowUpPromptsProps { | ||
| prompts: string[] | ||
| onPromptClick: (prompt: string) => void | ||
| } | ||
|
|
||
| export const FollowUpPrompts: React.FC<FollowUpPromptsProps> = ({ prompts, onPromptClick }) => { | ||
| // Safety check for prompts | ||
| if (!prompts || prompts.length === 0) { | ||
| return null | ||
| } | ||
|
|
||
| return ( | ||
| <Box sx={{ mt: 2 }}> | ||
| {/* Header with sparkles icon and text */} | ||
| <Box sx={{ display: 'flex', alignItems: 'center', gap: 0.5, mb: 1 }}> | ||
| <IconSparkles size={16} color='#1976D2' /> | ||
| <Typography variant='body2' sx={{ color: 'text.secondary', fontSize: '0.875rem' }}> | ||
| Try these prompts | ||
| </Typography> | ||
| </Box> | ||
|
|
||
| {/* Prompts container */} | ||
| <Box sx={{ display: 'flex', flexWrap: 'wrap', gap: 1 }}> | ||
| {prompts.map((prompt, index) => ( | ||
| <Chip | ||
| key={index} | ||
| label={prompt} | ||
| onClick={() => onPromptClick(prompt)} | ||
| variant='outlined' | ||
| sx={{ | ||
| cursor: 'pointer', | ||
| borderRadius: '15px', | ||
| fontSize: '0.875rem', | ||
| '&:hover': { | ||
| backgroundColor: 'action.hover', | ||
| filter: 'brightness(0.9)' | ||
| }, | ||
| '&:active': { | ||
| filter: 'brightness(0.75)' | ||
| } | ||
| }} | ||
| /> | ||
| ))} | ||
| </Box> | ||
| </Box> | ||
| ) | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,80 +1,15 @@ | ||
| import { getCredentialCategory } from './getCredentialCategory' | ||
| import { processFlowCredentials } from './processFlowCredentials' | ||
|
|
||
| /** | ||
| * Extract all credentials (assigned and unassigned) from flow data for QuickSetup mode | ||
| * @param {string|object} flowData - Flow data as JSON string or object | ||
| * @returns {object} Object containing all credentials info | ||
| */ | ||
| export const extractAllCredentials = (flowData: string | any) => { | ||
| try { | ||
| // Parse flow data if it's a string | ||
| const flow = typeof flowData === 'string' ? JSON.parse(flowData) : flowData | ||
| const { credentials, hasCredentials } = processFlowCredentials(flowData) | ||
|
|
||
| if (!flow.nodes || !Array.isArray(flow.nodes)) { | ||
| return { allCredentials: [], hasCredentials: false } | ||
| } | ||
|
|
||
| const allCredentials: any[] = [] | ||
| const credentialTypes = new Set<string>() | ||
|
|
||
| // Iterate through all nodes | ||
| flow.nodes.forEach((node: any) => { | ||
| if (node.data && node.data.inputParams) { | ||
| // Find all credential input parameters | ||
| const credentialParams = node.data.inputParams.filter((param: any) => { | ||
| return param.type === 'credential' | ||
| }) | ||
|
|
||
| credentialParams.forEach((credentialParam: any) => { | ||
| // Check if credential is assigned | ||
| const hasCredential = | ||
| node.data.credential || | ||
| (node.data.inputs && node.data.inputs[credentialParam.name]) || | ||
| (node.data.inputs && node.data.inputs['FLOWISE_CREDENTIAL_ID']) | ||
|
|
||
| // Extract credential names | ||
| const credentialNames = credentialParam.credentialNames || [] | ||
|
|
||
| credentialNames.forEach((credentialName: string) => { | ||
| credentialTypes.add(credentialName) | ||
|
|
||
| // Get category information to determine if credential is core | ||
| const category = getCredentialCategory(node.data.category, credentialName) | ||
|
|
||
| // Credential is required if: | ||
| // 1. Category is core (Chat Models, Agents, etc), OR | ||
| // 2. Parameter explicitly marked as NOT optional (optional: false) | ||
| // Default to optional if not explicitly marked | ||
| const isRequired = category.isCore || (credentialParam.optional === false) | ||
|
|
||
| const credInfo = { | ||
| nodeId: node.id, | ||
| nodeName: node.data.name || 'Unknown Node', | ||
| nodeCategory: node.data.category || 'Unknown', | ||
| nodeType: node.data.type || node.type || 'Unknown', | ||
| credentialType: credentialName, | ||
| parameterName: credentialParam.name, | ||
| label: credentialParam.label || credentialParam.name, | ||
| isRequired: isRequired, | ||
| isCore: category.isCore, | ||
| categoryType: category.type, | ||
| categoryDisplayName: category.displayName, | ||
| isAssigned: !!hasCredential, | ||
| assignedCredentialId: hasCredential || null | ||
| } | ||
|
|
||
| allCredentials.push(credInfo) | ||
| }) | ||
| }) | ||
| } | ||
| }) | ||
|
|
||
| return { | ||
| allCredentials, | ||
| hasCredentials: credentialTypes.size > 0 | ||
| } | ||
| } catch (error) { | ||
| console.error('Error in extractAllCredentials:', error) | ||
| return { allCredentials: [], hasCredentials: false } | ||
| return { | ||
| allCredentials: credentials, | ||
| hasCredentials | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The new
FollowUpPromptscomponent assumespromptsis an array and immediately callsprompts.map(...), but chat messages persisted in the DB storefollowUpPromptsas JSON strings (see the server’sbuildChatflow.tswhere the value isJSON.stringify). When an existing chat session is reloaded,message.followUpPromptsis still a string andFollowUpPromptswill try to execute.mapon that string, throwingprompts.map is not a functionand breaking the message rendering. Guard the component withArray.isArray(prompts)or deserialize earlier so historic conversations with follow-up prompts don’t crash the chat UI.Useful? React with 👍 / 👎.