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

Merged in AD-544-automatically-share-registered-pr (pull request #34)

Ad 544 automatically share registered pr
This commit is contained in:
diminator 2015-08-10 17:02:59 +02:00
commit b508df2045
2 changed files with 16 additions and 74 deletions

View File

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

View File

@ -18,17 +18,12 @@ import FormPropertyHeader from '../../../ascribe_forms/form_property_header';
import ActionPanel from '../../../ascribe_panel/action_panel';
import Table from '../../../ascribe_table/table';
import TableItem from '../../../ascribe_table/table_item';
import TableItemText from '../../../ascribe_table/table_item_text';
import GlobalNotificationModel from '../../../../models/global_notification_model';
import GlobalNotificationActions from '../../../../actions/global_notification_actions';
import AppConstants from '../../../../constants/application_constants';
import apiUrls from '../../../../constants/api_urls';
import { ColumnModel} from '../../../ascribe_table/models/table_models';
import { getLangText } from '../../../../utils/lang_utils';
@ -299,54 +294,4 @@ let PrizeJurySettings = React.createClass({
});
let PrizesDashboard = React.createClass({
getColumnList() {
return [
new ColumnModel(
(item) => {
return {
'content': item.name
}; },
'name',
getLangText('Name'),
TableItemText,
6,
false,
null
),
new ColumnModel(
(item) => {
return {
'content': item.domain
}; },
'domain',
getLangText('Domain'),
TableItemText,
1,
false,
null
)
];
},
render() {
return (
<Table
responsive
className="ascribe-table"
columnList={this.getColumnList()}
itemList={this.state.prizeList}>
{this.state.prizeList.map((item, i) => {
return (
<TableItem
className="ascribe-table-item-selectable"
key={i}/>
);
})}
</Table>
);
}
});
export default Settings;