[PLT-6708] /purpose [text] slash command: Edit the channel purpose (#6569)

* /purpose [text] slash command: Edit the channel purpose

* update command on server side to check for direct or group channels

* update stings and block the dialog when is DM or GM

* update per review

* remove duplicate websocker event and apply the same for /header command

* update per review

* update
Этот коммит содержится в:
Carlos Tadeu Panato Junior
2017-07-21 21:04:41 +02:00
коммит произвёл Joram Wilander
родитель 10b7b96a29
Коммит 816bfbeb91
8 изменённых файлов: 142 добавлений и 15 удалений

Просмотреть файл

@@ -227,12 +227,19 @@ export default class CreatePost extends React.Component {
return;
}
if (this.state.message.endsWith('/header ')) {
if (this.state.message.trimRight() === '/header') {
GlobalActions.showChannelHeaderUpdateModal(updateChannel);
this.setState({message: ''});
return;
}
const isDirectOrGroup = ((updateChannel.type === Constants.DM_CHANNEL) || (updateChannel.type === Constants.GM_CHANNEL));
if (!isDirectOrGroup && this.state.message.trimRight() === '/purpose') {
GlobalActions.showChannelPurposeUpdateModal(updateChannel);
this.setState({message: ''});
return;
}
this.doSubmit(e);
}