From a6102e27d48d00fcc733c4d16754961903a239e0 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Sun, 31 Jan 2016 22:03:30 -0300 Subject: PLT-7: Refactoring frontend (chunk 8) - Sidebar and related components - Small Tweak to demotion and add msg for terminal cmd --- web/react/components/change_url_modal.jsx | 54 +++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 6 deletions(-) (limited to 'web/react/components/change_url_modal.jsx') diff --git a/web/react/components/change_url_modal.jsx b/web/react/components/change_url_modal.jsx index bbe93f58d..49d1b86b4 100644 --- a/web/react/components/change_url_modal.jsx +++ b/web/react/components/change_url_modal.jsx @@ -4,6 +4,8 @@ var Modal = ReactBootstrap.Modal; import * as Utils from '../utils/utils.jsx'; +import {FormattedMessage} from 'mm-intl'; + export default class ChangeUrlModal extends React.Component { constructor(props) { super(props); @@ -39,21 +41,58 @@ export default class ChangeUrlModal extends React.Component { getURLError(url) { let error = []; //eslint-disable-line prefer-const if (url.length < 2) { - error.push({'Must be longer than two characters'}
); + error.push( + + +
+
+ ); } if (url.charAt(0) === '-' || url.charAt(0) === '_') { - error.push({'Must start with a letter or number'}
); + error.push( + + +
+
+ ); } if (url.length > 1 && (url.charAt(url.length - 1) === '-' || url.charAt(url.length - 1) === '_')) { - error.push({'Must end with a letter or number'}
); + error.push( + + +
+
); } if (url.indexOf('__') > -1) { - error.push({'Can not contain two underscores in a row.'}
); + error.push( + + +
+
); } // In case of error we don't detect if (error.length === 0) { - error.push({'Invalid URL'}
); + error.push( + + +
+
); } return error; } @@ -137,7 +176,10 @@ export default class ChangeUrlModal extends React.Component { className='btn btn-default' onClick={this.doCancel} > - {'Close'} +