From a374419ad5c5f35174ee6285b4eaa57ef82235bd Mon Sep 17 00:00:00 2001 From: =Corey Hulen Date: Thu, 24 Sep 2015 10:52:32 -0700 Subject: Removing old valet crud --- web/react/components/team_feature_tab.jsx | 190 ------------------------------ 1 file changed, 190 deletions(-) delete mode 100644 web/react/components/team_feature_tab.jsx (limited to 'web/react/components/team_feature_tab.jsx') diff --git a/web/react/components/team_feature_tab.jsx b/web/react/components/team_feature_tab.jsx deleted file mode 100644 index 3251746b8..000000000 --- a/web/react/components/team_feature_tab.jsx +++ /dev/null @@ -1,190 +0,0 @@ -// Copyright (c) 2015 Spinpunch, Inc. All Rights Reserved. -// See License.txt for license information. - -var SettingItemMin = require('./setting_item_min.jsx'); -var SettingItemMax = require('./setting_item_max.jsx'); - -var Client = require('../utils/client.jsx'); -var AsyncClient = require('../utils/async_client.jsx'); - -export default class FeatureTab extends React.Component { - constructor(props) { - super(props); - - this.submitValetFeature = this.submitValetFeature.bind(this); - this.handleValetRadio = this.handleValetRadio.bind(this); - this.onUpdateSection = this.onUpdateSection.bind(this); - this.setupInitialState = this.setupInitialState.bind(this); - - this.state = this.setupInitialState(); - } - componentWillReceiveProps(newProps) { - var team = newProps.team; - - var allowValet = 'false'; - if (team && team.allow_valet) { - allowValet = 'true'; - } - - this.setState({allowValet: allowValet}); - } - submitValetFeature() { - var data = {}; - data.allow_valet = this.state.allowValet; - - Client.updateValetFeature(data, - function success() { - this.props.updateSection(''); - AsyncClient.getMyTeam(); - }.bind(this), - function fail(err) { - var state = this.setupInitialState(); - state.serverError = err; - this.setState(state); - }.bind(this) - ); - } - handleValetRadio(val) { - this.setState({allowValet: val}); - React.findDOMNode(this.refs.wrapper).focus(); - } - onUpdateSection(e) { - e.preventDefault(); - if (this.props.activeSection === 'valet') { - this.props.updateSection(''); - } else { - this.props.updateSection('valet'); - } - } - setupInitialState() { - var allowValet; - var team = this.props.team; - - if (team && team.allow_valet) { - allowValet = 'true'; - } else { - allowValet = 'false'; - } - - return {allowValet: allowValet}; - } - render() { - var clientError = null; - var serverError = null; - if (this.state.clientError) { - clientError = this.state.clientError; - } - if (this.state.serverError) { - serverError = this.state.serverError; - } - - var valetSection; - - if (this.props.activeSection === 'valet') { - var valetActive = [false, false]; - if (this.state.allowValet === 'false') { - valetActive[1] = true; - } else { - valetActive[0] = true; - } - - let inputs = []; - - inputs.push( -
-
- -
-
-
- -
-
-

Valet is a preview feature for enabling a non-user account limited to basic member permissions that can be manipulated by 3rd parties.

IMPORTANT: The preview version of Valet should not be used without a secure connection and a trusted 3rd party, since user credentials are used to connect. OAuth2 will be used in the final release.
-
- ); - - valetSection = ( - - ); - } else { - var describe = ''; - if (this.state.allowValet === 'false') { - describe = 'Off'; - } else { - describe = 'On'; - } - - valetSection = ( - - ); - } - - return ( -
-
- -

- Advanced Features -

-
-
-

Advanced Features

-
- {valetSection} -
-
-
- ); - } -} - -FeatureTab.defaultProps = { - team: {}, - activeSection: '' -}; -FeatureTab.propTypes = { - updateSection: React.PropTypes.func.isRequired, - team: React.PropTypes.object.isRequired, - activeSection: React.PropTypes.string.isRequired -}; -- cgit v1.2.3-1-g7c22