fix: remove "Use CIRA" option from Add Device dialog#3282
Open
madhavilosetty-intel wants to merge 5 commits into
Open
fix: remove "Use CIRA" option from Add Device dialog#3282madhavilosetty-intel wants to merge 5 commits into
madhavilosetty-intel wants to merge 5 commits into
Conversation
73831b7 to
023e413
Compare
023e413 to
3ed7c20
Compare
3 tasks
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.
3ed7c20 to
281dda9
Compare
There was a problem hiding this comment.
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
AddDeviceEnterpriseComponentby dropping CIRA-specific fields/logic and switching the template to pure reactive forms (nongModel). - 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 callsDevicesService.editDevice()and re-attachesguidfrom 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 providesMAT_DIALOG_DATAwith aguid, spies oneditDevice, and asserts the patched payload includesguidandtagsand 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) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
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 )