1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-30 13:41:57 +02:00

api tokens with panel instead of property

Conflicts:
	js/components/settings_container.js
This commit is contained in:
diminator 2015-08-07 15:54:36 +02:00 committed by Tim Daubenschütz
parent 3ff401904b
commit d1edf898fc
2 changed files with 20 additions and 21 deletions

View File

@ -39,7 +39,9 @@ let RegisterPiece = React.createClass( {
submitMessage: React.PropTypes.string, submitMessage: React.PropTypes.string,
children: React.PropTypes.oneOfType([ children: React.PropTypes.oneOfType([
React.PropTypes.arrayOf(React.PropTypes.element), React.PropTypes.arrayOf(React.PropTypes.element),
React.PropTypes.element]) React.PropTypes.element,
React.PropTypes.string
])
}, },
mixins: [Router.Navigation], mixins: [Router.Navigation],

View File

@ -22,10 +22,12 @@ import Form from './ascribe_forms/form';
import Property from './ascribe_forms/property'; import Property from './ascribe_forms/property';
import InputCheckbox from './ascribe_forms/input_checkbox'; import InputCheckbox from './ascribe_forms/input_checkbox';
import ActionPanel from './ascribe_panel/action_panel';
import ApiUrls from '../constants/api_urls'; import ApiUrls from '../constants/api_urls';
import AppConstants from '../constants/application_constants'; import AppConstants from '../constants/application_constants';
import { getLangText } from '../utils/lang_utils';
import { getLangText } from '../utils/lang_utils';
import { getCookie } from '../utils/fetch_api_utils'; import { getCookie } from '../utils/fetch_api_utils';
let SettingsContainer = React.createClass({ let SettingsContainer = React.createClass({
@ -339,20 +341,18 @@ let APISettings = React.createClass({
GlobalNotificationActions.appendGlobalNotification(notification); GlobalNotificationActions.appendGlobalNotification(notification);
}, },
render() { getApplications(){
let content = <img src={AppConstants.baseUrl + 'static/img/ascribe_animated_medium.gif'} />; let content = <img src={AppConstants.baseUrl + 'static/img/ascribe_animated_medium.gif'} />;
if (this.state.applications.length > -1) { if (this.state.applications.length > -1) {
content = this.state.applications.map(function(app, i) { content = this.state.applications.map(function(app, i) {
return ( return (
<Property <ActionPanel
name={app.name} name={app.name}
label={app.name} key={i}
key={i}> title={app.name}
<div className="row-same-height"> content={'Bearer ' + app.bearer_token.token}
<div className="no-padding col-xs-6 col-sm-10 col-xs-height col-middle"> buttons={
{'Bearer ' + app.bearer_token.token} <div className="pull-right">
</div>
<div className="col-xs-6 col-sm-2 col-xs-height">
<button <button
className="pull-right btn btn-default btn-sm" className="pull-right btn btn-default btn-sm"
onClick={this.handleTokenRefresh} onClick={this.handleTokenRefresh}
@ -360,17 +360,14 @@ let APISettings = React.createClass({
{getLangText('REFRESH')} {getLangText('REFRESH')}
</button> </button>
</div> </div>
</div> }/>
</Property>); );
}, this); }, this);
content = (
<div>
<Form>
{content}
<hr />
</Form>
</div>);
} }
return content;
},
render() {
return ( return (
<CollapsibleParagraph <CollapsibleParagraph
title={getLangText('API Integration')} title={getLangText('API Integration')}
@ -392,7 +389,7 @@ let APISettings = React.createClass({
<pre> <pre>
Usage: curl &lt;url&gt; -H 'Authorization: Bearer &lt;token&gt;' Usage: curl &lt;url&gt; -H 'Authorization: Bearer &lt;token&gt;'
</pre> </pre>
{content} {this.getApplications()}
</CollapsibleParagraph> </CollapsibleParagraph>
); );
} }