Small fixes [SCI-10381][SCI-10665][SCI-10666]

This commit is contained in:
Anton 2024-04-24 12:40:29 +02:00
parent e3fbd945f8
commit 091c0612e3
3 changed files with 52 additions and 44 deletions

View file

@ -155,6 +155,7 @@ let inlineEditing = (function() {
if (inputField(container).attr('disabled')) {
saveAllEditFields();
let input = inputField(container);
input.val(container.attr('data-original-name'));
input.attr('disabled', false)
.removeClass('hidden')
.focus();

View file

@ -1,44 +1,44 @@
<template>
<div>
<div v-if="roles.length > 0 && visible && default_role" class="p-2 flex items-center gap-2 border-solid border-0 border-b border-b-sn-sleepy-grey">
<div>
<img src="/images/icon/team.png" class="rounded-full w-8 h-8">
</div>
<div>
{{ i18n.t('access_permissions.everyone_else', { team_name: params.object.team }) }}
</div>
<GeneralDropdown @open="loadUsers" @close="closeFlyout">
<template v-slot:field>
<i class="sn-icon sn-icon-info"></i>
</template>
<template v-slot:flyout>
<perfect-scrollbar class="flex flex-col max-h-96 max-w-[280px] relative pr-4 gap-y-px">
<div v-for="user in this.autoAssignedUsers"
:key="user.attributes.user.id"
:title="user.attributes.user.name"
class="rounded px-3 py-2.5 flex items-center hover:no-underline leading-5 gap-2">
<img :src="user.attributes.user.avatar_url" class="w-6 h-6 rounded-full">
<span class="truncate">{{ user.attributes.user.name }}</span>
</div>
</perfect-scrollbar>
</template>
</GeneralDropdown>
<MenuDropdown
v-if="params.object.top_level_assignable && params.object.urls.update_access"
class="ml-auto"
:listItems="rolesFromatted(default_role)"
:btnText="this.roles.find((role) => role[0] == default_role)[1]"
:position="'right'"
:caret="true"
@setRole="(...args) => this.changeDefaultRole(...args)"
@removeRole="() => this.changeDefaultRole()"
></MenuDropdown>
<div class="ml-auto btn btn-light pointer-events-none" v-else>
{{ this.roles.find((role) => role[0] == default_role)[1] }}
<div class="h-6 w-6"></div>
</div>
</div>
<perfect-scrollbar class="h-[50vh] relative">
<div v-if="roles.length > 0 && visible && default_role" class="p-2 flex items-center gap-2 border-solid border-0 border-b border-b-sn-sleepy-grey">
<div>
<img src="/images/icon/team.png" class="rounded-full w-8 h-8">
</div>
<div>
{{ i18n.t('access_permissions.everyone_else', { team_name: params.object.team }) }}
</div>
<GeneralDropdown @open="loadUsers" @close="closeFlyout">
<template v-slot:field>
<i class="sn-icon sn-icon-info"></i>
</template>
<template v-slot:flyout>
<perfect-scrollbar class="flex flex-col max-h-96 max-w-[280px] relative pr-4 gap-y-px">
<div v-for="user in this.autoAssignedUsers"
:key="user.attributes.user.id"
:title="user.attributes.user.name"
class="rounded px-3 py-2.5 flex items-center hover:no-underline leading-5 gap-2">
<img :src="user.attributes.user.avatar_url" class="w-6 h-6 rounded-full">
<span class="truncate">{{ user.attributes.user.name }}</span>
</div>
</perfect-scrollbar>
</template>
</GeneralDropdown>
<MenuDropdown
v-if="params.object.top_level_assignable && params.object.urls.update_access"
class="ml-auto"
:listItems="rolesFromatted(default_role)"
:btnText="this.roles.find((role) => role[0] == default_role)[1]"
:position="'right'"
:caret="true"
@setRole="(...args) => this.changeDefaultRole(...args)"
@removeRole="() => this.changeDefaultRole()"
></MenuDropdown>
<div class="ml-auto btn btn-light pointer-events-none" v-else>
{{ this.roles.find((role) => role[0] == default_role)[1] }}
<div class="h-6 w-6"></div>
</div>
</div>
<div v-for="userAssignment in manuallyAssignedUsers"
:key="userAssignment.id"
class="p-2 flex items-center gap-2">

View file

@ -1,11 +1,18 @@
<template>
<div :title="text" class="flex items-center">
<div class="truncate">
{{ text.slice(0, endCharacters * -1) }}
</div>
<div class="shrink-0">
{{ text.slice(text.length - endCharacters) }}
</div>
<template v-if="text.length <= endCharacters">
<div class="shrink-0">
{{ text }}
</div>
</template>
<template v-else>
<div class="truncate">
{{ text.slice(0, endCharacters * -1) }}
</div>
<div class="shrink-0">
{{ text.slice(text.length - endCharacters) }}
</div>
</template>
</div>
</template>