Skip to content

Commit

Permalink
allow diff numbers in splitArticle.diff
Browse files Browse the repository at this point in the history
  • Loading branch information
ChlodAlejandro committed Aug 10, 2022
1 parent f97e5b2 commit e12dd8b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
6 changes: 3 additions & 3 deletions i18n/ante/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@
"deputy.ante.splitArticle.from_oldid.help": "The revision ID of the original page prior to the split. This is the revision that still contains content that will eventually become part of the split, with the following revision (or succeeding revisions) progressively transferring content to the other pages.",
"deputy.ante.splitArticle.date.label": "Date of split",
"deputy.ante.splitArticle.date.help": "The date that the split occurred.",
"deputy.ante.splitArticle.diff.placeholder": "https://en.wikipedia.org/w/index.php?diff=123456&oldid=123455",
"deputy.ante.splitArticle.diff.label": "Diff URL",
"deputy.ante.splitArticle.diff.help": "The diff URL of the split.",
"deputy.ante.splitArticle.diff.placeholder": "123456789",
"deputy.ante.splitArticle.diff.label": "Diff",
"deputy.ante.splitArticle.diff.help": "The diff URL or revision ID of the split.",

"deputy.ante.mergedFrom.label": "Merged from $1",
"deputy.ante.mergedFrom.remove": "Remove notice",
Expand Down
7 changes: 6 additions & 1 deletion src/modules/ante/ui/pages/SplitArticleTemplateRowPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,12 @@ function initSplitArticleTemplateRowPage() {
value: this.splitArticleTemplateRow.from_oldid || '',
placeholder: mw.message( 'deputy.ante.splitArticle.diff.placeholder' ).text(),
validate: ( value: string ) => {
if ( value.trim().length === 0 ) {
if (
// Blank
value.trim().length === 0 ||
// Diff number
!isNaN( +value )
) {
return true;
}
try {
Expand Down

0 comments on commit e12dd8b

Please sign in to comment.