|
|
@ -36,19 +36,19 @@ function onChangeRole(val: SelectValue) { |
|
|
|
|
|
|
|
|
|
|
|
<template> |
|
|
|
<template> |
|
|
|
<div ref="dropdownRef" size="lg" class="nc-roles-selector relative" @click="isDropdownOpen = !isDropdownOpen"> |
|
|
|
<div ref="dropdownRef" size="lg" class="nc-roles-selector relative" @click="isDropdownOpen = !isDropdownOpen"> |
|
|
|
<RolesBadge data-testid="roles" :role="roleRef" :inherit="inheritRef === role" :size="sizeRef" /> |
|
|
|
<RolesBadge data-testid="roles" :role="roleRef" :inherit="inheritRef === role" :size="sizeRef" clickable /> |
|
|
|
<a-select |
|
|
|
<a-select |
|
|
|
v-model:value="roleRef" |
|
|
|
v-model:value="roleRef" |
|
|
|
:open="isDropdownOpen" |
|
|
|
:open="isDropdownOpen" |
|
|
|
:dropdown-match-select-width="false" |
|
|
|
:dropdown-match-select-width="false" |
|
|
|
dropdown-class-name="!rounded-lg !h-fit max-w-64" |
|
|
|
dropdown-class-name="!rounded-lg !h-fit max-w-[350px] nc-role-selector-dropdown" |
|
|
|
class="py-1 !absolute top-0 left-0 w-full h-full z-10 text-xs opacity-0" |
|
|
|
class="py-1 !absolute top-0 left-0 w-full h-full z-10 text-xs opacity-0" |
|
|
|
@change="onChangeRole" |
|
|
|
@change="onChangeRole" |
|
|
|
> |
|
|
|
> |
|
|
|
<a-select-option v-for="rl in props.roles" :key="rl" v-e="['c:workspace:settings:user-role-change']" :value="rl"> |
|
|
|
<a-select-option v-for="rl in props.roles" :key="rl" v-e="['c:workspace:settings:user-role-change']" :value="rl"> |
|
|
|
<div |
|
|
|
<div |
|
|
|
:class="{ |
|
|
|
:class="{ |
|
|
|
'w-[350px]': descriptionRef, |
|
|
|
'w-full': descriptionRef, |
|
|
|
'w-[200px]': !descriptionRef, |
|
|
|
'w-[200px]': !descriptionRef, |
|
|
|
}" |
|
|
|
}" |
|
|
|
class="flex flex-col nc-role-select-dropdown gap-1" |
|
|
|
class="flex flex-col nc-role-select-dropdown gap-1" |
|
|
@ -57,7 +57,7 @@ function onChangeRole(val: SelectValue) { |
|
|
|
<RolesBadge :class="`nc-role-select-${rl}`" :role="rl" :inherit="inheritRef === rl" :border="false" /> |
|
|
|
<RolesBadge :class="`nc-role-select-${rl}`" :role="rl" :inherit="inheritRef === rl" :border="false" /> |
|
|
|
<GeneralIcon v-if="rl === roleRef" icon="check" class="text-primary" /> |
|
|
|
<GeneralIcon v-if="rl === roleRef" icon="check" class="text-primary" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div v-if="descriptionRef" class="text-gray-500">{{ RoleDescriptions[rl] }}</div> |
|
|
|
<div v-if="descriptionRef" class="text-gray-500 text-xs">{{ RoleDescriptions[rl] }}</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</a-select-option> |
|
|
|
</a-select-option> |
|
|
|
</a-select> |
|
|
|
</a-select> |
|
|
@ -68,4 +68,25 @@ function onChangeRole(val: SelectValue) { |
|
|
|
.ant-select-item-option-content { |
|
|
|
.ant-select-item-option-content { |
|
|
|
white-space: normal; /* Change from 'nowrap' to 'normal' */ |
|
|
|
white-space: normal; /* Change from 'nowrap' to 'normal' */ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.nc-role-selector-dropdown { |
|
|
|
|
|
|
|
.rc-virtual-list-holder { |
|
|
|
|
|
|
|
&::-webkit-scrollbar { |
|
|
|
|
|
|
|
width: 4px; |
|
|
|
|
|
|
|
height: 4px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
&::-webkit-scrollbar-track-piece { |
|
|
|
|
|
|
|
width: 0px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
&::-webkit-scrollbar { |
|
|
|
|
|
|
|
@apply bg-transparent; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
&::-webkit-scrollbar-thumb { |
|
|
|
|
|
|
|
width: 4px; |
|
|
|
|
|
|
|
@apply bg-gray-200 rounded-md; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
&::-webkit-scrollbar-thumb:hover { |
|
|
|
|
|
|
|
@apply bg-gray-300; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
</style> |
|
|
|
</style> |
|
|
|