-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Labels
Milestone
Description
Description
Enhance the existing publish/unpublish button by adding a dropdown option for scheduling a publish. The schedule publish feature should allow users to set a specific date and time to publish the document. The date and time picker should restrict users from selecting any time in the past. When a document is scheduled for publishing, the button should display "Unpublish" and show a text indicating the scheduled date and time.
This issue depends on #380
Requirements
-
Publish Button Dropdown:
- Add a dropdown extension to the "Publish" button with an option "Schedule Publish".
-
Date & Time Picker:
- When "Schedule Publish" is selected, a date and time picker should appear.
- The date and time picker should restrict users from selecting any time in the past.
- The user can only choose a date maximum 30 days from now (720 hours from current time)
-
Scheduled State:
- When a document is scheduled for publishing, the button should change to "Unpublish".
- Display a text under the button indicating the scheduled publish date and time (e.g.,
Scheduled for {the date}
).
-
Unpublish:
- The "Unpublish" button should cancel the scheduled publish and set the
publishedAt
attribute tonull
.
- The "Unpublish" button should cancel the scheduled publish and set the
Steps to Accomplish
-
Update Publish Button UI:
- Modify the publish button to include a dropdown with the "Schedule Publish" option.
-
Implement Date & Time Picker:
- Integrate a date and time picker component that restricts past dates and times.
- Trigger the date and time picker when "Schedule Publish" is selected.
-
Handle Scheduled Publish:
- Update the document's
publishedAt
attribute with the selected date and time from the picker. - Change the button text to "Unpublish" and display the scheduled publish date and time.
- Update the document's
-
Handle Unpublish:
- Set the
publishedAt
attribute tonull
when the "Unpublish" button is clicked. - Remove the scheduled publish date and time text.
- Set the
Screenshot
Inspired by gmail
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done