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.
switch all modals over to ember-concurrency and gh-task-button
- Loading branch information
1 parent
0aa8b81
commit 6139731
Showing
22 changed files
with
195 additions
and
164 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
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 |
---|---|---|
@@ -1,20 +1,19 @@ | ||
import {alias} from 'ember-computed'; | ||
import ModalComponent from 'ghost-admin/components/modals/base'; | ||
import {invokeAction} from 'ember-invoke-action'; | ||
import {task} from 'ember-concurrency'; | ||
|
||
export default ModalComponent.extend({ | ||
|
||
submitting: false, | ||
|
||
subscriber: alias('model'), | ||
|
||
deleteSubscriber: task(function* () { | ||
yield invokeAction(this, 'confirm'); | ||
}).drop(), | ||
|
||
actions: { | ||
confirm() { | ||
this.set('submitting', true); | ||
|
||
invokeAction(this, 'confirm').finally(() => { | ||
this.set('submitting', false); | ||
}); | ||
this.get('deleteSubscriber').perform(); | ||
} | ||
} | ||
}); |
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 |
---|---|---|
@@ -1,24 +1,27 @@ | ||
import computed, {alias} from 'ember-computed'; | ||
import ModalComponent from 'ghost-admin/components/modals/base'; | ||
import {invokeAction} from 'ember-invoke-action'; | ||
import {task} from 'ember-concurrency'; | ||
|
||
export default ModalComponent.extend({ | ||
|
||
submitting: false, | ||
|
||
tag: alias('model'), | ||
|
||
postInflection: computed('tag.count.posts', function () { | ||
return this.get('tag.count.posts') > 1 ? 'posts' : 'post'; | ||
}), | ||
|
||
deleteTag: task(function* () { | ||
try { | ||
yield invokeAction(this, 'confirm'); | ||
} finally { | ||
this.send('closeModal'); | ||
} | ||
}).drop(), | ||
|
||
actions: { | ||
confirm() { | ||
this.set('submitting', true); | ||
|
||
invokeAction(this, 'confirm').finally(() => { | ||
this.send('closeModal'); | ||
}); | ||
this.get('deleteTag').perform(); | ||
} | ||
} | ||
}); |
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 |
---|---|---|
@@ -1,21 +1,24 @@ | ||
import ModalComponent from 'ghost-admin/components/modals/base'; | ||
import {alias} from 'ember-computed'; | ||
import {invokeAction} from 'ember-invoke-action'; | ||
import {task} from 'ember-concurrency'; | ||
|
||
export default ModalComponent.extend({ | ||
|
||
submitting: false, | ||
|
||
theme: alias('model.theme'), | ||
download: alias('model.download'), | ||
|
||
deleteTheme: task(function* () { | ||
try { | ||
yield invokeAction(this, 'confirm'); | ||
} finally { | ||
this.send('closeModal'); | ||
} | ||
}).drop(), | ||
|
||
actions: { | ||
confirm() { | ||
this.set('submitting', true); | ||
|
||
invokeAction(this, 'confirm').finally(() => { | ||
this.send('closeModal'); | ||
}); | ||
this.get('deleteTheme').perform(); | ||
} | ||
} | ||
}); |
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 |
---|---|---|
@@ -1,20 +1,23 @@ | ||
import ModalComponent from 'ghost-admin/components/modals/base'; | ||
import {invokeAction} from 'ember-invoke-action'; | ||
import {alias} from 'ember-computed'; | ||
import {task} from 'ember-concurrency'; | ||
|
||
export default ModalComponent.extend({ | ||
|
||
submitting: false, | ||
|
||
user: alias('model'), | ||
|
||
deleteUser: task(function* () { | ||
try { | ||
yield invokeAction(this, 'confirm'); | ||
} finally { | ||
this.send('closeModal'); | ||
} | ||
}).drop(), | ||
|
||
actions: { | ||
confirm() { | ||
this.set('submitting', true); | ||
|
||
invokeAction(this, 'confirm').finally(() => { | ||
this.send('closeModal'); | ||
}); | ||
this.get('deleteUser').perform(); | ||
} | ||
} | ||
}); |
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
Oops, something went wrong.