Skip to content

Modernize AnnouncementForm to ipl based RepositoryForm - #5546

Open
jrauh01 wants to merge 3 commits into
mainfrom
modernize-announcement-form
Open

Modernize AnnouncementForm to ipl based RepositoryForm#5546
jrauh01 wants to merge 3 commits into
mainfrom
modernize-announcement-form

Conversation

@jrauh01

@jrauh01 jrauh01 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Ports the announcement form off the Zend Icinga\Forms\RepositoryForm onto the ipl-based Icinga\Web\Form\RepositoryForm, moves AnnouncementsController to CompatController, and adds test coverage. The $Identifier property and corresponding getter are narrowed to ?string.

Each action builds its form inline, sets the CSRF counter-measure id from the session, wires ON_SUBMIT / ON_ERROR for the notifications, and renders via addContent(). Tabs come from addTitleTab().

Change in behavior

Start and End are now pre-filled.

They were 'placeholder' => new DateTime('tomorrow') on the Zend dateTimePicker, and <input type="datetime-local"> ignores placeholder, so the hint had to become a real value or disappear. Submitting without touching either field now succeeds and yields tomorrow through the day after, where it previously failed validation.

@jrauh01 jrauh01 self-assigned this Jul 16, 2026
@cla-bot cla-bot Bot added the cla/signed label Jul 16, 2026
@jrauh01
jrauh01 force-pushed the modernize-announcement-form branch 3 times, most recently from 4c2d91f to c086a73 Compare July 17, 2026 09:01
@lippserd
lippserd force-pushed the modernize-repository-form branch from 4137360 to 133a75e Compare July 21, 2026 07:34
@jrauh01
jrauh01 force-pushed the modernize-repository-form branch 5 times, most recently from 0dc7389 to ef94b62 Compare July 27, 2026 14:32
Base automatically changed from modernize-repository-form to main July 28, 2026 09:29
@jrauh01 jrauh01 added this to the 2.15.0 milestone Aug 6, 2026
@jrauh01
jrauh01 force-pushed the modernize-announcement-form branch from c086a73 to 40e55c3 Compare August 6, 2026 14:58
Now we don't have to use view scripts anymore. Use `setTitleTab()` to set the
tab and the title respectively. This differs from the earlier behavior where
the title was always `Announcements`.
Covers all three repository modes and the timestamp conversion `fetchEntry()`
adds on top of `RepositoryForm`. The repository is backed by an in-memory
`Config` whose `saveIni()` is a no-op, so inserts, updates and deletions can be
asserted on the config itself without touching the filesystem.

Two behaviors are pinned deliberately. Updating an announcement reassigns it to
the editing user, because the disabled author element is never submitted back
and the stored one is only pre-filled when the form has not been sent. This has
been the case since the Zend implementation. Start and end now default to
tomorrow and the day after, which the move to `localDateTime` turned from mere
placeholders into actual values.
@jrauh01
jrauh01 force-pushed the modernize-announcement-form branch from 40e55c3 to 2b1cd4e Compare August 10, 2026 13:42
@jrauh01
jrauh01 marked this pull request as ready for review August 10, 2026 13:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant