|
|
@ -2,6 +2,7 @@ |
|
|
|
import { onUnmounted } from '@vue/runtime-core' |
|
|
|
import { onUnmounted } from '@vue/runtime-core' |
|
|
|
import tinycolor from 'tinycolor2' |
|
|
|
import tinycolor from 'tinycolor2' |
|
|
|
import type { Select as AntSelect } from 'ant-design-vue' |
|
|
|
import type { Select as AntSelect } from 'ant-design-vue' |
|
|
|
|
|
|
|
import type { UserFieldRecordType } from 'nocodb-sdk' |
|
|
|
import { |
|
|
|
import { |
|
|
|
ActiveCellInj, |
|
|
|
ActiveCellInj, |
|
|
|
CellClickHookInj, |
|
|
|
CellClickHookInj, |
|
|
@ -25,7 +26,7 @@ import { |
|
|
|
import MdiCloseCircle from '~icons/mdi/close-circle' |
|
|
|
import MdiCloseCircle from '~icons/mdi/close-circle' |
|
|
|
|
|
|
|
|
|
|
|
interface Props { |
|
|
|
interface Props { |
|
|
|
modelValue?: { id: string; email: string; display_name: string }[] | string | null |
|
|
|
modelValue?: UserFieldRecordType[] | string | null |
|
|
|
rowIndex?: number |
|
|
|
rowIndex?: number |
|
|
|
location?: 'cell' | 'filter' |
|
|
|
location?: 'cell' | 'filter' |
|
|
|
forceMulti?: boolean |
|
|
|
forceMulti?: boolean |
|
|
@ -75,14 +76,15 @@ const searchVal = ref<string | null>() |
|
|
|
|
|
|
|
|
|
|
|
const { isUIAllowed } = useRoles() |
|
|
|
const { isUIAllowed } = useRoles() |
|
|
|
|
|
|
|
|
|
|
|
const options = computed<{ id: string; email: string; display_name: string }[]>(() => { |
|
|
|
const options = computed<UserFieldRecordType[]>(() => { |
|
|
|
const collaborators: { id: string; email: string; display_name: string }[] = [] |
|
|
|
const collaborators: UserFieldRecordType[] = [] |
|
|
|
|
|
|
|
|
|
|
|
collaborators.push( |
|
|
|
collaborators.push( |
|
|
|
...(baseUsers.value?.map((user: any) => ({ |
|
|
|
...(baseUsers.value?.map((user: any) => ({ |
|
|
|
id: user.id, |
|
|
|
id: user.id, |
|
|
|
email: user.email, |
|
|
|
email: user.email, |
|
|
|
display_name: user.display_name, |
|
|
|
display_name: user.display_name, |
|
|
|
|
|
|
|
deleted: user.deleted, |
|
|
|
})) || []), |
|
|
|
})) || []), |
|
|
|
) |
|
|
|
) |
|
|
|
return collaborators |
|
|
|
return collaborators |
|
|
@ -309,9 +311,9 @@ const filterOption = (input: string, option: any) => { |
|
|
|
<template #suffixIcon> |
|
|
|
<template #suffixIcon> |
|
|
|
<GeneralIcon icon="arrowDown" class="text-gray-700 nc-select-expand-btn" /> |
|
|
|
<GeneralIcon icon="arrowDown" class="text-gray-700 nc-select-expand-btn" /> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
<template v-for="op of options" :key="op.id || op.email"> |
|
|
|
<a-select-option |
|
|
|
<a-select-option |
|
|
|
v-for="op of options" |
|
|
|
v-if="!op.deleted" |
|
|
|
:key="op.id || op.email" |
|
|
|
|
|
|
|
:value="op.id" |
|
|
|
:value="op.id" |
|
|
|
:data-testid="`select-option-${column.title}-${location === 'filter' ? 'filter' : rowIndex}`" |
|
|
|
:data-testid="`select-option-${column.title}-${location === 'filter' ? 'filter' : rowIndex}`" |
|
|
|
:class="`nc-select-option-${column.title}-${op.email}`" |
|
|
|
:class="`nc-select-option-${column.title}-${op.email}`" |
|
|
@ -331,6 +333,7 @@ const filterOption = (input: string, option: any) => { |
|
|
|
</span> |
|
|
|
</span> |
|
|
|
</a-tag> |
|
|
|
</a-tag> |
|
|
|
</a-select-option> |
|
|
|
</a-select-option> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
|
|
<template #tagRender="{ label, value: val, onClose }"> |
|
|
|
<template #tagRender="{ label, value: val, onClose }"> |
|
|
|
<a-tag |
|
|
|
<a-tag |
|
|
|