Skip to content

Include 'latest_suspension' in /mine wiki response - #1307

Merged
tarrow merged 11 commits into
mainfrom
wiki-suspensions-3
Nov 2, 2026
Merged

tarrow merged 11 commits into
mainfrom
wiki-suspensions-3

Conversation

@tarrow

@tarrow tarrow commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Enable the Platform UI to display the state of Wikis on the Wiki Manager's dashboard.

Add a simple latestSuspension relationship to the Wiki model to get the latest wiki suspension, or null when there are no suspensions. Eager load this relationship in the WikisController to include the latest_suspension field in responses of the /wiki/mine endpoint.

Add an active "accessor"1 to WikiSuspension, which returns whether the active_from datetime has been reached. Include it in the $appends array so that serialized representations of the model include this boolean by default2. This centralizes the calculation and avoids duplicating it in the UI.

Bug: T441452

@tarrow
tarrow added this pull request to stack #1300 October 19, 2026 14:11
@tarrow
tarrow force-pushed the wiki-suspensions-3 branch from b5f317a to 85ca889 Compare October 19, 2026 14:13
@tarrow tarrow changed the title Wiki suspensions 3 include latestSuspensionAction in response used on Wiki dashboard Oct 19, 2026
@outdooracorn
outdooracorn force-pushed the wiki-suspensions-3 branch 3 times, most recently from d411066 to e3e7c39 Compare October 20, 2026 23:09
@outdooracorn
outdooracorn removed this pull request from stack #1300 October 20, 2026 23:44
@outdooracorn
outdooracorn added this pull request to stack #1310 October 20, 2026 23:46
@outdooracorn
outdooracorn removed this pull request from stack #1310 October 20, 2026 23:52
@outdooracorn
outdooracorn changed the base branch from wiki-suspensions-2 to ollie-improve-factory-and-tests October 20, 2026 23:52
@outdooracorn
outdooracorn added this pull request to stack #1311 October 20, 2026 23:52
@tarrow
tarrow force-pushed the wiki-suspensions-3 branch from b7c06b0 to 61c0002 Compare October 22, 2026 16:38
Comment thread app/Wiki.php Resolved
@outdooracorn
outdooracorn force-pushed the wiki-suspensions-3 branch 3 times, most recently from beeda8c to e8d5d3d Compare October 27, 2026 12:57
@outdooracorn
outdooracorn removed this pull request from stack #1311 October 27, 2026 12:57
@outdooracorn
outdooracorn changed the base branch from ollie-improve-factory-and-tests to remove-unsuspension-logic October 27, 2026 12:58
@outdooracorn
outdooracorn added this pull request to stack #1314 October 27, 2026 12:58
@outdooracorn outdooracorn changed the title include latestSuspensionAction in response used on Wiki dashboard Include 'latest_suspension' in /mine wiki response Oct 27, 2026
@outdooracorn
outdooracorn marked this pull request as ready for review October 27, 2026 14:38
@outdooracorn
outdooracorn force-pushed the wiki-suspensions-3 branch 2 times, most recently from 607a9f7 to 5f0036d Compare October 27, 2026 14:52
Base automatically changed from remove-unsuspension-logic to main October 27, 2026 15:07
Comment thread app/WikiSuspension.php Resolved
Comment thread app/WikiSuspension.php Resolved
outdooracorn
outdooracorn previously approved these changes Oct 29, 2026
Comment thread app/WikiSuspension.php Resolved

@tarrow tarrow left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"approved" (but it's my PR)

tarrow and others added 11 commits November 2, 2026 08:30
This commit adds a simple relationship to the Wiki model to include
just the latest suspension type suspension action.

It then includes this in the `/mine` endpoint for consumption by
the UI

Bug: T441452
This adds an Accessor[0] to allow the `/mine` api
to pass on if a given suspension is active or not
for use in the front end. This prevents having to
do date calculations in the UI.

[0] https://laravel.com/framework/docs/11.x/eloquent-mutators#building-value-objects-from-multiple-attributes
* Put properties before methods
* Put protected properties and methods before public ones
@tarrow
tarrow force-pushed the wiki-suspensions-3 branch from 4d396a7 to a252541 Compare November 2, 2026 08:30
@tarrow
tarrow merged commit 33d55ea into main Nov 2, 2026
4 checks passed
@tarrow
tarrow deleted the wiki-suspensions-3 branch November 2, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants