mirror of
https://github.com/langgenius/dify.git
synced 2024-11-16 19:59:50 +08:00
fix: not return annotation author error happens (#1793)
This commit is contained in:
parent
43741ad5d1
commit
c3275dfd36
|
@ -114,7 +114,8 @@ const HeaderOptions: FC<Props> = ({
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
// !w-[208px]
|
// !w-[208px]
|
||||||
className={'!w-[131px] h-fit !z-20'}
|
className={'!w-[135px] h-fit !z-20'}
|
||||||
|
popupClassName='!w-full'
|
||||||
manualClose
|
manualClose
|
||||||
/>
|
/>
|
||||||
{showAddModal && (
|
{showAddModal && (
|
||||||
|
|
|
@ -247,7 +247,7 @@ const Answer: FC<IAnswerProps> = ({
|
||||||
<Markdown className='line-through !text-gray-400' content={content} />
|
<Markdown className='line-through !text-gray-400' content={content} />
|
||||||
</div>
|
</div>
|
||||||
<EditTitle title={t('appAnnotation.editBy', {
|
<EditTitle title={t('appAnnotation.editBy', {
|
||||||
author: annotation?.logAnnotation.account.name,
|
author: annotation?.logAnnotation.account?.name,
|
||||||
})} />
|
})} />
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
|
@ -100,7 +100,7 @@ const getFormattedChatList = (messages: ChatMessage[]) => {
|
||||||
if (item.annotation_hit_history) {
|
if (item.annotation_hit_history) {
|
||||||
return {
|
return {
|
||||||
id: item.annotation_hit_history.annotation_id,
|
id: item.annotation_hit_history.annotation_id,
|
||||||
authorName: item.annotation_hit_history.annotation_create_account.name,
|
authorName: item.annotation_hit_history.annotation_create_account?.name || 'N/A',
|
||||||
created_at: item.annotation_hit_history.created_at,
|
created_at: item.annotation_hit_history.created_at,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import { Popover, Transition } from '@headlessui/react'
|
import { Popover, Transition } from '@headlessui/react'
|
||||||
import { Fragment, cloneElement, useRef } from 'react'
|
import { Fragment, cloneElement, useRef } from 'react'
|
||||||
|
import cn from 'classnames'
|
||||||
import s from './style.module.css'
|
import s from './style.module.css'
|
||||||
|
|
||||||
export type HtmlContentProps = {
|
export type HtmlContentProps = {
|
||||||
|
@ -10,6 +11,7 @@ export type HtmlContentProps = {
|
||||||
type IPopover = {
|
type IPopover = {
|
||||||
className?: string
|
className?: string
|
||||||
htmlContent: React.ReactElement<HtmlContentProps>
|
htmlContent: React.ReactElement<HtmlContentProps>
|
||||||
|
popupClassName?: string
|
||||||
trigger?: 'click' | 'hover'
|
trigger?: 'click' | 'hover'
|
||||||
position?: 'bottom' | 'br'
|
position?: 'bottom' | 'br'
|
||||||
btnElement?: string | React.ReactNode
|
btnElement?: string | React.ReactNode
|
||||||
|
@ -23,6 +25,7 @@ export default function CustomPopover({
|
||||||
trigger = 'hover',
|
trigger = 'hover',
|
||||||
position = 'bottom',
|
position = 'bottom',
|
||||||
htmlContent,
|
htmlContent,
|
||||||
|
popupClassName,
|
||||||
btnElement,
|
btnElement,
|
||||||
className,
|
className,
|
||||||
btnClassName,
|
btnClassName,
|
||||||
|
@ -57,12 +60,11 @@ export default function CustomPopover({
|
||||||
>
|
>
|
||||||
<Popover.Button
|
<Popover.Button
|
||||||
ref={buttonRef}
|
ref={buttonRef}
|
||||||
className={`group ${s.popupBtn} ${open ? '' : 'bg-gray-100'} ${
|
className={`group ${s.popupBtn} ${open ? '' : 'bg-gray-100'} ${!btnClassName
|
||||||
!btnClassName
|
? ''
|
||||||
? ''
|
: typeof btnClassName === 'string'
|
||||||
: typeof btnClassName === 'string'
|
? btnClassName
|
||||||
? btnClassName
|
: btnClassName?.(open)
|
||||||
: btnClassName?.(open)
|
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{btnElement}
|
{btnElement}
|
||||||
|
@ -80,7 +82,7 @@ export default function CustomPopover({
|
||||||
>
|
>
|
||||||
{({ close }) => (
|
{({ close }) => (
|
||||||
<div
|
<div
|
||||||
className={s.panelContainer}
|
className={cn(s.panelContainer, popupClassName)}
|
||||||
{...(trigger !== 'hover'
|
{...(trigger !== 'hover'
|
||||||
? {}
|
? {}
|
||||||
: {
|
: {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user