@@ -181,7 +181,9 @@ let ManageAppFields = ({
181
181
labelWidth = { DEFAULT_SETTINGS_LABEL_WIDTH }
182
182
label = { < Label
183
183
text = 'Clean up app'
184
- description = { < span > This will delete any files that < br /> are not referenced by any objects.</ span > } /> }
184
+ description = { < span > This will delete any files that are not referenced by any objects.
185
+ (Don't use the feature if you have Arrays of Files,< br /> or Files inside Object columns!)
186
+ </ span > } /> }
185
187
input = { < FormButton
186
188
onClick = { cleanUpFiles }
187
189
value = 'Clean Up Files' /> } />
@@ -190,61 +192,6 @@ let ManageAppFields = ({
190
192
color = { cleanUpMessageColor } >
191
193
< div > { cleanUpFilesMessage } </ div >
192
194
</ FormNote > : null }
193
- < Field
194
- labelWidth = { DEFAULT_SETTINGS_LABEL_WIDTH }
195
- label = { < Label
196
- text = 'Export app data'
197
- description = { 'We firmly believe in data portability.' } /> }
198
- //TODO: Add export progress view when designs are ready.
199
- input = { < FormButton
200
- onClick = { exportData }
201
- value = 'Export Data' /> } />
202
- { exportDataMessage ? < FormNote
203
- show = { true }
204
- color = { exportMessageColor } >
205
- < div > { exportDataMessage } </ div >
206
- </ FormNote > : null }
207
- { migrateAppField }
208
- < Field
209
- labelWidth = { DEFAULT_SETTINGS_LABEL_WIDTH }
210
- label = { < Label
211
- text = 'Clone app'
212
- description = { < span > Choose what you want to carry over < br /> and create a copy of this Parse app.</ span > } /> }
213
- input = { < FormButton
214
- value = 'Clone this app'
215
- onClick = { cloneApp } />
216
- } />
217
- { cloneAppMessage ? < FormNote
218
- show = { true }
219
- color = 'green' >
220
- < div > { cloneAppMessage } Check out the progress on your < Link to = { { pathname : '/apps' } } > apps page</ Link > !</ div >
221
- </ FormNote > : null }
222
- { ! isCollaborator ? < Field
223
- labelWidth = { DEFAULT_SETTINGS_LABEL_WIDTH }
224
- label = { < Label
225
- text = 'Transfer app'
226
- description = { < span > Give an existing collaborator < br /> ownership over this app.</ span > } />
227
- }
228
- input = { < FormButton
229
- value = 'Transfer this app'
230
- color = 'red'
231
- disabled = { ! hasCollaborators }
232
- onClick = { transferApp } />
233
- } /> : null }
234
- { transferAppMessage ? < FormNote
235
- color = 'green' >
236
- { transferAppMessage }
237
- </ FormNote > : null }
238
- { ! isCollaborator ? < Field
239
- labelWidth = { DEFAULT_SETTINGS_LABEL_WIDTH }
240
- label = { < Label
241
- text = 'Delete app'
242
- description = { < span > Completely remove any trace < br /> of this app's existence.</ span > } /> }
243
- input = { < FormButton
244
- color = 'red'
245
- value = 'Delete this app'
246
- onClick = { deleteApp } />
247
- } /> : null }
248
195
</ Fieldset > ) ;
249
196
}
250
197
@@ -284,6 +231,7 @@ export default class GeneralSettings extends DashboardView {
284
231
newConnectionString : '' ,
285
232
286
233
removedCollaborators : [ ] ,
234
+ showPurgeFilesModal : false ,
287
235
} ;
288
236
}
289
237
@@ -553,7 +501,7 @@ export default class GeneralSettings extends DashboardView {
553
501
return promise ;
554
502
} }
555
503
renderForm = { ( { changes, fields, setField, resetFields } ) => {
556
- let isCollaborator = AccountManager . currentUser ( ) . email !== this . props . initialFields . owner_email ;
504
+ // let isCollaborator = AccountManager.currentUser().email !== this.props.initialFields.owner_email;
557
505
return < div className = { styles . settings_page } >
558
506
< AppInformationFields
559
507
appName = { fields . appName }
@@ -576,6 +524,37 @@ export default class GeneralSettings extends DashboardView {
576
524
viewerEmail = { AccountManager . currentUser ( ) . email }
577
525
addCollaborator = { setCollaborators . bind ( undefined , setField ) }
578
526
removeCollaborator = { setCollaborators . bind ( undefined , setField ) } />
527
+ < ManageAppFields
528
+ mongoURL = { fields . mongoURL }
529
+ isCollaborator = { AccountManager . currentUser ( ) . email !== this . props . initialFields . owner_email }
530
+ hasCollaborators = { fields . collaborators . length > 0 }
531
+ appSlug = { this . context . currentApp . slug }
532
+ cleanUpFiles = { ( ) => this . setState ( { showPurgeFilesModal : true } ) }
533
+ cleanUpFilesMessage = { this . state . cleanupFilesMessage }
534
+ cleanUpMessageColor = { this . state . cleanupNoteColor } />
535
+ { this . state . showPurgeFilesModal ? < Modal
536
+ type = { Modal . Types . INFO }
537
+ icon = 'down-outline'
538
+ iconSize = { 40 }
539
+ title = 'Clean Orphan Files'
540
+ subtitle = { 'The files without DB references will be removed!' }
541
+ confirmText = 'Purge Files'
542
+ cancelText = 'Cancel'
543
+ buttonsInCenter = { true }
544
+ onCancel = { ( ) => this . setState ( { showPurgeFilesModal : false } ) }
545
+ onConfirm = { ( ) => this . context . currentApp . cleanUpFiles ( ) . then ( result => {
546
+ this . setState ( {
547
+ cleanupFilesMessage : 'All set! Your files will be deleted soon.' ,
548
+ cleanupNoteColor : 'orange' ,
549
+ showPurgeFilesModal : false ,
550
+ } ) ;
551
+ } ) . fail ( ( e ) => {
552
+ this . setState ( {
553
+ cleanupFilesMessage : e . error ,
554
+ cleanupNoteColor : 'red' ,
555
+ showPurgeFilesModal : false ,
556
+ } ) ;
557
+ } ) } /> : null }
579
558
</ div > ;
580
559
} } />
581
560
< Toolbar section = 'Settings' subsection = 'General' />
0 commit comments