fix(web): adjust the value of End User Name
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-02-03 17:57:26
|
* @Date: 2026-02-03 17:57:26
|
||||||
* @Last Modified by: ZhaoYing
|
* @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
|
* Neo4j User Memory Detail View
|
||||||
@@ -22,7 +22,7 @@ import InterestDistribution from './components/InterestDistribution'
|
|||||||
import NodeStatistics from './components/NodeStatistics'
|
import NodeStatistics from './components/NodeStatistics'
|
||||||
import RelationshipNetwork from './components/RelationshipNetwork'
|
import RelationshipNetwork from './components/RelationshipNetwork'
|
||||||
import MemoryInsight from './components/MemoryInsight'
|
import MemoryInsight from './components/MemoryInsight'
|
||||||
import type { EndUserProfileRef, MemoryInsightRef, AboutMeRef } from './types'
|
import type { EndUserProfileRef, MemoryInsightRef, AboutMeRef, EndUser } from './types'
|
||||||
import {
|
import {
|
||||||
analyticsRefresh,
|
analyticsRefresh,
|
||||||
} from '@/api/memory'
|
} from '@/api/memory'
|
||||||
@@ -39,8 +39,10 @@ const Neo4j: FC = () => {
|
|||||||
const [selectedKey, setSelectedKey] = useState<string | null>(null)
|
const [selectedKey, setSelectedKey] = useState<string | null>(null)
|
||||||
|
|
||||||
/** Update displayed name */
|
/** Update displayed name */
|
||||||
const handleNameUpdate = (data: { other_name?: string; id: string }) => {
|
const handleNameUpdate = (data?: EndUser) => {
|
||||||
setName(data.other_name && data.other_name !== '' ? data.other_name : data.id)
|
if (!data) return
|
||||||
|
let name = data.other_name && data.other_name !== '' ? data.other_name : data.id || data.end_user_id
|
||||||
|
setName(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Navigate back */
|
/** Navigate back */
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-02-03 18:33:30
|
* @Date: 2026-02-03 18:33:30
|
||||||
* @Last Modified by: ZhaoYing
|
* @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
|
* End User Profile Component
|
||||||
@@ -27,11 +27,11 @@ import type { EndUser, EndUserProfileModalRef, EndUserProfileRef } from '../type
|
|||||||
* Component props
|
* Component props
|
||||||
*/
|
*/
|
||||||
interface EndUserProfileProps {
|
interface EndUserProfileProps {
|
||||||
onDataLoaded?: (data: { other_name?: string; id: string }) => void;
|
onDataLoaded?: (data?: EndUser) => void;
|
||||||
className?: string;
|
className?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
const EndUserProfile = forwardRef<EndUserProfileRef, EndUserProfileProps>(({ className }, ref) => {
|
const EndUserProfile = forwardRef<EndUserProfileRef, EndUserProfileProps>(({ className, onDataLoaded }, ref) => {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
const { id } = useParams()
|
const { id } = useParams()
|
||||||
const endUserProfileModalRef = useRef<EndUserProfileModalRef>(null)
|
const endUserProfileModalRef = useRef<EndUserProfileModalRef>(null)
|
||||||
@@ -51,6 +51,7 @@ const EndUserProfile = forwardRef<EndUserProfileRef, EndUserProfileProps>(({ cla
|
|||||||
const userData = res as EndUser
|
const userData = res as EndUser
|
||||||
setData(userData)
|
setData(userData)
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
|
onDataLoaded?.(userData as EndUser)
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
setLoading(false)
|
setLoading(false)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: ZhaoYing
|
* @Author: ZhaoYing
|
||||||
* @Date: 2026-02-03 17:57:15
|
* @Date: 2026-02-03 17:57:15
|
||||||
* @Last Modified by: ZhaoYing
|
* @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
|
* User Memory Detail Types
|
||||||
@@ -172,6 +172,7 @@ export interface EndUser {
|
|||||||
other_name: string;
|
other_name: string;
|
||||||
aliases: string | null;
|
aliases: string | null;
|
||||||
meta_data: Record<string, string>;
|
meta_data: Record<string, string>;
|
||||||
|
id?: string;
|
||||||
end_user_info_id: string;
|
end_user_info_id: string;
|
||||||
end_user_id: string;
|
end_user_id: string;
|
||||||
created_at: string;
|
created_at: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user