1
0
mirror of https://github.com/ascribe/onion.git synced 2024-12-23 01:39:36 +01:00

add ContractSettingsUpdateButton boilerplate code

This commit is contained in:
Tim Daubenschütz 2015-09-15 11:50:23 +02:00
parent c08f46bd69
commit c5ef3cacd5
4 changed files with 25 additions and 9 deletions

View File

@ -70,7 +70,7 @@ let Property = React.createClass({
// In order to set this.state.value from another component
// the state of value should only be set if its not undefined and
// actually references something
if(typeof childInput.getDOMNode().value !== 'undefined') {
if(childInput && typeof childInput.getDOMNode().value !== 'undefined') {
this.setState({
value: childInput.getDOMNode().value
});

View File

@ -9,12 +9,14 @@ import ContractListStore from '../../stores/contract_list_store';
import ContractListActions from '../../actions/contract_list_actions';
import ActionPanel from '../ascribe_panel/action_panel';
import ContractSettingsUpdateButton from './contract_settings_update_button';
import GlobalNotificationModel from '../../models/global_notification_model';
import GlobalNotificationActions from '../../actions/global_notification_actions';
import { getLangText } from '../../utils/lang_utils';
let ContractSettings = React.createClass({
propTypes: {
defaultExpanded: React.PropTypes.bool
@ -97,7 +99,7 @@ let ContractSettings = React.createClass({
<CollapsibleParagraph
title={getLangText('Contracts')}
show={true}
defaultExpanded={false}>
defaultExpanded={true}>
<CollapsibleParagraph
title={getLangText('Public Contracts')}
show={true}
@ -155,9 +157,7 @@ let ContractSettings = React.createClass({
onClick={this.makeContractPublic(contract)}>
MAKE PUBLIC
</button>
<button className="btn btn-default btn-sm margin-left-2px">
UPDATE
</button>
<ContractSettingsUpdateButton />
<a
className="btn btn-default btn-sm margin-left-2px"
href={contract.blob.url_safe}

View File

@ -0,0 +1,16 @@
'use strict';
import React from 'react';
let ContractSettingsUpdateButton = React.createClass({
render() {
return (
<button className="btn btn-default btn-sm margin-left-2px">
UPDATE
</button>
);
}
});
export default ContractSettingsUpdateButton;

View File

@ -2,14 +2,11 @@
import React from 'react/addons';
import Router from 'react-router';
import fineUploader from 'fineUploader';
import Q from 'q';
import { getCookie } from '../../utils/fetch_api_utils';
import { getLangText } from '../../utils/lang_utils';
import S3Fetcher from '../../fetchers/s3_fetcher';
import fineUploader from 'fineUploader';
import FileDragAndDrop from './ascribe_file_drag_and_drop/file_drag_and_drop';
import GlobalNotificationModel from '../../models/global_notification_model';
@ -17,8 +14,11 @@ import GlobalNotificationActions from '../../actions/global_notification_actions
import AppConstants from '../../constants/application_constants';
import { getCookie } from '../../utils/fetch_api_utils';
import { getLangText } from '../../utils/lang_utils';
import { computeHashOfFile } from '../../utils/file_utils';
var ReactS3FineUploader = React.createClass({
propTypes: {
keyRoutine: React.PropTypes.shape({