Commit 57eb6992 authored by S4KH's avatar S4KH Committed by Joram Wilander
Browse files

Changed constants name MIN_TEAM_LENGTH value to 2 and the error message (#4149)

parent 90715531
......@@ -3629,7 +3629,7 @@
},
{
"id": "model.team.is_valid.characters.app_error",
"translation": "Name must be 4 or more lowercase alphanumeric characters"
"translation": "Name must be 2 or more lowercase alphanumeric characters"
},
{
"id": "model.team.is_valid.company.app_error",
......
......@@ -188,7 +188,7 @@ func IsValidTeamName(s string) bool {
return false
}
if len(s) <= 3 {
if len(s) <= 1 {
return false
}
......
......@@ -84,11 +84,11 @@ var domains = []struct {
{"spin-punch-", false},
{"spin_punch", false},
{"a", false},
{"aa", false},
{"aaa", false},
{"aa", true},
{"aaa", true},
{"aaa-999b", true},
{"b00b", true},
{"b))b", false},
{"b)", false},
{"test", true},
}
......
......@@ -30,7 +30,7 @@ export default class TeamSignupDisplayNamePage extends React.Component {
this.setState({nameError: Utils.localizeMessage('create_team.display_name.required', 'This field is required')});
return;
} else if (displayName.length < Constants.MIN_TEAMNAME_LENGTH || displayName.length > Constants.MAX_TEAMNAME_LENGTH) {
this.setState({nameError: Utils.localizeMessage('create_team.display_name.charLength', 'Name must be 4 or more characters up to a maximum of 15')});
this.setState({nameError: Utils.localizeMessage('create_team.display_name.charLength', 'Name must be 2 or more characters up to a maximum of 15')});
return;
}
......
......@@ -52,6 +52,9 @@ export default class TeamUrl extends React.Component {
if (cleanedName !== name || !urlRegex.test(name)) {
this.setState({nameError: Utils.localizeMessage('create_team.team_url.regex', "Use only lower case letters, numbers and dashes. Must start with a letter and can't end in a dash.")});
return;
} else if (cleanedName.length < Constants.MIN_TEAMNAME_LENGTH || cleanedName.length > Constants.MAX_TEAMNAME_LENGTH) {
this.setState({nameError: Utils.localizeMessage('create_team.team_url.charLength', 'Name must be 2 or more characters up to a maximum of 15')});
return;
}
for (let index = 0; index < Constants.RESERVED_TEAM_NAMES.length; index++) {
......
......@@ -1108,13 +1108,13 @@
"create_post.write": "Write a message...",
"create_team.agreement": "By proceeding to create your account and use {siteName}, you agree to our <a href='/static/help/terms.html'>Terms of Service</a> and <a href='/static/help/privacy.html'>Privacy Policy</a>. If you do not agree, you cannot use {siteName}.",
"create_team.display_name.back": "Back to previous step",
"create_team.display_name.charLength": "Name must be 4 or more characters up to a maximum of 15",
"create_team.display_name.charLength": "Name must be 2 or more characters up to a maximum of 15",
"create_team.display_name.nameHelp": "Name your team in any language. Your team name shows in menus and headings.",
"create_team.display_name.next": "Next",
"create_team.display_name.required": "This field is required",
"create_team.display_name.teamName": "Team Name",
"create_team.team_url.back": "Back to previous step",
"create_team.team_url.charLength": "Name must be 4 or more characters up to a maximum of 15",
"create_team.team_url.charLength": "Name must be 2 or more characters up to a maximum of 15",
"create_team.team_url.creatingTeam": "Creating team...",
"create_team.team_url.finish": "Finish",
"create_team.team_url.hint": "<li>Short and memorable is best</li><li>Use lowercase letters, numbers and dashes</li><li>Must start with a letter and can't end in a dash</li>",
......
......@@ -1102,13 +1102,13 @@
"create_post.write": "Escribe un mensaje...",
"create_team.agreement": "Al proceder con la creación de tu cuenta y utilizar {siteName}, estás de acuerdo con nuestros <a href='/static/help/terms.html'>Términos de Servicio</a> y <a href='/static/help/privacy.html'>Políticas de Privacidad</a>. Si no estás de acuerdo, no puedes utilizar {siteName}.",
"create_team.display_name.back": "Volver al paso anterior",
"create_team.display_name.charLength": "El Nombre debe tener entre 4 y 15 caracteres",
"create_team.display_name.charLength": "El Nombre debe tener entre 2 y 15 caracteres",
"create_team.display_name.nameHelp": "Nombre de tu equipo en cualquier idioma. El nombre del equipo se muestra en menús y encabezados.",
"create_team.display_name.next": "Siguiente",
"create_team.display_name.required": "Este campo es requerido",
"create_team.display_name.teamName": "Nombre del Equipo",
"create_team.team_url.back": "Volver al paso anterior",
"create_team.team_url.charLength": "El nombre debe tener entre 4 y 15 caracteres",
"create_team.team_url.charLength": "El nombre debe tener entre 2 y 15 caracteres",
"create_team.team_url.creatingTeam": "Creando equipo...",
"create_team.team_url.finish": "Finalizar",
"create_team.team_url.hint": "<li>Corto y memorable es mejor</li><li>Utiliza letras en minúscula, números y guiones</li><li>Debe comenzar con una letra y no puede terminar en guión</li>",
......
......@@ -1102,13 +1102,13 @@
"create_post.write": "Écrire un message...",
"create_team.agreement": "En créant votre compte et en utilisant votre {siteName}, vous acceptez nos <a href='/static/help/terms.html'>Terms of Service</a> and <a href='/static/help/privacy.html'>Privacy Policy</a>. Si vous n’acceptez pas, vous ne pouvez utilisé votre {siteName}.",
"create_team.display_name.back": "Retour à l’étape précedente",
"create_team.display_name.charLength": "Le nom doit contenir de 4 à 15 caractères",
"create_team.display_name.charLength": "Le nom doit contenir de 2 à 15 caractères",
"create_team.display_name.nameHelp": "Nommez votre équipe dans toutes les langues. Votre nom d'équipe sera montré dans les menus et rubriques.",
"create_team.display_name.next": "Suivant",
"create_team.display_name.required": "Ce champ est obligatoire",
"create_team.display_name.teamName": "Nom de l'équipe",
"create_team.team_url.back": "Retour à l’étape précedente",
"create_team.team_url.charLength": "Le nom doit contenir de 4 à 15 caractères",
"create_team.team_url.charLength": "Le nom doit contenir de 2 à 15 caractères",
"create_team.team_url.creatingTeam": "Création de l'équipe...",
"create_team.team_url.finish": "Terminer",
"create_team.team_url.hint": "<li>Courte et facile à retenir</li><li>Utilisez des lettres minuscules, des chiffres et des tirets </li><li>Doit commencer par une lettre et ne peut pas se terminer par un tiret</li>",
......
......@@ -1102,13 +1102,13 @@
"create_post.write": "メッセージを書き込んでいます…",
"create_team.agreement": "アカウントを作成し{siteName}を利用する前に<a href='/static/help/terms.html'>使用条件</a>と<a href='/static/help/privacy.html'>プライバシーポリシー</a>に同意してください。同意できない場合は{siteName}は使用できません。",
"create_team.display_name.back": "前のステップに戻る",
"create_team.display_name.charLength": "名前は4文字以上の15文字以下にしてください",
"create_team.display_name.charLength": "名前は2文字以上の15文字以下にしてください",
"create_team.display_name.nameHelp": "チーム名はどんな言語でも使うことができます。チーム名はメニューと画面上部に表示されます。",
"create_team.display_name.next": "次へ",
"create_team.display_name.required": "この項目は必須です",
"create_team.display_name.teamName": "チーム名",
"create_team.team_url.back": "前のステップに戻る",
"create_team.team_url.charLength": "名前は4文字以上の15文字以下にしてください",
"create_team.team_url.charLength": "名前は2文字以上の15文字以下にしてください",
"create_team.team_url.creatingTeam": "チームを作成中です…",
"create_team.team_url.finish": "完了",
"create_team.team_url.hint": "<li>短く覚えやすいものがベストです</li><li>英小文字、数字、ダッシュを使ってください</li><li>英小文字で始めてください。ダッシュで終わることはできません</li>",
......
......@@ -1102,13 +1102,13 @@
"create_post.write": "메시지를 입력하세요...",
"create_team.agreement": "By proceeding to create your account and use {siteName}, you agree to our <a href='/static/help/terms.html'>Terms of Service</a> and <a href='/static/help/privacy.html'>Privacy Policy</a>. If you do not agree, you cannot use {siteName}.",
"create_team.display_name.back": "이전 단계로 돌아가기",
"create_team.display_name.charLength": "Name must be 4 or more characters up to a maximum of 15",
"create_team.display_name.charLength": "Name must be 2 or more characters up to a maximum of 15",
"create_team.display_name.nameHelp": "Name your team in any language. Your team name shows in menus and headings.",
"create_team.display_name.next": "다음",
"create_team.display_name.required": "필수 항목입니다.",
"create_team.display_name.teamName": "팀 이름",
"create_team.team_url.back": "이전 단계로 돌아가기",
"create_team.team_url.charLength": "Name must be 4 or more characters up to a maximum of 15",
"create_team.team_url.charLength": "Name must be 2 or more characters up to a maximum of 15",
"create_team.team_url.creatingTeam": "팀 생성 중...",
"create_team.team_url.finish": "완료",
"create_team.team_url.hint": "<li>Short and memorable is best</li><li>Use lowercase letters, numbers and dashes</li><li>Must start with a letter and can't end in a dash</li>",
......
......@@ -1108,7 +1108,7 @@
"create_team.display_name.required": "Dit is een verplicht veld",
"create_team.display_name.teamName": "Team naam",
"create_team.team_url.back": "Terug naar de vorige stap",
"create_team.team_url.charLength": "De naam moet langer zijn dan 4 tekens met een maximum van 15",
"create_team.team_url.charLength": "De naam moet langer zijn dan 2 tekens met een maximum van 15",
"create_team.team_url.creatingTeam": "Maken van team...",
"create_team.team_url.finish": "Voltooien",
"create_team.team_url.hint": "<li>Kort en gemakkelijk te onthouden is het beste</li><li>Gebruik kleine letter, nummers en streepjes</li><li>Een teamnaam moet met een letter beginnen en mag niet met een streepje eindigen</li>",
......
......@@ -1102,13 +1102,13 @@
"create_post.write": "Escreva uma mensagem...",
"create_team.agreement": "Ao prosseguir para criar sua conta e usar {siteName}, você concorda com nosso <a href='/static/help/terms.html'>Termo de Serviço</a> e <a href='/static/help/privacy.html'>Politica de Privacidade</a>. Se você não concorda, você não pode usar {siteName}.",
"create_team.display_name.back": "Voltar para o passo anterior",
"create_team.display_name.charLength": "O nome deve ser de 4 ou mais caracteres até um máximo de 15",
"create_team.display_name.charLength": "O nome deve ser de 2 ou mais caracteres até um máximo de 15",
"create_team.display_name.nameHelp": "Nome da sua equipe em qualquer idioma. Seu nome de equipe é mostrado em menus e títulos.",
"create_team.display_name.next": "Próximo",
"create_team.display_name.required": "Este campo é obrigatório",
"create_team.display_name.teamName": "Nome da Equipe",
"create_team.team_url.back": "Voltar para o passo anterior",
"create_team.team_url.charLength": "O nome deve ser de 4 ou mais caracteres até um máximo de 15",
"create_team.team_url.charLength": "O nome deve ser de 2 ou mais caracteres até um máximo de 15",
"create_team.team_url.creatingTeam": "Criando equipe...",
"create_team.team_url.finish": "Terminar",
"create_team.team_url.hint": "<li>Curto e memorizável é o melhor</li><li>Use letras minúsculas, números e traços</li><li>Deve começar com uma letra e não pode terminar em um traço</li>",
......
......@@ -1102,13 +1102,13 @@
"create_post.write": "写一个消息...",
"create_team.agreement": "如果继续创建您的帐户和使用{siteName},您需要同意<a href='/static/help/terms.html'>服务条款</a>和<a href='/static/help/privacy.html'>隐私政策</a>。如果不同意,您将不能使用{siteName}。",
"create_team.display_name.back": "返回上一步",
"create_team.display_name.charLength": "名称必须是4到15个字符",
"create_team.display_name.charLength": "名称必须是2到15个字符",
"create_team.display_name.nameHelp": "您可以使用任何语言命名您的团队。您的团队名称将显示在菜单和标题栏上。",
"create_team.display_name.next": "下一步",
"create_team.display_name.required": "此栏必须填写",
"create_team.display_name.teamName": "团队名称",
"create_team.team_url.back": "返回上一步",
"create_team.team_url.charLength": "名称必须是4到15个字符",
"create_team.team_url.charLength": "名称必须是2到15个字符",
"create_team.team_url.creatingTeam": "创建团队...",
"create_team.team_url.finish": "完成",
"create_team.team_url.hint": "<li>简短和易记为最好的</li><li>使用小写字母,数字和连字符</li><li>必须以字母开头且不能以连字符结尾</li>",
......
......@@ -1102,13 +1102,13 @@
"create_post.write": "輸入訊息...",
"create_team.agreement": "一旦建立帳號使用{siteName},即表示您同意<a href='/static/help/terms.html'>服務條款</a>以及<a href='/static/help/privacy.html'>隱私政策</a>。如果您不同意,請停止使用{siteName}。",
"create_team.display_name.back": "回到上一步",
"create_team.display_name.charLength": "名稱長度為4到15字元",
"create_team.display_name.charLength": "名稱長度為2到15字元",
"create_team.display_name.nameHelp": "團隊可以用任何語言取名。團隊名稱將會顯示在選單跟畫面上方。",
"create_team.display_name.next": "下一步",
"create_team.display_name.required": "此欄位是必需的",
"create_team.display_name.teamName": "團隊名稱",
"create_team.team_url.back": "回到上一步",
"create_team.team_url.charLength": "名稱長度為4到15字元",
"create_team.team_url.charLength": "名稱長度為2到15字元",
"create_team.team_url.creatingTeam": "建立團隊中...",
"create_team.team_url.finish": "完成",
"create_team.team_url.hint": "<li>短且好記憶是最好的</li><li>請用小寫英字母、數字及連接號(-)</li><li>請以小寫英字母開頭,請不要以連接號結尾</li>",
......
......@@ -808,8 +808,8 @@ export const Constants = {
WEBRTC_TIME_DELAY: 750,
WEBRTC_CLEAR_ERROR_DELAY: 15000,
DEFAULT_MAX_USERS_PER_TEAM: 50,
MIN_TEAMNAME_LENGTH: 2,
DEFAULT_MAX_CHANNELS_PER_TEAM: 2000,
MIN_TEAMNAME_LENGTH: 4,
MAX_TEAMNAME_LENGTH: 15,
MIN_USERNAME_LENGTH: 3,
MAX_USERNAME_LENGTH: 22,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment