Skip to content

fix: remove "Use CIRA" option from Add Device dialog#3282

Open
madhavilosetty-intel wants to merge 5 commits into
mainfrom
remove-useCIRA
Open

fix: remove "Use CIRA" option from Add Device dialog#3282
madhavilosetty-intel wants to merge 5 commits into
mainfrom
remove-useCIRA

Conversation

@madhavilosetty-intel
Copy link
Copy Markdown
Contributor

@madhavilosetty-intel madhavilosetty-intel commented Apr 23, 2026

Partially addresses #3200

Devices now connect to the stack automatically, so the manual CIRA toggle and its associated fields (GUID, MPS username, MPS password) are no longer needed.

PR Checklist

  • Unit Tests have been added for new changes
  • API tests have been updated if applicable
  • All commented code has been removed
  • If you've added a dependency, you've ensured license is compatible with Apache 2.0 and clearly outlined the added dependency.

What are you changing?

Anything the reviewer should know when reviewing this PR?

If the there are associated PRs in other repositories, please link them here (i.e. device-management-toolkit/repo#365 )

@madhavilosetty-intel madhavilosetty-intel enabled auto-merge (squash) April 23, 2026 19:58
@madhavilosetty-intel madhavilosetty-intel changed the title feat(add-device): remove "Use CIRA" option from Add Device dialog feat: remove "Use CIRA" option from Add Device dialog Apr 23, 2026
Devices now connect to the stack automatically, so the manual CIRA
toggle and its associated fields (GUID, MPS username, MPS password)
are no longer needed.
@madhavilosetty-intel madhavilosetty-intel changed the title feat: remove "Use CIRA" option from Add Device dialog fix: remove "Use CIRA" option from Add Device dialog Apr 23, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Removes the legacy “Use CIRA” toggle from the Add Device (enterprise) dialog now that device connection is automatic, and cleans up the UI and translations accordingly.

Changes:

  • Removed the “Use CIRA” i18n key across supported locales.
  • Simplified AddDeviceEnterpriseComponent by dropping CIRA-specific fields/logic and switching the template to pure reactive forms (no ngModel).
  • Updated the component unit test to reflect the reduced form shape.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/assets/i18n/ar.json Removes addDevice.useCIRA translation entry
src/assets/i18n/de.json Removes addDevice.useCIRA translation entry
src/assets/i18n/en.json Removes addDevice.useCIRA translation entry
src/assets/i18n/es.json Removes addDevice.useCIRA translation entry
src/assets/i18n/fi.json Removes addDevice.useCIRA translation entry
src/assets/i18n/fr.json Removes addDevice.useCIRA translation entry
src/assets/i18n/he.json Removes addDevice.useCIRA translation entry
src/assets/i18n/it.json Removes addDevice.useCIRA translation entry
src/assets/i18n/ja.json Removes addDevice.useCIRA translation entry
src/assets/i18n/nl.json Removes addDevice.useCIRA translation entry
src/assets/i18n/ru.json Removes addDevice.useCIRA translation entry
src/assets/i18n/sv.json Removes addDevice.useCIRA translation entry
src/app/shared/add-device-enterprise/add-device-enterprise.component.ts Removes CIRA form controls/state and simplifies submit logic
src/app/shared/add-device-enterprise/add-device-enterprise.component.html Removes CIRA toggle/fields; always shows TLS/self-signed options
src/app/shared/add-device-enterprise/add-device-enterprise.component.spec.ts Updates tests for the new (non-CIRA) form payload
Comments suppressed due to low confidence (1)

src/app/shared/add-device-enterprise/add-device-enterprise.component.ts:108

  • submitForm() has an edit path that calls DevicesService.editDevice() and re-attaches guid from the original dialog data. There is currently no unit test covering this edit branch (only the add branch is tested), so regressions here won’t be caught. Add a spec that provides MAT_DIALOG_DATA with a guid, spies on editDevice, and asserts the patched payload includes guid and tags and that the dialog closes on success.
  submitForm(): void {
    if (this.form.valid) {
      const device: Device = { ...this.form.getRawValue() }
      device.tags = this.tags
      if (this.deviceOrig?.guid != null && this.deviceOrig?.guid !== '') {
        device.guid = this.deviceOrig.guid
        this.deviceService.editDevice(device).subscribe(() => {
          this.dialog.close({ submitted: true })
        })
      } else {
        this.deviceService.addDevice(device).subscribe(() => {
          this.dialog.close({ submitted: true })
        })
      }

Comment on lines 68 to 76
constructor() {
const device = this.device

this.deviceOrig = device
if (device != null) {
this.tags = device.tags || []
// If device has mpsusername set, it's a CIRA device
if (device.mpsusername != null && device.mpsusername !== '') {
this.useCIRA = true
}
}
this.form.patchValue(device)
// Ensure mpsusername defaults to admin if empty
if (!this.form.get('mpsusername')?.value) {
this.form.patchValue({ mpsusername: 'admin' })
}
// Apply CIRA state after patching form
this.onCIRAChange(this.useCIRA)
}
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