feat: Oracle CRM Page, Synthetic Client Data and Live Snapshot when hitting emotion hotpoint
This commit is contained in:
@@ -21,6 +21,7 @@ import {
|
||||
getVelocityToken,
|
||||
isAdminRole,
|
||||
normalizeVelocityRole,
|
||||
type VelocityUserProfile,
|
||||
} from '@/lib/velocityPlatformClient';
|
||||
|
||||
import {
|
||||
@@ -258,7 +259,7 @@ function App() {
|
||||
if (cancelled) return;
|
||||
login({
|
||||
id: me.user_id,
|
||||
name: me.user_id,
|
||||
name: resolveVelocityDisplayName(me),
|
||||
role: normalizeVelocityRole(me.role),
|
||||
});
|
||||
setAuthBootstrapped(true);
|
||||
@@ -287,7 +288,7 @@ function App() {
|
||||
if (cancelled) return;
|
||||
login({
|
||||
id: me.user_id,
|
||||
name: me.user_id,
|
||||
name: resolveVelocityDisplayName(me),
|
||||
role: normalizeVelocityRole(me.role),
|
||||
});
|
||||
})
|
||||
@@ -362,3 +363,17 @@ function formatRoleLabel(role: string | undefined) {
|
||||
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
||||
.join(' ');
|
||||
}
|
||||
|
||||
function resolveVelocityDisplayName(profile: VelocityUserProfile) {
|
||||
const fullName = profile.full_name?.trim();
|
||||
if (fullName) {
|
||||
return fullName;
|
||||
}
|
||||
|
||||
const email = profile.email?.trim();
|
||||
if (email) {
|
||||
return email;
|
||||
}
|
||||
|
||||
return profile.user_id;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user