From 3fc6d7315809f109b736a7e89bee796da77e901b Mon Sep 17 00:00:00 2001 From: Jaiwanth Date: Wed, 10 Feb 2021 10:15:24 +0530 Subject: [PATCH 1/4] Added loading and disabled the button while searching for server Signed-off-by: Jaiwanth --- src/components/views/dialogs/TextInputDialog.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/views/dialogs/TextInputDialog.js b/src/components/views/dialogs/TextInputDialog.js index 571ed7e413..27bd30f39e 100644 --- a/src/components/views/dialogs/TextInputDialog.js +++ b/src/components/views/dialogs/TextInputDialog.js @@ -18,6 +18,7 @@ import React, {createRef} from 'react'; import PropTypes from 'prop-types'; import * as sdk from '../../../index'; import Field from "../elements/Field"; +import { _t } from '../../../languageHandler'; export default class TextInputDialog extends React.Component { static propTypes = { @@ -29,6 +30,7 @@ export default class TextInputDialog extends React.Component { value: PropTypes.string, placeholder: PropTypes.string, button: PropTypes.string, + busyMessage: PropTypes.string, focus: PropTypes.bool, onFinished: PropTypes.func.isRequired, hasCancel: PropTypes.bool, @@ -40,6 +42,7 @@ export default class TextInputDialog extends React.Component { title: "", value: "", description: "", + busyMessage: "Loading...", focus: true, hasCancel: true, }; @@ -51,6 +54,7 @@ export default class TextInputDialog extends React.Component { this.state = { value: this.props.value, + busy: false, valid: false, }; } @@ -66,11 +70,13 @@ export default class TextInputDialog extends React.Component { onOk = async ev => { ev.preventDefault(); if (this.props.validator) { + this.setState({ busy: true }); await this._field.current.validate({ allowEmpty: false }); if (!this._field.current.state.valid) { this._field.current.focus(); this._field.current.validate({ allowEmpty: false, focused: true }); + this.setState({ busy: false }); return; } } @@ -125,7 +131,8 @@ export default class TextInputDialog extends React.Component { Date: Thu, 11 Feb 2021 17:38:46 +0530 Subject: [PATCH 2/4] Update src/components/views/dialogs/TextInputDialog.js Co-authored-by: Michael Telatynski <7t3chguy@googlemail.com> --- src/components/views/dialogs/TextInputDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/dialogs/TextInputDialog.js b/src/components/views/dialogs/TextInputDialog.js index 27bd30f39e..30c04bfa3f 100644 --- a/src/components/views/dialogs/TextInputDialog.js +++ b/src/components/views/dialogs/TextInputDialog.js @@ -18,7 +18,7 @@ import React, {createRef} from 'react'; import PropTypes from 'prop-types'; import * as sdk from '../../../index'; import Field from "../elements/Field"; -import { _t } from '../../../languageHandler'; +import { _t, _td } from '../../../languageHandler'; export default class TextInputDialog extends React.Component { static propTypes = { From 61c6033de72ed4a299cc2b7b8c027eba787f6c61 Mon Sep 17 00:00:00 2001 From: Jaiwanth Date: Thu, 11 Feb 2021 17:38:58 +0530 Subject: [PATCH 3/4] Update src/components/views/dialogs/TextInputDialog.js Co-authored-by: Michael Telatynski <7t3chguy@googlemail.com> --- src/components/views/dialogs/TextInputDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/dialogs/TextInputDialog.js b/src/components/views/dialogs/TextInputDialog.js index 30c04bfa3f..20a11acd19 100644 --- a/src/components/views/dialogs/TextInputDialog.js +++ b/src/components/views/dialogs/TextInputDialog.js @@ -30,7 +30,7 @@ export default class TextInputDialog extends React.Component { value: PropTypes.string, placeholder: PropTypes.string, button: PropTypes.string, - busyMessage: PropTypes.string, + busyMessage: PropTypes.string, // pass _td string focus: PropTypes.bool, onFinished: PropTypes.func.isRequired, hasCancel: PropTypes.bool, From 20dc8dbb320752b7aa1ce798fc91bc188bdc70ad Mon Sep 17 00:00:00 2001 From: Jaiwanth Date: Thu, 11 Feb 2021 17:39:12 +0530 Subject: [PATCH 4/4] Update src/components/views/dialogs/TextInputDialog.js Co-authored-by: Michael Telatynski <7t3chguy@googlemail.com> --- src/components/views/dialogs/TextInputDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/dialogs/TextInputDialog.js b/src/components/views/dialogs/TextInputDialog.js index 20a11acd19..69cc4390be 100644 --- a/src/components/views/dialogs/TextInputDialog.js +++ b/src/components/views/dialogs/TextInputDialog.js @@ -42,7 +42,7 @@ export default class TextInputDialog extends React.Component { title: "", value: "", description: "", - busyMessage: "Loading...", + busyMessage: _td("Loading..."), focus: true, hasCancel: true, };