diff --git a/src/UserSettingsStore.js b/src/UserSettingsStore.js index 009fdabb53..fef84468ec 100644 --- a/src/UserSettingsStore.js +++ b/src/UserSettingsStore.js @@ -25,11 +25,6 @@ import { _t } from './languageHandler'; export default { LABS_FEATURES: [ - { - name: "-", - id: 'rich_text_editor', - default: false, - }, { name: "-", id: 'matrix_apps', @@ -39,8 +34,7 @@ export default { // horrible but it works. The locality makes this somewhat more palatable. doTranslations: function() { - this.LABS_FEATURES[0].name = _t("New Composer & Autocomplete"); - this.LABS_FEATURES[1].name = _t("Matrix Apps"); + this.LABS_FEATURES[0].name = _t("Matrix Apps"); }, loadProfileInfo: function() { diff --git a/src/components/views/rooms/MessageComposer.js b/src/components/views/rooms/MessageComposer.js index 27d5e11119..c623c88312 100644 --- a/src/components/views/rooms/MessageComposer.js +++ b/src/components/views/rooms/MessageComposer.js @@ -226,21 +226,6 @@ export default class MessageComposer extends React.Component { this.setState({inputState}); } - onUpArrow() { - return this.refs.autocomplete.onUpArrow(); - } - - onDownArrow() { - return this.refs.autocomplete.onDownArrow(); - } - - _tryComplete(): boolean { - if (this.refs.autocomplete) { - return this.refs.autocomplete.onCompletionClicked(); - } - return false; - } - _onAutocompleteConfirm(range, completion) { if (this.messageComposerInput) { this.messageComposerInput.setDisplayedCompletion(range, completion); @@ -267,8 +252,7 @@ export default class MessageComposer extends React.Component { const uploadInputStyle = {display: 'none'}; const MemberAvatar = sdk.getComponent('avatars.MemberAvatar'); const TintableSvg = sdk.getComponent("elements.TintableSvg"); - const MessageComposerInput = sdk.getComponent("rooms.MessageComposerInput" + - (UserSettingsStore.isFeatureEnabled('rich_text_editor') ? "" : "Old")); + const MessageComposerInput = sdk.getComponent("rooms.MessageComposerInput"); const controls = []; @@ -351,8 +335,7 @@ export default class MessageComposer extends React.Component { title={_t("Show Text Formatting Toolbar")} src="img/button-text-formatting.svg" onClick={this.onToggleFormattingClicked} - style={{visibility: this.state.showFormatting || - !UserSettingsStore.isFeatureEnabled('rich_text_editor') ? 'hidden' : 'visible'}} + style={{visibility: this.state.showFormatting ? 'hidden' : 'visible'}} key="controls_formatting" /> ); @@ -367,10 +350,7 @@ export default class MessageComposer extends React.Component { room={this.props.room} placeholder={placeholderText} tryComplete={this._tryComplete} - onUpArrow={this.onUpArrow} - onDownArrow={this.onDownArrow} onFilesPasted={this.uploadFiles} - tabComplete={this.props.tabComplete} // used for old messagecomposerinput/tabcomplete onContentChanged={this.onInputContentChanged} onInputStateChanged={this.onInputStateChanged} />, formattingButton, @@ -389,18 +369,6 @@ export default class MessageComposer extends React.Component { ); } - let autoComplete; - if (UserSettingsStore.isFeatureEnabled('rich_text_editor')) { - autoComplete =
- -
; - } - - const {style, blockType} = this.state.inputState; const formatButtons = ["bold", "italic", "strike", "underline", "code", "quote", "bullet", "numbullet"].map( (name) => { @@ -424,22 +392,20 @@ export default class MessageComposer extends React.Component { {controls} - {UserSettingsStore.isFeatureEnabled('rich_text_editor') ? -
-
- {formatButtons} -
- - -
-
: null - } +
+
+ {formatButtons} +
+ + +
+
); } diff --git a/src/components/views/rooms/MessageComposerInput.js b/src/components/views/rooms/MessageComposerInput.js index 488a8229a6..6da7f272c4 100644 --- a/src/components/views/rooms/MessageComposerInput.js +++ b/src/components/views/rooms/MessageComposerInput.js @@ -908,14 +908,7 @@ MessageComposerInput.propTypes = { // called with current plaintext content (as a string) whenever it changes onContentChanged: React.PropTypes.func, - onUpArrow: React.PropTypes.func, - - onDownArrow: React.PropTypes.func, - onFilesPasted: React.PropTypes.func, - // attempts to confirm currently selected completion, returns whether actually confirmed - tryComplete: React.PropTypes.func, - onInputStateChanged: React.PropTypes.func, }; diff --git a/test/components/views/rooms/MessageComposerInput-test.js b/test/components/views/rooms/MessageComposerInput-test.js index 80fd158608..6d4b4e69cc 100644 --- a/test/components/views/rooms/MessageComposerInput-test.js +++ b/test/components/views/rooms/MessageComposerInput-test.js @@ -27,14 +27,10 @@ describe('MessageComposerInput', () => { mci = null, room = testUtils.mkStubRoom('!DdJkzRliezrwpNebLk:matrix.org'); - // TODO Remove when RTE is out of labs. - beforeEach(function() { testUtils.beforeEach(this); sandbox = testUtils.stubClient(sandbox); client = MatrixClientPeg.get(); - UserSettingsStore.isFeatureEnabled = sinon.stub() - .withArgs('rich_text_editor').returns(true); parentDiv = document.createElement('div'); document.body.appendChild(parentDiv);