Close confirm_integration On Enter Keypress (#5600)
Этот коммит содержится в:
коммит произвёл
Corey Hulen
родитель
3cbe05e0f4
Коммит
33c1609aa4
@@ -5,7 +5,7 @@ import React from 'react';
|
|||||||
|
|
||||||
import BackstageHeader from 'components/backstage/components/backstage_header.jsx';
|
import BackstageHeader from 'components/backstage/components/backstage_header.jsx';
|
||||||
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
|
import {FormattedMessage, FormattedHTMLMessage} from 'react-intl';
|
||||||
import {Link} from 'react-router/es6';
|
import {Link, browserHistory} from 'react-router/es6';
|
||||||
|
|
||||||
import UserStore from 'stores/user_store.jsx';
|
import UserStore from 'stores/user_store.jsx';
|
||||||
import IntegrationStore from 'stores/integration_store.jsx';
|
import IntegrationStore from 'stores/integration_store.jsx';
|
||||||
@@ -25,6 +25,7 @@ export default class ConfirmIntegration extends React.Component {
|
|||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.handleIntegrationChange = this.handleIntegrationChange.bind(this);
|
this.handleIntegrationChange = this.handleIntegrationChange.bind(this);
|
||||||
|
this.handleKeyPress = this.handleKeyPress.bind(this);
|
||||||
|
|
||||||
const userId = UserStore.getCurrentId();
|
const userId = UserStore.getCurrentId();
|
||||||
|
|
||||||
@@ -38,10 +39,12 @@ export default class ConfirmIntegration extends React.Component {
|
|||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
IntegrationStore.addChangeListener(this.handleIntegrationChange);
|
IntegrationStore.addChangeListener(this.handleIntegrationChange);
|
||||||
|
window.addEventListener('keypress', this.handleKeyPress);
|
||||||
}
|
}
|
||||||
|
|
||||||
componentWillUnmount() {
|
componentWillUnmount() {
|
||||||
IntegrationStore.removeChangeListener(this.handleIntegrationChange);
|
IntegrationStore.removeChangeListener(this.handleIntegrationChange);
|
||||||
|
window.removeEventListener('keypress', this.handleKeyPress);
|
||||||
}
|
}
|
||||||
|
|
||||||
handleIntegrationChange() {
|
handleIntegrationChange() {
|
||||||
@@ -53,6 +56,12 @@ export default class ConfirmIntegration extends React.Component {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
handleKeyPress(e) {
|
||||||
|
if (e.key === 'Enter') {
|
||||||
|
browserHistory.push('/' + this.props.team.name + '/integrations/' + this.state.type);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
let headerText = null;
|
let headerText = null;
|
||||||
let helpText = null;
|
let helpText = null;
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user