From 814bd2ca4068c46c3bfeabecf1e3dfc929bb7b22 Mon Sep 17 00:00:00 2001 From: Kristaps Fabians Geikins Date: Tue, 20 May 2025 12:27:05 +0300 Subject: [PATCH] chore: branch -> model in error msg (#4768) * chore: branch -> model in error msg * tests fix --- .../frontend-2/lib/common/generated/gql/graphql.ts | 3 +++ packages/server/modules/core/repositories/branches.ts | 4 ++-- packages/server/modules/core/tests/branches.spec.ts | 10 +++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/packages/frontend-2/lib/common/generated/gql/graphql.ts b/packages/frontend-2/lib/common/generated/gql/graphql.ts index 3776bea1d..587e8cfb2 100644 --- a/packages/frontend-2/lib/common/generated/gql/graphql.ts +++ b/packages/frontend-2/lib/common/generated/gql/graphql.ts @@ -4210,6 +4210,7 @@ export type UserUpdateInput = { }; export type UserWorkspacesFilter = { + completed?: InputMaybe; search?: InputMaybe; }; @@ -4864,6 +4865,7 @@ export type WorkspacePaymentMethod = typeof WorkspacePaymentMethod[keyof typeof export type WorkspacePermissionChecks = { __typename?: 'WorkspacePermissionChecks'; canCreateProject: PermissionCheckResult; + canEditEmbedOptions: PermissionCheckResult; canInvite: PermissionCheckResult; canMoveProjectToWorkspace: PermissionCheckResult; }; @@ -9063,6 +9065,7 @@ export type WorkspacePaidPlanPricesFieldArgs = { } export type WorkspacePermissionChecksFieldArgs = { canCreateProject: {}, + canEditEmbedOptions: {}, canInvite: {}, canMoveProjectToWorkspace: WorkspacePermissionChecksCanMoveProjectToWorkspaceArgs, } diff --git a/packages/server/modules/core/repositories/branches.ts b/packages/server/modules/core/repositories/branches.ts index 382d65261..77ae1ef90 100644 --- a/packages/server/modules/core/repositories/branches.ts +++ b/packages/server/modules/core/repositories/branches.ts @@ -665,7 +665,7 @@ export const getModelTreeItemsTotalCountFactory = export const validateBranchName = (name: string) => { name = (name || '').trim() if (!name) { - throw new BranchNameError('Branch name is required') + throw new BranchNameError('Model name is required') } if ( @@ -678,7 +678,7 @@ export const validateBranchName = (name: string) => { name.indexOf('\\') !== -1 ) throw new BranchNameError( - 'Branch names cannot start with "#", "$", start or end with "/", have multiple slashes next to each other (e.g., "//") or contain commas or backwards slashes.', + 'Model names cannot start with "#", "$", start or end with "/", have multiple slashes next to each other (e.g., "//") or contain commas or backwards slashes.', { info: { name diff --git a/packages/server/modules/core/tests/branches.spec.ts b/packages/server/modules/core/tests/branches.spec.ts index 01e7bd0ee..f8d130081 100644 --- a/packages/server/modules/core/tests/branches.spec.ts +++ b/packages/server/modules/core/tests/branches.spec.ts @@ -324,7 +324,7 @@ describe('Branches @core-branches', () => { }) assert.fail('Illegal branch name passed through.') } catch (err) { - expect(ensureError(err).message).to.contain('Branch names cannot start with') + expect(ensureError(err).message).to.contain('Model names cannot start with') } try { @@ -336,7 +336,7 @@ describe('Branches @core-branches', () => { }) assert.fail('Illegal branch name passed through.') } catch (err) { - expect(ensureError(err).message).to.contain('Branch names cannot start with') + expect(ensureError(err).message).to.contain('Model names cannot start with') } try { @@ -350,7 +350,7 @@ describe('Branches @core-branches', () => { ) assert.fail('Illegal branch name passed through in update operation.') } catch (err) { - expect(ensureError(err).message).to.contain('Branch names cannot start with') + expect(ensureError(err).message).to.contain('Model names cannot start with') } try { @@ -364,7 +364,7 @@ describe('Branches @core-branches', () => { ) assert.fail('Illegal branch name passed through in update operation.') } catch (err) { - expect(ensureError(err).message).to.contain('Branch names cannot start with') + expect(ensureError(err).message).to.contain('Model names cannot start with') } try { @@ -376,7 +376,7 @@ describe('Branches @core-branches', () => { }) assert.fail('Illegal branch name passed through.') } catch (err) { - expect(ensureError(err).message).to.contain('Branch names cannot start with') + expect(ensureError(err).message).to.contain('Model names cannot start with') } })