Skip to content

integrate policy API - #1154

Merged
dati18 merged 16 commits into
mainfrom
T432965
Jul 29, 2026
Merged

integrate policy API#1154
dati18 merged 16 commits into
mainfrom
T432965

Conversation

@deer-wmde

@deer-wmde deer-wmde commented Jul 24, 2026

Copy link
Copy Markdown
Contributor
  • Policy pages are now API-driven
  • The current/upcoming Terms of Use behavior is centralized in the renderer
  • Hosting Policy has been brought into the same rendering path
  • Current hosting policy is redirected to pilot version, will be removed later

Bug: T432965

@github-actions

Copy link
Copy Markdown

Deployment previews on netlify for branch refs/pull/1154/merge will be at the following locations (when build is done):

@dati18
dati18 marked this pull request as ready for review July 27, 2026 11:28
@deer-wmde

Copy link
Copy Markdown
Contributor Author

@tarrow @dati18 instead of duplicating the logic from the TermsOfUseNavigationPanel for the hosting policy, I just moved it to its own general component because its code was already quite generalized, this seemed like the quicker win from where the code already was

@deer-wmde
deer-wmde requested review from dati18 and tarrow July 28, 2026 12:35
Comment thread src/components/Pages/Components/PolicyNavigationPanel.vue Outdated
Comment thread src/components/Pages/HostingPolicy/HostingPolicyRenderer.vue Outdated
Comment thread src/components/Pages/Components/PolicyNavigationPanel.vue Outdated
deer-wmde and others added 16 commits July 29, 2026 14:55
**CHANGES**
1. `HostingPolicyRenderer.vue`
- Replaced banner condition from computed date logic to route/API
- Removed `isFutureDate` helper
- Added `isCurrentRoute` + `policyType` parity with `TermsOfUseRenderer`

2. `PolicyNavigationPanel.vue`
- Removed date parsing/comparison helpers
- Added API-driven state fields `currentPolicyId` and `upcomingPolicyId`
- Links now resolve current/upcoming via those IDs from API responses
instead of local date logic
- loadPolicies now fetches:
  - all policies
  - current policy (via `getCurrentPolicyByType`)
  - upcoming policy (via `getUpcomingPolicyByType`, with 404 handled as
“none”)

Bug: T432965
Co-authored-by: Thomas Arrow <thomas.arrow@wikimedia.de>
A rather unelegant workaround to handle the case of no currrent hosting
policy to redirect people to the pilot.

This allows us to change the footer link to be just '/hosting-policy'
and have it handled by the HostingPolicyRenderer but still redirect to
the pilot component.

Added comments to ensure we remove this cruft as soon as the pilot
policy is redundant.

Bug: T432965
@dati18
dati18 merged commit 3886dd0 into main Jul 29, 2026
7 checks passed
@dati18
dati18 deleted the T432965 branch July 29, 2026 13:20
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.

3 participants