Fixed issue with Team Settings modal saving items instead of cancelling; changed remaining copyrights

Этот коммит содержится в:
Reed Garmsen
2015-12-10 14:33:21 -08:00
родитель 149ac6f3ce
Коммит 470797cca6
12 изменённых файлов: 41 добавлений и 30 удалений

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

@@ -1,4 +1,4 @@
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
package api package api

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

@@ -1,4 +1,4 @@
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
package api package api

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

@@ -1,4 +1,4 @@
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
package model package model

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

@@ -1,4 +1,4 @@
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
package model package model

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

@@ -1,4 +1,4 @@
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
package model package model

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

@@ -1,4 +1,4 @@
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
package model package model

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

@@ -1,4 +1,4 @@
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
package model package model

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

@@ -1,4 +1,4 @@
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
package store package store

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

@@ -1,4 +1,4 @@
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
package store package store

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

@@ -12,6 +12,7 @@ export default class GeneralTab extends React.Component {
constructor(props) { constructor(props) {
super(props); super(props);
this.updateSection = this.updateSection.bind(this);
this.handleNameSubmit = this.handleNameSubmit.bind(this); this.handleNameSubmit = this.handleNameSubmit.bind(this);
this.handleInviteIdSubmit = this.handleInviteIdSubmit.bind(this); this.handleInviteIdSubmit = this.handleInviteIdSubmit.bind(this);
this.handleOpenInviteSubmit = this.handleOpenInviteSubmit.bind(this); this.handleOpenInviteSubmit = this.handleOpenInviteSubmit.bind(this);
@@ -27,11 +28,22 @@ export default class GeneralTab extends React.Component {
this.handleTeamListingRadio = this.handleTeamListingRadio.bind(this); this.handleTeamListingRadio = this.handleTeamListingRadio.bind(this);
this.handleGenerateInviteId = this.handleGenerateInviteId.bind(this); this.handleGenerateInviteId = this.handleGenerateInviteId.bind(this);
this.state = { this.state = this.setupInitialState(props);
name: props.team.display_name, }
invite_id: props.team.invite_id,
allow_open_invite: props.team.allow_open_invite, updateSection(section) {
allow_team_listing: props.team.allow_team_listing, this.setState(this.setupInitialState(this.props));
this.props.updateSection(section);
}
setupInitialState(props) {
const team = props.team;
return {
name: team.display_name,
invite_id: team.invite_id,
allow_open_invite: team.allow_open_invite,
allow_team_listing: team.allow_team_listing,
serverError: '', serverError: '',
clientError: '' clientError: ''
}; };
@@ -71,7 +83,7 @@ export default class GeneralTab extends React.Component {
(team) => { (team) => {
TeamStore.saveTeam(team); TeamStore.saveTeam(team);
TeamStore.emitChange(); TeamStore.emitChange();
this.props.updateSection(''); this.updateSection('');
}, },
(err) => { (err) => {
state.serverError = err.message; state.serverError = err.message;
@@ -91,7 +103,7 @@ export default class GeneralTab extends React.Component {
(team) => { (team) => {
TeamStore.saveTeam(team); TeamStore.saveTeam(team);
TeamStore.emitChange(); TeamStore.emitChange();
this.props.updateSection(''); this.updateSection('');
}, },
(err) => { (err) => {
state.serverError = err.message; state.serverError = err.message;
@@ -129,7 +141,7 @@ export default class GeneralTab extends React.Component {
(team) => { (team) => {
TeamStore.saveTeam(team); TeamStore.saveTeam(team);
TeamStore.emitChange(); TeamStore.emitChange();
this.props.updateSection(''); this.updateSection('');
}, },
(err) => { (err) => {
state.serverError = err.message; state.serverError = err.message;
@@ -164,7 +176,7 @@ export default class GeneralTab extends React.Component {
(team) => { (team) => {
TeamStore.saveTeam(team); TeamStore.saveTeam(team);
TeamStore.emitChange(); TeamStore.emitChange();
this.props.updateSection(''); this.updateSection('');
}, },
(err) => { (err) => {
state.serverError = err.message; state.serverError = err.message;
@@ -180,8 +192,7 @@ export default class GeneralTab extends React.Component {
} }
handleClose() { handleClose() {
this.setState({clientError: '', serverError: ''}); this.updateSection('');
this.props.updateSection('');
} }
componentDidMount() { componentDidMount() {
@@ -195,36 +206,36 @@ export default class GeneralTab extends React.Component {
onUpdateNameSection(e) { onUpdateNameSection(e) {
e.preventDefault(); e.preventDefault();
if (this.props.activeSection === 'name') { if (this.props.activeSection === 'name') {
this.props.updateSection(''); this.updateSection('');
} else { } else {
this.props.updateSection('name'); this.updateSection('name');
} }
} }
onUpdateInviteIdSection(e) { onUpdateInviteIdSection(e) {
e.preventDefault(); e.preventDefault();
if (this.props.activeSection === 'invite_id') { if (this.props.activeSection === 'invite_id') {
this.props.updateSection(''); this.updateSection('');
} else { } else {
this.props.updateSection('invite_id'); this.updateSection('invite_id');
} }
} }
onUpdateOpenInviteSection(e) { onUpdateOpenInviteSection(e) {
e.preventDefault(); e.preventDefault();
if (this.props.activeSection === 'open_invite') { if (this.props.activeSection === 'open_invite') {
this.props.updateSection(''); this.updateSection('');
} else { } else {
this.props.updateSection('open_invite'); this.updateSection('open_invite');
} }
} }
onUpdateTeamListingSection(e) { onUpdateTeamListingSection(e) {
e.preventDefault(); e.preventDefault();
if (this.props.activeSection === 'team_listing') { if (this.props.activeSection === 'team_listing') {
this.props.updateSection(''); this.updateSection('');
} else { } else {
this.props.updateSection('team_listing'); this.updateSection('team_listing');
} }
} }

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

@@ -1,4 +1,4 @@
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
import LoadingScreen from '../loading_screen.jsx'; import LoadingScreen from '../loading_screen.jsx';

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

@@ -1,4 +1,4 @@
// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. // Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information. // See License.txt for license information.
import Constants from '../utils/constants.jsx'; import Constants from '../utils/constants.jsx';