fix: Remove customContainer prop from PortalToFollowElem and adjust padding in dropdown component (#25779)

This commit is contained in:
Jyong 2025-09-16 18:40:06 +08:00 committed by GitHub
commit d575072735
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 11 additions and 23 deletions

View File

@ -114,7 +114,6 @@ const DropDown = ({
} : {
mainAxis: 4,
}}
customContainer={document.body}
>
<PortalToFollowElemTrigger onClick={handleTrigger}>
<ActionButton className={cn(expand ? 'size-8 rounded-lg' : 'size-6 rounded-md')}>

View File

@ -49,7 +49,7 @@ const LinkedAppsPanel: FC<Props> = ({
isMobile,
}) => {
return (
<div className='w-[320px] rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur p-1 shadow-lg backdrop-blur-[5px]'>
<div className='w-[320px] rounded-xl border-[0.5px] border-components-panel-border bg-components-panel-bg-blur p-1 shadow-lg backdrop-blur-[5px]'>
{relatedApps.map((item, index) => (
<LikedItem key={index} detail={item} isMobile={isMobile} />
))}

View File

@ -4,7 +4,6 @@ import {
FloatingPortal,
autoUpdate,
flip,
hide,
offset,
shift,
size,
@ -31,7 +30,6 @@ export type PortalToFollowElemOptions = {
offset?: number | OffsetOptions
onOpenChange?: (open: boolean) => void
triggerPopupSameWidth?: boolean
customContainer?: HTMLElement | null
}
export function usePortalToFollowElem({
@ -40,9 +38,7 @@ export function usePortalToFollowElem({
offset: offsetValue = 0,
onOpenChange: setControlledOpen,
triggerPopupSameWidth,
customContainer = null,
}: PortalToFollowElemOptions = {}) {
const container = customContainer || document.getElementById('workflow-container') || document.body
const [localOpen, setLocalOpen] = useState(false)
const open = controlledOpen ?? localOpen
const handleOpenChange = useCallback((newOpen: boolean) => {
@ -60,17 +56,9 @@ export function usePortalToFollowElem({
flip({
crossAxis: placement.includes('-'),
fallbackAxisSideDirection: 'start',
padding: 8,
}),
shift({
padding: 8,
boundary: container,
altBoundary: true,
}),
hide({
// hide when the reference element is not visible
boundary: container,
padding: 5,
}),
shift({ padding: 5 }),
size({
apply({ rects, elements }) {
if (triggerPopupSameWidth)

View File

@ -49,7 +49,7 @@ const Drawer = ({
return chunk && chunk.contains(target)
})
const reopenChunkDetail = (currSegment.showModal && isClickOnChildChunk)
|| (currChildChunk.showModal && isClickOnChunk && !isClickOnChildChunk)
|| (currChildChunk.showModal && isClickOnChunk && !isClickOnChildChunk) || (!isClickOnChunk && !isClickOnChildChunk)
return target && !panelContent.contains(target) && (!needCheckChunks || reopenChunkDetail)
}, [currSegment, currChildChunk, needCheckChunks])

View File

@ -126,6 +126,7 @@ const PipelineSettings = ({
start_node_id: lastRunData.datasource_node_id,
datasource_type: lastRunData.datasource_type,
datasource_info_list: datasourceInfoList,
original_document_id: documentId,
is_preview: false,
}, {
onSuccess: () => {

View File

@ -34,7 +34,6 @@ const ServiceApi = ({
mainAxis: 4,
crossAxis: -4,
}}
customContainer={document.body}
>
<PortalToFollowElemTrigger
className='w-full'

View File

@ -48,7 +48,7 @@ const Statistics = ({
hasRelatedApps ? (
<LinkedAppsPanel
relatedApps={relatedApps.data}
isMobile={expand}
isMobile={!expand}
/>
) : <NoLinkedAppsPanel />
}

View File

@ -99,8 +99,8 @@ const nodeDefault: NodeDefault<ToolNodeType> = {
const dataType = output.type
const schemaType = getMatchedSchemaType(output, schemaTypeDefinitions)
let type = dataType === 'array'
? `array[${output.items?.type.slice(0, 1).toLocaleLowerCase()}${output.items?.type.slice(1)}]`
: `${output.type.slice(0, 1).toLocaleLowerCase()}${output.type.slice(1)}`
? `Array[${output.items?.type ? output.items.type.slice(0, 1).toLocaleLowerCase() + output.items.type.slice(1) : 'Unknown'}]`
: `${output.type ? output.type.slice(0, 1).toLocaleLowerCase() + output.type.slice(1) : 'Unknown'}`
if (type === VarType.object && schemaType === 'file')
type = VarType.file

View File

@ -203,6 +203,7 @@ export type PublishedPipelineRunRequest = {
start_node_id: string
datasource_type: DatasourceType
datasource_info_list: Array<Record<string, any>>
original_document_id?: string
is_preview: boolean
}

View File

@ -87,13 +87,13 @@ export const useDatasetApiBaseUrl = () => {
export const useEnableDatasetServiceApi = () => {
return useMutation({
mutationKey: [NAME_SPACE, 'enable-api'],
mutationFn: (datasetId: string) => post<CommonResponse>(`/datasets/${datasetId}/enable`),
mutationFn: (datasetId: string) => post<CommonResponse>(`/datasets/${datasetId}/api-keys/enable`),
})
}
export const useDisableDatasetServiceApi = () => {
return useMutation({
mutationKey: [NAME_SPACE, 'disable-api'],
mutationFn: (datasetId: string) => post<CommonResponse>(`/datasets/${datasetId}/disable`),
mutationFn: (datasetId: string) => post<CommonResponse>(`/datasets/${datasetId}/api-keys/disable`),
})
}