Skip to content

Commit

Permalink
update status
Browse files Browse the repository at this point in the history
  • Loading branch information
shreeharsha-factly committed Jul 11, 2024
1 parent c5abe12 commit 24e0485
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions studio/src/actions/pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ export const addPage = (data) => {
dispatch(resetPages());
page.status === 'publish'
? dispatch(addSuccessNotification(`Page Published`))
: page.status === 'future'
? dispatch(addSuccessNotification('Page added & Scheduled for future publish'))
: page.status === 'draft'
? dispatch(addSuccessNotification('Page added'))
: dispatch(addSuccessNotification('Page added & Ready to Publish'));
Expand Down Expand Up @@ -211,6 +213,8 @@ export const updatePage = (data) => {
);
page.status === 'publish'
? dispatch(addSuccessNotification(`Page Published`))
: page.status === 'future'
? dispatch(addSuccessNotification('Page saved & Scheduled for future publish'))
: page.status === 'draft'
? dispatch(addSuccessNotification('Draft Saved'))
: dispatch(addSuccessNotification('Draft saved & Ready to Publish'));
Expand Down
4 changes: 4 additions & 0 deletions studio/src/actions/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ export const addPost = (data) => {
dispatch(resetPosts());
post.status === 'publish'
? dispatch(addSuccessNotification(`${post.format.name} Published`))
: post.status === 'future'
? dispatch(addSuccessNotification('Post added & Scheduled for future publish'))
: post.status === 'draft'
? dispatch(addSuccessNotification('Post added'))
: dispatch(addSuccessNotification('Post added & Ready to Publish'));
Expand Down Expand Up @@ -343,6 +345,8 @@ export const updatePost = (data) => {
);
data.status === 'publish'
? dispatch(addSuccessNotification(`${post.format.name} Published`))
: post.status === 'future'
? dispatch(addSuccessNotification('Post saved & Scheduled for future publish'))
: data.status === 'draft'
? dispatch(addSuccessNotification('Draft Saved'))
: dispatch(addSuccessNotification('Draft saved & Ready to Publish'));
Expand Down
12 changes: 12 additions & 0 deletions studio/src/pages/posts/components/PostForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,18 @@ function PostForm({ onCreate, data = {}, actions = {}, format, page = false }) {
form.submit();
},
},
{
key: 'future',
label: (
<Button type="future" disabled={!valueChange}>
Future Publish
</Button>
),
onClick: () => {
setStatus('future');
form.submit();
},
},
];

return (
Expand Down

0 comments on commit 24e0485

Please sign in to comment.