chore: branch -> model in error msg (#4768)

* chore: branch -> model in error msg

* tests fix
This commit is contained in:
Kristaps Fabians Geikins
2025-05-20 12:27:05 +03:00
committed by GitHub
parent 854deffdcb
commit 814bd2ca40
3 changed files with 10 additions and 7 deletions
@@ -4210,6 +4210,7 @@ export type UserUpdateInput = {
};
export type UserWorkspacesFilter = {
completed?: InputMaybe<Scalars['Boolean']['input']>;
search?: InputMaybe<Scalars['String']['input']>;
};
@@ -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,
}
@@ -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
@@ -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')
}
})