Skip to content

refactor(registration): remove flash drive references for internal boot support#1880

Merged
pujitm merged 3 commits intomainfrom
refactor/registration-page
Mar 2, 2026
Merged

refactor(registration): remove flash drive references for internal boot support#1880
pujitm merged 3 commits intomainfrom
refactor/registration-page

Conversation

@pujitm
Copy link
Member

@pujitm pujitm commented Mar 2, 2026

The registration page uses flash-drive-specific terminology that doesn't apply to internal boot or TPM-based license types; this PR replaces those references with generic boot device language, adds dynamic device type detection from GUID prefixes, and conditionally preserves flash-specific details for USB flash users.

Why This Exists

With internal boot support (single drive, multi-drive redundant) and TPM-based licensing, the registration page still referred exclusively to "USB Flash" — showing flash vendor/product fields and "Flash GUID" labels that are meaningless for non-flash boot devices. Users on internal boot or TPM setups saw confusing, inaccurate UI.

Resolution

  • Replace all "flash drive" / "USB Flash" terminology in the registration UI and error messages with generic "boot device" language.
  • Add a bootDeviceType computed property that derives device type from GUID prefixes (01- = internal boot single-device, 02- = internal boot multi-device, 03- = TPM, no prefix = flash).
  • Display the detected boot device type in the registration page's Boot Device section.
  • Conditionally show flash vendor and flash product rows only when the boot device is USB flash (these fields carry real data from the API for flash users).
  • Remove computedArray and arrayWarning from the registration component (array status is no longer displayed).

Implications / Review Concerns

  • The GUID prefix mapping (01- = internal boot, 02- = internal boot multi-device, 03- = TPM) is based on the Asana task specification. If these prefixes change, only server.ts needs updating.
  • Dead locale keys (registration.flashDrive, registration.flashGuid, registration.arrayStatus, registration.transferLicenseToNewFlash) were removed from en.json. Other locale files still carry the old keys — they are harmless but could be cleaned up in a follow-up.
  • The GetCoreSettings GraphQL query now also fetches customization.activationCode.system — verify the API schema supports this field.

Behavior Changes

  • Registration page now shows "Boot Device" section header instead of "Flash Drive".
  • "Flash GUID" label becomes "Device GUID".
  • New "Boot device type" row appears showing "USB Flash", "Internal Boot", "Internal Boot (Multi-device)", or "TPM" based on the GUID prefix.
  • Flash vendor and flash product rows are shown only for USB flash boot devices, hidden for internal boot and TPM.
  • Array status row is no longer displayed.
  • "Transfer License to New Flash" becomes "Transfer License to New Device".
  • All error/state messages (blacklisted, GUID mismatch, missing keyfile, etc.) now use "boot device" instead of "USB Flash".

Implementation Summary

  • web/src/store/server.ts: Added bootDeviceType computed property mapping GUID prefixes to device types. 02- now maps to 'internalBootMulti' (distinct from 01- = 'internalBoot').
  • web/src/components/Registration.standalone.vue: Replaced flashDriveItems with bootDeviceItems, conditionally shows flash vendor/product only for flash boot type, removed computedArray/arrayWarning usage, updated template labels.
  • web/src/locales/en.json: Added new keys (bootDevice, bootDeviceType.* including internalBootMulti, deviceGuid, transferLicenseToNewDevice), removed dead keys (flashDrive, flashGuid, arrayStatus, transferLicenseToNewFlash), retained flashVendor/flashProduct (still used conditionally), updated all server.state.* messages.
  • web/__test__/components/Registration.test.ts: Updated assertions to match new label keys, removed flashVendor/flashProduct from initial state.
  • web/src/composables/gql/gql.ts / graphql.ts: Regenerated — GetCoreSettings query now includes customization.activationCode.system.

Tests

Command Environment Result
pnpm test (web) macOS / Node 22 / Vitest 3.2.4 517 passed, 6 skipped, 56 files

Summary by CodeRabbit

  • New Features

    • Core settings now include activation-code system info.
    • UI now recognizes multiple boot device types (flash, internal, internalMulti, tpm) so device-specific rows render appropriately.
  • Refactor

    • Terminology updated from "Flash" to "Boot Device"; "Device GUID" replaces "Flash GUID".
    • License action relabeled to "Transfer License to New Device".
    • Translation keys updated for boot device labels and types.
  • Bug Fixes

    • Tests updated to reflect label changes.

…ernal boot device types

Replace flash-specific terminology with generic boot device language throughout
the registration page. Add computed boot device type derived from GUID prefixes
(01-/02- = internal boot, 03- = TPM, default = flash). Remove unused fields
(flashVendor, flashProduct, arrayStatus) from the component and clean up dead
locale keys.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 2, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between fc2d8a6 and e30eb83.

📒 Files selected for processing (2)
  • web/src/locales/en.json
  • web/src/store/server.ts

Walkthrough

Refactors "flash drive" terminology to "boot device", adds a new bootDeviceType computed/store property, updates GraphQL GetCoreSettings to include customization.activationCode.system fields, adjusts tests and translations, and removes array-status/license array tracking.

Changes

Cohort / File(s) Summary
Registration UI & logic
web/src/components/Registration.standalone.vue
Renamed flash-related identifiers to boot-device equivalents (flashDriveItemsbootDeviceItems, flashGuiddeviceGuid), updated template conditionals to use bootDeviceType, removed computedArray/arrayWarning usage, and adjusted action label to transfer license to new device.
Tests
web/__test__/components/Registration.test.ts
Updated initial state and assertions: removed flashVendor/flashProduct props; replaced expectations referencing "Flash GUID" with "Device GUID" for ENOKEYFILE and PRO states.
GraphQL documents & client typings
web/src/composables/gql/graphql.ts, web/src/composables/gql/gql.ts
Extended GetCoreSettings query/document to include customization.activationCode.system.{serverName,comment}; added corresponding graphql overload and updated Documents map key to the new query literal; updated generated query types.
Store
web/src/store/server.ts
Added exported bootDeviceType computed property (values: `'flash'
Localization
web/src/locales/en.json
Removed registration.arrayStatus; added registration.bootDevice, registration.bootDeviceType variants, and registration.deviceGuid; renamed registration.transferLicenseToNewFlashregistration.transferLicenseToNewDevice and updated related labels.

Sequence Diagram(s)

sequenceDiagram
  participant Component as RegistrationComponent
  participant Store as ServerStore
  participant GQL as GraphQLClient
  participant Backend as API/Server

  Component->>Store: read server state (guid, bootDeviceType)
  Note right of Store: bootDeviceType computed from guid
  Store-->>Component: bootDeviceType, vendor, product, GUID
  Component->>GQL: request GetCoreSettings (includes customization.activationCode)
  GQL->>Backend: execute GetCoreSettings query
  Backend-->>GQL: return vars, server, display, systemTime, info, customization.activationCode.system
  GQL-->>Component: resolved data (activationCode + settings)
  Component->>Component: render UI using bootDeviceType and device GUID label
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through code with nimble feet,
Flash became boot device — neat and fleet,
TPM, internal, or flash in the sun,
Activation codes queued, ready to run,
A rabbit's refactor — small, swift, and sweet.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main objective of the PR: removing flash drive terminology and adding support for internal boot device detection.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch refactor/registration-page

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 32b8fd742f

ℹ️ 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".

class="rounded-lg border border-gray-200 p-4 dark:border-gray-700"
>
<h4 class="mb-3 text-lg font-semibold">{{ t('registration.flashDrive') }}</h4>
<h4 class="mb-3 text-lg font-semibold">{{ t('registration.bootDevice') }}</h4>

Choose a reason for hiding this comment

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

P2 Badge Add translations for new registration i18n keys

The component now renders new keys like registration.bootDevice/registration.deviceGuid, but this commit only defines those keys in web/src/locales/en.json; checking web/src/locales/*.json shows other locales still only have the old registration.flash* keys. For non-English users, the registration section will regress to English fallback text (and emit missing-key warnings in dev) instead of localized strings that previously existed, so this change should either add the new keys to all locale files or keep backward-compatible key names.

Useful? React with 👍 / 👎.

…lash boot devices

These fields carry real data from the API (via var.ini) for USB flash boot
users. Show them only when the detected boot device type is flash, keeping the
UI clean for internal boot and TPM users.
@pujitm pujitm requested a review from elibosley March 2, 2026 15:32
@codecov
Copy link

codecov bot commented Mar 2, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 48.08%. Comparing base (15bd747) to head (e30eb83).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1880      +/-   ##
==========================================
+ Coverage   48.06%   48.08%   +0.02%     
==========================================
  Files        1002     1002              
  Lines       66511    66502       -9     
  Branches     6672     6675       +3     
==========================================
+ Hits        31968    31978      +10     
+ Misses      34422    34403      -19     
  Partials      121      121              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…e-device

02- GUID prefix now maps to 'internalBootMulti' instead of 'internalBoot',
displaying as "Internal Boot (Multi-device)" in the registration UI.
@github-actions
Copy link
Contributor

github-actions bot commented Mar 2, 2026

This plugin has been deployed to Cloudflare R2 and is available for testing.
Download it at this URL:

https://preview.dl.unraid.net/unraid-api/tag/PR1880/dynamix.unraid.net.plg

@pujitm pujitm merged commit 0bc7498 into main Mar 2, 2026
13 checks passed
@pujitm pujitm deleted the refactor/registration-page branch March 2, 2026 18:25
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