Browse Source

UI: Added trim value for created device, improvement created default rule chain and view queue-type-list

pull/3672/head
Vladyslav_Prykhodko 6 years ago
committed by Andrew Shvayka
parent
commit
e095bd379f
  1. 2
      rule-engine/rule-engine-components/src/main/resources/public/static/rulenode/rulenode-core-config.js
  2. 1
      ui-ngx/src/app/modules/home/components/profile/add-device-profile-dialog.component.html
  3. 1
      ui-ngx/src/app/modules/home/components/profile/device-profile.component.html
  4. 4
      ui-ngx/src/app/modules/home/components/rule-chain/rule-chain-autocomplete.component.ts
  5. 1
      ui-ngx/src/app/modules/home/components/wizard/device-wizard-dialog.component.html
  6. 17
      ui-ngx/src/app/modules/home/components/wizard/device-wizard-dialog.component.ts
  7. 1
      ui-ngx/src/app/shared/components/queue/queue-type-list.component.html

2
rule-engine/rule-engine-components/src/main/resources/public/static/rulenode/rulenode-core-config.js

File diff suppressed because one or more lines are too long

1
ui-ngx/src/app/modules/home/components/profile/add-device-profile-dialog.component.html

@ -49,7 +49,6 @@
[queueType]="serviceType" [queueType]="serviceType"
formControlName="defaultQueueName"> formControlName="defaultQueueName">
</tb-queue-type-list> </tb-queue-type-list>
<div class="tb-hint" translate>device-profile.select-queue-hint</div>
<mat-form-field fxHide class="mat-block"> <mat-form-field fxHide class="mat-block">
<mat-label translate>device-profile.type</mat-label> <mat-label translate>device-profile.type</mat-label>
<mat-select formControlName="type" required> <mat-select formControlName="type" required>

1
ui-ngx/src/app/modules/home/components/profile/device-profile.component.html

@ -57,7 +57,6 @@
[queueType]="serviceType" [queueType]="serviceType"
formControlName="defaultQueueName"> formControlName="defaultQueueName">
</tb-queue-type-list> </tb-queue-type-list>
<div class="tb-hint" translate>device-profile.select-queue-hint</div>
<mat-form-field fxHide class="mat-block"> <mat-form-field fxHide class="mat-block">
<mat-label translate>device-profile.type</mat-label> <mat-label translate>device-profile.type</mat-label>
<mat-select formControlName="type" required> <mat-select formControlName="type" required>

4
ui-ngx/src/app/modules/home/components/rule-chain/rule-chain-autocomplete.component.ts

@ -202,8 +202,8 @@ export class RuleChainAutocompleteComponent implements ControlValueAccessor, OnI
createDefaultRuleChain($event: Event, ruleChainName: string) { createDefaultRuleChain($event: Event, ruleChainName: string) {
$event.preventDefault(); $event.preventDefault();
this.ruleChainAutocomplete.closePanel(); this.ruleChainAutocomplete.closePanel();
this.ruleChainService.createDefaultRuleChain(ruleChainName).subscribe((ruleChain) => { this.ruleChainService.createDefaultRuleChain(ruleChainName.trim()).subscribe((ruleChain) => {
this.updateView(ruleChain.id.id); this.selectRuleChainFormGroup.get('ruleChainId').patchValue(ruleChain);
}); });
} }
} }

1
ui-ngx/src/app/modules/home/components/wizard/device-wizard-dialog.component.html

@ -102,7 +102,6 @@
[queueType]="serviceType" [queueType]="serviceType"
formControlName="defaultQueueName"> formControlName="defaultQueueName">
</tb-queue-type-list> </tb-queue-type-list>
<div class="tb-hint" translate>device-profile.select-queue-hint</div>
</div> </div>
</div> </div>
<mat-checkbox formControlName="gateway" style="padding-bottom: 16px;"> <mat-checkbox formControlName="gateway" style="padding-bottom: 16px;">

17
ui-ngx/src/app/modules/home/components/wizard/device-wizard-dialog.component.ts

@ -25,8 +25,12 @@ import {
createDeviceProfileConfiguration, createDeviceProfileConfiguration,
createDeviceProfileTransportConfiguration, createDeviceProfileTransportConfiguration,
DeviceProfile, DeviceProfile,
DeviceProfileType, DeviceProvisionConfiguration, DeviceProvisionType, DeviceProfileType,
DeviceTransportType, deviceTransportTypeConfigurationInfoMap, deviceTransportTypeHintMap, DeviceProvisionConfiguration,
DeviceProvisionType,
DeviceTransportType,
deviceTransportTypeConfigurationInfoMap,
deviceTransportTypeHintMap,
deviceTransportTypeTranslationMap deviceTransportTypeTranslationMap
} from '@shared/models/device.models'; } from '@shared/models/device.models';
import { MatHorizontalStepper } from '@angular/material/stepper'; import { MatHorizontalStepper } from '@angular/material/stepper';
@ -43,7 +47,8 @@ import { StepperSelectionEvent } from '@angular/cdk/stepper';
import { BreakpointObserver, BreakpointState } from '@angular/cdk/layout'; import { BreakpointObserver, BreakpointState } from '@angular/cdk/layout';
import { MediaBreakpoints } from '@shared/models/constants'; import { MediaBreakpoints } from '@shared/models/constants';
import { RuleChainId } from '@shared/models/id/rule-chain-id'; import { RuleChainId } from '@shared/models/id/rule-chain-id';
import {ServiceType} from "@shared/models/queue.models"; import { ServiceType } from '@shared/models/queue.models';
import { deepTrim } from '@core/utils';
@Component({ @Component({
selector: 'tb-device-wizard', selector: 'tb-device-wizard',
@ -108,7 +113,7 @@ export class DeviceWizardDialogComponent extends
deviceProfileId: [null, Validators.required], deviceProfileId: [null, Validators.required],
newDeviceProfileTitle: [{value: null, disabled: true}], newDeviceProfileTitle: [{value: null, disabled: true}],
defaultRuleChainId: [{value: null, disabled: true}], defaultRuleChainId: [{value: null, disabled: true}],
defaultQueueName: [''], defaultQueueName: [{value: null, disabled: true}],
description: [''] description: ['']
} }
); );
@ -288,7 +293,7 @@ export class DeviceWizardDialogComponent extends
if (this.deviceWizardFormGroup.get('defaultRuleChainId').value) { if (this.deviceWizardFormGroup.get('defaultRuleChainId').value) {
deviceProfile.defaultRuleChainId = new RuleChainId(this.deviceWizardFormGroup.get('defaultRuleChainId').value); deviceProfile.defaultRuleChainId = new RuleChainId(this.deviceWizardFormGroup.get('defaultRuleChainId').value);
} }
return this.deviceProfileService.saveDeviceProfile(deviceProfile).pipe( return this.deviceProfileService.saveDeviceProfile(deepTrim(deviceProfile)).pipe(
map(profile => profile.id), map(profile => profile.id),
tap((profileId) => { tap((profileId) => {
this.deviceWizardFormGroup.patchValue({ this.deviceWizardFormGroup.patchValue({
@ -319,7 +324,7 @@ export class DeviceWizardDialogComponent extends
id: this.customerFormGroup.get('customerId').value id: this.customerFormGroup.get('customerId').value
}; };
} }
return this.data.entitiesTableConfig.saveEntity(device); return this.data.entitiesTableConfig.saveEntity(deepTrim(device));
} }
private saveCredentials(device: BaseData<HasId>): Observable<boolean> { private saveCredentials(device: BaseData<HasId>): Observable<boolean> {

1
ui-ngx/src/app/shared/components/queue/queue-type-list.component.html

@ -40,4 +40,5 @@
<mat-error *ngIf="queueFormGroup.get('queue').hasError('required')"> <mat-error *ngIf="queueFormGroup.get('queue').hasError('required')">
{{ 'queue.name_required' | translate }} {{ 'queue.name_required' | translate }}
</mat-error> </mat-error>
<mat-hint class="tb-hint" translate [fxShow]="!disabled">device-profile.select-queue-hint</mat-hint>
</mat-form-field> </mat-form-field>

Loading…
Cancel
Save