diff --git a/cmd/conversation.go b/cmd/conversation.go index 1839fbdd..aacb5b92 100644 --- a/cmd/conversation.go +++ b/cmd/conversation.go @@ -567,7 +567,7 @@ func calculateSLA(app *App, conversation *cmodels.Conversation) error { // sendCSATSurvey sends a CSAT survey if enabled on the inbox. func sendCSATSurvey(app *App, conversation cmodels.Conversation, user umodels.User) error { - inbox, err := app.inbox.GetByID(conversation.InboxID) + inbox, err := app.inbox.GetDBRecord(conversation.InboxID) if err != nil { return err } diff --git a/cmd/inboxes.go b/cmd/inboxes.go index 9baeb0f1..d6015934 100644 --- a/cmd/inboxes.go +++ b/cmd/inboxes.go @@ -23,7 +23,7 @@ func handleGetInbox(r *fastglue.Request) error { app = r.Context.(*App) id, _ = strconv.Atoi(r.RequestCtx.UserValue("id").(string)) ) - inbox, err := app.inbox.GetByID(id) + inbox, err := app.inbox.GetDBRecord(id) if err != nil { return r.SendErrorEnvelope(fasthttp.StatusInternalServerError, "Error fetching inbox", nil, envelope.GeneralError) } @@ -74,7 +74,7 @@ func handleUpdateInbox(r *fastglue.Request) error { } if err := reloadInboxes(app); err != nil { - return r.SendErrorEnvelope(fasthttp.StatusInternalServerError, "Error reloading inboxes", nil, envelope.GeneralError) + return r.SendErrorEnvelope(fasthttp.StatusInternalServerError, "Error reloading inboxes, Please restart the app if the issue persists", nil, envelope.GeneralError) } return r.SendEnvelope(inbox) diff --git a/cmd/init.go b/cmd/init.go index fe7ac653..a93102be 100644 --- a/cmd/init.go +++ b/cmd/init.go @@ -471,11 +471,11 @@ func initEmailInbox(inboxRecord imodels.Inbox, store inbox.MessageStore) (inbox. // Load JSON data into Koanf. if err := ko.Load(rawbytes.Provider([]byte(inboxRecord.Config)), kjson.Parser()); err != nil { - log.Fatalf("error loading config: %v", err) + return nil, fmt.Errorf("loading config: %w", err) } if err := ko.UnmarshalWithConf("", &config, koanf.UnmarshalConf{Tag: "json"}); err != nil { - log.Fatalf("error unmarshalling `%s` %s config: %v", inboxRecord.Channel, inboxRecord.Name, err) + return nil, fmt.Errorf("unmarshalling `%s` %s config: %w", inboxRecord.Channel, inboxRecord.Name, err) } if len(config.SMTP) == 0 { @@ -499,11 +499,10 @@ func initEmailInbox(inboxRecord imodels.Inbox, store inbox.MessageStore) (inbox. }) if err != nil { - log.Fatalf("ERROR: initalizing `%s` inbox: `%s` error : %v", inboxRecord.Channel, inboxRecord.Name, err) - return nil, err + return nil, fmt.Errorf("initializing `%s` inbox: `%s` error : %w", inboxRecord.Channel, inboxRecord.Name, err) } - log.Printf("`%s` inbox successfully initalized. %d smtp servers. %d imap clients.", inboxRecord.Name, len(config.SMTP), len(config.IMAP)) + log.Printf("`%s` inbox successfully initialized. %d SMTP servers. %d IMAP clients.", inboxRecord.Name, len(config.SMTP), len(config.IMAP)) return inbox, nil } diff --git a/frontend/package.json b/frontend/package.json index 56f15871..62ac2fe0 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -61,10 +61,10 @@ "vue-picture-cropper": "^0.7.0", "vue-router": "^4.2.5", "vue-sonner": "^1.3.0", + "vue3-emoji-picker": "^1.1.8", "zod": "^3.23.8" }, "devDependencies": { - "@iconify/vue": "^4.1.2", "@rushstack/eslint-patch": "^1.3.3", "@vitejs/plugin-vue": "^5.0.3", "@vue/eslint-config-prettier": "^8.0.0", diff --git a/frontend/src/components/admin/inbox/formSchema.js b/frontend/src/components/admin/inbox/formSchema.js index bc926256..0c7cb138 100644 --- a/frontend/src/components/admin/inbox/formSchema.js +++ b/frontend/src/components/admin/inbox/formSchema.js @@ -2,9 +2,9 @@ import * as z from 'zod' import { isGoDuration } from '@/utils/strings' export const formSchema = z.object({ - name2: z.string().describe('Name').default(''), + name: z.string().describe('Name').default(''), from: z.string().describe('From address').default(''), - csat_enabled: z.boolean().describe('Enable CSAT').default(false), + csat_enabled: z.boolean().describe('Enable CSAT'), imap: z .object({ host: z.string().describe('Host').default('imap.gmail.com'), diff --git a/frontend/src/components/conversation/ReplyBox.vue b/frontend/src/components/conversation/ReplyBox.vue index 2bdd851d..d5fd44c1 100644 --- a/frontend/src/components/conversation/ReplyBox.vue +++ b/frontend/src/components/conversation/ReplyBox.vue @@ -64,10 +64,11 @@ + + :handleSend="handleSend" @emojiSelect="handleEmojiSelect"> @@ -92,9 +93,7 @@ import AttachmentsPreview from '@/components/attachment/AttachmentsPreview.vue' import ReplyBoxBottomMenuBar from '@/components/conversation/ReplyBoxMenuBar.vue' const conversationStore = useConversationStore() - const emitter = useEmitter() - let editorInstance = ref(null) const isEditorFullscreen = ref(false) const cursorPosition = ref(0) @@ -330,4 +329,8 @@ const selectCannedResponse = (content) => { filteredCannedResponses.value = [] selectedResponseIndex.value = -1 } + +const handleEmojiSelect = (emoji) => { + editorInstance.value.chain().focus().insertContent(emoji).run() +} diff --git a/frontend/src/components/conversation/ReplyBoxMenuBar.vue b/frontend/src/components/conversation/ReplyBoxMenuBar.vue index 6da16a0a..df270963 100644 --- a/frontend/src/components/conversation/ReplyBoxMenuBar.vue +++ b/frontend/src/components/conversation/ReplyBoxMenuBar.vue @@ -1,22 +1,18 @@