Remove admin enableMessageParserEarlyAdoption

This commit is contained in:
Gerzon Z 2021-08-03 03:01:53 -04:00
parent be431179e7
commit 56ee8d45cd
4 changed files with 17 additions and 27 deletions

View File

@ -26,9 +26,6 @@ export default {
Accounts_CustomFields: { Accounts_CustomFields: {
type: 'valueAsString' type: 'valueAsString'
}, },
Accounts_Default_User_Preferences_enableMessageParserEarlyAdoption: {
type: 'valueAsBoolean'
},
Accounts_EmailOrUsernamePlaceholder: { Accounts_EmailOrUsernamePlaceholder: {
type: 'valueAsString' type: 'valueAsString'
}, },

View File

@ -84,5 +84,5 @@ export default class Message extends Model {
@field('tshow') tshow; @field('tshow') tshow;
@field('md') md; @json('md', sanitizer) md;
} }

View File

@ -20,6 +20,10 @@ const changeMessageStatus = async(id, tmid, status, message) => {
m.mentions = message.mentions; m.mentions = message.mentions;
m.channels = message.channels; m.channels = message.channels;
} }
if (message.md) {
m.md = message.md;
}
}) })
); );

View File

@ -57,7 +57,6 @@ class ProfileView extends React.Component {
Accounts_AllowRealNameChange: PropTypes.bool, Accounts_AllowRealNameChange: PropTypes.bool,
Accounts_AllowUserAvatarChange: PropTypes.bool, Accounts_AllowUserAvatarChange: PropTypes.bool,
Accounts_AllowUsernameChange: PropTypes.bool, Accounts_AllowUsernameChange: PropTypes.bool,
Accounts_enableMessageParserEarlyAdoption: PropTypes.bool,
Accounts_CustomFields: PropTypes.string, Accounts_CustomFields: PropTypes.string,
setUser: PropTypes.func, setUser: PropTypes.func,
theme: PropTypes.string theme: PropTypes.string
@ -74,8 +73,7 @@ class ProfileView extends React.Component {
avatarUrl: null, avatarUrl: null,
avatar: {}, avatar: {},
avatarSuggestions: {}, avatarSuggestions: {},
customFields: {}, customFields: {}
preferences: []
}; };
async componentDidMount() { async componentDidMount() {
@ -112,15 +110,12 @@ class ProfileView extends React.Component {
this.setState({ avatar }); this.setState({ avatar });
} }
init = async(user) => { init = (user) => {
const { user: userProps } = this.props; const { user: userProps } = this.props;
const { const {
name, username, emails, customFields, id name, username, emails, customFields, enableMessageParserEarlyAdoption
} = user || userProps; } = user || userProps;
const result = await RocketChat.getUserPreferences(id);
const { preferences } = result;
this.setState({ this.setState({
name, name,
username, username,
@ -130,14 +125,13 @@ class ProfileView extends React.Component {
avatarUrl: null, avatarUrl: null,
avatar: {}, avatar: {},
customFields: customFields || {}, customFields: customFields || {},
enableMessageParser: preferences?.enableMessageParserEarlyAdoption || false, enableMessageParser: enableMessageParserEarlyAdoption || false
preferences
}); });
} }
formIsChanged = () => { formIsChanged = () => {
const { const {
name, username, email, newPassword, avatar, customFields, enableMessageParser, preferences name, username, email, newPassword, avatar, customFields, enableMessageParser
} = this.state; } = this.state;
const { user } = this.props; const { user } = this.props;
let customFieldsChanged = false; let customFieldsChanged = false;
@ -153,7 +147,7 @@ class ProfileView extends React.Component {
return !(user.name === name return !(user.name === name
&& user.username === username && user.username === username
&& preferences.enableMessageParserEarlyAdoption === enableMessageParser && user.enableMessageParserEarlyAdoption === enableMessageParser
&& !newPassword && !newPassword
&& (user.emails && user.emails[0].address === email) && (user.emails && user.emails[0].address === email)
&& !avatar.data && !avatar.data
@ -480,8 +474,7 @@ class ProfileView extends React.Component {
Accounts_AllowRealNameChange, Accounts_AllowRealNameChange,
Accounts_AllowUserAvatarChange, Accounts_AllowUserAvatarChange,
Accounts_AllowUsernameChange, Accounts_AllowUsernameChange,
Accounts_CustomFields, Accounts_CustomFields
Accounts_enableMessageParserEarlyAdoption
} = this.props; } = this.props;
return ( return (
@ -568,14 +561,11 @@ class ProfileView extends React.Component {
theme={theme} theme={theme}
/> />
<List.Separator /> <List.Separator />
{Accounts_enableMessageParserEarlyAdoption
? (
<List.Item <List.Item
title='Enable_Message_Parser' title='Enable_Message_Parser'
testID='profile-view-enable-message-parser' testID='profile-view-enable-message-parser'
right={() => this.renderMessageParserSwitch()} right={() => this.renderMessageParserSwitch()}
/> />
) : null}
<List.Separator /> <List.Separator />
{this.renderCustomFields()} {this.renderCustomFields()}
<RCTextInput <RCTextInput
@ -625,7 +615,6 @@ const mapStateToProps = state => ({
Accounts_AllowUserAvatarChange: state.settings.Accounts_AllowUserAvatarChange, Accounts_AllowUserAvatarChange: state.settings.Accounts_AllowUserAvatarChange,
Accounts_AllowUsernameChange: state.settings.Accounts_AllowUsernameChange, Accounts_AllowUsernameChange: state.settings.Accounts_AllowUsernameChange,
Accounts_CustomFields: state.settings.Accounts_CustomFields, Accounts_CustomFields: state.settings.Accounts_CustomFields,
Accounts_enableMessageParserEarlyAdoption: state.settings.Accounts_Default_User_Preferences_enableMessageParserEarlyAdoption,
baseUrl: state.server.server baseUrl: state.server.server
}); });