Remove unnecessary use of updateEmailMailPoetProperty
MAILPOET-6431
This commit is contained in:
committed by
Oluwaseun Olorunsola
parent
e5498b6baf
commit
b16071ee0e
@@ -53,7 +53,6 @@ export function EmailSidebarExtensionBody({ RichTextWithButton }) {
|
||||
href="https://www.mailpoet.com/blog/17-email-subject-line-best-practices-to-boost-engagement/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
onClick={() => {}}
|
||||
/>
|
||||
),
|
||||
emojiLink: (
|
||||
@@ -62,7 +61,6 @@ export function EmailSidebarExtensionBody({ RichTextWithButton }) {
|
||||
href="https://www.mailpoet.com/blog/tips-using-emojis-in-subject-lines/"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
onClick={() => {}}
|
||||
/>
|
||||
),
|
||||
},
|
||||
@@ -86,7 +84,6 @@ export function EmailSidebarExtensionBody({ RichTextWithButton }) {
|
||||
key="preview-text-kb"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
onClick={() => {}}
|
||||
/>
|
||||
),
|
||||
},
|
||||
@@ -100,10 +97,7 @@ export function EmailSidebarExtensionBody({ RichTextWithButton }) {
|
||||
updateProperty={updateEmailMailPoetProperty}
|
||||
label={__('Subject', 'mailpoet')}
|
||||
labelSuffix={
|
||||
<ExternalLink
|
||||
href="https://kb.mailpoet.com/article/435-a-guide-to-personalisation-tags-for-tailored-newsletters#list"
|
||||
onClick={() => {}}
|
||||
>
|
||||
<ExternalLink href="https://kb.mailpoet.com/article/435-a-guide-to-personalisation-tags-for-tailored-newsletters#list">
|
||||
{__('Guide', 'mailpoet')}
|
||||
</ExternalLink>
|
||||
}
|
||||
|
@@ -35,8 +35,7 @@ export function MoreMenu(): JSX.Element {
|
||||
editorCurrentPostType,
|
||||
'status'
|
||||
);
|
||||
const { saveEditedEmail, updateEmailMailPoetProperty } =
|
||||
useDispatch( storeName );
|
||||
const { saveEditedEmail } = useDispatch( storeName );
|
||||
const goToListings = () => {
|
||||
window.location.href = urls.listings;
|
||||
};
|
||||
@@ -132,10 +131,6 @@ export function MoreMenu(): JSX.Element {
|
||||
<MenuItem
|
||||
onClick={ async () => {
|
||||
await setStatus( 'draft' );
|
||||
await updateEmailMailPoetProperty(
|
||||
'deleted_at',
|
||||
''
|
||||
);
|
||||
await saveEditedEmail();
|
||||
recordEvent(
|
||||
'header_more_menu_restore_from_trash_button_clicked'
|
||||
|
@@ -134,29 +134,6 @@ export function* saveEditedEmail() {
|
||||
} );
|
||||
}
|
||||
|
||||
export function* updateEmailMailPoetProperty( name: string, value: string ) {
|
||||
const postId = select( storeName ).getEmailPostId();
|
||||
// There can be a better way how to get the edited post data
|
||||
const editedPost = select( coreDataStore ).getEditedEntityRecord(
|
||||
'postType',
|
||||
editorCurrentPostType,
|
||||
postId
|
||||
);
|
||||
// @ts-expect-error Property 'mailpoet_data' does not exist on type 'Updatable<Attachment<any>>'.
|
||||
const mailpoetData = editedPost?.mailpoet_data || {};
|
||||
yield dispatch( coreDataStore ).editEntityRecord(
|
||||
'postType',
|
||||
editorCurrentPostType,
|
||||
postId,
|
||||
{
|
||||
mailpoet_data: {
|
||||
...mailpoetData,
|
||||
[ name ]: value,
|
||||
},
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
export const setTemplateToPost =
|
||||
( templateSlug ) =>
|
||||
async ( { registry } ) => {
|
||||
|
Reference in New Issue
Block a user