File tree Expand file tree Collapse file tree 5 files changed +41
-37
lines changed Expand file tree Collapse file tree 5 files changed +41
-37
lines changed Original file line number Diff line number Diff line change @@ -71,7 +71,7 @@ let AppCard = ({
71
71
</ CountsSection >
72
72
< div className = { styles . details } >
73
73
< a className = { styles . appname } > { app . name } </ a >
74
- < div className = { styles . serverVersion } > Server version: < span className = { styles . ago } > { app . enabledFeatures . serverVersion || 'unknown' } </ span > </ div >
74
+ < div className = { styles . serverVersion } > Server version: < span className = { styles . ago } > { app . serverInfo . serverVersion || 'unknown' } </ span > </ div >
75
75
</ div >
76
76
</ li >
77
77
Original file line number Diff line number Diff line change @@ -93,44 +93,48 @@ class Dashboard extends React.Component {
93
93
if ( app . serverURL . startsWith ( 'https://api.parse.com/1' ) ) {
94
94
//api.parse.com doesn't have feature availability endpoint, fortunately we know which features
95
95
//it supports and can hard code them
96
- app . enabledFeatures = {
97
- schemas : {
98
- addField : true ,
99
- removeField : true ,
100
- addClass : true ,
101
- removeClass : true ,
102
- clearAllDataFromClass : false , //This still goes through ruby
103
- exportClass : false , //Still goes through ruby
104
- } ,
105
- cloudCode : {
106
- viewCode : true ,
107
- } ,
108
- hooks : {
109
- create : true ,
110
- read : true ,
111
- update : true ,
112
- delete : true ,
113
- } ,
114
- logs : {
115
- info : true ,
116
- error : true ,
117
- } ,
118
- globalConfig : {
119
- create : true ,
120
- read : true ,
121
- update : true ,
122
- delete : true ,
96
+ app . serverInfo = {
97
+ features : {
98
+ schemas : {
99
+ addField : true ,
100
+ removeField : true ,
101
+ addClass : true ,
102
+ removeClass : true ,
103
+ clearAllDataFromClass : false , //This still goes through ruby
104
+ exportClass : false , //Still goes through ruby
105
+ } ,
106
+ cloudCode : {
107
+ viewCode : true ,
108
+ } ,
109
+ hooks : {
110
+ create : true ,
111
+ read : true ,
112
+ update : true ,
113
+ delete : true ,
114
+ } ,
115
+ logs : {
116
+ info : true ,
117
+ error : true ,
118
+ } ,
119
+ globalConfig : {
120
+ create : true ,
121
+ read : true ,
122
+ update : true ,
123
+ delete : true ,
124
+ } ,
123
125
} ,
126
+ serverVersion : 'Parse.com' ,
124
127
}
125
128
AppsManager . addApp ( app )
126
129
} else {
130
+ app . serverInfo = { }
127
131
new ParseApp ( app ) . apiRequest (
128
132
'GET' ,
129
- 'features ' ,
133
+ 'serverInfo ' ,
130
134
{ } ,
131
135
{ useMasterKey : true }
132
- ) . then ( enabledFeatures => {
133
- app . enabledFeatures = enabledFeatures ;
136
+ ) . then ( serverInfo => {
137
+ app . serverInfo = serverInfo ;
134
138
AppsManager . addApp ( app )
135
139
this . forceUpdate ( ) ;
136
140
} ) ;
Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ export default class DashboardView extends React.Component {
25
25
this . context . currentApp . getMigrations ( ) . promise . then ( ( ) => this . forceUpdate ( ) ) ;
26
26
}
27
27
28
- let features = this . context . currentApp . enabledFeatures ;
28
+ let features = this . context . currentApp . serverInfo . features ;
29
29
30
30
let coreSubsections = [ ] ;
31
31
if ( features . schemas &&
Original file line number Diff line number Diff line change @@ -196,9 +196,9 @@ export default class DataBrowser extends React.Component {
196
196
className = { SpecialClasses [ className ] || className }
197
197
classNameForPermissionsEditor = { className }
198
198
setCurrent = { this . setCurrent . bind ( this ) }
199
- enableDeleteAllRows = { this . context . currentApp . enabledFeatures . schemas . clearAllDataFromClass }
200
- enableExportClass = { this . context . currentApp . enabledFeatures . schemas . exportClass }
201
- enableSecurityDialog = { false /* this will eventually come from the enabledFeatures object, format TBD */ }
199
+ enableDeleteAllRows = { this . context . currentApp . serverInfo . features . schemas . clearAllDataFromClass }
200
+ enableExportClass = { this . context . currentApp . serverInfo . features . schemas . exportClass }
201
+ enableSecurityDialog = { false /* this will eventually come from the serverInfo object, format TBD */ }
202
202
{ ...other } />
203
203
</ div >
204
204
) ;
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ export default class ParseApp {
36
36
webhookKey,
37
37
apiKey,
38
38
serverURL,
39
- enabledFeatures ,
39
+ serverInfo ,
40
40
...params ,
41
41
} ) {
42
42
this . name = appName ;
@@ -56,7 +56,7 @@ export default class ParseApp {
56
56
this . fileKey = apiKey ;
57
57
this . production = ! ! params [ 'is_production?' ] ;
58
58
this . serverURL = serverURL ;
59
- this . enabledFeatures = enabledFeatures ;
59
+ this . serverInfo = serverInfo ;
60
60
61
61
this . settings = {
62
62
fields : { } ,
You can’t perform that action at this time.
0 commit comments