File tree 3 files changed +9
-19
lines changed
3 files changed +9
-19
lines changed Original file line number Diff line number Diff line change 5
5
* This source code is licensed under the license found in the LICENSE file in
6
6
* the root directory of this source tree.
7
7
*/
8
- import React from 'react' ;
8
+ import React from 'react' ;
9
9
10
10
import AppSelector from 'dashboard/AppSelector.react' ;
11
11
import AppsManager from 'lib/AppsManager' ;
12
- import history from 'dashboard/history' ;
13
- import html from 'lib/htmlString' ;
14
- import ParseApp from 'lib/ParseApp' ;
12
+ import history from 'dashboard/history' ;
13
+ import html from 'lib/htmlString' ;
14
+ import ParseApp from 'lib/ParseApp' ;
15
15
16
16
let AppData = React . createClass ( {
17
17
childContextTypes : {
@@ -22,7 +22,7 @@ let AppData = React.createClass({
22
22
getChildContext ( ) {
23
23
return {
24
24
generatePath : this . generatePath ,
25
- currentApp : AppsManager . findAppBySlug ( this . props . params . appId )
25
+ currentApp : AppsManager . findAppBySlugOrName ( this . props . params . appId )
26
26
} ;
27
27
} ,
28
28
@@ -34,7 +34,8 @@ let AppData = React.createClass({
34
34
if ( this . props . params . appId === '_' ) {
35
35
return < AppSelector /> ;
36
36
}
37
- let current = AppsManager . findAppBySlug ( this . props . params . appId ) ;
37
+ //Find by name to catch edge cases around escaping apostrophes in URLs
38
+ let current = AppsManager . findAppBySlugOrName ( this . props . params . appId ) ;
38
39
if ( current ) {
39
40
current . setParseKeys ( ) ;
40
41
} else {
Original file line number Diff line number Diff line change @@ -21,26 +21,16 @@ const AppsManager = {
21
21
return appsStore ;
22
22
} ,
23
23
24
- findAppBySlug ( slug ) {
24
+ findAppBySlugOrName ( slugOrName ) {
25
25
let apps = this . apps ( ) ;
26
26
for ( let i = apps . length ; i -- ; ) {
27
- if ( apps [ i ] . slug === slug ) {
27
+ if ( apps [ i ] . slug === slugOrName || apps [ i ] . name === slugOrName ) {
28
28
return apps [ i ] ;
29
29
}
30
30
}
31
31
return null ;
32
32
} ,
33
33
34
- findAppByName ( name ) {
35
- let apps = this . apps ( ) ;
36
- for ( let i = apps . length ; i -- ; ) {
37
- if ( apps [ i ] . name === name ) {
38
- return apps [ i ]
39
- }
40
- }
41
- return null ;
42
- } ,
43
-
44
34
create ( name , connectionURL ) {
45
35
let payload = {
46
36
parse_app : { name }
Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ export default class ParseApp {
39
39
serverInfo,
40
40
production,
41
41
iconName,
42
- ...params ,
43
42
} ) {
44
43
this . name = appName ;
45
44
this . createdAt = created_at ? new Date ( created_at ) : new Date ( ) ;
You can’t perform that action at this time.
0 commit comments