mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05: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
2 changed files with 4 additions and 18 deletions
|
@ -6,14 +6,11 @@
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
{{#if this.user.count.posts}}
|
{{#if this.user.count.posts}}
|
||||||
<p>
|
<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.
|
<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>
|
|
||||||
<p>
|
|
||||||
A backup will be automatically downloaded to your device before deletion.
|
|
||||||
</p>
|
</p>
|
||||||
{{else}}
|
{{else}}
|
||||||
<p>
|
<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>
|
</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -22,7 +19,7 @@
|
||||||
<button class="gh-btn" data-test-button="cancel-delete-user" type="button" {{action "closeModal"}}>
|
<button class="gh-btn" data-test-button="cancel-delete-user" type="button" {{action "closeModal"}}>
|
||||||
<span>Cancel</span>
|
<span>Cancel</span>
|
||||||
</button>
|
</button>
|
||||||
<GhTaskButton @buttonText="Download backup & delete user"
|
<GhTaskButton @buttonText="Delete user"
|
||||||
@successText="Deleted"
|
@successText="Deleted"
|
||||||
@task={{this.deleteUser}}
|
@task={{this.deleteUser}}
|
||||||
@class="gh-btn gh-btn-red gh-btn-icon"
|
@class="gh-btn gh-btn-red gh-btn-icon"
|
||||||
|
|
|
@ -385,20 +385,9 @@ export default Controller.extend({
|
||||||
this.user.commentNotifications = event.target.checked;
|
this.user.commentNotifications = event.target.checked;
|
||||||
}),
|
}),
|
||||||
|
|
||||||
_exportDb(filename) {
|
|
||||||
this.utils.downloadFile(`${this.ghostPaths.url.api('db')}?filename=${filename}`);
|
|
||||||
},
|
|
||||||
|
|
||||||
deleteUser: task(function *() {
|
deleteUser: task(function *() {
|
||||||
try {
|
try {
|
||||||
const result = yield this.user.destroyRecord();
|
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);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.notifications.closeAlerts('user.delete');
|
this.notifications.closeAlerts('user.delete');
|
||||||
this.store.unloadAll('post');
|
this.store.unloadAll('post');
|
||||||
|
|
Loading…
Add table
Reference in a new issue