@@ -46,53 +46,6 @@ const DEFAULT_SETTINGS_LABEL_WIDTH = 62;
46
46
47
47
let numJobsFromRequestLimit = ( limit ) => Math . floor ( ( limit - 10 ) / 20 ) ;
48
48
49
- let CurrentPlan = ( { requestLimit} ) => {
50
- let costString = requestLimit === 30 ?
51
- 'Free' :
52
- '$' + ( ( requestLimit - 30 ) * 10 ) . toString ( ) ;
53
- return (
54
- < div >
55
- < div className = { cost } > { costString } </ div >
56
- < div className = { features } > { requestLimit . toString ( ) + ' requests per second' } < br /> { numJobsFromRequestLimit ( requestLimit ) . toString ( ) + ' background job' + ( numJobsFromRequestLimit ( requestLimit ) > 1 ? 's' : '' ) } </ div >
57
- </ div >
58
- ) } ;
59
-
60
- let CurrentPlanFields = ( {
61
- visible,
62
- requestLimit,
63
- setRequestLimit,
64
- } ) => visible ? < Fieldset
65
- legend = 'Current Plan'
66
- description = { 'Adjust your pricing and your app\u2019s request limit' } >
67
- < Field
68
- labelWidth = { 40 }
69
- label = { < Label
70
- text = 'Scale your app'
71
- description = 'This will take effect as soon as you save your changes.' /> }
72
- input = { < Range
73
- min = { 0 }
74
- max = { 600 }
75
- step = { 10 }
76
- color = '#169CEE'
77
- value = { requestLimit }
78
- track = { true }
79
- units = { value => {
80
- let numJobs = numJobsFromRequestLimit ( value ) ;
81
- return value + 'req/s & ' + numJobs + ' job' + ( numJobs == 1 ? '' : 's' )
82
- } }
83
- width = { 220 }
84
- onChange = { limit => {
85
- if ( limit < 30 ) {
86
- limit = 30 ;
87
- }
88
- setRequestLimit ( limit ) ;
89
- } } /> } />
90
- < Field
91
- labelWidth = { DEFAULT_SETTINGS_LABEL_WIDTH }
92
- label = { < Label text = 'Your plan' /> }
93
- input = { < CurrentPlan requestLimit = { requestLimit } /> } />
94
- </ Fieldset > : < noscript /> ;
95
-
96
49
let AppInformationFields = ( {
97
50
appName,
98
51
setAppName,
@@ -115,61 +68,17 @@ let AppInformationFields = ({
115
68
labelWidth = { DEFAULT_SETTINGS_LABEL_WIDTH }
116
69
label = { < Label text = 'App name' /> }
117
70
input = { < TextInput
118
- value = { appName }
119
- onChange = { setAppName } />
71
+ value = { appName } />
120
72
} />
121
73
< Field
122
74
labelWidth = { 58 }
123
75
label = { < Label
124
76
text = 'In production?'
125
- description = 'Flip this switch when you launch. This will help us track your traffic and allow us to properly scale your app. ' /> }
77
+ description = '(On back4app, this switch is temporarily disabled) ' /> }
126
78
input = { < Toggle
127
79
value = { inProduction }
128
- type = { Toggle . Types . YES_NO }
129
- onChange = { setInProduction } />
80
+ type = { Toggle . Types . YES_NO } />
130
81
} />
131
- { inProduction ? < div >
132
- < Field
133
- labelWidth = { DEFAULT_SETTINGS_LABEL_WIDTH }
134
- label = { < Label text = 'iTunes App Store URL' /> }
135
- input = { < TextInput
136
- value = { iTunesURL }
137
- placeholder = 'Where is it?'
138
- onChange = { setiTunesURL } />
139
- } />
140
- < Field
141
- labelWidth = { DEFAULT_SETTINGS_LABEL_WIDTH }
142
- label = { < Label text = 'Google Play Store URL' /> }
143
- input = { < TextInput
144
- value = { googlePlayURL }
145
- placeholder = 'Where is it?'
146
- onChange = { setGooglePlayURL } />
147
- } />
148
- < Field
149
- labelWidth = { DEFAULT_SETTINGS_LABEL_WIDTH }
150
- label = { < Label text = 'Windows App Store URL' /> }
151
- input = { < TextInput
152
- value = { windowsAppStoreURL }
153
- placeholder = 'Where is it?'
154
- onChange = { setWindowsAppStoreURL } />
155
- } />
156
- < Field
157
- labelWidth = { DEFAULT_SETTINGS_LABEL_WIDTH }
158
- label = { < Label text = 'Web App URL' /> }
159
- input = { < TextInput
160
- value = { webAppURL }
161
- placeholder = 'Where is it?'
162
- onChange = { setWebAppURL } />
163
- } />
164
- < Field
165
- labelWidth = { DEFAULT_SETTINGS_LABEL_WIDTH }
166
- label = { < Label text = 'Other URL' /> }
167
- input = { < TextInput
168
- value = { otherURL }
169
- placeholder = 'Where is it?'
170
- onChange = { setOtherURL } />
171
- } />
172
- </ div > : null }
173
82
</ Fieldset > ;
174
83
175
84
let CollaboratorsFields = ( {
@@ -490,42 +399,7 @@ export default class GeneralSettings extends DashboardView {
490
399
{ this . state . migrationWarnings . map ( warning => < FormNote key = { warning } show = { true } color = 'orange' > { warning } </ FormNote > ) }
491
400
</ FormModal >
492
401
493
- let transferAppModal = < FormModal
494
- title = 'Transfer App Ownership'
495
- subtitle = 'This is an irreversible action!'
496
- icon = 'users-solid'
497
- iconSize = { 30 }
498
- type = { Modal . Types . DANGER }
499
- open = { this . state . showTransferAppModal }
500
- submitText = 'Transfer ownership'
501
- inProgressText = { 'Transferring\u2026' }
502
- enabled = {
503
- ( this . state . password . length > 0 || ! AccountManager . currentUser ( ) . has_password )
504
- && this . state . transferNewOwner . length > 0
505
- }
506
- onSubmit = { ( ) => AppsManager . transferApp ( this . context . currentApp . slug , this . state . transferNewOwner , this . state . password ) }
507
- onClose = { ( ) => this . setState ( { showTransferAppModal : false } ) }
508
- onSuccess = { ( { message } ) => this . setState ( { transferAppSuccessMessage : message } ) }
509
- clearFields = { ( ) => this . setState ( {
510
- password : '' ,
511
- transferNewOwner : '' ,
512
- } ) } >
513
- < Field
514
- labelWidth = { 60 }
515
- label = { < Label
516
- text = 'Choose new owner'
517
- description = 'The new owner must already be a collaborator.' />
518
- }
519
- input = { < Dropdown
520
- fixed = { true }
521
- value = { this . state . transferNewOwner }
522
- onChange = { ( collaborator ) => this . setState ( { transferNewOwner : collaborator } ) } >
523
- { ( ( this . props . initialFields || { } ) . collaborators || [ ] ) . map ( collaborator =>
524
- < DropdownOption key = { collaborator . id . toString ( ) } value = { collaborator . userEmail } > { collaborator . userEmail } </ DropdownOption >
525
- ) }
526
- </ Dropdown > } />
527
- { AccountManager . currentUser ( ) . has_password ? passwordField : null }
528
- </ FormModal > ;
402
+
529
403
530
404
let deleteAppModal = < FormModal
531
405
title = 'Delete App'
@@ -681,10 +555,6 @@ export default class GeneralSettings extends DashboardView {
681
555
renderForm = { ( { changes, fields, setField, resetFields } ) => {
682
556
let isCollaborator = AccountManager . currentUser ( ) . email !== this . props . initialFields . owner_email ;
683
557
return < div className = { styles . settings_page } >
684
- < CurrentPlanFields
685
- visible = { ! isCollaborator }
686
- requestLimit = { fields . requestLimit }
687
- setRequestLimit = { setField . bind ( this , 'requestLimit' ) } />
688
558
< AppInformationFields
689
559
appName = { fields . appName }
690
560
setAppName = { setField . bind ( this , 'appName' ) }
@@ -706,59 +576,8 @@ export default class GeneralSettings extends DashboardView {
706
576
viewerEmail = { AccountManager . currentUser ( ) . email }
707
577
addCollaborator = { setCollaborators . bind ( undefined , setField ) }
708
578
removeCollaborator = { setCollaborators . bind ( undefined , setField ) } />
709
- < ManageAppFields
710
- mongoURL = { fields . mongoURL }
711
- changeConnectionString = { ( ) => this . setState ( { showChangeConnectionStringModal : true } ) }
712
- isCollaborator = { isCollaborator }
713
- hasCollaborators = { initialFields . collaborators . length > 0 }
714
- startMigration = { ( ) => this . setState ( { showMigrateAppModal : true } ) }
715
- hasInProgressMigration = { ! ! this . context . currentApp . migration }
716
- appSlug = { this . context . currentApp . slug }
717
- cleanUpFiles = { ( ) => this . context . currentApp . cleanUpFiles ( ) . then ( result => {
718
- this . setState ( {
719
- cleanupFilesMessage : result . notice ,
720
- cleanupNoteColor : 'orange' ,
721
- } ) ;
722
- } ) . fail ( ( e ) => {
723
- this . setState ( {
724
- cleanupFilesMessage : e . error ,
725
- cleanupNoteColor : 'red' ,
726
- } ) ;
727
- } ) }
728
- cleanUpFilesMessage = { this . state . cleanupFilesMessage }
729
- cleanUpMessageColor = { this . state . cleanupNoteColor }
730
- exportData = { ( ) => this . context . currentApp . exportData ( ) . then ( ( result ) => {
731
- this . setState ( {
732
- exportDataMessage : result . notice ,
733
- exportDataColor : 'orange' ,
734
- } ) ;
735
- } ) . fail ( ( e ) => {
736
- this . setState ( {
737
- exportDataMessage : e . error ,
738
- exportDataColor : 'red' ,
739
- } ) ;
740
- } ) }
741
- exportDataMessage = { this . state . exportDataMessage }
742
- exportMessageColor = { this . state . exportDataColor }
743
- cloneApp = { ( ) => this . setState ( {
744
- showCloneAppModal : true ,
745
- cloneAppMessage : '' ,
746
- } ) }
747
- cloneAppMessage = { this . state . cloneAppMessage }
748
- transferApp = { ( ) => this . setState ( {
749
- showTransferAppModal : true ,
750
- transferAppSuccessMessage : '' ,
751
- } ) }
752
- transferAppMessage = { this . state . transferAppSuccessMessage }
753
- deleteApp = { ( ) => this . setState ( { showDeleteAppModal : true } ) } />
754
579
</ div > ;
755
580
} } />
756
- { migrateAppModal }
757
- { transferAppModal }
758
- { deleteAppModal }
759
- { cloneAppModal }
760
- { collaboratorRemovedWarningModal }
761
- { changeConnectionStringModal }
762
581
< Toolbar section = 'Settings' subsection = 'General' />
763
582
</ div > ;
764
583
}
0 commit comments