mirror of
https://github.com/abhinavxd/libredesk.git
synced 2025-11-13 10:25:44 +00:00
feat: allow sending attachments in new conversations
- replace existing combobox selects with common component selectcombobox.vue
This commit is contained in:
@@ -48,63 +48,17 @@
|
||||
class="w-48"
|
||||
v-if="action.type && conversationActions[action.type]?.type === 'select'"
|
||||
>
|
||||
<ComboBox
|
||||
<SelectComboBox
|
||||
v-model="action.value[0]"
|
||||
:items="conversationActions[action.type]?.options"
|
||||
:placeholder="t('form.field.select')"
|
||||
@select="handleValueChange($event, index)"
|
||||
>
|
||||
<template #item="{ item }">
|
||||
<div class="flex items-center gap-2 ml-2">
|
||||
<Avatar v-if="action.type === 'assign_user'" class="w-7 h-7">
|
||||
<AvatarImage :src="item.avatar_url || ''" :alt="item.label.slice(0, 2)" />
|
||||
<AvatarFallback>
|
||||
{{ item.label.slice(0, 2).toUpperCase() }}
|
||||
</AvatarFallback>
|
||||
</Avatar>
|
||||
<span v-if="action.type === 'assign_team'">
|
||||
{{ item.emoji }}
|
||||
</span>
|
||||
<span>{{ item.label }}</span>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<template #selected="{ selected }">
|
||||
<div v-if="action.type === 'assign_team'">
|
||||
<div v-if="selected" class="flex items-center gap-2">
|
||||
{{ selected.emoji }}
|
||||
<span>{{ selected.label }}</span>
|
||||
</div>
|
||||
<span v-else>{{ $t('form.field.selectTeam') }}</span>
|
||||
</div>
|
||||
|
||||
<div v-else-if="action.type === 'assign_user'" class="flex items-center gap-2">
|
||||
<div v-if="selected" class="flex items-center gap-2">
|
||||
<Avatar class="w-7 h-7">
|
||||
<AvatarImage
|
||||
:src="selected.avatar_url ?? ''"
|
||||
:alt="selected.label.slice(0, 2)"
|
||||
/>
|
||||
<AvatarFallback>
|
||||
{{ selected.label.slice(0, 2).toUpperCase() }}
|
||||
</AvatarFallback>
|
||||
</Avatar>
|
||||
<span>{{ selected.label }}</span>
|
||||
</div>
|
||||
<span v-else>{{ $t('form.field.selectUser') }}</span>
|
||||
</div>
|
||||
<span v-else>
|
||||
<span v-if="!selected"> {{ $t('form.field.select') }}</span>
|
||||
<span v-else>{{ selected.label }} </span>
|
||||
</span>
|
||||
</template>
|
||||
</ComboBox>
|
||||
:type="action.type === 'assign_team' ? 'team' : 'user'"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cursor-pointer" @click.prevent="removeAction(index)">
|
||||
<X size="16" />
|
||||
</div>
|
||||
<CloseButton :onClose="() => removeAction(index)" />
|
||||
</div>
|
||||
|
||||
<div
|
||||
@@ -133,7 +87,7 @@
|
||||
<script setup>
|
||||
import { toRefs } from 'vue'
|
||||
import { Button } from '@/components/ui/button'
|
||||
import { X } from 'lucide-vue-next'
|
||||
import CloseButton from '@/components/button/CloseButton.vue'
|
||||
import { useTagStore } from '@/stores/tag'
|
||||
import {
|
||||
Select,
|
||||
@@ -143,13 +97,12 @@ import {
|
||||
SelectTrigger,
|
||||
SelectValue
|
||||
} from '@/components/ui/select'
|
||||
import ComboBox from '@/components/ui/combobox/ComboBox.vue'
|
||||
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'
|
||||
import { SelectTag } from '@/components/ui/select'
|
||||
import { useConversationFilters } from '@/composables/useConversationFilters'
|
||||
import { getTextFromHTML } from '@/utils/strings.js'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
import Editor from '@/features/conversation/ConversationTextEditor.vue'
|
||||
import SelectComboBox from '@/components/combobox/SelectCombobox.vue'
|
||||
|
||||
const props = defineProps({
|
||||
actions: {
|
||||
|
||||
Reference in New Issue
Block a user