0
0
Fork 0
mirror of https://github.com/verdigado/organization_folders.git synced 2024-12-06 11:22:41 +01:00

use principal fullHierarchyNames in frontend

This commit is contained in:
Jonathan Treffler 2024-11-26 18:36:15 +01:00
parent 89ff5415dd
commit 826db21508

View file

@ -13,8 +13,6 @@ const props = defineProps({
}, },
}); });
const friendlyNameParts = computed(() => [props.member.principal.id] /*.split(" / ")*/);
const emit = defineEmits(["update", "delete"]); const emit = defineEmits(["update", "delete"]);
const permissionLevelOptions = [ const permissionLevelOptions = [
@ -36,18 +34,18 @@ const onDeleteClicked = (e) => {
<template> <template>
<tr> <tr>
<td> <td>
<NcAvatar :user="props.member.type === 1 ? props.member.principal : undefined" <NcAvatar :user="props.member.principal.type === 1 ? props.member.principal.id : undefined"
:disabled-menu="true" :disabled-menu="true"
:disabled-tooltip="true" :disabled-tooltip="true"
:icon-class="props.member.type === 2 ? 'icon-group' : undefined" /> :icon-class="props.member.principal.type > 1 ? 'icon-group' : undefined" />
</td> </td>
<td> <td>
<div class="friendlyNameParts"> <div class="fullHierarchyNameParts">
<div v-for="(friendlyNamePart, index) of friendlyNameParts" :key="'breadcrumb-' + friendlyNamePart" class="friendlyNamePartDiv"> <div v-for="(fullHierarchyNamePart, index) of props.member.principal.fullHierarchyNames" :key="fullHierarchyNamePart">
<p v-tooltip="friendlyNamePart" class="friendlyNamePartP"> <p v-tooltip="fullHierarchyNamePart">
{{ friendlyNamePart }} {{ fullHierarchyNamePart }}
</p> </p>
<ChevronRight v-if="index !== friendlyNameParts.length - 1" :size="20" /> <ChevronRight v-if="index !== props.member.principal.fullHierarchyNames.length - 1" :size="20" />
</div> </div>
</div> </div>
</td> </td>
@ -68,28 +66,32 @@ const onDeleteClicked = (e) => {
</tr> </tr>
</template> </template>
<style scoped> <style lang="scss" scoped>
td { td {
padding: 8px; padding: 8px;
} }
.friendlyNameParts {
.fullHierarchyNameParts {
display: inline-flex; display: inline-flex;
max-width: 100%; max-width: 100%;
overflow-x: clip; overflow-x: clip;
}
.friendlyNamePartP {
white-space: nowrap;
overflow: hidden;
} > div {
.friendlyNamePartP:not(:last-child) { display: inline-flex;
text-overflow: ellipsis; min-width: 20px;
}
.friendlyNamePartDiv { &:last-child {
display: inline-flex; flex-shrink: 0;
min-width: 20px; }
}
.friendlyNamePartDiv:last-child { > p {
flex-shrink: 0; white-space: nowrap;
overflow: hidden;
&:not(:last-child) {
text-overflow: ellipsis;
}
}
}
} }
</style> </style>