From 075fb82907ae62b40e547df5b0c7bd760ebe015d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20Jedlicska?= <57442769+gjedlicska@users.noreply.github.com> Date: Wed, 28 Jun 2023 09:17:55 +0200 Subject: [PATCH] add FE2 terminology to commit create webhook (#1657) --- .../modules/activitystream/services/commitActivity.ts | 11 ++++++++++- .../server/modules/cli/commands/download/commit.ts | 1 + .../server/modules/core/services/commit/management.ts | 9 ++++++++- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/packages/server/modules/activitystream/services/commitActivity.ts b/packages/server/modules/activitystream/services/commitActivity.ts index 14f649349..7b932a134 100644 --- a/packages/server/modules/activitystream/services/commitActivity.ts +++ b/packages/server/modules/activitystream/services/commitActivity.ts @@ -21,6 +21,7 @@ export async function addCommitCreatedActivity(params: { userId: string input: CommitCreateInput branchName: string + modelId: string commit: CommitRecord }) { const { commitId, input, streamId, userId, branchName, commit } = params @@ -31,7 +32,15 @@ export async function addCommitCreatedActivity(params: { resourceId: commitId, actionType: ActionTypes.Commit.Create, userId, - info: { id: commitId, commit: input }, + info: { + id: commitId, + commit: { + ...input, + projectId: streamId, + modelId: params.modelId, + versionId: commit.id + } + }, message: `Commit created on branch ${branchName}: ${commitId} (${input.message})` }), pubsub.publish(CommitPubsubEvents.CommitCreated, { diff --git a/packages/server/modules/cli/commands/download/commit.ts b/packages/server/modules/cli/commands/download/commit.ts index 164b82ab9..4b499925f 100644 --- a/packages/server/modules/cli/commands/download/commit.ts +++ b/packages/server/modules/cli/commands/download/commit.ts @@ -194,6 +194,7 @@ const saveNewCommit = async (commit: Commit, localResources: LocalResources) => totalChildrenCount }, branchName: targetBranch.name, + modelId: targetBranch.id, commit: newCommit }) diff --git a/packages/server/modules/core/services/commit/management.ts b/packages/server/modules/core/services/commit/management.ts index 4cc056895..19159813d 100644 --- a/packages/server/modules/core/services/commit/management.ts +++ b/packages/server/modules/core/services/commit/management.ts @@ -141,7 +141,14 @@ export async function createCommitByBranchName( streamId, userId: authorId, branchName, - input: { ...commit, branchName, objectId, streamId }, + input: { + ...commit, + branchName, + objectId, + streamId + }, + // the new FE2 term for a branchId + modelId: myBranch.id, commit }) }