mirror of
https://github.com/langgenius/dify.git
synced 2026-04-29 04:26:30 +08:00
fix(CI): fix CI errors
This commit is contained in:
parent
b25d379ef4
commit
db744444f2
@ -102,14 +102,14 @@ const FormPlayground = () => {
|
|||||||
options={{
|
options={{
|
||||||
...demoFormOpts,
|
...demoFormOpts,
|
||||||
validators: {
|
validators: {
|
||||||
onSubmit: ({ value }) => {
|
onSubmit: ({ value: formValue }) => {
|
||||||
const result = UserSchema.safeParse(value as typeof demoFormOpts.defaultValues)
|
const result = UserSchema.safeParse(formValue as typeof demoFormOpts.defaultValues)
|
||||||
if (!result.success)
|
if (!result.success)
|
||||||
return result.error.issues[0].message
|
return result.error.issues[0].message
|
||||||
return undefined
|
return undefined
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
onSubmit: ({ value }) => {
|
onSubmit: () => {
|
||||||
setStatus('Successfully saved profile.')
|
setStatus('Successfully saved profile.')
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
|
|||||||
@ -67,7 +67,7 @@ const InputWithCopy = React.forwardRef<HTMLInputElement, InputWithCopyProps>((
|
|||||||
inputProps.className,
|
inputProps.className,
|
||||||
)}
|
)}
|
||||||
value={value}
|
value={value}
|
||||||
{...(({ size, ...rest }) => rest)(inputProps)}
|
{...(({ size: _size, ...rest }) => rest)(inputProps)}
|
||||||
/>
|
/>
|
||||||
{showCopyButton && (
|
{showCopyButton && (
|
||||||
<div
|
<div
|
||||||
|
|||||||
@ -29,7 +29,7 @@ const VoiceInputMock = ({ onConverted, onCancel }: any) => {
|
|||||||
<div className="absolute inset-[1.5px] flex items-center overflow-hidden rounded-[10.5px] bg-primary-25 py-[14px] pl-[14.5px] pr-[6.5px]">
|
<div className="absolute inset-[1.5px] flex items-center overflow-hidden rounded-[10.5px] bg-primary-25 py-[14px] pl-[14.5px] pr-[6.5px]">
|
||||||
{/* Waveform visualization placeholder */}
|
{/* Waveform visualization placeholder */}
|
||||||
<div className="absolute bottom-0 left-0 flex h-4 w-full items-end gap-[3px] px-2">
|
<div className="absolute bottom-0 left-0 flex h-4 w-full items-end gap-[3px] px-2">
|
||||||
{new Array(40).fill(0).map((_, i) => (
|
{Array.from({ length: 40 }).map((_, i) => (
|
||||||
<div
|
<div
|
||||||
key={i}
|
key={i}
|
||||||
className="w-[2px] rounded-t bg-blue-200"
|
className="w-[2px] rounded-t bg-blue-200"
|
||||||
|
|||||||
@ -105,8 +105,6 @@ const FileUploader = ({
|
|||||||
return isValidType && isValidSize
|
return isValidType && isValidSize
|
||||||
}, [fileUploadConfig, notify, t, ACCEPTS])
|
}, [fileUploadConfig, notify, t, ACCEPTS])
|
||||||
|
|
||||||
type UploadResult = Awaited<ReturnType<typeof upload>>
|
|
||||||
|
|
||||||
const fileUpload = useCallback(async (fileItem: FileItem): Promise<FileItem> => {
|
const fileUpload = useCallback(async (fileItem: FileItem): Promise<FileItem> => {
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append('file', fileItem.file)
|
formData.append('file', fileItem.file)
|
||||||
|
|||||||
@ -17,13 +17,11 @@ type SubscriptionTriggerButtonProps = {
|
|||||||
onClick?: () => void
|
onClick?: () => void
|
||||||
isOpen?: boolean
|
isOpen?: boolean
|
||||||
className?: string
|
className?: string
|
||||||
onSelect: (v: SimpleSubscription, callback?: () => void) => void
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const SubscriptionTriggerButton: React.FC<SubscriptionTriggerButtonProps> = ({
|
const SubscriptionTriggerButton: React.FC<SubscriptionTriggerButtonProps> = ({
|
||||||
selectedId,
|
selectedId,
|
||||||
onClick,
|
onClick,
|
||||||
onSelect,
|
|
||||||
isOpen = false,
|
isOpen = false,
|
||||||
className,
|
className,
|
||||||
}) => {
|
}) => {
|
||||||
@ -109,7 +107,6 @@ export const SubscriptionSelectorEntry = ({ selectedId, onSelect }: {
|
|||||||
selectedId={selectedId}
|
selectedId={selectedId}
|
||||||
onClick={() => setIsOpen(!isOpen)}
|
onClick={() => setIsOpen(!isOpen)}
|
||||||
isOpen={isOpen}
|
isOpen={isOpen}
|
||||||
onSelect={onSelect}
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</PortalToFollowElemTrigger>
|
</PortalToFollowElemTrigger>
|
||||||
|
|||||||
@ -151,7 +151,8 @@ export const useChecklist = (nodes: Node[], edges: Edge[]) => {
|
|||||||
|
|
||||||
if (node.type === CUSTOM_NODE) {
|
if (node.type === CUSTOM_NODE) {
|
||||||
const checkData = getCheckData(node.data)
|
const checkData = getCheckData(node.data)
|
||||||
let { errorMessage } = nodesExtraData![node.data.type]?.checkValid(checkData, t, moreDataForCheckValid)
|
const validator = nodesExtraData?.[node.data.type as BlockEnum]?.checkValid
|
||||||
|
let errorMessage = validator ? validator(checkData, t, moreDataForCheckValid).errorMessage : undefined
|
||||||
|
|
||||||
if (!errorMessage) {
|
if (!errorMessage) {
|
||||||
const availableVars = map[node.id].availableVars
|
const availableVars = map[node.id].availableVars
|
||||||
|
|||||||
@ -83,7 +83,7 @@ const useConfig = (id: string, payload: PluginTriggerNodeType) => {
|
|||||||
const {
|
const {
|
||||||
provider_id,
|
provider_id,
|
||||||
provider_name,
|
provider_name,
|
||||||
event_name: event_name,
|
event_name,
|
||||||
config = {},
|
config = {},
|
||||||
event_parameters: rawEventParameters = {},
|
event_parameters: rawEventParameters = {},
|
||||||
subscription_id,
|
subscription_id,
|
||||||
|
|||||||
@ -16,7 +16,7 @@ export const getToolCheckParams = (
|
|||||||
workflowTools: ToolWithProvider[],
|
workflowTools: ToolWithProvider[],
|
||||||
language: string,
|
language: string,
|
||||||
) => {
|
) => {
|
||||||
const { provider_id, provider_type, tool_name: tool_name } = toolData
|
const { provider_id, provider_type, tool_name } = toolData
|
||||||
const isBuiltIn = provider_type === CollectionType.builtIn
|
const isBuiltIn = provider_type === CollectionType.builtIn
|
||||||
const currentTools = provider_type === CollectionType.builtIn ? buildInTools : provider_type === CollectionType.custom ? customTools : workflowTools
|
const currentTools = provider_type === CollectionType.builtIn ? buildInTools : provider_type === CollectionType.custom ? customTools : workflowTools
|
||||||
const currCollection = currentTools.find(item => canFindTool(item.id, provider_id))
|
const currCollection = currentTools.find(item => canFindTool(item.id, provider_id))
|
||||||
|
|||||||
@ -295,7 +295,8 @@ export const fetchAccessToken = async ({ userId, appCode }: { userId?: string, a
|
|||||||
if (accessToken)
|
if (accessToken)
|
||||||
headers.append('Authorization', `Bearer ${accessToken}`)
|
headers.append('Authorization', `Bearer ${accessToken}`)
|
||||||
const params = new URLSearchParams()
|
const params = new URLSearchParams()
|
||||||
userId && params.append('user_id', userId)
|
if (userId)
|
||||||
|
params.append('user_id', userId)
|
||||||
const url = `/passport?${params.toString()}`
|
const url = `/passport?${params.toString()}`
|
||||||
return get<{ access_token: string }>(url, { headers }) as Promise<{ access_token: string }>
|
return get<{ access_token: string }>(url, { headers }) as Promise<{ access_token: string }>
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user