这是indexloc提供的服务,不要输入任何密码
Skip to content

Add Schedule Publish Feature to Publish Button #381

@DennisAlund

Description

@DennisAlund

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

  1. Publish Button Dropdown:

    • Add a dropdown extension to the "Publish" button with an option "Schedule Publish".
  2. 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)
  3. 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}).
  4. Unpublish:

    • The "Unpublish" button should cancel the scheduled publish and set the publishedAt attribute to null.

Steps to Accomplish

  1. Update Publish Button UI:

    • Modify the publish button to include a dropdown with the "Schedule Publish" option.
  2. 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.
  3. 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.
  4. Handle Unpublish:

    • Set the publishedAt attribute to null when the "Unpublish" button is clicked.
    • Remove the scheduled publish date and time text.

Screenshot

Inspired by gmail

image

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions