1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { Resource, ResourceKind } from 'models/resource';
7 export type UserPrefs = {
10 organization_email?: string,
17 export interface User {
29 export const getUserFullname = (user: User) => {
30 return user.firstName && user.lastName
31 ? `${user.firstName} ${user.lastName}`
35 export const getUserDisplayName = (user: User, withEmail = false) => {
36 const displayName = getUserFullname(user) || user.email || user.username || user.uuid;
37 if (withEmail && user.email && displayName !== user.email) {
38 return `${displayName} <<${user.email}>>`;
43 export interface UserResource extends Resource, User {
44 kind: ResourceKind.USER;
45 defaultOwnerUuid: string;