Merge pull request #890 from SuanmoSuanyangTechnology/fix/v0.3.0_zy

fix(web): adjust the value of End User Name
This commit is contained in:
yingzhao
2026-04-14 16:07:55 +08:00
committed by GitHub
3 changed files with 12 additions and 8 deletions

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-03 17:57:26
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-26 18:59:53
* @Last Modified time: 2026-04-14 16:04:08
*/
/**
* Neo4j User Memory Detail View
@@ -22,7 +22,7 @@ import InterestDistribution from './components/InterestDistribution'
import NodeStatistics from './components/NodeStatistics'
import RelationshipNetwork from './components/RelationshipNetwork'
import MemoryInsight from './components/MemoryInsight'
import type { EndUserProfileRef, MemoryInsightRef, AboutMeRef } from './types'
import type { EndUserProfileRef, MemoryInsightRef, AboutMeRef, EndUser } from './types'
import {
analyticsRefresh,
} from '@/api/memory'
@@ -39,8 +39,10 @@ const Neo4j: FC = () => {
const [selectedKey, setSelectedKey] = useState<string | null>(null)
/** Update displayed name */
const handleNameUpdate = (data: { other_name?: string; id: string }) => {
setName(data.other_name && data.other_name !== '' ? data.other_name : data.id)
const handleNameUpdate = (data?: EndUser) => {
if (!data) return
let name = data.other_name && data.other_name !== '' ? data.other_name : data.id || data.end_user_id
setName(name)
}
/** Navigate back */

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-03 18:33:30
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-27 11:11:09
* @Last Modified time: 2026-04-14 16:03:41
*/
/**
* End User Profile Component
@@ -27,11 +27,11 @@ import type { EndUser, EndUserProfileModalRef, EndUserProfileRef } from '../type
* Component props
*/
interface EndUserProfileProps {
onDataLoaded?: (data: { other_name?: string; id: string }) => void;
onDataLoaded?: (data?: EndUser) => void;
className?: string;
}
const EndUserProfile = forwardRef<EndUserProfileRef, EndUserProfileProps>(({ className }, ref) => {
const EndUserProfile = forwardRef<EndUserProfileRef, EndUserProfileProps>(({ className, onDataLoaded }, ref) => {
const { t } = useTranslation()
const { id } = useParams()
const endUserProfileModalRef = useRef<EndUserProfileModalRef>(null)
@@ -51,6 +51,7 @@ const EndUserProfile = forwardRef<EndUserProfileRef, EndUserProfileProps>(({ cla
const userData = res as EndUser
setData(userData)
setLoading(false)
onDataLoaded?.(userData as EndUser)
})
.finally(() => {
setLoading(false)

View File

@@ -2,7 +2,7 @@
* @Author: ZhaoYing
* @Date: 2026-02-03 17:57:15
* @Last Modified by: ZhaoYing
* @Last Modified time: 2026-03-24 17:58:54
* @Last Modified time: 2026-04-14 16:03:16
*/
/**
* User Memory Detail Types
@@ -172,6 +172,7 @@ export interface EndUser {
other_name: string;
aliases: string | null;
meta_data: Record<string, string>;
id?: string;
end_user_info_id: string;
end_user_id: string;
created_at: string;