This repository has been archived by the owner on Nov 28, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add delete webhook icon and confirmation modal
- Loading branch information
1 parent
cfec673
commit d0896d7
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import ModalComponent from 'ghost-admin/components/modal-base'; | ||
import {alias} from '@ember/object/computed'; | ||
import {inject as service} from '@ember/service'; | ||
import {task} from 'ember-concurrency'; | ||
|
||
export default ModalComponent.extend({ | ||
notifications: service(), | ||
|
||
webhook: alias('model'), | ||
|
||
actions: { | ||
confirm() { | ||
this.deleteWebhook.perform(); | ||
} | ||
}, | ||
|
||
deleteWebhook: task(function* () { | ||
try { | ||
yield this.confirm(); | ||
} catch (error) { | ||
this.notifications.showAPIError(error, {key: 'webhook.delete.failed'}); | ||
} finally { | ||
this.send('closeModal'); | ||
} | ||
}).drop() | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<header class="modal-header"> | ||
<h1>Are you sure?</h1> | ||
</header> | ||
<a class="close" href="" title="Close" {{action "closeModal"}}>{{svg-jar "close"}}<span class="hidden">Close</span></a> | ||
|
||
<div class="modal-body"> | ||
<p> | ||
Deleting this webhook may prevent the integration from functioning. | ||
</p> | ||
</div> | ||
|
||
<div class="modal-footer"> | ||
<button {{action "closeModal"}} class="gh-btn"><span>Cancel</span></button> | ||
{{gh-task-button "Delete Webhook" successText="Deleted" task=deleteWebhook class="gh-btn gh-btn-red gh-btn-icon"}} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters