summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDessalines <tyhou13@gmx.com>2019-04-18 08:14:45 -0700
committerDessalines <tyhou13@gmx.com>2019-04-18 08:14:45 -0700
commit927dcd8191846e4493b55bf1dca8c6efc6815893 (patch)
treeedbc1a08a45af72210feb289045ea9a2c98c82d6
parentfdf547354f225621763fdc46c9b099ed05789271 (diff)
Adding max length to user, post, and forum fields.
Fixes #76
-rw-r--r--ui/src/components/community-form.tsx4
-rw-r--r--ui/src/components/login.tsx2
-rw-r--r--ui/src/components/post-form.tsx2
-rw-r--r--ui/src/components/setup.tsx2
-rw-r--r--ui/src/components/site-form.tsx2
5 files changed, 6 insertions, 6 deletions
diff --git a/ui/src/components/community-form.tsx b/ui/src/components/community-form.tsx
index 0613ef4d..14c2a6b8 100644
--- a/ui/src/components/community-form.tsx
+++ b/ui/src/components/community-form.tsx
@@ -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">
diff --git a/ui/src/components/login.tsx b/ui/src/components/login.tsx
index e871acef..4d0b22d0 100644
--- a/ui/src/components/login.tsx
+++ b/ui/src/components/login.tsx
@@ -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">
diff --git a/ui/src/components/post-form.tsx b/ui/src/components/post-form.tsx
index b8ea359f..4627ab48 100644
--- a/ui/src/components/post-form.tsx
+++ b/ui/src/components/post-form.tsx
@@ -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">
diff --git a/ui/src/components/setup.tsx b/ui/src/components/setup.tsx
index 94480ee8..9560a60d 100644
--- a/ui/src/components/setup.tsx
+++ b/ui/src/components/setup.tsx
@@ -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">
diff --git a/ui/src/components/site-form.tsx b/ui/src/components/site-form.tsx
index 78a332f6..7ca45b86 100644
--- a/ui/src/components/site-form.tsx
+++ b/ui/src/components/site-form.tsx
@@ -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">