Skip to content

Commit c48c0a5

Browse files
authored
210 feature request show user names not just usernames (#211)
* fix: display email if username is too short * feat: added email field to expanded cards
1 parent fbb8b2b commit c48c0a5

File tree

6 files changed

+10
-5
lines changed

6 files changed

+10
-5
lines changed

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/lib/common/classes.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export class PreAuthKey {
5656
export class User {
5757
public id: string = '';
5858
public name: string = '';
59+
public email: string = '';
5960
public createdAt: string = '';
6061
public constructor(init?: Partial<User>) {
6162
Object.assign(this, init);

src/lib/devices/CreateDevice.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@
6565
<label class="block text-secondary text-sm font-bold mb-2" for="select">Select User</label>
6666
<select class="card-select mr-3" required bind:value={selectedUser}>
6767
{#each $userStore as user}
68-
<option>{user.name}</option>
68+
<option>{user.name.length > 1 ? user.name : user.email}</option>
6969
{/each}
7070
</select>
7171
</div>

src/lib/devices/DeviceCard/MoveDevice.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<form on:submit|preventDefault={moveDeviceAction}>
4040
<select class="card-select mr-3" required bind:value={selectedUser}>
4141
{#each $userStore as user}
42-
<option value={user.id}>{user.name}</option>
42+
<option value={user.id}>{user.name.length > 1 ? user.name : user.email}</option>
4343
{/each}
4444
</select>
4545
<!-- edit accept symbol -->

src/lib/users/UserCard.svelte

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@
3939
<div class="overflow-x-auto">
4040
<table class="table table-compact w-full">
4141
<tbody>
42+
<tr>
43+
<th>Email</th>
44+
<td>{user.email}</td>
45+
</tr>
4246
<tr>
4347
<th>User Creation Date</th>
4448
<td>{new Date(user.createdAt)}</td>

src/lib/users/UserCard/RenameUser.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
</script>
3333

3434
{#if !cardEditing}
35-
<span class="font-bold">{user.id}: {user.name}</span>
35+
<span class="font-bold">{user.id}: {user.name.length > 1 ? user.name : user.email}</span>
3636
<!-- edit symbol -->
3737
<button type="button" on:click|stopPropagation={() => editingUser()} class="ml-2"
3838
><svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4 inline flex-shrink-0" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">

0 commit comments

Comments
 (0)