Skip to content

feat(devices): add remote platform erase support - #3206

Open
nmgaston wants to merge 40 commits into
mainfrom
remotePlatformErase
Open

feat(devices): add remote platform erase support#3206
nmgaston wants to merge 40 commits into
mainfrom
remotePlatformErase

Conversation

@nmgaston

@nmgaston nmgaston commented Mar 18, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds the Remote Platform Erase (RPE) experience to the device detail view, including UI integration, API wiring, localization, and test coverage.

It also standardizes RPE naming across app and test code (remoteEraserpe / rpeSupported) to match current API fields.


What changed

1) Remote Platform Erase UI (device details)

Added a new RemotePlatformEraseComponent under:

  • src/app/devices/remote-platform-erase/

Key behavior:

  • Detects whether the selected device supports remote platform erase
  • Allows enabling/disabling the AMT platform erase feature
  • Presents per-capability erase options in the UI
  • Requires user confirmation before executing erase
  • Shows warning/error feedback and loading states

2) Device detail navigation integration

Updated DeviceDetailComponent to include a new sidebar/category entry:

  • Remote Platform Erase (computer_cancel icon)

3) Service/API updates

Updated DevicesService with a remote erase action method:

  • sendRemotePlatformErase(deviceId, capabilities)
  • Calls: POST /api/v1/amt/boot/remoteErase/:deviceId
  • Sends a request body composed of boolean capability fields selected in the UI

Also aligned AMT feature field naming in requests/responses with current backend expectations.

4) Model and naming consistency

Updated model/types and related usage to consistently use:

  • rpe
  • rpeSupported
  • platformEraseEnabled (AMT feature field)

This replaces older/inconsistent naming patterns and keeps app/tests aligned.

5) Internationalization

Added translation keys for all new RPE strings across all supported locales.

6) Test coverage

Unit tests

Expanded DevicesService tests to validate:

  • Correct handling of RPE-related feature state
  • Correct request behavior for remote erase and feature toggles
  • Merge/overwrite behavior between optimistic updates and follow-up authoritative responses

Cypress E2E tests

Added/expanded E2E coverage for:

  • Supported vs unsupported device states
  • Feature toggle enable/disable flows
  • Confirm/cancel erase flow
  • Error handling/snackbar behavior when API calls fail

Reviewer notes

  • Remote erase capabilities are sent as boolean fields in the request body (not a bitmask payload).
  • Remote erase endpoint used by this PR:
    POST /api/v1/amt/boot/remoteErase/:deviceId
  • This PR is intended to align with related backend/platform changes in:
    • device-management-toolkit/mps#2407
    • device-management-toolkit/console#846

PR checklist

  • Unit tests added/updated
  • API tests updated where applicable
  • Commented code removed
  • If dependencies were added, license compatibility (Apache 2.0) was verified and documented

@nmgaston
nmgaston force-pushed the remotePlatformErase branch from c7091b5 to cf0fa97 Compare March 18, 2026 00:17
Comment thread src/assets/i18n/ar.json
@rsdmike

rsdmike commented Apr 17, 2026

Copy link
Copy Markdown
Member

Thanks for doing this! Few things i see:

  1. There are some errors showig on the device detail page:
_effect-chunk2.mjs:2601 ERROR Error: Cannot find control with name: 'enablePlatformErase'
    at _throwError (forms.mjs:1658:9)
    at setUpControl (forms.mjs:1524:19)
  ...
  1. Remote Platform Erase is allowing me to click it device details page, but my device doesnt support it.
  2. icon on menu should probably be computer cancel instead of mobile cancel
  3. I think since the checkbox is already on amt device info, if its enabled no need to show the checkbox here:
image I think need to move this: image in to one box, hidden until the feature is enabled. If its enabled, then should show this capabilites to select. the call to action button (initiate) should be up in the top right of the RPE box to follow the design pattern of KVM, SOL, Audit Log, etc...

@nmgaston
nmgaston requested review from DevipriyaS17 and nbmaiti July 13, 2026 19:23
@nmgaston
nmgaston force-pushed the remotePlatformErase branch from 871d2e1 to 2c0484a Compare July 15, 2026 17:24
Comment thread src/app/devices/remote-platform-erase/remote-platform-erase.component.ts Outdated
Comment thread src/app/devices/devices.service.ts Outdated
Comment thread src/app/devices/devices.service.ts Outdated
Comment thread src/app/devices/devices.service.ts Outdated
@nmgaston
nmgaston force-pushed the remotePlatformErase branch from ce3ce1f to 1eb5340 Compare July 29, 2026 00:18
@nmgaston
nmgaston force-pushed the remotePlatformErase branch from 3f0071e to 195fa82 Compare August 1, 2026 01:44

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Remote Platform Erase (RPE) area under device details and updates the AMT-features contract from remoteErase to rpe/rpeSupported, along with UI text and test updates across the app.

Changes:

  • Introduces RemotePlatformEraseComponent and wires it into the device detail navigation.
  • Updates DevicesService + related components/specs to use rpe/rpeSupported instead of remoteErase.
  • Adds/updates i18n strings and adds Cypress coverage for the new RPE flow.

Reviewed changes

Copilot reviewed 38 out of 39 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
src/models/models.ts Updates AMT feature typings to rpe/rpeSupported and adds types for remote erase capabilities/options.
src/assets/i18n/ar.json Adds RPE-related translations (and related shared keys) for Arabic.
src/assets/i18n/de.json Adds RPE-related translations (and related shared keys) for German.
src/assets/i18n/en.json Adds RPE UI strings and general labels/tooltips for the new feature.
src/assets/i18n/es.json Adds RPE-related translations (and related shared keys) for Spanish.
src/assets/i18n/fi.json Adds RPE-related translations (and related shared keys) for Finnish.
src/assets/i18n/fr.json Adds RPE-related translations (and related shared keys) for French.
src/assets/i18n/he.json Adds RPE-related translations (and related shared keys) for Hebrew.
src/assets/i18n/it.json Adds RPE-related translations (and related shared keys) for Italian.
src/assets/i18n/ja.json Adds RPE-related translations (and related shared keys) for Japanese.
src/assets/i18n/nl.json Adds RPE-related translations (and related shared keys) for Dutch.
src/assets/i18n/ru.json Adds RPE-related translations (and related shared keys) for Russian.
src/assets/i18n/sv.json Adds RPE-related translations (and related shared keys) for Swedish.
src/app/shared/are-you-sure/are-you-sure.component.ts Extends confirmation dialog to optionally accept custom message/params via MAT_DIALOG_DATA.
src/app/shared/are-you-sure/are-you-sure.component.html Switches confirmation dialog body to support dynamic translation keys + params.
src/app/devices/user-consent.service.spec.ts Updates mocked AMT features to use rpe/rpeSupported.
src/app/devices/sol/sol.component.ts Updates SOL feature-save payload to use rpe instead of remoteErase.
src/app/devices/sol/sol.component.spec.ts Updates SOL tests to include rpe/rpeSupported.
src/app/devices/remote-platform-erase/remote-platform-erase.constants.ts Adds RPE capability key list used by the new UI.
src/app/devices/remote-platform-erase/remote-platform-erase.component.ts Implements the RPE UI logic: load features/caps, toggle RPE, confirm and post erase options.
src/app/devices/remote-platform-erase/remote-platform-erase.component.html Implements the RPE UI template with capability selection + confirmation flow.
src/app/devices/remote-platform-erase/remote-platform-erase.component.scss Adds basic host styling for the new component.
src/app/devices/kvm/kvm.component.ts Updates KVM feature-save payload to use rpe instead of remoteErase.
src/app/devices/kvm/kvm.component.spec.ts Updates KVM tests to include rpe/rpeSupported.
src/app/devices/ider/ider.component.ts Updates IDER feature-save payload to use rpe instead of remoteErase.
src/app/devices/ider/ider.component.spec.ts Updates IDER tests and payload assertions to use rpe.
src/app/devices/hardware-information/hardware-information.component.spec.ts Updates hardware info test fixtures to include rpe/rpeSupported.
src/app/devices/general/general.component.ts Adds rpe controls to the General tab and updates feature-save payload composition.
src/app/devices/general/general.component.spec.ts Updates General tab tests to expect rpe instead of remoteErase and stubs featuresChanges.
src/app/devices/general/general.component.html Adds an RPE checkbox row + tooltip in the General tab.
src/app/devices/devices.service.ts Adds remote erase options/capabilities API methods and updates AMT-features POST body/caching behavior.
src/app/devices/devices.service.spec.ts Updates DevicesService tests for new AMT-features request body and rpe cache behavior.
src/app/devices/device-toolbar/device-toolbar.component.spec.ts Updates toolbar test fixtures to include rpe/rpeSupported.
src/app/devices/device-detail/device-detail.component.ts Adds the “Remote Platform Erase” nav item and includes the new component in imports.
src/app/devices/device-detail/device-detail.component.html Adds the route switch case to render <app-remote-platform-erase>.
cypress/e2e/integration/device/remote-platform-erase.spec.ts Adds Cypress coverage for supported/unsupported states, toggling, confirm/cancel, and failure snackbar.
cypress/e2e/fixtures/api/eventlog.ts Adds fixture responses for RPE features and capabilities.

Comment thread src/app/devices/remote-platform-erase/remote-platform-erase.component.ts Outdated
Comment thread src/app/devices/devices.service.ts
Comment thread src/app/devices/device-detail/device-detail.component.ts

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 38 out of 39 changed files in this pull request and generated no new comments.

Suppressed comments (3)

src/app/devices/remote-platform-erase/remote-platform-erase.component.ts:184

  • Fallback translation key remotePlatformErase.toggleFeatureError is not present in the i18n JSON (the existing key is remotePlatformErase.updateError). When the API call fails without a server-provided message, the snackbar will show the raw key instead of a localized message.
          const msg: string = err.error?.message || this.t('remotePlatformErase.toggleFeatureError')

src/app/devices/remote-platform-erase/remote-platform-erase.constants.ts:10

  • This header comment says the file defines “Bitmask definitions”, but the file only exports string capability keys. This is misleading and contradicts the boolean-capabilities request approach used elsewhere in this PR.
/**
 * Bitmask definitions for AMT_BootCapabilities.PlatformErase.
 * Capabilities vary by AMT/CSME version.
 * Reference: https://software.intel.com/sites/manageability/AMT_Implementation_and_Reference_Guide/
 *   default.htm?turl=HTMLDocuments%2FWS-Management_Class_Reference%2FAMT_BootCapabilities.htm%23PlatformErase

src/app/devices/devices.service.ts:474

  • The comment says in-flight GET responses will “preserve” the updated value rather than being overwritten, but getAMTFeatures() always overwrites the cache with the GET response. This comment should be updated to match the actual behavior (optimistic UI update only).
    // Update cache immediately so any in-flight GET responses will read the
    // updated value and preserve it (rather than being overwritten).

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.

Add support for Remote Platform Erase in Console Add support for Remote Platform Erase in MPS

5 participants