Skip to content
This repository was archived by the owner on Jun 13, 2025. It is now read-only.

Commit 1a00ad9

Browse files
Fix: support view
1 parent c7d9fcf commit 1a00ad9

File tree

49 files changed

+965
-121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+965
-121
lines changed

actions/whatsapp/triggers/comment-sync.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const commentSync = async (actionPayload: ActionEventPayload) => {
2727
}
2828

2929
const parentIssueComment = issueComment.parent;
30-
console.log(parentIssueComment);
30+
3131
const parentSourceMetadata = parentIssueComment
3232
? // eslint-disable-next-line @typescript-eslint/no-explicit-any
3333
(parentIssueComment.sourceMetadata as Record<string, any>)
@@ -58,7 +58,6 @@ export const commentSync = async (actionPayload: ActionEventPayload) => {
5858
return { message: 'Linked issue is not sync with source' };
5959
}
6060

61-
console.log(parentSourceMetadata);
6261
// Send a POST request to the Slack API to post the message
6362
await axios.post('http://localhost:3002/messages/broadcast', {
6463
clientId: integrationAccount.accountId,

actions/whatsapp/utils.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@ export async function isCreateTicket(
7171
let previousMessage = '';
7272
if (linkedIssue) {
7373
const linkedSourceData = linkedIssue.sourceData as JsonObject;
74-
console.log(linkedSourceData.syncedCommentId);
7574

7675
const issueComments = await getIssueCommentReplies({
7776
issueCommentId: linkedSourceData.syncedCommentId as string,
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
Warnings:
3+
4+
- A unique constraint covering the columns `[email,workspaceId]` on the table `People` will be added. If there are existing duplicate values, this will fail.
5+
- Added the required column `workspaceId` to the `People` table without a default value. This is not possible if the table is not empty.
6+
7+
*/
8+
-- AlterEnum
9+
-- This migration adds more than one value to an enum.
10+
-- With PostgreSQL versions 11 and earlier, this is not possible
11+
-- in a single migration. This can be worked around by creating
12+
-- multiple migrations, each migration adding only one value to
13+
-- the enum.
14+
15+
16+
ALTER TYPE "ModelName" ADD VALUE 'Company';
17+
ALTER TYPE "ModelName" ADD VALUE 'People';
18+
ALTER TYPE "ModelName" ADD VALUE 'Support';
19+
20+
-- DropIndex
21+
DROP INDEX "People_email_companyId_key";
22+
23+
-- AlterTable
24+
ALTER TABLE "People" ADD COLUMN "workspaceId" TEXT NOT NULL;
25+
26+
-- CreateIndex
27+
CREATE UNIQUE INDEX "People_email_workspaceId_key" ON "People"("email", "workspaceId");
28+
29+
-- AddForeignKey
30+
ALTER TABLE "People" ADD CONSTRAINT "People_workspaceId_fkey" FOREIGN KEY ("workspaceId") REFERENCES "Workspace"("id") ON DELETE RESTRICT ON UPDATE CASCADE;

apps/server/prisma/schema.prisma

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,9 @@ model People {
567567
568568
reportedIssues Support[]
569569
570-
@@unique([email, companyId])
570+
workspace Workspace @relation(fields: [workspaceId], references: [id])
571+
workspaceId String
572+
@@unique([email, workspaceId])
571573
}
572574

573575
model Project {
@@ -857,6 +859,7 @@ model Workspace {
857859
ActionEvent ActionEvent[]
858860
Conversation Conversation[]
859861
Company Company[]
862+
People People[]
860863
}
861864

862865
enum Preference {
@@ -898,6 +901,7 @@ enum ModelName {
898901
Attachment
899902
AIRequest
900903
Cycle
904+
Company
901905
Conversation
902906
ConversationHistory
903907
Emoji
@@ -914,10 +918,12 @@ enum ModelName {
914918
LinkedComment
915919
LinkedIssue
916920
Notification
921+
People
917922
Project
918923
ProjectMilestone
919924
Prompt
920925
Reaction
926+
Support
921927
SyncAction
922928
Team
923929
Template

apps/server/src/modules/people/people.service.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ export default class PeopleService {
4444
data: {
4545
...data,
4646
companyId,
47+
workspaceId,
4748
},
4849
include: {
4950
company: true,

apps/server/src/modules/replication/replication.interface.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ export const tablesToSendMessagesFor = new Map([
3838
[ModelNameEnum.Cycle, true],
3939
[ModelNameEnum.Conversation, true],
4040
[ModelNameEnum.ConversationHistory, true],
41+
[ModelNameEnum.People, true],
42+
[ModelNameEnum.Support, true],
43+
[ModelNameEnum.Company, true],
4144
]);
4245

4346
export const tablesToTrigger = new Map([

apps/server/src/modules/sync-actions/sync-actions.utils.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,25 @@ export async function getWorkspaceId(
174174
});
175175
return projectMilestone.project.workspaceId;
176176

177+
case ModelName.Company:
178+
const company = await prisma.company.findUnique({
179+
where: { id: modelId },
180+
});
181+
return company.workspaceId;
182+
183+
case ModelName.People:
184+
const people = await prisma.people.findUnique({
185+
where: { id: modelId },
186+
});
187+
return people.workspaceId;
188+
189+
case ModelName.Support:
190+
const support = await prisma.support.findUnique({
191+
where: { id: modelId },
192+
include: { issue: { include: { team: true } } },
193+
});
194+
return support.issue.team.workspaceId;
195+
177196
default:
178197
return undefined;
179198
}
@@ -302,6 +321,9 @@ export async function getModelData(
302321
IssueSuggestion: prisma.issueSuggestion,
303322
Project: prisma.project,
304323
ProjectMilestone: prisma.projectMilestone,
324+
Support: prisma.support,
325+
People: prisma.people,
326+
Company: prisma.company,
305327
};
306328

307329
const model = modelMap[modelName];

apps/server/src/modules/teams/teams.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ export default class TeamsService {
8383
...teamData,
8484
workflow: {
8585
create:
86-
preferences.teamType === 'support'
86+
preferences?.teamType === 'support'
8787
? supportWorkflowSeedData
8888
: workflowSeedData,
8989
},

apps/webapp/src/common/layouts/content-box.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const ContentBox = observer(
1616
return (
1717
<main
1818
className={cn(
19-
'p-3 pl-0 h-[calc(100vh)]',
19+
'main-container p-3 pl-0 h-[calc(100vh)]',
2020
applicationStore.sidebarCollapsed && 'pl-3',
2121
className,
2222
)}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
export interface CompanyType {
2+
id: string;
3+
createdAt: string;
4+
updatedAt: string;
5+
6+
name: string;
7+
domain?: string;
8+
website?: string;
9+
description?: string;
10+
logo?: string;
11+
industry?: string;
12+
size?: string;
13+
type?: string;
14+
15+
metadata?: string;
16+
workspaceId: string;
17+
}

0 commit comments

Comments
 (0)