1
0
mirror of https://github.com/ascribe/onion.git synced 2024-06-30 13:41:57 +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 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';
@ -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>
); );
} }

View File

@ -18,17 +18,12 @@ import FormPropertyHeader from '../../../ascribe_forms/form_property_header';
import ActionPanel from '../../../ascribe_panel/action_panel'; 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 GlobalNotificationModel from '../../../../models/global_notification_model';
import GlobalNotificationActions from '../../../../actions/global_notification_actions'; import GlobalNotificationActions from '../../../../actions/global_notification_actions';
import AppConstants from '../../../../constants/application_constants'; import AppConstants from '../../../../constants/application_constants';
import apiUrls from '../../../../constants/api_urls'; import apiUrls from '../../../../constants/api_urls';
import { ColumnModel} from '../../../ascribe_table/models/table_models';
import { getLangText } from '../../../../utils/lang_utils'; 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; export default Settings;