mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-18 14:47:38 +01:00
Merge pull request #9999 from reasonerjt/fix-project-length
Update minimum length of project name
This commit is contained in:
commit
87a507b039
@ -50,7 +50,7 @@ type ProjectAPI struct {
|
||||
}
|
||||
|
||||
const projectNameMaxLen int = 255
|
||||
const projectNameMinLen int = 2
|
||||
const projectNameMinLen int = 1
|
||||
const restrictedNameChars = `[a-z0-9]+(?:[._-][a-z0-9]+)*`
|
||||
|
||||
// Prepare validates the URL and the user
|
||||
|
@ -119,7 +119,7 @@ func TestAddProject(t *testing.T) {
|
||||
// case 4: response code = 400 : Project name is illegal in length
|
||||
fmt.Println("case 4 : response code = 400 : Project name is illegal in length ")
|
||||
|
||||
result, err = apiTest.ProjectsPost(*admin, apilib.ProjectReq{ProjectName: "t", Metadata: map[string]string{models.ProMetaPublic: "true"}})
|
||||
result, err = apiTest.ProjectsPost(*admin, apilib.ProjectReq{ProjectName: "", Metadata: map[string]string{models.ProMetaPublic: "true"}})
|
||||
if err != nil {
|
||||
t.Error("Error while creat project", err.Error())
|
||||
t.Log(err)
|
||||
|
@ -8,7 +8,7 @@
|
||||
<div class="clr-control-container" [class.clr-error]="!isNameValid">
|
||||
<div class="clr-input-wrapper">
|
||||
<input type="text" id="create_project_name" [(ngModel)]="project.name" name="create_project_name" class="clr-input input-width"
|
||||
required pattern="^[a-z0-9]+(?:[._-][a-z0-9]+)*$" minlength="2" #projectName="ngModel" autocomplete="off"
|
||||
required pattern="^[a-z0-9]+(?:[._-][a-z0-9]+)*$" #projectName="ngModel" autocomplete="off"
|
||||
(keyup)='handleValidation()'>
|
||||
<clr-icon class="clr-validate-icon" shape="exclamation-circle"></clr-icon>
|
||||
<span class="spinner spinner-inline" [hidden]="!checkOnGoing"></span>
|
||||
|
@ -214,9 +214,8 @@
|
||||
"PUBLIC_PROJECTS": "Public Projects",
|
||||
"PROJECT": "Project",
|
||||
"NEW_PROJECT": "New Project",
|
||||
"NAME_TOOLTIP": "Project name should be at least 2 characters long with lower case characters, numbers and ._- and must be start with characters or numbers.",
|
||||
"NAME_TOOLTIP": "Project name should be 1~255 characters long with lower case characters, numbers and ._- and must be start with characters or numbers.",
|
||||
"NAME_IS_REQUIRED": "Project name is required.",
|
||||
"NAME_MINIMUM_LENGTH": "Project name is too short, it should be greater than 2 characters.",
|
||||
"NAME_ALREADY_EXISTS": "Project name already exists.",
|
||||
"NAME_IS_ILLEGAL": "Project name is invalid.",
|
||||
"UNKNOWN_ERROR": "An unknown error occurred while creating the project.",
|
||||
|
@ -214,10 +214,9 @@
|
||||
"PUBLIC_PROJECTS": "Public Projects",
|
||||
"PROJECT": "Proyecto",
|
||||
"NEW_PROJECT": "Nuevo proyecto",
|
||||
"NAME_TOOLTIP": "Project name should be at least 2 characters long with lower case characters, numbers and ._- and must be start with characters or numbers.",
|
||||
"NAME_TOOLTIP": "Project name should be 1~255 characters long with lower case characters, numbers and ._- and must be start with characters or numbers.",
|
||||
"DESTINATION_NAME_TOOLTIP": "Destination name should be at least 2 characters long with lower case characters, numbers and ._- and must be start with characters or numbers.",
|
||||
"NAME_IS_REQUIRED": "El nombre del proyecto es obligatorio.",
|
||||
"NAME_MINIMUM_LENGTH": "El nombre del proyecto es demasiado corto, debe ser mayor de 2 caracteres.",
|
||||
"NAME_ALREADY_EXISTS": "Ya existe un proyecto con ese nombre.",
|
||||
"NAME_IS_ILLEGAL": "El nombre del proyecto no es valido.",
|
||||
"UNKNOWN_ERROR": "Ha ocurrido un error al crear el proyecto.",
|
||||
|
@ -208,9 +208,8 @@
|
||||
"PUBLIC_PROJECTS": "Projets Publics",
|
||||
"PROJECT": "Projet",
|
||||
"NEW_PROJECT": "Nouveau Projet",
|
||||
"NAME_TOOLTIP": "Le nom du projet doit comporter au moins 2 caractères avec des minuscules, des chiffres et. _- et doit commencer par des caractères ou des chiffres.",
|
||||
"NAME_TOOLTIP": "Le nom du projet doit comporter 1~255 caractères avec des minuscules, des chiffres et. _- et doit commencer par des caractères ou des chiffres.",
|
||||
"NAME_IS_REQUIRED": "Le nom du projet est obligatoire.",
|
||||
"NAME_MINIMUM_LENGTH": "Le nom du projet est trop court, il doit être supérieur à 2 caractères.",
|
||||
"NAME_ALREADY_EXISTS": "Le nom du projet existe déjà.",
|
||||
"NAME_IS_ILLEGAL": "Le nom du projet est invalide.",
|
||||
"UNKNOWN_ERROR": "Une erreur inconnue s'est produite lors de la création du projet.",
|
||||
|
@ -212,9 +212,8 @@
|
||||
"PUBLIC_PROJECTS": "Projetos Públicos",
|
||||
"PROJECT": "Projeto",
|
||||
"NEW_PROJECT": "Novo Projeto",
|
||||
"NAME_TOOLTIP": "Nome do projeto deve conter ao menos 2 caracteres sendo minusculos, números e ._- e deve iniciar com letras ou números.",
|
||||
"NAME_TOOLTIP": "Nome do projeto deve conter 1~255 caracteres sendo minusculos, números e ._- e deve iniciar com letras ou números.",
|
||||
"NAME_IS_REQUIRED": "Nome do projeto é obrigatório.",
|
||||
"NAME_MINIMUM_LENGTH": "Nome do projeto é muito curto, deve conter ao menos 2 caracteres.",
|
||||
"NAME_ALREADY_EXISTS": "Nome do projeto já existe.",
|
||||
"NAME_IS_ILLEGAL": "Nome do projeto é inválido.",
|
||||
"UNKNOWN_ERROR": "Um erro desconhecido ocorreu ao criar o projeto.",
|
||||
|
@ -214,9 +214,8 @@
|
||||
"PUBLIC_PROJECTS": "Genel Projeler",
|
||||
"PROJECT": "Proje",
|
||||
"NEW_PROJECT": "Yeni Proje",
|
||||
"NAME_TOOLTIP": "Proje adı, en az 2 karakter uzunluğunda, küçük harf, rakam ve ._- ile yazılmalı ve karakter veya rakamlarla başlamalıdır.",
|
||||
"NAME_TOOLTIP": "Proje adı, en az 1~255 karakter uzunluğunda, küçük harf, rakam ve ._- ile yazılmalı ve karakter veya rakamlarla başlamalıdır.",
|
||||
"NAME_IS_REQUIRED": "Proje adı gerekli.",
|
||||
"NAME_MINIMUM_LENGTH": "Proje adı çok kısa, 2 karakterden büyük olmalıdır.",
|
||||
"NAME_ALREADY_EXISTS": "Proje adı zaten var.",
|
||||
"NAME_IS_ILLEGAL": "Proje adı geçersiz.",
|
||||
"UNKNOWN_ERROR": "Proje oluşturulurken bilinmeyen bir hata oluştu.",
|
||||
|
@ -213,9 +213,8 @@
|
||||
"PUBLIC_PROJECTS": "公开项目",
|
||||
"PROJECT": "项目",
|
||||
"NEW_PROJECT": "新建项目",
|
||||
"NAME_TOOLTIP": "项目名称由小写字符、数字和._-组成且至少2个字符并以字符或者数字开头。",
|
||||
"NAME_TOOLTIP": "项目名称由小写字符、数字和._-组成且至少1个字符并以字符或者数字开头。",
|
||||
"NAME_IS_REQUIRED": "项目名称为必填项。",
|
||||
"NAME_MINIMUM_LENGTH": "项目名称长度过短,至少多于2个字符。",
|
||||
"NAME_ALREADY_EXISTS": "项目名称已存在。",
|
||||
"NAME_IS_ILLEGAL": "项目名称非法。",
|
||||
"UNKNOWN_ERROR": "创建项目时发生未知错误。",
|
||||
|
Loading…
Reference in New Issue
Block a user