mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-26 04:13:30 +03:00
Stopped downloading site backup when deleting a user
refs https://github.com/TryGhost/Ghost/issues/15008 - Backup process had a slim benefit to keep around. Without it the removal process is much smoother. - The backup still happens on the server side if it's absolutely needed at some point in the future
This commit is contained in:
parent
87eafc1ae4
commit
04d27fac5f
@ -6,14 +6,11 @@
|
||||
<div class="modal-body">
|
||||
{{#if this.user.count.posts}}
|
||||
<p>
|
||||
<strong>{{this.user.name}}</strong> and their <strong data-test-text="user-post-count">{{gh-pluralize this.user.count.posts 'post'}}</strong> will be permanently deleted. If you don’t want to lose these posts, you should assign them to a different author.
|
||||
</p>
|
||||
<p>
|
||||
A backup will be automatically downloaded to your device before deletion.
|
||||
<strong>{{this.user.name}}</strong> and their <strong data-test-text="user-post-count">{{gh-pluralize this.user.count.posts 'post'}}</strong> will be permanently deleted.
|
||||
</p>
|
||||
{{else}}
|
||||
<p>
|
||||
<strong>{{this.user.name}}</strong> will be permanently deleted. A backup will be automatically downloaded to your device before deletion.
|
||||
<strong>{{this.user.name}}</strong> will be permanently deleted.
|
||||
</p>
|
||||
{{/if}}
|
||||
</div>
|
||||
@ -22,7 +19,7 @@
|
||||
<button class="gh-btn" data-test-button="cancel-delete-user" type="button" {{action "closeModal"}}>
|
||||
<span>Cancel</span>
|
||||
</button>
|
||||
<GhTaskButton @buttonText="Download backup & delete user"
|
||||
<GhTaskButton @buttonText="Delete user"
|
||||
@successText="Deleted"
|
||||
@task={{this.deleteUser}}
|
||||
@class="gh-btn gh-btn-red gh-btn-icon"
|
||||
|
@ -385,20 +385,9 @@ export default Controller.extend({
|
||||
this.user.commentNotifications = event.target.checked;
|
||||
}),
|
||||
|
||||
_exportDb(filename) {
|
||||
this.utils.downloadFile(`${this.ghostPaths.url.api('db')}?filename=${filename}`);
|
||||
},
|
||||
|
||||
deleteUser: task(function *() {
|
||||
try {
|
||||
const result = yield this.user.destroyRecord();
|
||||
|
||||
if (result._meta && result._meta.filename) {
|
||||
this._exportDb(result._meta.filename);
|
||||
// give the iframe some time to trigger the download before
|
||||
// it's removed from the dom when transitioning
|
||||
yield timeout(300);
|
||||
}
|
||||
yield this.user.destroyRecord();
|
||||
|
||||
this.notifications.closeAlerts('user.delete');
|
||||
this.store.unloadAll('post');
|
||||
|
Loading…
Reference in New Issue
Block a user