Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ export default function Header(data: Props) {
{data.user.picture ? (
<img
src={data.user.picture}
alt={data.user.name}
alt={data.user.name || data.user.displayName}
className="w-8 h-8 rounded-full"
/>
) : (
Expand All @@ -131,7 +131,7 @@ export default function Header(data: Props) {
<Menu.Section>
<Menu.Item key="profile" textValue="Profile">
<div className="text-black dark:text-headplane-50">
<p className="font-bold">{data.user.name}</p>
<p className="font-bold">{data.user.name || data.user.displayName}</p>
<p>{data.user.email}</p>
</div>
</Menu.Item>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/machines/components/machine-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default function MachineRow({
{node.givenName}
</p>
<p className="text-sm opacity-50">
{node.user.name || node.user.email}
{node.user.name || node.user.displayName || node.user.email || node.user.id}
</p>
<div className="flex gap-1 flex-wrap mt-1.5">
{mapTagsToComponents(node, uiTags)}
Expand Down
2 changes: 1 addition & 1 deletion app/routes/machines/dialogs/move.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default function Move({ machine, users, isOpen, setIsOpen }: MoveProps) {
}}
>
{users.map((user) => (
<Select.Item key={user.id}>{user.name}</Select.Item>
<Select.Item key={user.id}>{user.name || user.displayName || user.email || user.id}</Select.Item>
))}
</Select>
</Dialog.Panel>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/machines/dialogs/new.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default function NewMachine(data: NewMachineProps) {
placeholder="Select a user"
>
{data.users.map((user) => (
<Select.Item key={user.id}>{user.name}</Select.Item>
<Select.Item key={user.id}>{user.name || user.displayName || user.email || user.id}</Select.Item>
))}
</Select>
</Dialog.Panel>
Expand Down
4 changes: 2 additions & 2 deletions app/routes/machines/machine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default function Page() {
</span>
<div className="flex items-center gap-x-2.5 mt-1">
<UserCircle />
{node.user.name || node.user.email}
{node.user.name || node.user.displayName || node.user.email || node.user.id}
</div>
</div>
<div className="p-2 pl-4">
Expand Down Expand Up @@ -254,7 +254,7 @@ export default function Page() {
className="w-full max-w-full grid grid-cols-1 lg:grid-cols-2 gap-y-2 sm:gap-x-12"
>
<div className="flex flex-col gap-1">
<Attribute name="Creator" value={node.user.name || node.user.email} />
<Attribute name="Creator" value={node.user.name || node.user.displayName || node.user.email || node.user.id} />
<Attribute name="Machine name" value={node.givenName} />
<Attribute
tooltip="OS hostname is published by the machine’s operating system and is used as the default name for the machine."
Expand Down
2 changes: 1 addition & 1 deletion app/routes/settings/auth-keys/auth-key-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function AuthKeyRow({ authKey, user, url }: Props) {
return (
<div className="w-full">
<Attribute name="Key" value={authKey.key} isCopyable />
<Attribute name="User" value={user.name} isCopyable />
<Attribute name="User" value={user.name || user.displayName} isCopyable />
<Attribute name="Reusable" value={authKey.reusable ? 'Yes' : 'No'} />
<Attribute name="Ephemeral" value={authKey.ephemeral ? 'Yes' : 'No'} />
<Attribute name="Used" value={authKey.used ? 'Yes' : 'No'} />
Expand Down
2 changes: 1 addition & 1 deletion app/routes/settings/auth-keys/dialogs/add-auth-key.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export default function AddAuthKey(data: AddAuthKeyProps) {
}}
>
{data.users.map((user) => (
<Select.Item key={user.id}>{user.name}</Select.Item>
<Select.Item key={user.id}>{user.name || user.displayName || user.email || user.id}</Select.Item>
))}
</Select>
<NumberInput
Expand Down
2 changes: 1 addition & 1 deletion app/routes/settings/auth-keys/overview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export default function Page() {
{[
<Select.Item key="__headplane_all">All</Select.Item>,
...keys.map(({ user }) => (
<Select.Item key={user.id}>{user.name}</Select.Item>
<Select.Item key={user.id}>{user.name || user.displayName || user.email || user.id}</Select.Item>
)),
]}
</Select>
Expand Down
4 changes: 2 additions & 2 deletions app/routes/users/components/user-row.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ export default function UserRow({ user, role }: UserRowProps) {
{user.profilePicUrl ? (
<img
src={user.profilePicUrl}
alt={user.name}
alt={user.name || user.displayName}
className="w-10 h-10 rounded-full"
/>
) : (
<CircleUser className="w-10 h-10" />
)}
<div className="ml-4">
<p className={cn('font-semibold leading-snug')}>{user.name}</p>
<p className={cn('font-semibold leading-snug')}>{user.name || user.displayName}</p>
<p className="text-sm opacity-50">{user.email}</p>
</div>
</div>
Expand Down
3 changes: 1 addition & 2 deletions app/routes/users/dialogs/delete-user.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ interface DeleteProps {
}

export default function DeleteUser({ user, isOpen, setIsOpen }: DeleteProps) {
const name =
(user.displayName?.length ?? 0) > 0 ? user.displayName : user.name;
const name = user.name || user.displayName;

return (
<Dialog isOpen={isOpen} onOpenChange={setIsOpen}>
Expand Down
2 changes: 1 addition & 1 deletion app/routes/users/dialogs/reassign-user.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default function ReassignUser({
<Dialog.Panel
variant={user.headplaneRole === 'owner' ? 'unactionable' : 'normal'}
>
<Dialog.Title>Change role for {user.name}?</Dialog.Title>
<Dialog.Title>Change role for {user.name || user.displayName}?</Dialog.Title>
<Dialog.Text className="mb-6">
Most roles are carried straight from Tailscale. However, keep in mind
that I have not fully implemented permissions yet and some things may
Expand Down
4 changes: 2 additions & 2 deletions app/routes/users/dialogs/rename-user.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ export default function RenameUser({ user, isOpen, setIsOpen }: RenameProps) {
return (
<Dialog isOpen={isOpen} onOpenChange={setIsOpen}>
<Dialog.Panel>
<Dialog.Title>Rename {user.name}?</Dialog.Title>
<Dialog.Title>Rename {user.name || user.displayName}?</Dialog.Title>
<Dialog.Text className="mb-6">
Enter a new username for {user.name}. Changing a username will not
Enter a new username for {user.name || user.displayName}. Changing a username will not
update any ACL policies that may refer to this user by their old
username.
</Dialog.Text>
Expand Down