]> Untitled Git - lemmy.git/commitdiff
Adding max length to user, post, and forum fields.
authorDessalines <tyhou13@gmx.com>
Thu, 18 Apr 2019 15:14:45 +0000 (08:14 -0700)
committerDessalines <tyhou13@gmx.com>
Thu, 18 Apr 2019 15:14:45 +0000 (08:14 -0700)
Fixes #76

ui/src/components/community-form.tsx
ui/src/components/login.tsx
ui/src/components/post-form.tsx
ui/src/components/setup.tsx
ui/src/components/site-form.tsx

index 0613ef4d25e0bd8287107fd2ed86cd84adca3c62..14c2a6b8c0fb6dfb02f6cc723ccbfda4dc992e90 100644 (file)
@@ -76,13 +76,13 @@ export class CommunityForm extends Component<CommunityFormProps, CommunityFormSt
         <div class="form-group row">
           <label class="col-12 col-form-label">Name</label>
           <div class="col-12">
-            <input type="text" class="form-control" value={this.state.communityForm.name} onInput={linkEvent(this, this.handleCommunityNameChange)} required minLength={3} pattern="[a-z0-9_]+" title="lowercase, underscores, and no spaces."/>
+            <input type="text" class="form-control" value={this.state.communityForm.name} onInput={linkEvent(this, this.handleCommunityNameChange)} required minLength={3} maxLength={20} pattern="[a-z0-9_]+" title="lowercase, underscores, and no spaces."/>
           </div>
         </div>
         <div class="form-group row">
           <label class="col-12 col-form-label">Title</label>
           <div class="col-12">
-            <input type="text" value={this.state.communityForm.title} onInput={linkEvent(this, this.handleCommunityTitleChange)} class="form-control" required minLength={3} />
+            <input type="text" value={this.state.communityForm.title} onInput={linkEvent(this, this.handleCommunityTitleChange)} class="form-control" required minLength={3} maxLength={100} />
           </div>
         </div>
         <div class="form-group row">
index e871acef56aa5dadc438a500e0452018f14cbb63..4d0b22d02e8fc8714d1f178fcb6bb310800ade7c 100644 (file)
@@ -98,7 +98,7 @@ export class Login extends Component<any, State> {
         <div class="form-group row">
           <label class="col-sm-2 col-form-label">Username</label>
           <div class="col-sm-10">
-            <input type="text" class="form-control" value={this.state.registerForm.username} onInput={linkEvent(this, this.handleRegisterUsernameChange)} required minLength={3} pattern="[a-zA-Z0-9_]+" />
+            <input type="text" class="form-control" value={this.state.registerForm.username} onInput={linkEvent(this, this.handleRegisterUsernameChange)} required minLength={3} maxLength={20} pattern="[a-zA-Z0-9_]+" />
           </div>
         </div>
         <div class="form-group row">
index b8ea359fd194df089bf6867d0752fb7803b8bdd9..4627ab48c535661c7004ecef2c1175522d420b66 100644 (file)
@@ -86,7 +86,7 @@ export class PostForm extends Component<PostFormProps, PostFormState> {
           <div class="form-group row">
             <label class="col-sm-2 col-form-label">Title</label>
             <div class="col-sm-10">
-              <textarea value={this.state.postForm.name} onInput={linkEvent(this, this.handlePostNameChange)} class="form-control" required rows={2} />
+              <textarea value={this.state.postForm.name} onInput={linkEvent(this, this.handlePostNameChange)} class="form-control" required rows={2} minLength={3} maxLength={100} />
             </div>
           </div>
           <div class="form-group row">
index 94480ee8292a85ab349b1fa769024a8a8d08f959..9560a60dce42313a61c57397d739b70a8fbb64de 100644 (file)
@@ -65,7 +65,7 @@ export class Setup extends Component<any, State> {
         <div class="form-group row">
           <label class="col-sm-2 col-form-label">Username</label>
           <div class="col-sm-10">
-            <input type="text" class="form-control" value={this.state.userForm.username} onInput={linkEvent(this, this.handleRegisterUsernameChange)} required minLength={3} pattern="[a-zA-Z0-9_]+" />
+            <input type="text" class="form-control" value={this.state.userForm.username} onInput={linkEvent(this, this.handleRegisterUsernameChange)} required minLength={3} maxLength={20} pattern="[a-zA-Z0-9_]+" />
           </div>
         </div>
         <div class="form-group row">
index 78a332f61835930f987fead8b8383dcb1c263b2c..7ca45b86e3aab24f632a64bbca1d567b1c67a872 100644 (file)
@@ -37,7 +37,7 @@ export class SiteForm extends Component<SiteFormProps, SiteFormState> {
         <div class="form-group row">
           <label class="col-12 col-form-label">Name</label>
           <div class="col-12">
-            <input type="text" class="form-control" value={this.state.siteForm.name} onInput={linkEvent(this, this.handleSiteNameChange)} required minLength={3} />
+            <input type="text" class="form-control" value={this.state.siteForm.name} onInput={linkEvent(this, this.handleSiteNameChange)} required minLength={3} maxLength={20} />
           </div>
         </div>
         <div class="form-group row">