File tree Expand file tree Collapse file tree 3 files changed +33
-4
lines changed Expand file tree Collapse file tree 3 files changed +33
-4
lines changed Original file line number Diff line number Diff line change @@ -586,7 +586,8 @@ var MainApp = (function (_Component) {
586
586
// Set initial state:
587
587
this.state = {
588
588
configItems: [],
589
- currentEditConfigItem: {}
589
+ currentEditConfigItem: {},
590
+ applications: []
590
591
};
591
592
592
593
// Bind our events:
@@ -674,7 +675,8 @@ var MainApp = (function (_Component) {
674
675
key: '_onChange',
675
676
value: function _onChange() {
676
677
this.setState({
677
- configItems: _storesConfigStore2['default'].getConfigItems()
678
+ configItems: _storesConfigStore2['default'].getConfigItems(),
679
+ applications: _storesConfigStore2['default'].getApplications()
678
680
});
679
681
}
680
682
}, {
@@ -960,6 +962,21 @@ var ConfigStore = (function (_Store) {
960
962
value: function getConfigItems() {
961
963
return this.configitems;
962
964
}
965
+ }, {
966
+ key: 'getApplications',
967
+ value: function getApplications() {
968
+ var applications = [];
969
+
970
+ // Cycle through and get the list of applications:
971
+ applications = this.configitems.map(function (item) {
972
+ return item.application;
973
+ });
974
+ applications = applications.filter(function (v, i) {
975
+ return applications.indexOf(v) == i;
976
+ });
977
+
978
+ return applications;
979
+ }
963
980
}, {
964
981
key: '__onDispatch',
965
982
value: function __onDispatch(action) {
Original file line number Diff line number Diff line change @@ -29,7 +29,8 @@ class MainApp extends Component {
29
29
// Set initial state:
30
30
this . state = {
31
31
configItems : [ ] ,
32
- currentEditConfigItem : { }
32
+ currentEditConfigItem : { } ,
33
+ applications : [ ]
33
34
} ;
34
35
35
36
// Bind our events:
@@ -146,7 +147,8 @@ class MainApp extends Component {
146
147
147
148
_onChange ( ) {
148
149
this . setState ( {
149
- configItems : ConfigStore . getConfigItems ( )
150
+ configItems : ConfigStore . getConfigItems ( ) ,
151
+ applications : ConfigStore . getApplications ( )
150
152
} ) ;
151
153
}
152
154
Original file line number Diff line number Diff line change @@ -14,6 +14,16 @@ class ConfigStore extends Store {
14
14
return this . configitems ;
15
15
}
16
16
17
+ getApplications ( ) {
18
+ let applications = [ ] ;
19
+
20
+ // Cycle through and get the list of applications:
21
+ applications = this . configitems . map ( function ( item ) { return item . application ; } ) ;
22
+ applications = applications . filter ( function ( v , i ) { return applications . indexOf ( v ) == i ; } ) ;
23
+
24
+ return applications ;
25
+ }
26
+
17
27
__onDispatch ( action ) {
18
28
19
29
switch ( action . actionType ) {
You can’t perform that action at this time.
0 commit comments