feat(web): add helper text to UPC manage-license action#1930
feat(web): add helper text to UPC manage-license action#1930elibosley merged 4 commits intocodex/manage-license-start-trialfrom
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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: 610096925e
ℹ️ 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".
| const filteredKeyActions = computed(() => { | ||
| const actions = keyActions.value?.filter((action) => !['renew'].includes(action.name)); | ||
| if (!actions?.length) { | ||
| return actions; | ||
| } | ||
| const hasLegacyLicenseAction = actions.some((action) => licenseActionsToManage.has(action.name)); | ||
| if (!hasLegacyLicenseAction) { | ||
| return actions; | ||
| if (!keyActions.value?.length) { | ||
| return keyActions.value; | ||
| } | ||
| const hasTrialStart = actions.some((action) => action.name === 'trialStart'); | ||
| const manageActionText = hasTrialStart | ||
| ? 'Manage License / Start Trial' | ||
| : 'onboarding.licenseStep.actions.manageLicense'; | ||
| const nonLicenseActions = actions.filter((action) => !licenseActionsToManage.has(action.name)); | ||
| return [createManageLicenseAction(manageActionText), ...nonLicenseActions]; | ||
| return [manageLicenseAction]; |
There was a problem hiding this comment.
Do not replace every key action with Manage License
This computed now collapses any non-auth keyActions array to [manageLicenseAction]. That also catches states whose only dropdown actions are not myKeys at all—for example trialExtendAction in expired-trial flows and replaceAction in GUID-mismatch flows (web/src/store/server.ts, the trialExtendAction/replaceAction definitions and their uses in stateData). In those cases the dropdown used to call accountStore.trialExtend() or accountStore.replace(), but after this change it only calls accountStore.myKeys(), so users lose the only in-menu route to extend a trial or replace a key.
Useful? React with 👍 / 👎.
| <li v-for="action in filteredKeyActions" :key="action.name"> | ||
| <DropdownItem :item="action" /> | ||
| </li> | ||
| <li class="-mt-1 px-2 text-xs leading-relaxed opacity-75"> |
There was a problem hiding this comment.
Guard the helper text on an actual action being shown
filteredKeyActions returns [] when there are no non-auth actions, and in Vue an empty array is still truthy, so this template renders the helper copy even when no Manage License item is present. A concrete case is registered PRO/LIFETIME systems with no renewal due: keyActions becomes empty in web/src/store/server.ts, so the dropdown would show “Replace, recover...” by itself with no related action above it.
Useful? React with 👍 / 👎.
| const manageLicenseHelperText = computed(() => | ||
| hasTrialStartAction.value | ||
| ? 'Start your trial from Manage License in your Unraid Account.' | ||
| : t('onboarding.licenseStep.actions.manageLicenseHelperText') |
There was a problem hiding this comment.
Localize the new trial helper copy
The new trialStart branch bypasses vue-i18n and returns a hard-coded English sentence, while the rest of this dropdown and the existing helper text use translation keys. That means any non-English user who has a trialStart action will now see untranslated helper copy in the profile menu, even though web/src/locales/*.json already carries the surrounding strings.
Useful? React with 👍 / 👎.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## codex/manage-license-start-trial #1930 +/- ##
====================================================================
- Coverage 51.64% 51.54% -0.11%
====================================================================
Files 1021 1021
Lines 70533 70464 -69
Branches 7762 7803 +41
====================================================================
- Hits 36430 36323 -107
- Misses 33981 34019 +38
Partials 122 122 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
This plugin has been deployed to Cloudflare R2 and is available for testing. |
Summary
Manage Licenseentry.trialStartis present inkeyActions.Testing
pnpm type-checkNotes