Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1630 from benetech/frontend_v2
Browse files Browse the repository at this point in the history
#1620 - add title length validation
  • Loading branch information
rupeshparab authored Jan 10, 2021
2 parents 06d16fa + 7b16b3e commit 480a17f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/components/Home/components/NewProblemsForm/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ div.row {
.container table {
width: calc(100% - 20px);
margin: 10px;
min-width: 950px;
table-layout: fixed;

.headerRow {
th[scope='col'] {
Expand Down Expand Up @@ -75,7 +75,9 @@ div.row {
}

.titleCell {
width: 320px;
width: 350px;
padding-left: 10px;
padding-right: 45px;
}

.tableControlHeader {
Expand All @@ -92,6 +94,8 @@ div.row {
cursor: pointer;
display: flex;
justify-content: flex-end;
background: white;
position: relative;

> span {
display: inherit;
Expand Down
2 changes: 2 additions & 0 deletions src/components/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@ class App extends Component {
} else {
message = Locales.strings.no_problem_title_warning;
}
} else if ($.trim(text).length > 2000) {
message = Locales.strings.title_max_length;
} else if (problemList.theActiveMathField.$latex() === '' && image === null) {
message = Locales.strings.no_problem_equation_or_image_warning;
}
Expand Down
1 change: 1 addition & 0 deletions src/strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ class Locales {
thanks_for_mobile_notfiy: 'Thanks, we will notify you once we add mobile compatibility',
the: 'The',
title: 'Title',
title_max_length: 'Max length of title is 2000 characters',
to_mathshare_twitter: 'Twitter',
to_mathshare_youtube: 'YouTube',
to_track: 'to track your problem sets',
Expand Down

0 comments on commit 480a17f

Please sign in to comment.