Background
Blocks will need to have a defined beginning and end. Admins sometimes want to block for a short period of time (a time out) vs extended (ban).
Design
The block type field should look and feel as defined in Figma file
User story
as an admin, I want to set a duration for a block so that I maintain the integrity of our projects
Requirements
Implement 'Expiration' field in Codex. This field will allow admins to select when a block should expire.
When a block is sitewide and the block is indefinite, the option "Hide username from edits and lists" needs to be enabled; otherwise, it is disabled.
Acceptance Criteria
- As an admin creating a block, the expiration field displays three radio buttons: preset duration, custom duration, and a "specific date and time" (calendar picker).
- When the "preset duration" radio button is selected, a dropdown menu is displayed to choose preset durations.
- When the "custom duration" radio button is selected, a text input and a dropdown menu are displayed to choose the time interval for the block duration.
- When the "specific date and time" radio button is selected, a text input with the date and time calendar picker is displayed.
- Preset values come from the ipboptions message, like in the current code (via Language::getBlockDurations())
- Custom duration includes: num: 1-12, Hours, Days, Weeks, Months, Years
- Calendar picker (aka "specific date and time") allows the selection of a finite date and time.
- For "Custom duration", set min and max numbers so the range is 1-12. Set the minimum number to avoid negative numbers.
- Toggling between calendar and dropdown options should preserve the entry
- Expiration is required. An error state should be shown if it is not selected
- Expiration dates should always be in the future; selecting a day or time in the past should throw an error