Переглянути джерело

feat(portal): add customContainer prop to PortalToFollowElem for flexible rendering

tags/2.0.0-beta.1
twwu 2 місяці тому
джерело
коміт
00b5772012

+ 1
- 0
web/app/components/app-sidebar/dataset-info/dropdown.tsx Переглянути файл

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

+ 3
- 1
web/app/components/base/portal-to-follow-elem/index.tsx Переглянути файл

@@ -31,6 +31,7 @@ export type PortalToFollowElemOptions = {
offset?: number | OffsetOptions
onOpenChange?: (open: boolean) => void
triggerPopupSameWidth?: boolean
customContainer?: HTMLElement | null
}

export function usePortalToFollowElem({
@@ -39,8 +40,9 @@ export function usePortalToFollowElem({
offset: offsetValue = 0,
onOpenChange: setControlledOpen,
triggerPopupSameWidth,
customContainer = null,
}: PortalToFollowElemOptions = {}) {
const container = document.getElementById('workflow-container') || document.body
const container = customContainer || document.getElementById('workflow-container') || document.body
const [localOpen, setLocalOpen] = useState(false)
const open = controlledOpen ?? localOpen
const handleOpenChange = useCallback((newOpen: boolean) => {

+ 1
- 1
web/app/components/datasets/create-from-pipeline/list/template-card/operations.tsx Переглянути файл

@@ -49,7 +49,7 @@ const Operations = ({
onClick={onClickExport}
>
<span className='system-md-regular px-1 text-text-secondary'>
{t('datasetPipeline.operations.exportDSL')}
{t('datasetPipeline.operations.exportPipeline')}
</span>
</div>
</div>

+ 0
- 1
web/i18n/en-US/dataset-pipeline.ts Переглянути файл

@@ -18,7 +18,6 @@ const translation = {
choose: 'Choose',
details: 'Details',
editInfo: 'Edit info',
exportDSL: 'Export DSL',
useTemplate: 'Use this Knowledge Pipeline',
backToDataSource: 'Back to Data Source',
process: 'Process',

+ 0
- 1
web/i18n/zh-Hans/dataset-pipeline.ts Переглянути файл

@@ -18,7 +18,6 @@ const translation = {
choose: '选择',
details: '详情',
editInfo: '编辑信息',
exportDSL: '导出 DSL',
useTemplate: '使用此知识流水线',
backToDataSource: '返回数据源',
process: '处理',

Завантаження…
Відмінити
Зберегти