Merge pull request #2343 from internet2000/master
Some checks failed
Run build / build (push) Has been cancelled
Run formatter / check-code-formatting (push) Has been cancelled
Run lint / run-lint (push) Has been cancelled
Build and push the edge image / run-pre-checks (push) Has been cancelled
Build and push the edge image / build-publish-docker-hub (push) Has been cancelled

Allow numbers in project name, fix #2130
This commit is contained in:
Kasra Bigdeli
2025-09-29 22:16:44 -07:00
committed by GitHub

View File

@@ -30,7 +30,7 @@ function isNameAllowed(name: string) {
const isNameFormattingOk =
!!name &&
name.length < 50 &&
/^[a-z]/.test(name) &&
/^[a-z0-9]/.test(name) &&
/[a-z0-9]$/.test(name) &&
/^[a-z0-9\-]+$/.test(name) &&
name.indexOf('--') < 0
@@ -242,7 +242,7 @@ class AppsDataStore {
if (!isNameAllowed(appName)) {
throw ApiStatusCodes.createError(
ApiStatusCodes.STATUS_ERROR_BAD_NAME,
'App Name is not allowed. Only lowercase letters and single hyphens are allowed'
'App Name is not allowed. Only lowercase letters, numbers and single hyphens are allowed'
)
}
@@ -873,7 +873,7 @@ class AppsDataStore {
reject(
ApiStatusCodes.createError(
ApiStatusCodes.STATUS_ERROR_BAD_NAME,
'App Name is not allowed. Only lowercase letters and single hyphens are allowed'
'App Name is not allowed. Only lowercase letters, numbers and single hyphens are allowed'
)
)
return
@@ -915,7 +915,7 @@ class AppsDataStore {
reject(
ApiStatusCodes.createError(
ApiStatusCodes.STATUS_ERROR_BAD_NAME,
'App Name is not allowed. Only lowercase letters and single hyphens are allowed'
'App Name is not allowed. Only lowercase letters, numbers and single hyphens are allowed'
)
)
return