add feature flag, allowing to revert to old slate editor

This commit is contained in:
Bruno Windels 2019-08-22 14:07:43 +01:00
parent 6e54bb8e51
commit b395fad834
2 changed files with 29 additions and 10 deletions

View file

@ -1550,7 +1550,6 @@ module.exports = React.createClass({
render: function() { render: function() {
const RoomHeader = sdk.getComponent('rooms.RoomHeader'); const RoomHeader = sdk.getComponent('rooms.RoomHeader');
const MessageComposer = sdk.getComponent('rooms.MessageComposer');
const ForwardMessage = sdk.getComponent("rooms.ForwardMessage"); const ForwardMessage = sdk.getComponent("rooms.ForwardMessage");
const AuxPanel = sdk.getComponent("rooms.AuxPanel"); const AuxPanel = sdk.getComponent("rooms.AuxPanel");
const SearchBar = sdk.getComponent("rooms.SearchBar"); const SearchBar = sdk.getComponent("rooms.SearchBar");
@ -1778,15 +1777,29 @@ module.exports = React.createClass({
myMembership === 'join' && !this.state.searchResults myMembership === 'join' && !this.state.searchResults
); );
if (canSpeak) { if (canSpeak) {
messageComposer = if (SettingsStore.isFeatureEnabled("feature_cider_composer")) {
<MessageComposer const MessageComposer = sdk.getComponent('rooms.MessageComposer');
room={this.state.room} messageComposer =
callState={this.state.callState} <MessageComposer
disabled={this.props.disabled} room={this.state.room}
showApps={this.state.showApps} callState={this.state.callState}
e2eStatus={this.state.e2eStatus} disabled={this.props.disabled}
permalinkCreator={this._getPermalinkCreatorForRoom(this.state.room)} showApps={this.state.showApps}
/>; e2eStatus={this.state.e2eStatus}
permalinkCreator={this._getPermalinkCreatorForRoom(this.state.room)}
/>;
} else {
const SlateMessageComposer = sdk.getComponent('rooms.SlateMessageComposer');
messageComposer =
<SlateMessageComposer
room={this.state.room}
callState={this.state.callState}
disabled={this.props.disabled}
showApps={this.state.showApps}
e2eStatus={this.state.e2eStatus}
permalinkCreator={this._getPermalinkCreatorForRoom(this.state.room)}
/>;
}
} }
// TODO: Why aren't we storing the term/scope/count in this format // TODO: Why aren't we storing the term/scope/count in this format

View file

@ -114,6 +114,12 @@ export const SETTINGS = {
supportedLevels: LEVELS_FEATURE, supportedLevels: LEVELS_FEATURE,
default: false, default: false,
}, },
"feature_cider_composer": {
isFeature: true,
displayName: _td("Use the new, faster, but still experimental composer for writing messages (requires refresh)"),
supportedLevels: LEVELS_FEATURE,
default: false,
},
"MessageComposerInput.suggestEmoji": { "MessageComposerInput.suggestEmoji": {
supportedLevels: LEVELS_ACCOUNT_SETTINGS, supportedLevels: LEVELS_ACCOUNT_SETTINGS,
displayName: _td('Enable Emoji suggestions while typing'), displayName: _td('Enable Emoji suggestions while typing'),