Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(all): Add reply to convo #154

Merged
merged 19 commits into from
Mar 26, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add convomessage metadata
  • Loading branch information
McPizza0 committed Mar 24, 2024
commit f8485df2f61cd237707a0bf41d06e0713d9b1075
24 changes: 23 additions & 1 deletion apps/platform/trpc/routers/convoRouter/entryRouter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ export const convoEntryRouter = router({
publicId: true,
createdAt: true,
body: true,
type: true
type: true,
metadata: true
},
with: {
subject: {
Expand All @@ -153,6 +154,27 @@ export const convoEntryRouter = router({
}
});

// for each of the email.to, email.cc and email.from arrays from the metadata, set all entries.id fields to 0
convoEntriesQuery.forEach((entry) => {
if (entry.metadata?.email) {
if (entry.metadata.email.to) {
entry.metadata.email.to.forEach((to) => {
to.id = 0;
});
}
if (entry.metadata.email.cc) {
entry.metadata.email.cc.forEach((cc) => {
cc.id = 0;
});
}
if (entry.metadata.email.from) {
entry.metadata.email.from.forEach((from) => {
from.id = 0;
});
}
}
});

return {
entries: convoEntriesQuery
};
Expand Down
20 changes: 14 additions & 6 deletions apps/web-app/components/convos/convoMessageItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,11 @@
class="text-sm leading-none">
{{ author.name }}
</span>
<UnUiTooltip :text="props.entry.createdAt.toLocaleString()">
<span class="text-xs leading-none text-gray-500">
{{ timeAgo }}
</span>
</UnUiTooltip>
<span
v-if="props.entry.metadata?.email?.from?.[0]?.email"
class="text-base-9 text-xs">
- via {{ props.entry.metadata?.email.from[0].email }}</span
>
</div>
<div class="flex flex-row gap-0">
<UnUiTooltip text="Report a bug">
Expand Down Expand Up @@ -130,10 +130,18 @@
</UnUiTooltip>
</div>
</div>
<!-- eslint-disable vue/no-v-html -->
<div
class="rounded-br-x w-full overflow-hidden rounded-bl-xl p-2 shadow-md"
:class="convoBubbleClasses"
v-html="convoEntryBody"></div>
v-html="convoEntryBody" />
<div class="flex flex-row justify-end">
<UnUiTooltip :text="props.entry.createdAt.toLocaleString()">
<span class="text-base-9 text-xs leading-none">
{{ timeAgo }}
</span>
</UnUiTooltip>
</div>
</div>
</div>
</div>
Expand Down