[PLT-6710] /rename [text] slash command: Rename the channel (#6570)

* /rename [text] slash command: Rename the channel

* update strings per review
Этот коммит содержится в:
Carlos Tadeu Panato Junior
2017-07-31 18:54:34 +02:00
коммит произвёл Harrison Healey
родитель 489602efe5
Коммит 251f000c68
7 изменённых файлов: 124 добавлений и 3 удалений

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

@@ -243,6 +243,12 @@ export default class CreatePost extends React.Component {
return;
}
if (!isDirectOrGroup && this.state.message.trimRight() === '/rename') {
GlobalActions.showChannelNameUpdateModal(updateChannel);
this.setState({message: ''});
return;
}
this.doSubmit(e);
}

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

@@ -115,6 +115,7 @@ export default class Navbar extends React.Component {
ModalStore.addModalListener(ActionTypes.TOGGLE_QUICK_SWITCH_MODAL, this.toggleQuickSwitchModal);
ModalStore.addModalListener(ActionTypes.TOGGLE_CHANNEL_HEADER_UPDATE_MODAL, this.showEditChannelHeaderModal);
ModalStore.addModalListener(ActionTypes.TOGGLE_CHANNEL_PURPOSE_UPDATE_MODAL, this.showChannelPurposeModal);
ModalStore.addModalListener(ActionTypes.TOGGLE_CHANNEL_NAME_UPDATE_MODAL, this.showRenameChannelModal);
$('.inner-wrap').click(this.hideSidebars);
document.addEventListener('keydown', this.handleQuickSwitchKeyPress);
}
@@ -128,6 +129,7 @@ export default class Navbar extends React.Component {
ModalStore.removeModalListener(ActionTypes.TOGGLE_QUICK_SWITCH_MODAL, this.toggleQuickSwitchModal);
ModalStore.addModalListener(ActionTypes.TOGGLE_CHANNEL_HEADER_UPDATE_MODAL, this.hideEditChannelHeaderModal);
ModalStore.addModalListener(ActionTypes.TOGGLE_CHANNEL_PURPOSE_UPDATE_MODAL, this.hideChannelPurposeModal);
ModalStore.addModalListener(ActionTypes.TOGGLE_CHANNEL_NAME_UPDATE_MODAL, this.hideRenameChannelModal);
document.removeEventListener('keydown', this.handleQuickSwitchKeyPress);
}
@@ -218,9 +220,7 @@ export default class Navbar extends React.Component {
});
}
showRenameChannelModal(e) {
e.preventDefault();
showRenameChannelModal() {
this.setState({
showRenameChannelModal: true
});