Skip to content

Commit 9064304

Browse files
authored
Merge pull request #38 from cazetto/homolog
Fix
2 parents 722d4bc + f2a5f45 commit 9064304

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

src/dashboard/Dashboard.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ import { setBasePath } from 'lib/AJAX';
5252
import Header from 'components/back4App/Header/Header.react';
5353
import Sidebar from 'components/back4App/Sidebar/Sidebar.react';
5454
import ServerSettings from 'dashboard/ServerSettings/ServerSettings.react';
55+
import { ActionTypes } from 'lib/stores/back4App/AppsStore';
56+
import subscribeTo from 'lib/subscribeTo';
5557

5658
import {
5759
Router,
@@ -61,12 +63,17 @@ import {
6163

6264
const ShowSchemaOverview = false; //In progress features. Change false to true to work on this feature.
6365

66+
// @subscribeTo('Apps', 'apps')
67+
// @subscribeTo('Schema', 'schema')
68+
// @subscribeTo('Jobs', 'jobs')
6469
class App extends React.Component {
6570
constructor(props) {
6671
super(props);
6772
this.state = {
6873
sidebarIsOpen: false
6974
};
75+
76+
console.log(this.props.apps)
7077
}
7178

7279
handleSidebarToggle(isOpen) {
@@ -196,8 +203,8 @@ class Dashboard extends React.Component {
196203
}
197204
});
198205
return Parse.Promise.when(appInfoPromises);
199-
}).then(function() {
200-
Array.prototype.slice.call(arguments).forEach(app => {
206+
}).then(function(resolvedApps) {
207+
resolvedApps.forEach(app => {
201208
AppsManager.addApp(app);
202209
});
203210
this.setState({ configLoadingState: AsyncStatus.SUCCESS });

src/lib/stores/back4App/AppsStore.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import keyMirror from 'lib/keyMirror';
2+
import Parse from 'parse';
3+
import { Map, List } from 'immutable';
4+
import { registerStore } from 'lib/stores/StoreManager';
5+
6+
export const ActionTypes = keyMirror([
7+
'FETCH'
8+
]);
9+
10+
// Apps state should be an Immutable Map with the following fields:
11+
// - lastFetch: the last time all data was fetched from the server
12+
// - apps: An Immutable Map of schedule ids to Maps of apps details
13+
14+
function AppsStore(state, action) {
15+
switch (action.type) {
16+
case ActionTypes.FETCH:
17+
console.log('AppsStore:FETCH');
18+
}
19+
}
20+
21+
registerStore('Apps', AppsStore);

0 commit comments

Comments
 (0)