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) {
|
||||
super(props);
|
||||
|
||||
this.getActiveTab = this.getActiveTab.bind(this);
|
||||
this.onListenerChange = this.onListenerChange.bind(this);
|
||||
|
||||
this.state = {user: UserStore.getCurrentUser()};
|
||||
@@ -30,10 +29,6 @@ export default class UserSettings extends React.Component {
|
||||
UserStore.removeChangeListener(this.onListenerChange);
|
||||
}
|
||||
|
||||
getActiveTab() {
|
||||
return this.refs.activeTab;
|
||||
}
|
||||
|
||||
onListenerChange() {
|
||||
var user = UserStore.getCurrentUser();
|
||||
if (!utils.areObjectsEqual(this.state.user, user)) {
|
||||
@@ -46,7 +41,6 @@ export default class UserSettings extends React.Component {
|
||||
return (
|
||||
<div>
|
||||
<GeneralTab
|
||||
ref='activeTab'
|
||||
user={this.state.user}
|
||||
activeSection={this.props.activeSection}
|
||||
updateSection={this.props.updateSection}
|
||||
@@ -60,7 +54,6 @@ export default class UserSettings extends React.Component {
|
||||
return (
|
||||
<div>
|
||||
<SecurityTab
|
||||
ref='activeTab'
|
||||
user={this.state.user}
|
||||
activeSection={this.props.activeSection}
|
||||
updateSection={this.props.updateSection}
|
||||
@@ -75,7 +68,6 @@ export default class UserSettings extends React.Component {
|
||||
return (
|
||||
<div>
|
||||
<NotificationsTab
|
||||
ref='activeTab'
|
||||
user={this.state.user}
|
||||
activeSection={this.props.activeSection}
|
||||
updateSection={this.props.updateSection}
|
||||
@@ -89,7 +81,6 @@ export default class UserSettings extends React.Component {
|
||||
return (
|
||||
<div>
|
||||
<DeveloperTab
|
||||
ref='activeTab'
|
||||
activeSection={this.props.activeSection}
|
||||
updateSection={this.props.updateSection}
|
||||
closeModal={this.props.closeModal}
|
||||
@@ -101,7 +92,6 @@ export default class UserSettings extends React.Component {
|
||||
return (
|
||||
<div>
|
||||
<DisplayTab
|
||||
ref='activeTab'
|
||||
user={this.state.user}
|
||||
activeSection={this.props.activeSection}
|
||||
updateSection={this.props.updateSection}
|
||||
@@ -117,7 +107,6 @@ export default class UserSettings extends React.Component {
|
||||
return (
|
||||
<div>
|
||||
<AdvancedTab
|
||||
ref='activeTab'
|
||||
user={this.state.user}
|
||||
activeSection={this.props.activeSection}
|
||||
updateSection={this.props.updateSection}
|
||||
|
||||
@@ -41,12 +41,15 @@ export default class UserSettingsDisplay extends React.Component {
|
||||
this.handleFont = this.handleFont.bind(this);
|
||||
this.updateSection = this.updateSection.bind(this);
|
||||
this.updateState = this.updateState.bind(this);
|
||||
this.deactivate = this.deactivate.bind(this);
|
||||
this.createCollapseSection = this.createCollapseSection.bind(this);
|
||||
|
||||
this.state = getDisplayStateFromStores();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
Utils.applyFont(PreferenceStore.get(Preferences.CATEGORY_DISPLAY_SETTINGS, 'selected_font', Constants.DEFAULT_FONT));
|
||||
}
|
||||
|
||||
handleSubmit() {
|
||||
const userId = UserStore.getCurrentId();
|
||||
|
||||
@@ -136,10 +139,6 @@ export default class UserSettingsDisplay extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
deactivate() {
|
||||
this.updateState();
|
||||
}
|
||||
|
||||
createCollapseSection() {
|
||||
if (this.props.activeSection === 'collapse') {
|
||||
const collapseFormat = [false, false];
|
||||
|
||||
@@ -65,7 +65,6 @@ class UserSettingsModal extends React.Component {
|
||||
this.handleConfirm = this.handleConfirm.bind(this);
|
||||
this.handleCancelConfirmation = this.handleCancelConfirmation.bind(this);
|
||||
|
||||
this.deactivateTab = this.deactivateTab.bind(this);
|
||||
this.closeModal = this.closeModal.bind(this);
|
||||
this.collapseModal = this.collapseModal.bind(this);
|
||||
|
||||
@@ -108,7 +107,6 @@ class UserSettingsModal extends React.Component {
|
||||
return;
|
||||
}
|
||||
|
||||
this.deactivateTab();
|
||||
this.props.onModalDismissed();
|
||||
return;
|
||||
}
|
||||
@@ -125,8 +123,6 @@ class UserSettingsModal extends React.Component {
|
||||
handleCollapse() {
|
||||
$(ReactDOM.findDOMNode(this.refs.modalBody)).closest('.modal-dialog').removeClass('display--content');
|
||||
|
||||
this.deactivateTab();
|
||||
|
||||
this.setState({
|
||||
active_tab: '',
|
||||
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
|
||||
closeModal() {
|
||||
if (this.requireConfirm) {
|
||||
@@ -197,8 +185,6 @@ class UserSettingsModal extends React.Component {
|
||||
if (!skipConfirm && this.requireConfirm) {
|
||||
this.showConfirmModal(() => this.updateTab(tab, true));
|
||||
} else {
|
||||
this.deactivateTab();
|
||||
|
||||
this.setState({
|
||||
active_tab: tab,
|
||||
active_section: ''
|
||||
|
||||
Ссылка в новой задаче
Block a user