mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-18 02:21:47 -05:00
Wired up edit post, view in browser, and delete post menu actions
This commit is contained in:
parent
bad9254eb9
commit
086119671e
2 changed files with 15 additions and 18 deletions
|
@ -63,31 +63,19 @@
|
|||
@name="analytics-actions-menu"
|
||||
@tagName="ul"
|
||||
@classNames="gh-analytics-actions-menu dropdown-menu dropdown-triangle-top-right"
|
||||
@closeOnClick={{true}}
|
||||
>
|
||||
<li>
|
||||
<button
|
||||
type="button"
|
||||
class="mr2"
|
||||
data-test-button="edit-post">
|
||||
{{!-- <LinkTo @route="lexical-editor.edit" @models={{array this.post.displayName this.post.id}} class="gh-post-list-cta edit" title=""></LinkTo> --}}
|
||||
<span>Edit post</span>
|
||||
</button>
|
||||
<LinkTo @route="lexical-editor.edit" @models={{array this.post.displayName this.post.id}}>Edit post</LinkTo>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{this.post.url}}" target="_blank" rel="noreferrer">View in browser</a>
|
||||
</li>
|
||||
<li>
|
||||
<button
|
||||
type="button"
|
||||
class="mr2"
|
||||
{{!-- {{on "click" this.confirmLogoutMember}} --}}
|
||||
data-test-button="view-post"
|
||||
>
|
||||
<span>View in browser</span>
|
||||
</button>
|
||||
</li>
|
||||
<li>
|
||||
<button
|
||||
type="button"
|
||||
class="mr2"
|
||||
{{!-- {{on "click" this.deletePosts}} --}}
|
||||
{{on "click" this.confirmDeleteMember}}
|
||||
data-test-button="delete-post"
|
||||
>
|
||||
<span class="red">Delete post</span>
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import Component from '@glimmer/component';
|
||||
import DeletePostModal from '../modals/delete-post';
|
||||
import {action} from '@ember/object';
|
||||
import {didCancel, task} from 'ember-concurrency';
|
||||
import {inject as service} from '@ember/service';
|
||||
|
@ -25,6 +26,7 @@ export default class Analytics extends Component {
|
|||
@service feature;
|
||||
@service store;
|
||||
@service router;
|
||||
@service modals;
|
||||
|
||||
@tracked sources = null;
|
||||
@tracked links = null;
|
||||
|
@ -171,6 +173,13 @@ export default class Analytics extends Component {
|
|||
this.showPublishFlowModal = !this.showPublishFlowModal;
|
||||
}
|
||||
|
||||
@action
|
||||
confirmDeleteMember() {
|
||||
this.modals.open(DeletePostModal, {
|
||||
post: this.post
|
||||
});
|
||||
}
|
||||
|
||||
updateLinkData(linksData) {
|
||||
let updatedLinks;
|
||||
if (this.links?.length) {
|
||||
|
|
Loading…
Add table
Reference in a new issue