[PLT-6697] Added CTRL/CMD+SHIFT+K shortcut to open 'more direct messages' dialog (#6534)
* add keypress shortcut to open 'more direct messages' dialog * removed duplicate e.preventDefault() * add text description to /shortcuts output
Этот коммит содержится в:
коммит произвёл
Harrison Healey
родитель
fd6f6a55ce
Коммит
0d6dd52be6
@@ -47,6 +47,7 @@ func (me *ShortcutsProvider) DoCommand(args *model.CommandArgs, message string)
|
|||||||
"api.command_shortcuts.nav.unread_next",
|
"api.command_shortcuts.nav.unread_next",
|
||||||
"api.command_shortcuts.nav.switcher",
|
"api.command_shortcuts.nav.switcher",
|
||||||
"api.command_shortcuts.nav.switcher_team",
|
"api.command_shortcuts.nav.switcher_team",
|
||||||
|
"api.command_shortcuts.nav.direct_messages_menu",
|
||||||
"api.command_shortcuts.nav.settings",
|
"api.command_shortcuts.nav.settings",
|
||||||
"api.command_shortcuts.nav.recent_mentions",
|
"api.command_shortcuts.nav.recent_mentions",
|
||||||
// Files shortcuts
|
// Files shortcuts
|
||||||
|
|||||||
@@ -799,6 +799,10 @@
|
|||||||
"id": "api.command_shortcuts.nav.switcher_team",
|
"id": "api.command_shortcuts.nav.switcher_team",
|
||||||
"translation": "{{.CmdOrCtrl}}+ALT+K: Open a quick team switcher dialog\n"
|
"translation": "{{.CmdOrCtrl}}+ALT+K: Open a quick team switcher dialog\n"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"id": "api.command_shortcuts.nav.direct_messages_menu",
|
||||||
|
"translation": "{{.CmdOrCtrl}}+SHIFT+K: Open direct messages menu\n"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"id": "api.command_shortcuts.nav.unread_next",
|
"id": "api.command_shortcuts.nav.unread_next",
|
||||||
"translation": "ALT+SHIFT+DOWN: Next channel or direct message in left hand sidebar with unread messages\n"
|
"translation": "ALT+SHIFT+DOWN: Next channel or direct message in left hand sidebar with unread messages\n"
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ export default class Navbar extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleQuickSwitchKeyPress(e) {
|
handleQuickSwitchKeyPress(e) {
|
||||||
if (Utils.cmdOrCtrlPressed(e, true) && e.keyCode === Constants.KeyCodes.K) {
|
if (Utils.cmdOrCtrlPressed(e, true) && !e.shiftKey && e.keyCode === Constants.KeyCodes.K) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
if (e.altKey) {
|
if (e.altKey) {
|
||||||
if (getMyTeams(store.getState()).length <= 1) {
|
if (getMyTeams(store.getState()).length <= 1) {
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ export default class Sidebar extends React.Component {
|
|||||||
this.hideNewChannelModal = this.hideNewChannelModal.bind(this);
|
this.hideNewChannelModal = this.hideNewChannelModal.bind(this);
|
||||||
this.showMoreDirectChannelsModal = this.showMoreDirectChannelsModal.bind(this);
|
this.showMoreDirectChannelsModal = this.showMoreDirectChannelsModal.bind(this);
|
||||||
this.hideMoreDirectChannelsModal = this.hideMoreDirectChannelsModal.bind(this);
|
this.hideMoreDirectChannelsModal = this.hideMoreDirectChannelsModal.bind(this);
|
||||||
|
this.handleOpenMoreDirectChannelsModal = this.handleOpenMoreDirectChannelsModal.bind(this);
|
||||||
|
|
||||||
this.createChannelElement = this.createChannelElement.bind(this);
|
this.createChannelElement = this.createChannelElement.bind(this);
|
||||||
this.updateTitle = this.updateTitle.bind(this);
|
this.updateTitle = this.updateTitle.bind(this);
|
||||||
@@ -200,6 +201,11 @@ export default class Sidebar extends React.Component {
|
|||||||
this.showMoreDirectChannelsModal(args.startingUsers);
|
this.showMoreDirectChannelsModal(args.startingUsers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleOpenMoreDirectChannelsModal(e) {
|
||||||
|
e.preventDefault();
|
||||||
|
this.showMoreDirectChannelsModal();
|
||||||
|
}
|
||||||
|
|
||||||
onChange() {
|
onChange() {
|
||||||
if (this.state.currentTeam.id !== TeamStore.getCurrentId()) {
|
if (this.state.currentTeam.id !== TeamStore.getCurrentId()) {
|
||||||
ChannelStore.clear();
|
ChannelStore.clear();
|
||||||
@@ -301,6 +307,8 @@ export default class Sidebar extends React.Component {
|
|||||||
ChannelActions.goToChannel(nextChannel);
|
ChannelActions.goToChannel(nextChannel);
|
||||||
this.updateScrollbarOnChannelChange(nextChannel);
|
this.updateScrollbarOnChannelChange(nextChannel);
|
||||||
this.isSwitchingChannel = false;
|
this.isSwitchingChannel = false;
|
||||||
|
} else if (Utils.cmdOrCtrlPressed(e) && e.shiftKey && e.keyCode === Constants.KeyCodes.K) {
|
||||||
|
this.handleOpenMoreDirectChannelsModal(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -681,10 +689,7 @@ export default class Sidebar extends React.Component {
|
|||||||
<li key='more'>
|
<li key='more'>
|
||||||
<a
|
<a
|
||||||
href='#'
|
href='#'
|
||||||
onClick={(e) => {
|
onClick={this.handleOpenMoreDirectChannelsModal}
|
||||||
e.preventDefault();
|
|
||||||
this.showMoreDirectChannelsModal();
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='sidebar.moreElips'
|
id='sidebar.moreElips'
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user