Browse Source

Fixed downlink fields staying required in the Add integration wizard after choosing Skip (#16795)

* Showed Azure Event Hub IoT Hub name only with a downlink converter

The IoT Hub name field is used only to send cloud-to-device messages, so the form shows it only when the integration has a downlink converter. The add-integration wizard counted a converter chosen under "Select existing" even after switching to "Skip", and did not count "Library"; it now uses only the current choice, which also fixes the downlink fields of UDP, TCP, KPN, ChirpStack and Azure Service Bus. Required-field messages on the form now read as full sentences.

* Moved downlink converter check in the wizard to a getter

The add-integration wizard now decides whether a downlink converter is set in isDownlinkConverterSet, next to createDownlinkConverter().
pull/16810/merge
Serhii Titenko 1 week ago
committed by GitHub
parent
commit
bb58609601
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 20
      ui-ngx/src/app/modules/home/components/integration/configuration/azure-event-hub-integration-form/azure-event-hub-integration-form.component.html
  2. 2
      ui-ngx/src/app/modules/home/components/wizard/integration-wizard-dialog.component.html
  3. 11
      ui-ngx/src/app/modules/home/components/wizard/integration-wizard-dialog.component.ts
  4. 10
      ui-ngx/src/assets/locale/locale.constant-en_US.json

20
ui-ngx/src/app/modules/home/components/integration/configuration/azure-event-hub-integration-form/azure-event-hub-integration-form.component.html

@ -12,15 +12,17 @@
label="{{ 'integration.connection-string' | translate }}"
requiredText="{{ 'integration.connection-string-required' | translate }}">
</tb-secret-key-input>
<mat-form-field appearance="outline" class="mat-block">
<mat-label translate>integration.iot-hub-name</mat-label>
<input matInput [required]="isSetDownLink" formControlName="iotHubName">
@if (azureEventHubIntegrationConfigForm.get('iotHubName').hasError('required')) {
<mat-error translate>
integration.event-iot-hub-name-required
</mat-error>
}
</mat-form-field>
@if (isSetDownLink) {
<mat-form-field appearance="outline" class="mat-block">
<mat-label translate>integration.iot-hub-name</mat-label>
<input matInput required formControlName="iotHubName">
@if (azureEventHubIntegrationConfigForm.get('iotHubName').hasError('required')) {
<mat-error translate>
integration.event-iot-hub-name-required
</mat-error>
}
</mat-form-field>
}
<mat-expansion-panel class="expansion-panel-setting"
[expanded]="azureEventHubIntegrationConfigForm.get('enablePersistentCheckpoints').value">

2
ui-ngx/src/app/modules/home/components/wizard/integration-wizard-dialog.component.html

@ -163,7 +163,7 @@
[genericAdditionalInfoTemplate]="genericAdditionalInfo"
[executeRemotelyTemplate]="executeRemotely"
[integrationType]="integrationWizardForm.get('type').value"
[isSetDownlink]="!!downlinkConverterForm.get('downlinkConverterId').value || downlinkConverterForm.get('converterType').value === 'new'"
[isSetDownlink]="isDownlinkConverterSet"
[isEdgeTemplate]="isEdgeTemplate"
></tb-integration-configuration>
<ng-template #genericAdditionalInfo>

11
ui-ngx/src/app/modules/home/components/wizard/integration-wizard-dialog.component.ts

@ -283,6 +283,17 @@ export class IntegrationWizardDialogComponent extends
}
}
get isDownlinkConverterSet(): boolean {
switch (this.downlinkConverterForm.get('converterType').value) {
case ConverterSourceType.EXISTING:
return !!this.downlinkConverterForm.get('downlinkConverterId').value;
case ConverterSourceType.SKIP:
return false;
default:
return true;
}
}
private createDownlinkConverter(): Observable<ConverterId> {
const converterType = this.downlinkConverterForm.get('converterType').value;
if (converterType === ConverterSourceType.SKIP) {

10
ui-ngx/src/assets/locale/locale.constant-en_US.json

@ -5683,21 +5683,21 @@
"service-bus-namespace-name-required": "Service Bus Namespace Name is required.",
"connection-string": "Connection string",
"consumer-group": "Consumer group",
"connection-string-required": "Connection string required!",
"connection-string-required": "Connection string is required.",
"event-hub-name": "Event Hub Name",
"event-hub-name-required": "Event Hub Name is required.",
"event-iot-hub-name-required": "Iot Hub Name is required for downlink",
"event-iot-hub-name-required": "IoT Hub name is required.",
"enable-persistent-checkpoints": "Enable persistent checkpoints",
"enable-persistent-checkpoints-hint": "Enable Azure Blob Storage to resume processing from the last checkpoint after a restart. Disable to always start from the latest event.",
"storage-connection-string": "Storage connection string",
"storage-connection-string-required": "Storage connection string is required!",
"storage-connection-string-required": "Storage connection string is required.",
"container-name": "Container name",
"container-name-required": "Container name is required",
"container-name-required": "Container name is required.",
"sas-key-name": "SAS Key Name",
"sas-key-name-required": "SAS Key Name is required.",
"sas-key": "SAS Key",
"sas-key-required": "SAS Key is required.",
"iot-hub-name": "IoT Hub Name",
"iot-hub-name": "IoT Hub name",
"hostname": "Hostname",
"hostname-required": "Hostname is required",
"integration-clazz": "Integration class",

Loading…
Cancel
Save