nutella_framework 0.4.13 → 0.4.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -1
- data/VERSION +1 -1
- data/framework_components/order.json +2 -1
- data/framework_components/roomcast-bot/data/default/channels-data.json +1 -0
- data/framework_components/roomcast-bot/data/default/channels.json +1 -0
- data/framework_components/roomcast-bot/data/default/configs.json +1 -0
- data/framework_components/roomcast-bot/data/default/mapping.json +1 -0
- data/framework_components/roomcast-bot/roomcast_bot.rb +178 -0
- data/framework_components/roomcast-bot/startup +5 -0
- data/framework_components/roomcast-channel-creator/.gitignore +2 -0
- data/framework_components/roomcast-channel-creator/README.md +9 -0
- data/framework_components/roomcast-channel-creator/dist/app.js +29607 -0
- data/framework_components/roomcast-channel-creator/dist/css/font-awesome.min.css +4 -0
- data/framework_components/roomcast-channel-creator/dist/css/ionicons.min.css +11 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/FontAwesome.otf +0 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/fontawesome-webfont.eot +0 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/fontawesome-webfont.svg +565 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/fontawesome-webfont.ttf +0 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/fontawesome-webfont.woff +0 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/fontawesome-webfont.woff2 +0 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/ionicons.eot +0 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/ionicons.svg +2230 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/ionicons.ttf +0 -0
- data/framework_components/roomcast-channel-creator/dist/fonts/ionicons.woff +0 -0
- data/framework_components/roomcast-channel-creator/dist/main.css +3304 -0
- data/framework_components/roomcast-channel-creator/dist/nutella_lib.js +5068 -0
- data/framework_components/roomcast-channel-creator/gulp/config.js +51 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/browserify.js +77 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/build.js +3 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/css.js +7 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/default.js +3 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/fonts.js +7 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/less.js +16 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/mui-fonts.js +7 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/nutella.js +7 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/setWatch.js +5 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/svgs.js +7 -0
- data/framework_components/roomcast-channel-creator/gulp/tasks/watch.js +12 -0
- data/framework_components/roomcast-channel-creator/gulp/util/bundleLogger.js +21 -0
- data/framework_components/roomcast-channel-creator/gulp/util/handleErrors.js +15 -0
- data/framework_components/roomcast-channel-creator/gulpfile.js +16 -0
- data/framework_components/roomcast-channel-creator/index.html +52 -0
- data/framework_components/roomcast-channel-creator/nutella.json +6 -0
- data/framework_components/roomcast-channel-creator/package.json +37 -0
- data/framework_components/roomcast-channel-creator/src/app/app.js +22 -0
- data/framework_components/roomcast-channel-creator/src/app/components/AnimationMixin.js +44 -0
- data/framework_components/roomcast-channel-creator/src/app/components/CataloguePage.js +130 -0
- data/framework_components/roomcast-channel-creator/src/app/components/Channel.js +378 -0
- data/framework_components/roomcast-channel-creator/src/app/components/ColorCell.js +28 -0
- data/framework_components/roomcast-channel-creator/src/app/components/ColorPicker.js +53 -0
- data/framework_components/roomcast-channel-creator/src/app/components/DetailPage.js +66 -0
- data/framework_components/roomcast-channel-creator/src/app/components/NutellaMixin.js +40 -0
- data/framework_components/roomcast-channel-creator/src/app/components/PageSliderMixin.js +68 -0
- data/framework_components/roomcast-channel-creator/src/app/components/Router.js +52 -0
- data/framework_components/roomcast-channel-creator/src/app/components/TopBar.js +86 -0
- data/framework_components/roomcast-channel-creator/src/app/components/main.js +333 -0
- data/framework_components/roomcast-channel-creator/src/css/font-awesome.min.css +4 -0
- data/framework_components/roomcast-channel-creator/src/css/ionicons.min.css +11 -0
- data/framework_components/roomcast-channel-creator/src/fonts/FontAwesome.otf +0 -0
- data/framework_components/roomcast-channel-creator/src/fonts/fontawesome-webfont.eot +0 -0
- data/framework_components/roomcast-channel-creator/src/fonts/fontawesome-webfont.svg +565 -0
- data/framework_components/roomcast-channel-creator/src/fonts/fontawesome-webfont.ttf +0 -0
- data/framework_components/roomcast-channel-creator/src/fonts/fontawesome-webfont.woff +0 -0
- data/framework_components/roomcast-channel-creator/src/fonts/fontawesome-webfont.woff2 +0 -0
- data/framework_components/roomcast-channel-creator/src/fonts/ionicons.eot +0 -0
- data/framework_components/roomcast-channel-creator/src/fonts/ionicons.svg +2230 -0
- data/framework_components/roomcast-channel-creator/src/fonts/ionicons.ttf +0 -0
- data/framework_components/roomcast-channel-creator/src/fonts/ionicons.woff +0 -0
- data/framework_components/roomcast-channel-creator/src/less/main.less +500 -0
- data/framework_components/roomcast-channel-creator/src/less/my_overrides.less +14 -0
- data/framework_components/roomcast-package-creator/.gitignore +2 -0
- data/framework_components/roomcast-package-creator/README.md +9 -0
- data/framework_components/roomcast-package-creator/dist/app.js +36624 -0
- data/framework_components/roomcast-package-creator/dist/css/font-awesome.min.css +4 -0
- data/framework_components/roomcast-package-creator/dist/css/ionicons.min.css +11 -0
- data/framework_components/roomcast-package-creator/dist/fonts/FontAwesome.otf +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/fontawesome-webfont.eot +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/fontawesome-webfont.svg +565 -0
- data/framework_components/roomcast-package-creator/dist/fonts/fontawesome-webfont.ttf +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/fontawesome-webfont.woff +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/fontawesome-webfont.woff2 +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/ionicons.eot +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/ionicons.svg +2230 -0
- data/framework_components/roomcast-package-creator/dist/fonts/ionicons.ttf +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/ionicons.woff +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/material-ui-icons.eot +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/material-ui-icons.svg +14 -0
- data/framework_components/roomcast-package-creator/dist/fonts/material-ui-icons.ttf +0 -0
- data/framework_components/roomcast-package-creator/dist/fonts/material-ui-icons.woff +0 -0
- data/framework_components/roomcast-package-creator/dist/main.css +5932 -0
- data/framework_components/roomcast-package-creator/dist/nutella_lib.js +5068 -0
- data/framework_components/roomcast-package-creator/gulp/config.js +51 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/browserify.js +77 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/build.js +3 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/css.js +7 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/default.js +3 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/fonts.js +7 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/less.js +16 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/mui-fonts.js +7 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/nutella.js +7 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/setWatch.js +5 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/svgs.js +7 -0
- data/framework_components/roomcast-package-creator/gulp/tasks/watch.js +12 -0
- data/framework_components/roomcast-package-creator/gulp/util/bundleLogger.js +21 -0
- data/framework_components/roomcast-package-creator/gulp/util/handleErrors.js +15 -0
- data/framework_components/roomcast-package-creator/gulpfile.js +16 -0
- data/framework_components/roomcast-package-creator/index.html +51 -0
- data/framework_components/roomcast-package-creator/nutella.json +6 -0
- data/framework_components/roomcast-package-creator/package.json +38 -0
- data/framework_components/roomcast-package-creator/src/app/app.js +19 -0
- data/framework_components/roomcast-package-creator/src/app/components/ButtonInteractionsMixin.js +45 -0
- data/framework_components/roomcast-package-creator/src/app/components/ChannelCard.js +87 -0
- data/framework_components/roomcast-package-creator/src/app/components/ChannelItem.js +71 -0
- data/framework_components/roomcast-package-creator/src/app/components/ChannelsCatalogue.js +64 -0
- data/framework_components/roomcast-package-creator/src/app/components/ChannelsPanel.js +127 -0
- data/framework_components/roomcast-package-creator/src/app/components/ConfigField.js +50 -0
- data/framework_components/roomcast-package-creator/src/app/components/ConfigurationsPanel.js +114 -0
- data/framework_components/roomcast-package-creator/src/app/components/ContextButton.js +37 -0
- data/framework_components/roomcast-package-creator/src/app/components/GlobalButton.js +26 -0
- data/framework_components/roomcast-package-creator/src/app/components/NutellaMixin.js +23 -0
- data/framework_components/roomcast-package-creator/src/app/components/PoolHeader.js +67 -0
- data/framework_components/roomcast-package-creator/src/app/components/PoolRow.js +160 -0
- data/framework_components/roomcast-package-creator/src/app/components/ResourceFamilyPool.js +168 -0
- data/framework_components/roomcast-package-creator/src/app/components/ResourcesPanel.js +76 -0
- data/framework_components/roomcast-package-creator/src/app/components/main.js +222 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/dialog_.jsx +66 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/drop-down-menu.jsx +163 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/enhanced-textarea.jsx +113 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/floating-action-button_.jsx +73 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/menu-item.jsx +100 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/menu.jsx +209 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/overlay.jsx +21 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/raised-button_.jsx +72 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/right-nav.jsx +108 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/svg-icons/drop-down-arrow.jsx +17 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/svg-icons/navigation-chevron-left.jsx +16 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/svg-icons/navigation-chevron-right.jsx +17 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/svg-icons/navigation-menu.jsx +16 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/svg-icons/svg-icon.jsx +23 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/svg-icons/toggle-check-box-checked.jsx +16 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/svg-icons/toggle-check-box-outline-blank.jsx +16 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/svg-icons/toggle-radio-button-off.jsx +16 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/svg-icons/toggle-radio-button-on.jsx +16 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/text-field.jsx +215 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/utils/css-event.js +52 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/utils/date-time.js +132 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/utils/dom.js +71 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/utils/events.js +34 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/utils/key-code.js +10 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/utils/key-line.js +13 -0
- data/framework_components/roomcast-package-creator/src/app/components/material-ui/utils/unique-id.js +7 -0
- data/framework_components/roomcast-package-creator/src/css/font-awesome.min.css +4 -0
- data/framework_components/roomcast-package-creator/src/css/ionicons.min.css +11 -0
- data/framework_components/roomcast-package-creator/src/fonts/FontAwesome.otf +0 -0
- data/framework_components/roomcast-package-creator/src/fonts/fontawesome-webfont.eot +0 -0
- data/framework_components/roomcast-package-creator/src/fonts/fontawesome-webfont.svg +565 -0
- data/framework_components/roomcast-package-creator/src/fonts/fontawesome-webfont.ttf +0 -0
- data/framework_components/roomcast-package-creator/src/fonts/fontawesome-webfont.woff +0 -0
- data/framework_components/roomcast-package-creator/src/fonts/fontawesome-webfont.woff2 +0 -0
- data/framework_components/roomcast-package-creator/src/fonts/ionicons.eot +0 -0
- data/framework_components/roomcast-package-creator/src/fonts/ionicons.svg +2230 -0
- data/framework_components/roomcast-package-creator/src/fonts/ionicons.ttf +0 -0
- data/framework_components/roomcast-package-creator/src/fonts/ionicons.woff +0 -0
- data/framework_components/roomcast-package-creator/src/less/drop-down-icon.less +43 -0
- data/framework_components/roomcast-package-creator/src/less/drop-down-menu.less +77 -0
- data/framework_components/roomcast-package-creator/src/less/enhanced-textarea.less +16 -0
- data/framework_components/roomcast-package-creator/src/less/main.less +491 -0
- data/framework_components/roomcast-package-creator/src/less/menu-item.less +69 -0
- data/framework_components/roomcast-package-creator/src/less/menu.less +50 -0
- data/framework_components/roomcast-package-creator/src/less/my_overrides.less +15 -0
- data/framework_components/roomcast-package-creator/src/less/svg-icon.less +11 -0
- data/framework_components/roomcast-package-creator/src/less/text-field.less +168 -0
- data/lib/commands/checkup.rb +1 -1
- data/nutella_lib/framework_net.rb +0 -1
- metadata +173 -4
@@ -0,0 +1,127 @@
|
|
1
|
+
var React = require('react');
|
2
|
+
var Mui = require('material-ui');
|
3
|
+
var Paper = Mui.Paper;
|
4
|
+
var ChannelInfo = require('./ChannelCard');
|
5
|
+
var ChannelsCatalogue = require('./ChannelsCatalogue');
|
6
|
+
var RaisedButton = require('./material-ui/raised-button_.jsx');
|
7
|
+
var Dialog = require('./material-ui/dialog_.jsx');
|
8
|
+
var FlatButton = Mui.FlatButton;
|
9
|
+
|
10
|
+
var ChannelsPanel = React.createClass({
|
11
|
+
|
12
|
+
handleSaveChanges: function() {
|
13
|
+
this.props.onSaveChanges();
|
14
|
+
},
|
15
|
+
|
16
|
+
handleUndoChanges: function() {
|
17
|
+
this.props.onUndoChanges();
|
18
|
+
},
|
19
|
+
|
20
|
+
enableUndoDialog: function() {
|
21
|
+
this.refs.undoDialog.show();
|
22
|
+
},
|
23
|
+
|
24
|
+
disableUndoDialog: function() {
|
25
|
+
this.refs.undoDialog.dismiss();
|
26
|
+
},
|
27
|
+
|
28
|
+
handleSelectedChannel: function(ch) {
|
29
|
+
this.props.onSelectedChannel(ch);
|
30
|
+
},
|
31
|
+
|
32
|
+
enableSaveDialog: function() {
|
33
|
+
this.refs.saveDialog.show();
|
34
|
+
},
|
35
|
+
|
36
|
+
disableSaveDialog: function() {
|
37
|
+
this.refs.saveDialog.dismiss();
|
38
|
+
},
|
39
|
+
|
40
|
+
|
41
|
+
render: function() {
|
42
|
+
|
43
|
+
var self = this;
|
44
|
+
|
45
|
+
var handleOnSave = function() {
|
46
|
+
self.handleSaveChanges();
|
47
|
+
self.disableSaveDialog();
|
48
|
+
};
|
49
|
+
|
50
|
+
var customActionsSave = [
|
51
|
+
React.createElement(FlatButton, {
|
52
|
+
key: 2,
|
53
|
+
label: "Confirm",
|
54
|
+
secondary: true,
|
55
|
+
onTouchTap: handleOnSave}),
|
56
|
+
React.createElement(FlatButton, {
|
57
|
+
key: 1,
|
58
|
+
label: "Cancel",
|
59
|
+
primary: true,
|
60
|
+
onTouchTap: this.disableSaveDialog})
|
61
|
+
];
|
62
|
+
|
63
|
+
var handleOnUndo = function() {
|
64
|
+
self.handleUndoChanges();
|
65
|
+
self.disableUndoDialog();
|
66
|
+
};
|
67
|
+
|
68
|
+
var customActionsUndo = [
|
69
|
+
React.createElement(FlatButton, {
|
70
|
+
key: 2,
|
71
|
+
label: "Confirm",
|
72
|
+
secondary: true,
|
73
|
+
onTouchTap: handleOnUndo}),
|
74
|
+
React.createElement(FlatButton, {
|
75
|
+
key: 1,
|
76
|
+
label: "Cancel",
|
77
|
+
primary: true,
|
78
|
+
onTouchTap: this.disableUndoDialog})
|
79
|
+
];
|
80
|
+
|
81
|
+
return (
|
82
|
+
|
83
|
+
<div className="channels-panel">
|
84
|
+
|
85
|
+
<Paper className='channels-panel-paper'>
|
86
|
+
|
87
|
+
<div className='channels-catalogue-title-div-outer'>
|
88
|
+
<div className='channels-catalogue-title-div-middle'>
|
89
|
+
<div className='channels-catalogue-title-div-inner'>
|
90
|
+
<p> Channels Catalogue </p>
|
91
|
+
</div>
|
92
|
+
</div>
|
93
|
+
</div>
|
94
|
+
|
95
|
+
<ChannelsCatalogue
|
96
|
+
channels={this.props.channels}
|
97
|
+
onSelectedChannel={this.handleSelectedChannel}
|
98
|
+
selectedChannel={this.props.selectedChannel} />
|
99
|
+
|
100
|
+
<div className='channels-panel-save-buttons-div-outer' >
|
101
|
+
|
102
|
+
<div className='channels-panel-save-buttons-div-inner' >
|
103
|
+
|
104
|
+
<div className='div-button-container-final-button'>
|
105
|
+
<RaisedButton className='save-button' label='Save changes' secondary={true} saveButton={true} onTouchTap={this.enableSaveDialog} />
|
106
|
+
</div>
|
107
|
+
|
108
|
+
<div className='div-button-container-final-button'>
|
109
|
+
<RaisedButton className='undo-button' label='Undo changes' primary={true} undoButton={true} onTouchTap={this.enableUndoDialog} />
|
110
|
+
</div>
|
111
|
+
|
112
|
+
</div>
|
113
|
+
|
114
|
+
</div>
|
115
|
+
|
116
|
+
</Paper>
|
117
|
+
|
118
|
+
<Dialog ref='saveDialog' actions={customActionsSave} > Do you want to save this configuration? </Dialog>
|
119
|
+
<Dialog ref='undoDialog' actions={customActionsUndo} > Do you want to reload the starting configuration? </Dialog>
|
120
|
+
|
121
|
+
</div> );
|
122
|
+
}
|
123
|
+
|
124
|
+
});
|
125
|
+
|
126
|
+
module.exports = ChannelsPanel;
|
127
|
+
|
@@ -0,0 +1,50 @@
|
|
1
|
+
var React = require('react');
|
2
|
+
var Mui = require('material-ui');
|
3
|
+
|
4
|
+
var ConfigField = React.createClass({
|
5
|
+
|
6
|
+
componentDidMount: function() {
|
7
|
+
this.setValue(this.props.value);
|
8
|
+
},
|
9
|
+
|
10
|
+
componentDidUpdate: function() {
|
11
|
+
if(this.props.hasToUpdateValues) {
|
12
|
+
this.setValue();
|
13
|
+
this.props.onUpdatedValues();
|
14
|
+
}
|
15
|
+
},
|
16
|
+
|
17
|
+
handleChange: function() {
|
18
|
+
if(!this.props.lastItem) {
|
19
|
+
this.props.onChange(this.props.configId, this.refs.configInput.getDOMNode().value);
|
20
|
+
}
|
21
|
+
},
|
22
|
+
|
23
|
+
setValue: function() {
|
24
|
+
this.refs.configInput.getDOMNode().value = this.props.value;
|
25
|
+
},
|
26
|
+
|
27
|
+
getValue: function() {
|
28
|
+
return this.refs.configInput.getDOMNode().value;
|
29
|
+
},
|
30
|
+
|
31
|
+
render: function() {
|
32
|
+
|
33
|
+
return (
|
34
|
+
|
35
|
+
<div className='config-text-field-div'>
|
36
|
+
<input
|
37
|
+
ref='configInput'
|
38
|
+
type='text'
|
39
|
+
className='config-input'
|
40
|
+
placeholder={this.props.placeholder}
|
41
|
+
onChange={this.handleChange}
|
42
|
+
required={true} />
|
43
|
+
</div>);
|
44
|
+
|
45
|
+
}
|
46
|
+
|
47
|
+
});
|
48
|
+
|
49
|
+
module.exports = ConfigField;
|
50
|
+
|
@@ -0,0 +1,114 @@
|
|
1
|
+
var React = require('react');
|
2
|
+
var Mui = require('material-ui');
|
3
|
+
var NutellaMixin = require('./NutellaMixin');
|
4
|
+
var Paper = Mui.Paper;
|
5
|
+
var DropDownMenu = require('./material-ui/drop-down-menu.jsx');
|
6
|
+
|
7
|
+
/**
|
8
|
+
*/
|
9
|
+
var ConfigurationsPanel = React.createClass({
|
10
|
+
|
11
|
+
mixins: [NutellaMixin],
|
12
|
+
|
13
|
+
componentDidMount: function() {
|
14
|
+
var self = this;
|
15
|
+
self.didReceivedFirstConfigs = false;
|
16
|
+
self.lastSavedNames = {};
|
17
|
+
|
18
|
+
// Subscribe for future changes
|
19
|
+
nutella.net.subscribe('configs/update', function (message, from) {
|
20
|
+
if(message.length !== 0) {
|
21
|
+
self.updatePlaceholders(message);
|
22
|
+
}
|
23
|
+
});
|
24
|
+
},
|
25
|
+
|
26
|
+
componentWillReceiveProps: function() {
|
27
|
+
if(!this.didReceivedFirstConfigs && this.props.configs.length !== 0) {
|
28
|
+
// Set initial placeholders
|
29
|
+
this.updatePlaceholders(this.props.configs);
|
30
|
+
this.didReceivedFirstConfigs = true;
|
31
|
+
}
|
32
|
+
},
|
33
|
+
|
34
|
+
updatePlaceholders: function(configs) {
|
35
|
+
for (var c in configs) {
|
36
|
+
if (configs.hasOwnProperty(c)) {
|
37
|
+
this.lastSavedNames[c] = configs[c].name;
|
38
|
+
}
|
39
|
+
}
|
40
|
+
},
|
41
|
+
|
42
|
+
shouldComponentUpdate: function() {
|
43
|
+
return this.props.configs.length !== 0;
|
44
|
+
},
|
45
|
+
|
46
|
+
handleChangeConfig: function(e, selectedIndex, menuItem) {
|
47
|
+
this.props.onChangeConfig(menuItem.configId);
|
48
|
+
},
|
49
|
+
|
50
|
+
handleDeleteConfig: function(menuItem) {
|
51
|
+
console.log('deleting configId', menuItem.configId);
|
52
|
+
this.props.onDeleteConfig(menuItem.configId);
|
53
|
+
},
|
54
|
+
|
55
|
+
handleInputChange: function(id, value) {
|
56
|
+
this.props.onUpdateConfigName(id, value);
|
57
|
+
},
|
58
|
+
|
59
|
+
render: function() {
|
60
|
+
|
61
|
+
var self = this;
|
62
|
+
var dropdown = null;
|
63
|
+
var menuItems = [];
|
64
|
+
|
65
|
+
var configs = this.props.configs;
|
66
|
+
if(configs.length !== 0) {
|
67
|
+
var ids = [];
|
68
|
+
for(var c in configs) {
|
69
|
+
if(configs.hasOwnProperty(c)) {
|
70
|
+
ids.push(+c);
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
function sortNumber(a,b) {
|
75
|
+
return b - a;
|
76
|
+
}
|
77
|
+
ids.sort(sortNumber);
|
78
|
+
|
79
|
+
ids.forEach(function(id, i) {
|
80
|
+
menuItems.push({configId: id, text: configs[id].name, lastSavedName: self.lastSavedNames[id]});
|
81
|
+
});
|
82
|
+
|
83
|
+
// Add last item: new configuration
|
84
|
+
menuItems.push({configId: 0, text: '', lastSavedName: 'Add configuration'});
|
85
|
+
|
86
|
+
dropdown = (<DropDownMenu
|
87
|
+
menuItems={menuItems}
|
88
|
+
configMenu={true}
|
89
|
+
autoWidth={false}
|
90
|
+
onChange={this.handleChangeConfig}
|
91
|
+
onDeleteConfig={this.handleDeleteConfig}
|
92
|
+
onAddEmptyConfig={this.props.onAddEmptyConfig}
|
93
|
+
onInputChange={this.handleInputChange} />);
|
94
|
+
}
|
95
|
+
|
96
|
+
return (
|
97
|
+
<div className='configurations-panel-div'>
|
98
|
+
|
99
|
+
<Paper>
|
100
|
+
|
101
|
+
<span className='config-title'> Configuration: </span>
|
102
|
+
|
103
|
+
{dropdown}
|
104
|
+
|
105
|
+
</Paper>
|
106
|
+
|
107
|
+
</div>);
|
108
|
+
|
109
|
+
}
|
110
|
+
|
111
|
+
});
|
112
|
+
|
113
|
+
module.exports = ConfigurationsPanel;
|
114
|
+
|
@@ -0,0 +1,37 @@
|
|
1
|
+
var React = require('react');
|
2
|
+
var Mui = require('material-ui');
|
3
|
+
var FloatingActionButton_ = require('./material-ui/floating-action-button_.jsx');
|
4
|
+
|
5
|
+
/**
|
6
|
+
* @prop type
|
7
|
+
* @prop selectedChannel
|
8
|
+
* @prop onAddedChannel
|
9
|
+
* @prop onRemovedChannel
|
10
|
+
*/
|
11
|
+
var ContextButton = React.createClass({
|
12
|
+
|
13
|
+
addChannel: function() {
|
14
|
+
this.props.onAddedChannel(this.props.selectedChannel.id);
|
15
|
+
},
|
16
|
+
|
17
|
+
removeChannel: function() {
|
18
|
+
this.props.onRemovedChannel(this.props.selectedChannel.id);
|
19
|
+
},
|
20
|
+
|
21
|
+
render: function() {
|
22
|
+
|
23
|
+
var button = this.props.type==='add'? <FloatingActionButton_ icon='content-add' secondary={true} onTouchTap={this.addChannel} /> :
|
24
|
+
<FloatingActionButton_ icon='content-remove' primary={true} onTouchTap={this.removeChannel} />;
|
25
|
+
|
26
|
+
return (
|
27
|
+
<div className='div-button-container'>
|
28
|
+
{button}
|
29
|
+
</div>
|
30
|
+
);
|
31
|
+
|
32
|
+
}
|
33
|
+
|
34
|
+
});
|
35
|
+
|
36
|
+
module.exports = ContextButton;
|
37
|
+
|
@@ -0,0 +1,26 @@
|
|
1
|
+
var React = require('react');
|
2
|
+
var Mui = require('material-ui');
|
3
|
+
var RaisedButton = require('./material-ui/raised-button_.jsx');
|
4
|
+
|
5
|
+
/**
|
6
|
+
* @prop type
|
7
|
+
* @prop onRemovedChannels
|
8
|
+
*/
|
9
|
+
var GlobalButton = React.createClass({
|
10
|
+
|
11
|
+
removeChannels: function() {
|
12
|
+
this.props.onRemovedChannels();
|
13
|
+
},
|
14
|
+
|
15
|
+
render: function(){
|
16
|
+
|
17
|
+
var button = this.props.type==='add'? <RaisedButton label='Add' secondary={true} /> : <RaisedButton label='Remove' primary={true} onTouchTap={this.removeChannels} />;
|
18
|
+
return (<div className='div-button-container'>
|
19
|
+
{button}
|
20
|
+
</div>);
|
21
|
+
}
|
22
|
+
|
23
|
+
});
|
24
|
+
|
25
|
+
module.exports = GlobalButton;
|
26
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
|
2
|
+
var NutellaMixin = {
|
3
|
+
|
4
|
+
getChannelsForRid: function(message, rid) {
|
5
|
+
var myChannelsId = [];
|
6
|
+
var myChannels = [];
|
7
|
+
message.forEach(function(f) {
|
8
|
+
for (var i in f.items) {
|
9
|
+
var item = f.items[i];
|
10
|
+
if (item.name === 'iPad1') {
|
11
|
+
myChannelsId = item.channels;
|
12
|
+
break;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
});
|
16
|
+
myChannelsId.forEach(function(id) {
|
17
|
+
myChannels.push(CHANNELS[id]);
|
18
|
+
});
|
19
|
+
}
|
20
|
+
|
21
|
+
};
|
22
|
+
|
23
|
+
module.exports = NutellaMixin;
|
@@ -0,0 +1,67 @@
|
|
1
|
+
var React = require('react');
|
2
|
+
var Mui = require('material-ui');
|
3
|
+
var RaisedButton_ = require('./material-ui/raised-button_.jsx');
|
4
|
+
var ContextButton = require('./ContextButton');
|
5
|
+
var GlobalButton = require('./GlobalButton');
|
6
|
+
|
7
|
+
/**
|
8
|
+
* @prop familyName
|
9
|
+
* @prop selectedChannel
|
10
|
+
* @prop onRemovedAllChannels
|
11
|
+
* @prop onAddedChannelToPool
|
12
|
+
* @prop onRemovedChannelFromPool
|
13
|
+
*/
|
14
|
+
var PoolHeader = React.createClass({
|
15
|
+
|
16
|
+
handleAddedChannel: function(chId) {
|
17
|
+
this.props.onAddedChannelToPool(chId);
|
18
|
+
},
|
19
|
+
|
20
|
+
handleRemovedChannel: function(chId) {
|
21
|
+
this.props.onRemovedChannelFromPool(chId);
|
22
|
+
},
|
23
|
+
|
24
|
+
handleRemovedChannels: function() {
|
25
|
+
this.props.onRemovedAllChannels();
|
26
|
+
},
|
27
|
+
|
28
|
+
render: function() {
|
29
|
+
|
30
|
+
var buttonStyle = {
|
31
|
+
marginRight:'10px'
|
32
|
+
};
|
33
|
+
|
34
|
+
var buttonAdd, buttonRemove, headerButtons;
|
35
|
+
if(this.props.selectedChannel) {
|
36
|
+
buttonAdd = <ContextButton
|
37
|
+
type='add'
|
38
|
+
onAddedChannel={this.handleAddedChannel}
|
39
|
+
selectedChannel={this.props.selectedChannel} />;
|
40
|
+
buttonRemove = <ContextButton
|
41
|
+
type='remove'
|
42
|
+
onRemovedChannel={this.handleRemovedChannel}
|
43
|
+
selectedChannel={this.props.selectedChannel} />;
|
44
|
+
headerButtons = <th>
|
45
|
+
{buttonAdd}
|
46
|
+
{buttonRemove}
|
47
|
+
</th>
|
48
|
+
} else {
|
49
|
+
buttonRemove = <GlobalButton type='remove' onRemovedChannels={this.handleRemovedChannels} />;
|
50
|
+
headerButtons = <th>
|
51
|
+
{buttonRemove}
|
52
|
+
</th>
|
53
|
+
}
|
54
|
+
|
55
|
+
return (
|
56
|
+
|
57
|
+
<tr className='pool-header'>
|
58
|
+
<th></th>
|
59
|
+
<th> {this.props.familyName} </th>
|
60
|
+
{headerButtons}
|
61
|
+
<th></th>
|
62
|
+
</tr>);
|
63
|
+
|
64
|
+
}
|
65
|
+
});
|
66
|
+
|
67
|
+
module.exports = PoolHeader;
|
@@ -0,0 +1,160 @@
|
|
1
|
+
var React = require('react');
|
2
|
+
var Mui = require('material-ui');
|
3
|
+
var ChannelItem = require('./ChannelItem');
|
4
|
+
var ContextButton = require('./ContextButton');
|
5
|
+
var GlobalButton = require('./GlobalButton');
|
6
|
+
var ButtonInteractionsMixin = require('./ButtonInteractionsMixin');
|
7
|
+
var TextField = require('./material-ui/text-field.jsx');
|
8
|
+
var FloatingActionButton = Mui.FloatingActionButton;
|
9
|
+
|
10
|
+
var PoolRow = React.createClass({
|
11
|
+
|
12
|
+
mixins: [ButtonInteractionsMixin],
|
13
|
+
|
14
|
+
handleSelectedChannel: function(ch) {
|
15
|
+
this.props.onSelectedChannel(ch);
|
16
|
+
},
|
17
|
+
|
18
|
+
handleAddedChannel: function(chId) {
|
19
|
+
var newChannels = this.insertNewChannel(this.props.resourceWithChannels.channels, chId);
|
20
|
+
this.handleUpdatedChannel(newChannels);
|
21
|
+
},
|
22
|
+
|
23
|
+
handleRemovedChannel: function(chId) {
|
24
|
+
var newChannels = this.removeChannel(this.props.resourceWithChannels.channels, chId);
|
25
|
+
this.handleUpdatedChannel(newChannels);
|
26
|
+
},
|
27
|
+
|
28
|
+
/**
|
29
|
+
* Deep copies data structure at this level with the local changes.
|
30
|
+
* Has to be reimplemented at each level of the hierarchy.
|
31
|
+
* @param newChannels
|
32
|
+
*/
|
33
|
+
handleUpdatedChannel: function(newChannels) {
|
34
|
+
|
35
|
+
var textFieldValue = this.refs['textField' + this.props.rowIndex].getValue();
|
36
|
+
|
37
|
+
// create new object for single resource
|
38
|
+
var resourceMapping = {
|
39
|
+
name: textFieldValue,
|
40
|
+
channels: newChannels
|
41
|
+
};
|
42
|
+
|
43
|
+
// pass update upwards
|
44
|
+
this.props.onUpdatedMapping(resourceMapping, this.props.rowIndex);
|
45
|
+
},
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Removes all the channels from this row.
|
49
|
+
*/
|
50
|
+
handleRemovedChannels: function() {
|
51
|
+
var newChannels = [];
|
52
|
+
this.handleUpdatedChannel(newChannels);
|
53
|
+
},
|
54
|
+
|
55
|
+
/**
|
56
|
+
* Updates the mapping structure at each text field input change.
|
57
|
+
* TODO performance?
|
58
|
+
*/
|
59
|
+
handleTextFieldChange: function() {
|
60
|
+
this.handleUpdatedChannel(this.props.resourceWithChannels.channels);
|
61
|
+
},
|
62
|
+
|
63
|
+
handleDeleteRow: function() {
|
64
|
+
this.props.onDeleteRow(this.props.rowIndex);
|
65
|
+
},
|
66
|
+
|
67
|
+
render: function () {
|
68
|
+
|
69
|
+
var self=this;
|
70
|
+
|
71
|
+
// populate row of channels
|
72
|
+
var channelsList = [];
|
73
|
+
this.props.resourceWithChannels.channels.forEach(function (chId) {
|
74
|
+
|
75
|
+
// set selected channel in resources list
|
76
|
+
var resourcesSelected = null;
|
77
|
+
if(self.props.selectedChannel && self.props.selectedChannel.imgNode == self.refs.channel) {
|
78
|
+
resourcesSelected = true;
|
79
|
+
}
|
80
|
+
|
81
|
+
var itsChannel = self.props.channels[chId];
|
82
|
+
if(itsChannel) {
|
83
|
+
channelsList.push(<ChannelItem
|
84
|
+
ref={'channel'}
|
85
|
+
id={chId}
|
86
|
+
key={chId}
|
87
|
+
channelData={itsChannel}
|
88
|
+
name={itsChannel.name}
|
89
|
+
imgPath={itsChannel.screenshot}
|
90
|
+
onSelectedChannel={self.handleSelectedChannel}
|
91
|
+
currentSelectedChannel={self.props.selectedChannel}
|
92
|
+
belongsTo='resources'
|
93
|
+
resourcesSelected={true} />);
|
94
|
+
}
|
95
|
+
});
|
96
|
+
|
97
|
+
// check if the selected channel is already present in this row
|
98
|
+
var itsChannels = self.props.resourceWithChannels.channels;
|
99
|
+
var isChannelAllowed = function(ch) {
|
100
|
+
if(!self.props.selectedChannel.id) return;
|
101
|
+
for(var i=0; i<itsChannels.length; i++){
|
102
|
+
if(itsChannels[i]===self.props.selectedChannel.id) return true;
|
103
|
+
}
|
104
|
+
return false;
|
105
|
+
};
|
106
|
+
|
107
|
+
// set type of button based on context
|
108
|
+
var button;
|
109
|
+
if( this.props.selectedChannel ) {
|
110
|
+
if( isChannelAllowed(this.props.selectedChannel) ) {
|
111
|
+
button=<ContextButton
|
112
|
+
type='remove'
|
113
|
+
selectedChannel={self.props.selectedChannel}
|
114
|
+
onRemovedChannel={self.handleRemovedChannel} />;
|
115
|
+
} else {
|
116
|
+
button=<ContextButton
|
117
|
+
type='add'
|
118
|
+
selectedChannel={self.props.selectedChannel}
|
119
|
+
onAddedChannel={self.handleAddedChannel} />;
|
120
|
+
}
|
121
|
+
} else {
|
122
|
+
button=<GlobalButton
|
123
|
+
type='remove'
|
124
|
+
onRemovedChannels={self.handleRemovedChannels} />;
|
125
|
+
}
|
126
|
+
|
127
|
+
var tdButtonStyle = {
|
128
|
+
'textAlign': 'center'
|
129
|
+
};
|
130
|
+
|
131
|
+
return (
|
132
|
+
|
133
|
+
<tr className='pool-row'>
|
134
|
+
|
135
|
+
<td>
|
136
|
+
|
137
|
+
<div className='remove-row-div' onTouchTap={this.handleDeleteRow}> </div>
|
138
|
+
|
139
|
+
</td>
|
140
|
+
|
141
|
+
<td>
|
142
|
+
<div className='text-field-div'>
|
143
|
+
<TextField
|
144
|
+
ref={'textField' + this.props.rowIndex}
|
145
|
+
hintText={'Group name'}
|
146
|
+
value={this.props.resourceWithChannels.name}
|
147
|
+
multiLine={true}
|
148
|
+
onChange={this.handleTextFieldChange}/>
|
149
|
+
</div>
|
150
|
+
</td>
|
151
|
+
|
152
|
+
<td> {channelsList} </td>
|
153
|
+
<td style={tdButtonStyle}> {button} </td>
|
154
|
+
|
155
|
+
</tr>);
|
156
|
+
|
157
|
+
}
|
158
|
+
});
|
159
|
+
|
160
|
+
module.exports = PoolRow;
|