Skip to content
Open
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
2 changes: 1 addition & 1 deletion frontend/src/components/BreadcrumbNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</RouterLink>
</template>
<template v-else>
<span class="text-gray-700 font-medium">{{ crumb.label }}</span>
<span class="text-gray-700 font-medium truncate max-w-48 sm:max-w-xs" :title="crumb.label">{{ crumb.label }}</span>
</template>
<ChevronRightIcon v-if="index < crumbs.length - 1 && !crumb.to" class="w-4 h-4 mx-1 text-gray-400"/>
</li>
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/authority/GroupInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="px-6 py-6">
<div class="flex flex-col items-center justify-center h-full text-center">
<img :src="group.pictureUrl" class="w-48 h-48 rounded-full object-cover border border-gray-300 mb-4" />
<h2 class="text-xl font-semibold text-gray-900">{{ group.name }}</h2>
<h2 class="text-xl font-semibold text-gray-900 truncate w-full" :title="group.name">{{ group.name }}</h2>
</div>
</div>
</section>
Expand Down
25 changes: 13 additions & 12 deletions frontend/src/components/authority/UserInfo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,18 @@
<div class="px-6 py-6">
<div class="flex flex-col items-center justify-center h-full text-center">
<img :src="user.pictureUrl" class="w-48 h-48 rounded-full object-cover border border-gray-300 mb-4" />
<h2 class="text-xl font-semibold text-gray-900">
<template v-if="user.firstName || user.lastName">
{{ user.firstName }} {{ user.lastName }}
</template>
<template v-else>
{{ user.name }}
</template>
<h2 class="text-xl font-semibold text-gray-900 truncate w-full" :title="displayName">
{{ displayName }}
</h2>
<p v-if="user.firstName || user.lastName" class="text-sm text-gray-500 mt-1">
<p v-if="user.firstName || user.lastName" class="text-sm text-gray-500 mt-1 truncate w-full" :title="user.name">
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the v-if seems misplaced here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should the condition be v-if="displayName !== user.name" instead, so it relies on the computed property rather than duplicating its logic?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that should make it more clear, yes

{{ user.name }}
</p>
<span v-if="!user.enabled" class="inline-flex items-center rounded-md bg-gray-100 px-2 py-1 text-xs font-medium text-gray-600 ring-1 ring-inset ring-gray-500/10 mt-2">{{ t('user.detail.disabled') }}</span>
</div>
<dl class="divide-y divide-gray-100">
<div class="py-3 flex justify-between">
<dt class="text-sm text-gray-500">{{ t('user.detail.email') }}</dt>
<dd class="text-sm text-gray-900 font-medium">{{ user.email }}</dd>
<div class="py-3 flex justify-between min-w-0">
<dt class="text-sm text-gray-500 shrink-0 mr-2">{{ t('user.detail.email') }}</dt>
<dd class="text-sm text-gray-900 font-medium truncate min-w-0" :title="user.email">{{ user.email }}</dd>
</div>
<div class="py-3 flex justify-between">
<dt class="text-sm text-gray-500">{{ t('user.detail.roles') }}</dt>
Expand Down Expand Up @@ -48,7 +43,13 @@ const props = defineProps<{
user: UserDtoWithDetails;
}>();

const sortedRoles = computed(() =>
const displayName = computed(() =>
props.user.firstName || props.user.lastName
? `${props.user.firstName ?? ''} ${props.user.lastName ?? ''}`.trim()
: props.user.name
);

const sortedRoles = computed(() =>
[...props.user.realmRoles].filter(isSelectableRealmRole).sort((a, b) => a.localeCompare(b, undefined, { sensitivity: 'base' }))
);

Expand Down
Loading