Skip to content

Use API-driven current/upcoming policy selection - #1156

Merged
tarrow merged 4 commits into
T432965from
T432965-sub-20260728
Jul 29, 2026
Merged

Use API-driven current/upcoming policy selection#1156
tarrow merged 4 commits into
T432965from
T432965-sub-20260728

Conversation

@dati18

@dati18 dati18 commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

CHANGES

  1. HostingPolicyRenderer.vue
  • Replaced banner condition from computed date logic to route/API
  • Removed isFutureDate helper
  • Added isCurrentRoute + policyType parity with TermsOfUseRenderer
  1. 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

@github-actions

Copy link
Copy Markdown

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

@tarrow
tarrow changed the base branch from main to T432965 July 29, 2026 08:55
@tarrow
tarrow force-pushed the T432965-sub-20260728 branch from c34b8cb to 7715ed8 Compare July 29, 2026 10:27
@tarrow
tarrow merged commit a27cc21 into T432965 Jul 29, 2026
7 checks passed
@tarrow
tarrow deleted the T432965-sub-20260728 branch July 29, 2026 10:34
dati18 added a commit that referenced this pull request Jul 29, 2026
**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>
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