+
{{ requiredText }}
diff --git a/ui-ngx/src/app/shared/components/entity/entity-list.component.ts b/ui-ngx/src/app/shared/components/entity/entity-list.component.ts
index 5cd19156a5..552c4f1f71 100644
--- a/ui-ngx/src/app/shared/components/entity/entity-list.component.ts
+++ b/ui-ngx/src/app/shared/components/entity/entity-list.component.ts
@@ -14,17 +14,7 @@
/// limitations under the License.
///
-import {
- AfterViewInit,
- Component,
- ElementRef,
- forwardRef,
- Input,
- OnChanges,
- OnInit,
- SimpleChanges,
- ViewChild
-} from '@angular/core';
+import { Component, ElementRef, forwardRef, Input, OnChanges, OnInit, SimpleChanges, ViewChild } from '@angular/core';
import {
ControlValueAccessor,
NG_VALIDATORS,
@@ -65,7 +55,7 @@ import { isArray } from 'lodash';
}
]
})
-export class EntityListComponent implements ControlValueAccessor, OnInit, AfterViewInit, OnChanges {
+export class EntityListComponent implements ControlValueAccessor, OnInit, OnChanges {
entityListFormGroup: UntypedFormGroup;
@@ -115,6 +105,10 @@ export class EntityListComponent implements ControlValueAccessor, OnInit, AfterV
@coerceBoolean()
syncIdsWithDB = false;
+ @Input()
+ @coerceBoolean()
+ inlineField: boolean;
+
@ViewChild('entityInput') entityInput: ElementRef;
@ViewChild('entityAutocomplete') matAutocomplete: MatAutocomplete;
@ViewChild('chipList', {static: true}) chipList: MatChipGrid;
@@ -126,9 +120,9 @@ export class EntityListComponent implements ControlValueAccessor, OnInit, AfterV
private dirty = false;
- private propagateChange = (v: any) => { };
+ private propagateChange = (_v: any) => { };
- constructor(public translate: TranslateService,
+ constructor(private translate: TranslateService,
private entityService: EntityService,
private fb: UntypedFormBuilder) {
this.entityListFormGroup = this.fb.group({
@@ -146,7 +140,7 @@ export class EntityListComponent implements ControlValueAccessor, OnInit, AfterV
this.propagateChange = fn;
}
- registerOnTouched(fn: any): void {
+ registerOnTouched(_fn: any): void {
}
ngOnInit() {
@@ -178,9 +172,6 @@ export class EntityListComponent implements ControlValueAccessor, OnInit, AfterV
}
}
- ngAfterViewInit(): void {
- }
-
setDisabledState(isDisabled: boolean): void {
this.disabled = isDisabled;
if (isDisabled) {
diff --git a/ui-ngx/src/app/shared/components/entity/entity-type-select.component.html b/ui-ngx/src/app/shared/components/entity/entity-type-select.component.html
index b21734cfdd..6506d233b0 100644
--- a/ui-ngx/src/app/shared/components/entity/entity-type-select.component.html
+++ b/ui-ngx/src/app/shared/components/entity/entity-type-select.component.html
@@ -15,14 +15,16 @@
limitations under the License.
-->
-
- {{ 'entity.type' | translate }}
+
+ {{ label }}
{{ displayEntityTypeFn(type) }}
-
+
{{ 'entity.type-required' | translate }}
diff --git a/ui-ngx/src/app/shared/components/entity/entity-type-select.component.ts b/ui-ngx/src/app/shared/components/entity/entity-type-select.component.ts
index ce599a0c08..f8a4f49a82 100644
--- a/ui-ngx/src/app/shared/components/entity/entity-type-select.component.ts
+++ b/ui-ngx/src/app/shared/components/entity/entity-type-select.component.ts
@@ -52,6 +52,9 @@ export class EntityTypeSelectComponent implements ControlValueAccessor, OnInit,
@coerceBoolean()
showLabel: boolean;
+ @Input()
+ label = this.translate.instant('entity.type');
+
@Input()
@coerceBoolean()
required: boolean;
@@ -65,12 +68,16 @@ export class EntityTypeSelectComponent implements ControlValueAccessor, OnInit,
@Input()
appearance: MatFormFieldAppearance = 'fill';
+ @Input()
+ @coerceBoolean()
+ inlineField: boolean;
+
entityTypes: Array;
- private propagateChange = (v: any) => { };
+ private propagateChange = (_v: any) => { };
constructor(private entityService: EntityService,
- public translate: TranslateService,
+ private translate: TranslateService,
private fb: UntypedFormBuilder,
private destroyRef: DestroyRef) {
this.entityTypeFormGroup = this.fb.group({
@@ -82,7 +89,7 @@ export class EntityTypeSelectComponent implements ControlValueAccessor, OnInit,
this.propagateChange = fn;
}
- registerOnTouched(fn: any): void {
+ registerOnTouched(_fn: any): void {
}
ngOnInit() {
@@ -97,7 +104,7 @@ export class EntityTypeSelectComponent implements ControlValueAccessor, OnInit,
takeUntilDestroyed(this.destroyRef)
).subscribe(
(value) => {
- let modelValue;
+ let modelValue: EntityType | AliasEntityType;
if (!value || value === '') {
modelValue = null;
} else {
diff --git a/ui-ngx/src/app/shared/components/mqtt-version-select.component.html b/ui-ngx/src/app/shared/components/mqtt-version-select.component.html
new file mode 100644
index 0000000000..81029a3445
--- /dev/null
+++ b/ui-ngx/src/app/shared/components/mqtt-version-select.component.html
@@ -0,0 +1,30 @@
+
+
+ device-profile.mqtt-protocol-version
+
+ @for (version of mqttVersions; track version) {
+
+ {{ mqttVersionTranslation.get(version) }}
+
+ }
+
+
diff --git a/ui-ngx/src/app/shared/components/mqtt-version-select.component.ts b/ui-ngx/src/app/shared/components/mqtt-version-select.component.ts
new file mode 100644
index 0000000000..6bde856a7b
--- /dev/null
+++ b/ui-ngx/src/app/shared/components/mqtt-version-select.component.ts
@@ -0,0 +1,79 @@
+///
+/// Copyright © 2016-2025 The Thingsboard Authors
+///
+/// Licensed under the Apache License, Version 2.0 (the "License");
+/// you may not use this file except in compliance with the License.
+/// You may obtain a copy of the License at
+///
+/// http://www.apache.org/licenses/LICENSE-2.0
+///
+/// Unless required by applicable law or agreed to in writing, software
+/// distributed under the License is distributed on an "AS IS" BASIS,
+/// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+/// See the License for the specific language governing permissions and
+/// limitations under the License.
+///
+
+import { Component, forwardRef, Input } from '@angular/core';
+import { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';
+import { coerceBoolean } from '@shared/decorators/coercion';
+import { SubscriptSizing, MatFormFieldAppearance } from '@angular/material/form-field';
+import { MqttVersionTranslation, MqttVersion } from '@shared/models/mqtt.models';
+
+@Component({
+ selector: 'tb-mqtt-version-select',
+ templateUrl: './mqtt-version-select.component.html',
+ styleUrls: [],
+ providers: [{
+ provide: NG_VALUE_ACCESSOR,
+ useExisting: forwardRef(() => MqttVersionSelectComponent),
+ multi: true
+ }]
+})
+export class MqttVersionSelectComponent implements ControlValueAccessor {
+
+ @Input()
+ disabled: boolean;
+
+ @Input()
+ subscriptSizing: SubscriptSizing = 'dynamic';
+
+ @Input()
+ appearance: MatFormFieldAppearance = 'fill';
+
+ mqttVersions = Object.values(MqttVersion);
+ mqttVersionTranslation = MqttVersionTranslation;
+ modelValue: MqttVersion;
+
+ @Input()
+ @coerceBoolean()
+ required = false;
+
+ private propagateChange = (v: any) => { };
+
+ constructor() {
+ }
+
+ registerOnChange(fn: any): void {
+ this.propagateChange = fn;
+ }
+
+ registerOnTouched(fn: any): void {
+ }
+
+ setDisabledState(isDisabled: boolean): void {
+ this.disabled = isDisabled;
+ }
+
+ writeValue(value: MqttVersion | null): void {
+ this.modelValue = value;
+ }
+
+ mqttVersionChanged() {
+ this.updateView();
+ }
+
+ private updateView() {
+ this.propagateChange(this.modelValue);
+ }
+}
diff --git a/ui-ngx/src/app/shared/components/time/timewindow-panel.component.html b/ui-ngx/src/app/shared/components/time/timewindow-panel.component.html
index 042d94087c..fbb3c1d2f6 100644
--- a/ui-ngx/src/app/shared/components/time/timewindow-panel.component.html
+++ b/ui-ngx/src/app/shared/components/time/timewindow-panel.component.html
@@ -27,7 +27,7 @@
-