Removed deactivate method from User Settings tabs (#3271)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
22245eee70
Коммит
d9e8eb619a
@@ -16,7 +16,6 @@ export default class UserSettings extends React.Component {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props);
|
super(props);
|
||||||
|
|
||||||
this.getActiveTab = this.getActiveTab.bind(this);
|
|
||||||
this.onListenerChange = this.onListenerChange.bind(this);
|
this.onListenerChange = this.onListenerChange.bind(this);
|
||||||
|
|
||||||
this.state = {user: UserStore.getCurrentUser()};
|
this.state = {user: UserStore.getCurrentUser()};
|
||||||
@@ -30,10 +29,6 @@ export default class UserSettings extends React.Component {
|
|||||||
UserStore.removeChangeListener(this.onListenerChange);
|
UserStore.removeChangeListener(this.onListenerChange);
|
||||||
}
|
}
|
||||||
|
|
||||||
getActiveTab() {
|
|
||||||
return this.refs.activeTab;
|
|
||||||
}
|
|
||||||
|
|
||||||
onListenerChange() {
|
onListenerChange() {
|
||||||
var user = UserStore.getCurrentUser();
|
var user = UserStore.getCurrentUser();
|
||||||
if (!utils.areObjectsEqual(this.state.user, user)) {
|
if (!utils.areObjectsEqual(this.state.user, user)) {
|
||||||
@@ -46,7 +41,6 @@ export default class UserSettings extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<GeneralTab
|
<GeneralTab
|
||||||
ref='activeTab'
|
|
||||||
user={this.state.user}
|
user={this.state.user}
|
||||||
activeSection={this.props.activeSection}
|
activeSection={this.props.activeSection}
|
||||||
updateSection={this.props.updateSection}
|
updateSection={this.props.updateSection}
|
||||||
@@ -60,7 +54,6 @@ export default class UserSettings extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<SecurityTab
|
<SecurityTab
|
||||||
ref='activeTab'
|
|
||||||
user={this.state.user}
|
user={this.state.user}
|
||||||
activeSection={this.props.activeSection}
|
activeSection={this.props.activeSection}
|
||||||
updateSection={this.props.updateSection}
|
updateSection={this.props.updateSection}
|
||||||
@@ -75,7 +68,6 @@ export default class UserSettings extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<NotificationsTab
|
<NotificationsTab
|
||||||
ref='activeTab'
|
|
||||||
user={this.state.user}
|
user={this.state.user}
|
||||||
activeSection={this.props.activeSection}
|
activeSection={this.props.activeSection}
|
||||||
updateSection={this.props.updateSection}
|
updateSection={this.props.updateSection}
|
||||||
@@ -89,7 +81,6 @@ export default class UserSettings extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<DeveloperTab
|
<DeveloperTab
|
||||||
ref='activeTab'
|
|
||||||
activeSection={this.props.activeSection}
|
activeSection={this.props.activeSection}
|
||||||
updateSection={this.props.updateSection}
|
updateSection={this.props.updateSection}
|
||||||
closeModal={this.props.closeModal}
|
closeModal={this.props.closeModal}
|
||||||
@@ -101,7 +92,6 @@ export default class UserSettings extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<DisplayTab
|
<DisplayTab
|
||||||
ref='activeTab'
|
|
||||||
user={this.state.user}
|
user={this.state.user}
|
||||||
activeSection={this.props.activeSection}
|
activeSection={this.props.activeSection}
|
||||||
updateSection={this.props.updateSection}
|
updateSection={this.props.updateSection}
|
||||||
@@ -117,7 +107,6 @@ export default class UserSettings extends React.Component {
|
|||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<AdvancedTab
|
<AdvancedTab
|
||||||
ref='activeTab'
|
|
||||||
user={this.state.user}
|
user={this.state.user}
|
||||||
activeSection={this.props.activeSection}
|
activeSection={this.props.activeSection}
|
||||||
updateSection={this.props.updateSection}
|
updateSection={this.props.updateSection}
|
||||||
|
|||||||
@@ -41,12 +41,15 @@ export default class UserSettingsDisplay extends React.Component {
|
|||||||
this.handleFont = this.handleFont.bind(this);
|
this.handleFont = this.handleFont.bind(this);
|
||||||
this.updateSection = this.updateSection.bind(this);
|
this.updateSection = this.updateSection.bind(this);
|
||||||
this.updateState = this.updateState.bind(this);
|
this.updateState = this.updateState.bind(this);
|
||||||
this.deactivate = this.deactivate.bind(this);
|
|
||||||
this.createCollapseSection = this.createCollapseSection.bind(this);
|
this.createCollapseSection = this.createCollapseSection.bind(this);
|
||||||
|
|
||||||
this.state = getDisplayStateFromStores();
|
this.state = getDisplayStateFromStores();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentWillUnmount() {
|
||||||
|
Utils.applyFont(PreferenceStore.get(Preferences.CATEGORY_DISPLAY_SETTINGS, 'selected_font', Constants.DEFAULT_FONT));
|
||||||
|
}
|
||||||
|
|
||||||
handleSubmit() {
|
handleSubmit() {
|
||||||
const userId = UserStore.getCurrentId();
|
const userId = UserStore.getCurrentId();
|
||||||
|
|
||||||
@@ -136,10 +139,6 @@ export default class UserSettingsDisplay extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
deactivate() {
|
|
||||||
this.updateState();
|
|
||||||
}
|
|
||||||
|
|
||||||
createCollapseSection() {
|
createCollapseSection() {
|
||||||
if (this.props.activeSection === 'collapse') {
|
if (this.props.activeSection === 'collapse') {
|
||||||
const collapseFormat = [false, false];
|
const collapseFormat = [false, false];
|
||||||
|
|||||||
@@ -65,7 +65,6 @@ class UserSettingsModal extends React.Component {
|
|||||||
this.handleConfirm = this.handleConfirm.bind(this);
|
this.handleConfirm = this.handleConfirm.bind(this);
|
||||||
this.handleCancelConfirmation = this.handleCancelConfirmation.bind(this);
|
this.handleCancelConfirmation = this.handleCancelConfirmation.bind(this);
|
||||||
|
|
||||||
this.deactivateTab = this.deactivateTab.bind(this);
|
|
||||||
this.closeModal = this.closeModal.bind(this);
|
this.closeModal = this.closeModal.bind(this);
|
||||||
this.collapseModal = this.collapseModal.bind(this);
|
this.collapseModal = this.collapseModal.bind(this);
|
||||||
|
|
||||||
@@ -108,7 +107,6 @@ class UserSettingsModal extends React.Component {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.deactivateTab();
|
|
||||||
this.props.onModalDismissed();
|
this.props.onModalDismissed();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -125,8 +123,6 @@ class UserSettingsModal extends React.Component {
|
|||||||
handleCollapse() {
|
handleCollapse() {
|
||||||
$(ReactDOM.findDOMNode(this.refs.modalBody)).closest('.modal-dialog').removeClass('display--content');
|
$(ReactDOM.findDOMNode(this.refs.modalBody)).closest('.modal-dialog').removeClass('display--content');
|
||||||
|
|
||||||
this.deactivateTab();
|
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
active_tab: '',
|
active_tab: '',
|
||||||
active_section: ''
|
active_section: ''
|
||||||
@@ -167,14 +163,6 @@ class UserSettingsModal extends React.Component {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called to let settings tab perform cleanup before being closed
|
|
||||||
deactivateTab() {
|
|
||||||
const activeTab = this.refs.userSettings.getActiveTab();
|
|
||||||
if (activeTab && activeTab.deactivate) {
|
|
||||||
activeTab.deactivate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called by settings tabs when their close button is pressed
|
// Called by settings tabs when their close button is pressed
|
||||||
closeModal() {
|
closeModal() {
|
||||||
if (this.requireConfirm) {
|
if (this.requireConfirm) {
|
||||||
@@ -197,8 +185,6 @@ class UserSettingsModal extends React.Component {
|
|||||||
if (!skipConfirm && this.requireConfirm) {
|
if (!skipConfirm && this.requireConfirm) {
|
||||||
this.showConfirmModal(() => this.updateTab(tab, true));
|
this.showConfirmModal(() => this.updateTab(tab, true));
|
||||||
} else {
|
} else {
|
||||||
this.deactivateTab();
|
|
||||||
|
|
||||||
this.setState({
|
this.setState({
|
||||||
active_tab: tab,
|
active_tab: tab,
|
||||||
active_section: ''
|
active_section: ''
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user