fix(web): unify UPC license actions into manage/trial entry#1929
fix(web): unify UPC license actions into manage/trial entry#1929
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (29)
Disabled knowledge base sources:
WalkthroughAdds a new trialStart action across stores and UI: account store publishes trialStart callbacks, server store surfaces a trialStart action for ENOKEYFILE/TRIAL states, UserProfile dropdown integrates manage-license/trial helper behavior, and tests/locales updated accordingly. Changes
Sequence DiagramsequenceDiagram
participant User
participant Dropdown as DropdownContent.vue
participant AccountStore as Account Store
participant Server as Server API
User->>Dropdown: Click "Manage License / Start Trial"
Dropdown->>AccountStore: accountStore.trialStart()
AccountStore->>Server: POST ACCOUNT_CALLBACK (type: "trialStart", payload: serverPayload + activationCode?)
Server-->>AccountStore: 200 OK
AccountStore-->>Dropdown: resolve/action complete
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a5e4712078
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| title: text, | ||
| }; | ||
| }; | ||
| const licenseActionsToManage = new Set(['activate', 'purchase', 'recover', 'redeem', 'trialStart']); |
There was a problem hiding this comment.
Keep partner activation on the dedicated callback
Including activate in licenseActionsToManage means partner-activation states now collapse into accountStore.myKeys() instead of the original purchaseStore.activate() path. That is not equivalent: redeemAction only exposes activate for ENOKEYFILE/TRIAL/EEXPIRED systems with an activation code (web/src/store/server.ts:377-397), and purchaseStore.activate() is the code that forwards activationCodeData to UPC (web/src/store/purchase.ts:19-33,60-66). Routing those users through myKeys drops that payload, so the one-click partner activation flow can no longer complete from the profile menu.
Useful? React with 👍 / 👎.
| const createManageLicenseAction = (text: string): UserProfileLink<'manageLicense'> => { | ||
| return { | ||
| click: () => { | ||
| accountStore.myKeys(); | ||
| emit('close-dropdown'); |
There was a problem hiding this comment.
Preserve disabled gating on the synthesized license entry
When serverActionsDisable is true, the underlying license actions are intentionally disabled with the "Requires the local unraid-api…" guard (web/src/store/server.ts:327-397,474-484). The synthetic manageLicense item created here never carries over disabled or the reason, so the dropdown stays clickable on servers where the rest of the UI blocks license flows because the local API is offline or CORS-failing. That creates a bypass of the existing safeguard via the profile menu.
Useful? React with 👍 / 👎.
|
This plugin has been deployed to Cloudflare R2 and is available for testing. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1929 +/- ##
==========================================
- Coverage 51.61% 51.54% -0.08%
==========================================
Files 1021 1021
Lines 70477 70464 -13
Branches 7763 7809 +46
==========================================
- Hits 36379 36321 -58
- Misses 33976 34021 +45
Partials 122 122 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
web/__test__/components/Registration.test.ts (1)
442-443: Assert the rendered fallback here, not just the store array.This only verifies that
web/src/store/server.tsnow exposestrialStart; it would still pass ifRegistration.standalone.vuestopped rendering the extra action. Prefer asserting the rendered key-action labels/buttons for this state.As per coding guidelines "Test component behavior and output, not implementation details".
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@web/__test__/components/Registration.test.ts` around lines 442 - 443, The test is asserting the store array (serverStore.keyActions) instead of the component output; update the test to render Registration.standalone.vue (or use the existing rendered wrapper) and assert the visible fallback/key-action labels or buttons appear for 'activate', 'recover', and 'trialStart' (e.g., via getByText/getAllByRole queries) rather than checking actionNames, so the spec verifies rendered behavior not store internals.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@web/src/components/UserProfile/DropdownContent.vue`:
- Around line 97-99: The string assigned to manageActionText is hard-coded in
the hasTrialStart branch, causing inconsistent localization; change this to a
message key and run it through the same i18n lookup before building the
synthetic link. Update the logic that sets manageActionText (the variable used
for text/title when creating the synthetic link in DropdownContent.vue) so both
branches use translation keys (e.g., add a new key for "Manage License / Start
Trial") and call the same translator function (the existing i18n.t or $t usage)
so the displayed text/title are localized consistently.
---
Nitpick comments:
In `@web/__test__/components/Registration.test.ts`:
- Around line 442-443: The test is asserting the store array
(serverStore.keyActions) instead of the component output; update the test to
render Registration.standalone.vue (or use the existing rendered wrapper) and
assert the visible fallback/key-action labels or buttons appear for 'activate',
'recover', and 'trialStart' (e.g., via getByText/getAllByRole queries) rather
than checking actionNames, so the spec verifies rendered behavior not store
internals.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 2123a876-7a97-4480-a158-f8c1034f69e0
📒 Files selected for processing (5)
web/__test__/components/Registration.test.tsweb/__test__/store/account.test.tsweb/src/components/UserProfile/DropdownContent.vueweb/src/store/account.tsweb/src/store/server.ts
## Summary - Keep UPC actions collapsed to a single `Manage License` entry. - Add helper copy directly below the action to improve discoverability. - Use trial-specific helper text when `trialStart` is present in `keyActions`. ## Testing - `pnpm type-check` ## Notes - This PR is stacked on top of #1929 for A/B validation between builds.
🤖 I have created a release *beep* *boop* --- ## [4.30.1](v4.30.0...v4.30.1) (2026-03-18) ### Bug Fixes * **web:** unify UPC license actions into manage/trial entry ([#1929](#1929)) ([164198c](164198c)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Summary
redeem,purchase,recover,activate) into a single entry.Manage License / Start Trialwhen trial start is available.myKeys) to preserve one-click behavior.trialStartaccount/server action plumbing so trial availability can be represented in UPC state/action lists.Testing
pnpm exec vitest run __test__/store/account.test.ts __test__/components/Registration.test.ts __test__/store/server.test.tspnpm type-checkSummary by CodeRabbit
New Features
Localization
Tests