fix: remove "Use CIRA" option from Add Device dialog#3282
fix: remove "Use CIRA" option from Add Device dialog#3282madhavilosetty-intel wants to merge 1 commit into
Conversation
73831b7 to
023e413
Compare
023e413 to
3ed7c20
Compare
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 })
})
}
6e5db7c to
1f024f6
Compare
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.
1f024f6 to
d73e5d1
Compare
|
Could you please elobrate on the removal of the manual CIRA toggle completely and not depending on APP_DISABLE_CIRA content. How was this manual CIRA toggle used earlier in earlier versions and removal of this flag how the behavior changes. |
@sudhir-intc Good Question. Like CIRA tab we can hide this option too. The question is, do we need it? For a client initiated connection , we never need to add a device from server. When it first makes an attempt to talk to server either we add the device or update if it does exists. What we had earlier is only for debug purpose. @graikhel-intel What do you think? |
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 )