make production build

This commit is contained in:
Eric Hulburd
2016-02-08 18:23:40 -06:00
parent 3cb2320300
commit 109ad432bb
31 changed files with 330 additions and 1387 deletions

View File

@@ -1 +0,0 @@
base.widget.js

View File

@@ -1 +0,0 @@
campaign_orders.widget.js

View File

@@ -1 +0,0 @@
energy_time_series.widget.js

View File

@@ -0,0 +1,25 @@
import layoutRt from './layout.rt.js';
var Layout = React.createClass({
getInitialState: function() {
},
handleResize: function(e) {
this.setState({windowWidth: window.innerWidth});
},
componentDidMount: function() {
window.addEventListener('resize', this.handleResize);
},
setView: function(event) {
var layout = this;
layout.setState({view: event.target.value});
},
render: function() {
return layoutRt.bind(this);
}
});
export default Layout;

View File

@@ -0,0 +1,6 @@
<div>
<select onChange="{this.setView}">
<option value="savings">Savings</option>
<option value="production">Production</option>
</select>
</div>

View File

@@ -0,0 +1,5 @@
import React from 'react/addons';
import _ from 'lodash';
export default function () {
return React.createElement('div', {}, React.createElement('select', { 'onChange': this.setView }, React.createElement('option', { 'value': 'savings' }, 'Savings'), React.createElement('option', { 'value': 'production' }, 'Production')));
};

View File

@@ -0,0 +1,9 @@
#layout {
h1 {
color: red;
}
}
// needless comment
#yada {
div { padding: 200px; }
}

View File

@@ -1,51 +0,0 @@
import React from 'react';
import Relay from 'react-relay';
class PowerTimeSeries extends React.Component {
get timeframes(){
return [
{display: "Today", value: 'today'},
{display: "1 week", value: 'week'},
{display: "1 month", value: 'month'},
{display: "6 months", value: 'half_year'},
{display: "1 year", value: 'year'}
];
}
render() {
var power_time_series = this;
return (
<div>
<h1>Power Time Series</h1>
<ul>
{power_time_series.props.viewer.widgets.edges.map(edge =>
<li key={edge.node.id}>{edge.node.name} (ID: {edge.node.id})</li>
)}
</ul>
<div class="spk-power-time-series-timeframes">
{power_time_series.timeframes.map(timeframe =>
<div data-value="{timeframe.value}" class="spk-power-time-series-timeframe">{timeframe.display}</div>
)}
</div>
</div>
);
}
}
export default Relay.createContainer(PowerTimeSeries, {
fragments: {
viewer: () => Relay.QL`
fragment on User {
widgets(first: 10) {
edges {
node {
id,
name,
},
},
},
}
`,
},
});

View File

@@ -1 +0,0 @@
production_radiation_time_series.widget.js

View File

@@ -1,6 +0,0 @@
## Dashboard Widgets
After initialized:
1. They get/ check the data they need.
2. Render default graph settings.
3. Update graphs based on user input.