Browse Source

Merge pull request #16699 from thingsboard/rc

Merge rc into master
pull/16744/head
Vladyslav Prykhodko 3 weeks ago
committed by GitHub
parent
commit
c7d34e8ebf
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/DevicePageElements.java
  2. 18
      tools/src/main/python/license-headers/curations.json
  3. 1
      ui-ngx/package.json
  4. 2
      ui-ngx/src/app/core/core.state.ts
  5. 114
      ui-ngx/src/app/modules/home/components/converter/converter.component.ts
  6. 79
      ui-ngx/src/app/modules/home/components/device/device-info-filter.component.html
  7. 261
      ui-ngx/src/app/modules/home/components/device/device-info-filter.component.ts
  8. 12
      ui-ngx/src/app/modules/home/components/entity/entities-table.component.scss
  9. 6
      ui-ngx/src/app/modules/home/components/integration/configuration/azure-services-bus-integration-form/azure-services-bus-integration-form.component.html
  10. 8
      ui-ngx/src/app/modules/home/components/integration/configuration/kpn-integration-form/kpn-integration-form.component.html
  11. 1
      ui-ngx/src/app/modules/home/components/integration/configuration/opc-ua-integration-form/opc-ua-integration-form.component.html
  12. 17
      ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.html
  13. 5
      ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.ts
  14. 6
      ui-ngx/src/app/modules/home/components/profile/device-profile-autocomplete.component.html
  15. 1
      ui-ngx/src/app/modules/home/components/profile/device-profile-autocomplete.component.ts
  16. 2
      ui-ngx/src/app/modules/home/components/role/registration-permissions.component.html
  17. 22
      ui-ngx/src/app/modules/home/components/wizard/integration-wizard-dialog.component.ts
  18. 39
      ui-ngx/src/app/modules/home/pages/admin/resource/js-library-table-header.component.html
  19. 11
      ui-ngx/src/app/modules/home/pages/admin/resource/js-library-table-header.component.ts
  20. 39
      ui-ngx/src/app/modules/home/pages/admin/resource/resources-table-header.component.html
  21. 11
      ui-ngx/src/app/modules/home/pages/admin/resource/resources-table-header.component.ts
  22. 29
      ui-ngx/src/app/modules/home/pages/asset/asset-table-header.component.html
  23. 6
      ui-ngx/src/app/modules/home/pages/asset/asset-table-header.component.scss
  24. 11
      ui-ngx/src/app/modules/home/pages/asset/asset-table-header.component.ts
  25. 13
      ui-ngx/src/app/modules/home/pages/device/device-table-header.component.html
  26. 26
      ui-ngx/src/app/modules/home/pages/device/device-table-header.component.ts
  27. 25
      ui-ngx/src/app/modules/home/pages/edge/edge-table-header.component.html
  28. 1
      ui-ngx/src/app/modules/home/pages/edge/edge-table-header.component.ts
  29. 26
      ui-ngx/src/app/modules/home/pages/entity-view/entity-view-table-header.component.html
  30. 6
      ui-ngx/src/app/modules/home/pages/entity-view/entity-view-table-header.component.scss
  31. 1
      ui-ngx/src/app/modules/home/pages/entity-view/entity-view-table-header.component.ts
  32. 41
      ui-ngx/src/app/shared/components/button/filter-button.component.html
  33. 204
      ui-ngx/src/app/shared/components/button/filter-button.component.ts
  34. 13
      ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.html
  35. 9
      ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.ts
  36. 2
      ui-ngx/src/app/shared/components/role/group-permissions.component.html
  37. 7
      ui-ngx/src/app/shared/components/time/timezone-select.component.ts
  38. 6
      ui-ngx/src/app/shared/shared.module.ts
  39. 3
      ui-ngx/src/assets/locale/locale.constant-ar_AE.json
  40. 2
      ui-ngx/src/assets/locale/locale.constant-ca_ES.json
  41. 4
      ui-ngx/src/assets/locale/locale.constant-da_DK.json
  42. 4
      ui-ngx/src/assets/locale/locale.constant-de_DE.json
  43. 4
      ui-ngx/src/assets/locale/locale.constant-el_GR.json
  44. 10
      ui-ngx/src/assets/locale/locale.constant-en_US.json
  45. 4
      ui-ngx/src/assets/locale/locale.constant-es_ES.json
  46. 4
      ui-ngx/src/assets/locale/locale.constant-fr_FR.json
  47. 4
      ui-ngx/src/assets/locale/locale.constant-hi_IN.json
  48. 4
      ui-ngx/src/assets/locale/locale.constant-it_IT.json
  49. 4
      ui-ngx/src/assets/locale/locale.constant-ja_JP.json
  50. 2
      ui-ngx/src/assets/locale/locale.constant-ka_GE.json
  51. 4
      ui-ngx/src/assets/locale/locale.constant-ko_KR.json
  52. 4
      ui-ngx/src/assets/locale/locale.constant-lt_LT.json
  53. 2
      ui-ngx/src/assets/locale/locale.constant-lv_LV.json
  54. 4
      ui-ngx/src/assets/locale/locale.constant-nl_BE.json
  55. 4
      ui-ngx/src/assets/locale/locale.constant-nl_NL.json
  56. 4
      ui-ngx/src/assets/locale/locale.constant-no_NO.json
  57. 4
      ui-ngx/src/assets/locale/locale.constant-pl_PL.json
  58. 4
      ui-ngx/src/assets/locale/locale.constant-pt_BR.json
  59. 4
      ui-ngx/src/assets/locale/locale.constant-sl_SI.json
  60. 4
      ui-ngx/src/assets/locale/locale.constant-tr_TR.json
  61. 4
      ui-ngx/src/assets/locale/locale.constant-uk_UA.json
  62. 4
      ui-ngx/src/assets/locale/locale.constant-zh_CN.json
  63. 4
      ui-ngx/src/assets/locale/locale.constant-zh_TW.json
  64. 9
      ui-ngx/src/scss/filter-button.scss
  65. 12
      ui-ngx/yarn.lock

2
msa/black-box-tests/src/test/java/org/thingsboard/server/msa/ui/pages/DevicePageElements.java

@ -42,7 +42,7 @@ public class DevicePageElements extends OtherPageElementsHelper {
private static final String DEVICE_LABEL_EDIT = "//input[@formcontrolname='label']";
private static final String DEVICE_DEVICE_PROFILE_PAGE = DEVICE + "/ancestor::mat-row//mat-cell[contains(@class,'cdk-column-type')]/span";
protected static final String CHANGE_OWNER_BTN = "//mat-icon[text() = 'assignment_ind']/parent::button";
private static final String FILTER_BTN = "//tb-device-info-filter/button";
private static final String FILTER_BTN = "//tb-device-table-header//tb-filter-button/button";
private static final String DEVICE_PROFILE_FIELD = "(//input[@formcontrolname='deviceProfile'])[2]";
private static final String DEVICE_STATE_SELECT = "//div[contains(@class,'tb-filter-panel')]//mat-select[@role='combobox']";
private static final String LIST_OF_DEVICES_STATE = "//div[@class='status']";

18
tools/src/main/python/license-headers/curations.json

@ -1393,12 +1393,6 @@
"reason": "PE agent entity tabs component added in f5e28c9cc42 as part of the PE agent feature introduced on lts-4.4, which has no counterpart in CE. The candidate CE ui-ngx/src/app/modules/home/pages/edge/edge-tabs.component.ts shares only the entity tabs component boilerplate. Reviewed candidate at a0aff29ef42d3636473b017115a9334b48d54d15 (blob 58bc88a8db4).",
"contentHash": "sha256:774979b5f77b5d58e1d7dfabc31f6271a46cfa346b8f43e6bb18db92e0cb2429"
},
{
"path": "ui-ngx/src/app/modules/home/pages/asset/asset-table-header.component.scss",
"header": "ce-modified",
"reason": "Retained CE file subsequently deleted on the CE mainline in d81add6fd73 (Angular 15 migration). PE keeps the assets table header stylesheet and updated it for the MDC slide toggle. Reviewed against last CE path version 80430897422ae13b600ee9c9dbc57f7d558a3b4b^1 (blob 488e5b4c27e).",
"contentHash": "sha256:57aabaed35a0bf7d372df84d6d3c7e7562eeccc06bd19655f94000bd2693f3c0"
},
{
"path": "ui-ngx/src/app/modules/home/pages/converter/converter.module.ts",
"header": "busl",
@ -1441,12 +1435,6 @@
"reason": "New PE file implementing a PE feature. It was written by adapting CE ui-ngx/src/app/modules/home/pages/dashboard/make-dashboard-public-dialog.component.ts, which PE still carries at its own path, so this is not a CE file with PE modifications. Adaptation from CE does not make it CE-derived. Maintainer rule (2026-09-09): a file that exists in CE and carries PE changes is modified CE; a file that does not exist in CE and implements a PE feature is PE-only, however closely it resembles a CE file.",
"contentHash": "sha256:07f295f637db24d600798215d33391f4e966954899f644a41b9735f5ed5392db"
},
{
"path": "ui-ngx/src/app/modules/home/pages/entity-view/entity-view-table-header.component.scss",
"header": "ce-modified",
"reason": "Retained CE file subsequently deleted on the CE mainline in d81add6fd73 (Angular 15 migration). PE keeps the entity views table header stylesheet and updated it for the MDC slide toggle. Reviewed against last CE path version 80430897422ae13b600ee9c9dbc57f7d558a3b4b^1 (blob 66a9d55fb35).",
"contentHash": "sha256:6c7ddc99037190175a49c49f17e30954e2e46d03f7e91cb02ae5e40381a4850b"
},
{
"path": "ui-ngx/src/app/modules/home/pages/iframe/iframe-view.module.ts",
"header": "busl",
@ -1710,6 +1698,12 @@
"header": "busl",
"reason": "ID wrapper for a PE-only entity. Maintainer resolved ConverterId and comparable PE-only entity wrappers as PE-authored; extending the common ID type and repeating its annotations/type tag is template use. Reviewed similarity candidate ui-ngx/src/app/shared/models/id/asset-id.ts at 0d3b41e002f958887a317ca8366fdc4efa549058 (blob 86ca874a92346a950b6912d78116f1f7ee6bb654).",
"contentHash": "sha256:5427b1c6bf59f9e9372c47717fee96bf94bddeaf65ad920b77647b16539bf5f9"
},
{
"path": "ui-ngx/src/scss/filter-button.scss",
"header": "ce-modified",
"reason": "Shared filter button styles extracted from the CE device filter component, which now uses this file instead of its own copy; the rules are the CE implementation with the panel class renamed. Reviewed against CE ui-ngx/src/app/modules/home/components/device/device-info-filter.component.scss at 269bc8dc73a4892e93cf61db6a8a41ea377c8636 (blob 4a79c6c9ce599e85209d5a6ee9062b6f713ac0f1).",
"contentHash": "sha256:3b19b678564aa147c087269d91d7996a5c2a58d7ff058afbe6610c5cda56cc0e"
}
]
}

1
ui-ngx/package.json

@ -145,7 +145,6 @@
"eslint-plugin-jsdoc": "^62.9.0",
"eslint-plugin-prefer-arrow": "^1.2.3",
"eslint-plugin-tailwindcss": "^3.18.3",
"ngrx-store-freeze": "^0.2.4",
"normalize-package-data": "8.0.0",
"packageurl-js": "2.0.1",
"patch-package": "^8.0.1",

2
ui-ngx/src/app/core/core.state.ts

@ -1,7 +1,6 @@
// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-License-Identifier: Apache-2.0
import { ActionReducerMap, MetaReducer } from '@ngrx/store';
import { storeFreeze } from 'ngrx-store-freeze';
import { environment as env } from '@env/environment';
@ -31,7 +30,6 @@ export const metaReducers: MetaReducer<AppState>[] = [
initStateFromLocalStorage
];
if (!env.production) {
metaReducers.unshift(storeFreeze);
metaReducers.unshift(debug);
}

114
ui-ngx/src/app/modules/home/components/converter/converter.component.ts

@ -47,8 +47,8 @@ import {
} from '@shared/models/integration.models';
import { capitalize, deepClone, isDefinedAndNotNull, isEmptyStr, isNotEmptyStr } from '@core/utils';
import { NULL_UUID } from '@shared/models/id/has-uuid';
import { catchError, filter, map, startWith } from 'rxjs/operators';
import { combineLatest, defer, forkJoin, merge, Observable, of, shareReplay } from 'rxjs';
import { catchError, filter, map, startWith, switchMap, tap } from 'rxjs/operators';
import { combineLatest, defer, forkJoin, merge, Observable, of, shareReplay, Subscription } from 'rxjs';
import { ContentType } from '@shared/models/constants';
import { ConverterLibraryService } from '@core/http/converter-library.service';
import { EntityType } from '@shared/models/entity-type.models';
@ -61,6 +61,12 @@ import { EventsDialogComponent, EventsDialogData } from '@home/dialogs/events-di
import { Operation, Resource } from '@shared/models/security.models';
import { UserPermissionsService } from '@core/http/user-permissions.service';
interface ConverterDefaults {
updateOnlyKeys: DefaultUpdateOnlyKeys;
converterV2Config: Record<IntegrationType, ConverterConfigV2>;
integrationsConvertersInfo: IntegrationsConvertersInfo;
}
@Component({
selector: 'tb-converter',
templateUrl: './converter.component.html',
@ -149,6 +155,10 @@ export class ConverterComponent extends EntityComponent<Converter> implements On
private defaultUpdateOnlyKeysByIntegrationType: DefaultUpdateOnlyKeys = {};
private defaultConverterV2Configuration: Record<IntegrationType, ConverterConfigV2> = {} as Record<IntegrationType, ConverterConfigV2>;
// Emits once, when the data above is loaded; replays at once to later subscribers
private readonly defaults$: Observable<ConverterDefaults>;
private scriptTemplateSubscriptions: Record<string, Subscription> = {};
constructor(protected store: Store<AppState>,
protected translate: TranslateService,
private converterService: ConverterService,
@ -163,13 +173,21 @@ export class ConverterComponent extends EntityComponent<Converter> implements On
private destroyRef: DestroyRef,
private userPermissionsService: UserPermissionsService) {
super(store, fb, entityValue, entitiesTableConfigValue, cd);
forkJoin({
updateOnlyKeys: this.resourcesService.loadJsonResource<DefaultUpdateOnlyKeys>('/assets/converters/default-update-only-keys.json'),
converterV2Config: this.resourcesService.loadJsonResource<Record<IntegrationType, ConverterConfigV2>>('/assets/converters/default-converters-v2-configuration.json'),
// A failed request falls back to the initial value of its field
this.defaults$ = forkJoin({
updateOnlyKeys: this.resourcesService.loadJsonResource<DefaultUpdateOnlyKeys>('/assets/converters/default-update-only-keys.json')
.pipe(catchError(() => of(this.defaultUpdateOnlyKeysByIntegrationType))),
converterV2Config: this.resourcesService.loadJsonResource<Record<IntegrationType, ConverterConfigV2>>('/assets/converters/default-converters-v2-configuration.json')
.pipe(catchError(() => of(this.defaultConverterV2Configuration))),
integrationsConvertersInfo: this.integrationService.getIntegrationsConvertersInfoCached()
.pipe(catchError(() => of(this.integrationsConvertersInfo)))
}).pipe(
shareReplay(1)
);
// Subscribed first, so the fields are set before any other subscriber of defaults$ runs
this.defaults$.pipe(
takeUntilDestroyed()
).subscribe((value) =>{
).subscribe((value) => {
this.defaultUpdateOnlyKeysByIntegrationType = value.updateOnlyKeys;
this.defaultConverterV2Configuration = value.converterV2Config;
this.integrationsConvertersInfo = value.integrationsConvertersInfo;
@ -200,11 +218,11 @@ export class ConverterComponent extends EntityComponent<Converter> implements On
const typeControl = this.entityForm.get('integrationType');
// The type can be set before the template subscribes (e.g. preset from the integration form)
this.integrationInfo$ = combineLatest([
this.integrationService.getIntegrationsConvertersInfoCached(),
this.defaults$,
defer(() => typeControl.valueChanges.pipe(startWith(typeControl.value)))
]).pipe(
filter(([, type]) => !!type),
map(([info, type]) => info?.[type]),
map(([defaults, type]) => defaults.integrationsConvertersInfo?.[type]),
shareReplay(1)
);
}
@ -214,24 +232,12 @@ export class ConverterComponent extends EntityComponent<Converter> implements On
this.entityForm.get('type').valueChanges,
this.entityForm.get('integrationType').valueChanges
).pipe(
tap(() => this.onTypesChanged()),
// The version, the scripts and the default configuration need the loaded defaults:
// at once when they are loaded, otherwise once, for the latest types, when they arrive
switchMap(() => this.defaults$),
takeUntilDestroyed(this.destroyRef)
).subscribe(() => {
this.resetToNewTab();
let converterType: ConverterType = this.entityForm.get('type').value;
const integrationType: IntegrationType = this.entityForm.get('integrationType').value;
this.hideDownlink = integrationTypeInfoMap.get(integrationType)?.hideDownlink ?? false;
if (this.hideDownlink && converterType === ConverterType.DOWNLINK) {
converterType = ConverterType.UPLINK;
this.entityForm.get('type').setValue(converterType, {emitEvent: false});
}
this.updateConverterVersion();
this.onConverterTypeChanged(converterType);
if (converterType === ConverterType.UPLINK) {
this.updateDefaultConfiguration(integrationType);
}
this.updatedConverterScriptLangDisableState();
});
).subscribe(() => this.applyTypesDefaults());
this.entityForm.get('configuration.scriptLang').valueChanges.pipe(
takeUntilDestroyed(this.destroyRef)
).subscribe(() => {
@ -245,6 +251,41 @@ export class ConverterComponent extends EntityComponent<Converter> implements On
this.checkIsNewConverter(this.entity, this.entityForm, true);
}
private onTypesChanged(): void {
this.resetToNewTab();
const integrationType: IntegrationType = this.entityForm.get('integrationType').value;
this.hideDownlink = integrationTypeInfoMap.get(integrationType)?.hideDownlink ?? false;
if (this.hideDownlink && this.entityForm.get('type').value === ConverterType.DOWNLINK) {
this.entityForm.get('type').setValue(ConverterType.UPLINK, {emitEvent: false});
}
}
private applyTypesDefaults(): void {
// A library converter selected while the defaults were loading keeps its version and scripts
if (this.entityForm.get('converterLibrary').value) {
return;
}
const converterType: ConverterType = this.entityForm.get('type').value;
const integrationType: IntegrationType = this.entityForm.get('integrationType').value;
this.updateConverterVersion();
this.onConverterTypeChanged(converterType);
if (converterType === ConverterType.UPLINK) {
this.updateDefaultConfiguration(integrationType);
}
this.updatedConverterScriptLangDisableState();
this.cd.markForCheck();
}
// Runs the action at once when the defaults are loaded, otherwise when they arrive
private whenDefaultsLoaded(action: () => void): void {
this.defaults$.pipe(
takeUntilDestroyed(this.destroyRef)
).subscribe(() => {
action();
this.cd.markForCheck();
});
}
private resetToNewTab() {
this.prevLibraryConverterFormValue = null;
this.prevNewConverterFormValue = null;
@ -384,12 +425,12 @@ export class ConverterComponent extends EntityComponent<Converter> implements On
form.get('configuration.scriptLang').patchValue(
this.tbelEnabled ? ScriptLanguage.TBEL : ScriptLanguage.JS, {emitEvent});
if (!emitEvent) {
this.updateConverterVersion();
this.whenDefaultsLoaded(() => this.updateConverterVersion());
} else {
form.get('integrationType').updateValueAndValidity({onlySelf: true});
}
} else {
this.updatedPredefinedConverterKeys();
this.whenDefaultsLoaded(() => this.updatedPredefinedConverterKeys());
this.updatedConverterVersionDisableState();
this.updatedConverterScriptLangDisableState(entity);
form.updateValueAndValidity();
@ -403,10 +444,10 @@ export class ConverterComponent extends EntityComponent<Converter> implements On
form.get('configuration.scriptLang').patchValue(scriptLang, {emitEvent: true});
}
if (isDefinedAndNotNull(entity?.converterVersion)) {
this.updatedPredefinedConverterKeys();
this.whenDefaultsLoaded(() => this.updatedPredefinedConverterKeys());
this.updatedConverterVersionDisableState();
} else {
this.updateConverterVersion();
this.whenDefaultsLoaded(() => this.updateConverterVersion());
}
}
}
@ -489,8 +530,9 @@ export class ConverterComponent extends EntityComponent<Converter> implements On
const converterType: ConverterType = this.entityForm.get('type').value;
const integrationType: IntegrationType = this.entityForm.get('integrationType').value;
const converterInfo: ConverterInfo = this.integrationsConvertersInfo?.[integrationType]?.[converterType.toLocaleLowerCase()];
this.predefinedConverterKeys = converterInfo.keys.map(value => ({name: value, value}));
this.predefinedKeys = deepClone(converterInfo.keys);
const keys = converterInfo?.keys ?? [];
this.predefinedConverterKeys = keys.map(value => ({name: value, value}));
this.predefinedKeys = deepClone(keys);
} else {
this.predefinedConverterKeys = null;
this.predefinedKeys = [];
@ -515,11 +557,15 @@ export class ConverterComponent extends EntityComponent<Converter> implements On
if (!isNotEmptyStr(scriptBody)) {
const targetTemplateUrl = getTargetTemplateUrl(converterType, scriptLang, integrationType, converterVersion);
this.resourcesService.loadJsonResource(targetTemplateUrl)
this.scriptTemplateSubscriptions[targetField]?.unsubscribe();
this.scriptTemplateSubscriptions[targetField] = this.resourcesService.loadJsonResource<string>(targetTemplateUrl)
.pipe(takeUntilDestroyed(this.destroyRef))
.subscribe(template => {
this.entityForm.get('configuration').get(targetField)
.patchValue(template, { emitEvent: false });
const scriptControl = this.entityForm.get('configuration').get(targetField);
// A template that arrives late does not replace a script set in the meantime
if (!isNotEmptyStr(scriptControl.value)) {
scriptControl.patchValue(template, {emitEvent: false});
}
});
}
}

79
ui-ngx/src/app/modules/home/components/device/device-info-filter.component.html

@ -1,95 +1,30 @@
<!--
SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
-->
@if (panelMode) {
<ng-container *ngTemplateOutlet="deviceFilterPanel"></ng-container>
} @else {
@if (buttonMode) {
<button color="primary"
matTooltip="{{buttonDisplayValue}}"
matTooltipPosition="above"
mat-stroked-button
(click)="toggleDeviceFilterPanel($event)">
<mat-icon>filter_list</mat-icon>{{buttonDisplayValue}}
</button>
} @else {
<div class="tb-device-filter-config-component tb-form-panel no-padding no-border" [formGroup]="deviceInfoFilterForm">
<div class="tb-form-row column-xs">
<div class="fixed-title-width" translate>device-profile.device-profile</div>
<tb-device-profile-autocomplete
class="flex-1"
formControlName="deviceProfileId"
[inlineField]="true"
[displayAllOnEmpty]="true"
(deviceProfileChanged)="deviceProfileChanged($event)"
[editProfileEnabled]="false"
[addNewProfile]="false">
</tb-device-profile-autocomplete>
</div>
<div class="tb-form-row column-xs">
<div class="fixed-title-width" translate>device.device-state</div>
<mat-form-field class="flex-1" appearance="outline" subscriptSizing="dynamic">
<mat-select formControlName="active" placeholder="{{ 'device.any' | translate }}">
<mat-option>{{ 'device.any' | translate }}</mat-option>
<mat-option [value]="true">{{ 'device.active' | translate }}</mat-option>
<mat-option [value]="false">{{ 'device.inactive' | translate }}</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
}
}
<ng-template #deviceFilterPanel>
<form class="mat-content mat-padding flex flex-col" (ngSubmit)="update()">
<ng-container *ngTemplateOutlet="deviceFilter"></ng-container>
<div class="tb-panel-actions flex flex-row items-center justify-end">
<button type="button"
mat-button
color="primary"
(click)="reset()">
{{ 'action.reset' | translate }}
</button>
<span class="flex-1"></span>
<button type="button"
mat-button
(click)="cancel()">
{{ 'action.cancel' | translate }}
</button>
<button type="submit"
mat-raised-button
color="primary"
[disabled]="deviceInfoFilterForm.invalid || !deviceInfoFilterForm.dirty">
{{ 'action.update' | translate }}
</button>
</div>
</form>
</ng-template>
<ng-template #deviceFilter>
<div class="tb-device-filter-config-component tb-form-panel no-padding no-border" [formGroup]="deviceInfoFilterForm">
<ng-container [formGroup]="deviceInfoFilterForm">
<div class="tb-form-row column-xs">
<div class="fixed-title-width" translate>device-profile.device-profile</div>
<tb-device-profile-autocomplete
class="flex-1"
class="min-w-0 flex-1"
formControlName="deviceProfileId"
[inlineField]="true"
[displayAllOnEmpty]="true"
(deviceProfileChanged)="deviceProfileChanged($event)"
[editProfileEnabled]="false"
[addNewProfile]="false">
</tb-device-profile-autocomplete>
</div>
<div class="tb-form-row column-xs">
<div class="fixed-title-width" translate>device.device-state</div>
<mat-form-field class="flex-1" appearance="outline" subscriptSizing="dynamic">
<mat-select formControlName="active" placeholder="{{ 'device.any' | translate }}">
<mat-form-field class="min-w-0 flex-1" appearance="outline" subscriptSizing="dynamic">
<mat-select formControlName="active" placeholder="{{ 'device.any' | translate }}" [aria-label]="'device.device-state' | translate">
<mat-option>{{ 'device.any' | translate }}</mat-option>
<mat-option [value]="true">{{ 'device.active' | translate }}</mat-option>
<mat-option [value]="false">{{ 'device.inactive' | translate }}</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</ng-template>
</ng-container>

261
ui-ngx/src/app/modules/home/components/device/device-info-filter.component.ts

@ -1,45 +1,16 @@
// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-License-Identifier: Apache-2.0
import {
ChangeDetectorRef,
Component,
DestroyRef,
ElementRef,
forwardRef,
Inject,
InjectionToken,
Input,
OnInit,
Optional,
TemplateRef,
ViewChild,
ViewContainerRef
} from '@angular/core';
import { ControlValueAccessor, FormBuilder, FormGroup, NG_VALUE_ACCESSOR } from '@angular/forms';
import { coerceBoolean } from '@shared/decorators/coercion';
import { ConnectedPosition, Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';
import { TemplatePortal } from '@angular/cdk/portal';
import { TranslateService } from '@ngx-translate/core';
import { DeviceInfoFilter } from '@shared/models/device.models';
import { deepClone, isDefinedAndNotNull, isEmpty, isUndefinedOrNull } from '@core/utils';
import { EntityInfoData } from '@shared/models/entity.models';
import { DeviceProfileService } from '@core/http/device-profile.service';
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
import { ChangeDetectionStrategy, Component, DestroyRef, forwardRef, inject } from '@angular/core';
import { ControlValueAccessor, FormBuilder, NG_VALUE_ACCESSOR } from '@angular/forms';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { fromEvent, Subscription } from 'rxjs';
export const DEVICE_FILTER_CONFIG_DATA = new InjectionToken<any>('DeviceFilterConfigData');
export interface DeviceFilterConfigData {
panelMode: boolean;
deviceInfoFilter: DeviceInfoFilter;
initialFilterConfig?: DeviceInfoFilter;
}
import { DeviceInfoFilter } from '@shared/models/device.models';
// @dynamic
@Component({
selector: 'tb-device-info-filter',
templateUrl: './device-info-filter.component.html',
styleUrls: ['./device-info-filter.component.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
host: {class: 'contents'},
providers: [
{
provide: NG_VALUE_ACCESSOR,
@ -49,78 +20,25 @@ export interface DeviceFilterConfigData {
],
standalone: false
})
export class DeviceInfoFilterComponent implements OnInit, ControlValueAccessor {
@ViewChild('deviceFilterPanel')
deviceFilterPanel: TemplateRef<any>;
@Input() disabled: boolean;
@coerceBoolean()
@Input()
buttonMode = true;
@Input()
initialDeviceFilterConfig: DeviceInfoFilter = {
deviceProfileId: null,
active: null
};
panelMode = false;
buttonDisplayValue = this.translate.instant('device.device-filter-title');
deviceInfoFilterForm: FormGroup;
deviceFilterOverlayRef: OverlayRef;
export class DeviceInfoFilterComponent implements ControlValueAccessor {
panelResult: DeviceInfoFilter = null;
private fb = inject(FormBuilder);
private destroyRef = inject(DestroyRef);
private deviceProfileInfo: EntityInfoData;
private deviceInfoFilter: DeviceInfoFilter;
private resizeWindows: Subscription;
deviceInfoFilterForm = this.fb.group({
deviceProfileId: [null as DeviceInfoFilter['deviceProfileId']],
active: [null as boolean]
});
private propagateChange = (_: any) => {};
private propagateChange = (_: DeviceInfoFilter) => {};
constructor(@Optional() @Inject(DEVICE_FILTER_CONFIG_DATA)
private data: DeviceFilterConfigData | undefined,
@Optional()
private overlayRef: OverlayRef,
private fb: FormBuilder,
private translate: TranslateService,
private overlay: Overlay,
private nativeElement: ElementRef,
private viewContainerRef: ViewContainerRef,
private deviceProfileService: DeviceProfileService,
private cd: ChangeDetectorRef,
private destroyRef: DestroyRef) {
}
ngOnInit(): void {
if (this.data) {
this.panelMode = this.data.panelMode;
this.deviceInfoFilter = this.data.deviceInfoFilter;
this.initialDeviceFilterConfig = this.data.initialFilterConfig;
if (this.panelMode && !this.initialDeviceFilterConfig) {
this.initialDeviceFilterConfig = deepClone(this.deviceInfoFilter);
}
}
this.deviceInfoFilterForm = this.fb.group({
deviceProfileId: [null, []],
active: ['', []]
});
constructor() {
this.deviceInfoFilterForm.valueChanges.pipe(
takeUntilDestroyed(this.destroyRef)
).subscribe(
() => {
if (!this.buttonMode) {
this.deviceFilterUpdated(this.deviceInfoFilterForm.value);
}
}
);
if (this.panelMode) {
this.updateDeviceInfoFilterForm(this.deviceInfoFilter);
}
).subscribe(value => this.propagateChange({
deviceProfileId: value.deviceProfileId ?? null,
active: value.active ?? null
}));
}
registerOnChange(fn: any): void {
@ -131,8 +49,7 @@ export class DeviceInfoFilterComponent implements OnInit, ControlValueAccessor {
}
setDisabledState(isDisabled: boolean): void {
this.disabled = isDisabled;
if (this.disabled) {
if (isDisabled) {
this.deviceInfoFilterForm.disable({emitEvent: false});
} else {
this.deviceInfoFilterForm.enable({emitEvent: false});
@ -140,145 +57,9 @@ export class DeviceInfoFilterComponent implements OnInit, ControlValueAccessor {
}
writeValue(deviceInfoFilter?: DeviceInfoFilter): void {
this.deviceInfoFilter = deviceInfoFilter;
if (!this.initialDeviceFilterConfig && deviceInfoFilter) {
this.initialDeviceFilterConfig = deepClone(deviceInfoFilter);
}
this.updateButtonDisplayValue();
this.updateDeviceInfoFilterForm(deviceInfoFilter);
}
toggleDeviceFilterPanel($event: Event) {
if ($event) {
$event.stopPropagation();
}
const config = new OverlayConfig({
panelClass: 'tb-filter-panel',
backdropClass: 'cdk-overlay-transparent-backdrop',
hasBackdrop: true,
maxHeight: '80vh',
height: 'min-content',
minWidth: ''
});
config.hasBackdrop = true;
const connectedPosition: ConnectedPosition = {
originX: 'start',
originY: 'bottom',
overlayX: 'start',
overlayY: 'top'
};
config.positionStrategy = this.overlay.position().flexibleConnectedTo(this.nativeElement)
.withPositions([connectedPosition]);
this.deviceFilterOverlayRef = this.overlay.create(config);
this.deviceFilterOverlayRef.backdropClick().subscribe(() => {
this.deviceFilterOverlayRef.dispose();
});
this.deviceFilterOverlayRef.attach(new TemplatePortal(this.deviceFilterPanel,
this.viewContainerRef));
this.resizeWindows = fromEvent(window, 'resize').subscribe(() => {
this.deviceFilterOverlayRef.updatePosition();
});
}
cancel() {
this.updateDeviceInfoFilterForm(this.deviceInfoFilter);
this.deviceInfoFilterForm.markAsPristine();
if (this.overlayRef) {
this.overlayRef.dispose();
} else {
this.resizeWindows.unsubscribe();
this.deviceFilterOverlayRef.dispose();
}
}
update() {
this.deviceFilterUpdated(this.deviceInfoFilterForm.value);
this.deviceInfoFilterForm.markAsPristine();
if (this.panelMode) {
this.panelResult = this.deviceInfoFilter;
}
if (this.overlayRef) {
this.overlayRef.dispose();
} else {
this.resizeWindows.unsubscribe();
this.deviceFilterOverlayRef.dispose();
}
}
reset() {
const deviceInfoFilter = this.deviceFilterFromFormValue(this.deviceInfoFilterForm.value);
if (!this.deviceInfoFilterConfigEquals(deviceInfoFilter, this.initialDeviceFilterConfig)) {
this.updateDeviceInfoFilterForm(this.initialDeviceFilterConfig);
this.deviceInfoFilterForm.markAsDirty();
}
}
deviceProfileChanged(deviceProfileInfo: EntityInfoData) {
this.deviceProfileInfo = deviceProfileInfo;
this.updateButtonDisplayValue();
}
private deviceInfoFilterConfigEquals = (filter1?: DeviceInfoFilter, filter2?: DeviceInfoFilter): boolean => {
if (filter1 === filter2) {
return true;
}
if ((isUndefinedOrNull(filter1) || isEmpty(filter1)) && (isUndefinedOrNull(filter2) || isEmpty(filter2))) {
return true;
} else if (isDefinedAndNotNull(filter1) && isDefinedAndNotNull(filter2)) {
if (filter1.active !== filter2.active) {
return false;
}
return filter1.deviceProfileId === filter2.deviceProfileId;
}
return false;
};
private updateDeviceInfoFilterForm(deviceInfoFilter?: DeviceInfoFilter) {
this.deviceInfoFilterForm.patchValue({
deviceProfileId: deviceInfoFilter?.deviceProfileId ?? null,
active: deviceInfoFilter?.active ?? null
}, {emitEvent: false});
}
private deviceFilterUpdated(deviceInfoFilter: DeviceInfoFilter) {
this.deviceInfoFilter = this.deviceFilterFromFormValue(deviceInfoFilter);
this.updateButtonDisplayValue();
this.propagateChange(this.deviceInfoFilter);
}
private updateButtonDisplayValue() {
if (this.buttonMode) {
const filterTextParts: string[] = [];
if (isDefinedAndNotNull(this.deviceInfoFilter?.deviceProfileId)) {
if (!this.deviceProfileInfo) {
this.deviceProfileService.getDeviceProfileInfo(this.deviceInfoFilter?.deviceProfileId.id,
{ignoreLoading: true, ignoreErrors: true}).subscribe(
(deviceProfileInfo) => {
this.deviceProfileChanged(deviceProfileInfo);
});
return;
} else {
filterTextParts.push(this.deviceProfileInfo.name);
}
}
if (isDefinedAndNotNull(this.deviceInfoFilter?.active)) {
const translationKey = this.deviceInfoFilter?.active ? 'device.active' : 'device.inactive';
filterTextParts.push(this.translate.instant(translationKey));
}
if (!filterTextParts.length) {
this.buttonDisplayValue = this.translate.instant('device.device-filter-title');
} else {
this.buttonDisplayValue = this.translate.instant('device.filter-title') + `: ${filterTextParts.join(', ')}`;
}
this.cd.detectChanges();
}
}
private deviceFilterFromFormValue(formValue: any): DeviceInfoFilter {
return {
deviceProfileId: formValue?.deviceProfileId ?? null,
active: formValue?.active ?? null
};
}
}

12
ui-ngx/src/app/modules/home/components/entity/entities-table.component.scss

@ -32,6 +32,18 @@
.title-container{
overflow: hidden;
height: 100%;
min-width: 0;
.tb-entity-table-title {
flex: 0 1 auto;
min-width: 64px;
}
::ng-deep > :not(.tb-entity-table-title, button) {
min-width: 0;
flex-shrink: 10000;
.mat-mdc-slide-toggle .mdc-label {
white-space: normal;
}
}
}
.tb-entity-table-title {

6
ui-ngx/src/app/modules/home/components/integration/configuration/azure-services-bus-integration-form/azure-services-bus-integration-form.component.html

@ -42,11 +42,13 @@
<ng-template matExpansionPanelContent>
<tb-secret-key-input formControlName="downlinkConnectionString" class="mat-block flex-1" appearance="outline"
label="{{ 'integration.downlink-connection-string' | translate }}">
[required]="isSetDownLink"
label="{{ 'integration.downlink-connection-string' | translate }}"
requiredText="{{ 'integration.downlink-connection-string-required' | translate }}">
</tb-secret-key-input>
<mat-form-field appearance="outline" class="mat-block">
<mat-label translate>integration.downlink-topic-name</mat-label>
<input matInput formControlName="downlinkTopicName">
<input matInput [required]="isSetDownLink" formControlName="downlinkTopicName">
@if (azureServicesBusIntegrationConfigForm.get('downlinkTopicName').hasError('required')) {
<mat-error translate>
integration.downlink-topic-name-required

8
ui-ngx/src/app/modules/home/components/integration/configuration/kpn-integration-form/kpn-integration-form.component.html

@ -78,10 +78,14 @@
<legend class="group-title" translate>integration.downlink-credentials</legend>
<div class="flex flex-col gt-xs:gap-2">
<tb-secret-key-input formControlName="apiId" class="mat-block flex-1" appearance="outline"
label="{{ 'integration.api-id' | translate }}">
required
label="{{ 'integration.api-id' | translate }}"
requiredText="{{ 'integration.api-id-required' | translate }}">
</tb-secret-key-input>
<tb-secret-key-input formControlName="apiKey" class="mat-block flex-1" appearance="outline"
label="{{ 'integration.api-key' | translate }}">
required
label="{{ 'integration.api-key' | translate }}"
requiredText="{{ 'integration.api-key-required' | translate }}">
</tb-secret-key-input>
</div>
</fieldset>

1
ui-ngx/src/app/modules/home/components/integration/configuration/opc-ua-integration-form/opc-ua-integration-form.component.html

@ -78,6 +78,7 @@
<tb-secret-file-input formControlName="fileContent"
label="{{ 'integration.opc-ua-keystore-location' | translate }}"
inputId="location"
required
[existingFileName]="opcIntegrationConfigForm.get('keystore.location').value"
(fileNameChanged)="opcIntegrationConfigForm.get('keystore.location').setValue($event)">
</tb-secret-file-input>

17
ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.html

@ -5,11 +5,19 @@
SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
-->
<mat-form-field [formGroup]="selectAssetProfileFormGroup" class="mat-block" [subscriptSizing]="subscriptSizing" [appearance]="appearance">
<mat-label>{{ 'asset-profile.asset-profile' | translate }}</mat-label>
<mat-form-field [formGroup]="selectAssetProfileFormGroup"
[class.tb-inline-field]="inlineField"
[class.flex]="inlineField"
class="mat-block"
[appearance]="inlineField ? 'outline' : appearance"
[subscriptSizing]="inlineField ? 'dynamic' : subscriptSizing">
@if (!inlineField) {
<mat-label>{{ 'asset-profile.asset-profile' | translate }}</mat-label>
}
<input matInput type="text"
#assetProfileInput
formControlName="assetProfile"
[attr.aria-label]="inlineField ? ('asset-profile.asset-profile' | translate) : null"
(focusin)="onFocus()"
[required]="required"
(keydown)="assetProfileEnter($event)"
@ -54,12 +62,13 @@
(closed)="onPanelClosed()"
#assetProfileAutocomplete="matAutocomplete"
[displayWith]="displayAssetProfileFn">
@for (assetProfile of filteredAssetProfiles | async; track assetProfile) {
@let assetProfiles = filteredAssetProfiles | async;
@for (assetProfile of assetProfiles; track assetProfile) {
<mat-option [value]="assetProfile">
<span [innerHTML]="assetProfile.name | highlight:searchText"></span>
</mat-option>
}
@if (!(filteredAssetProfiles | async)?.length) {
@if (assetProfiles && !assetProfiles.length) {
<mat-option [value]="null" class="tb-not-found">
<div class="tb-not-found-content" (click)="$event.stopPropagation()">
@if (!textIsNotEmpty(searchText) || !addNewProfile) {

5
ui-ngx/src/app/modules/home/components/profile/asset-profile-autocomplete.component.ts

@ -93,6 +93,10 @@ export class AssetProfileAutocompleteComponent implements ControlValueAccessor,
@Input()
appearance: MatFormFieldAppearance = 'fill';
@Input()
@coerceBoolean()
inlineField: boolean;
@Output()
assetProfileUpdated = new EventEmitter<AssetProfileId>();
@ -306,6 +310,7 @@ export class AssetProfileAutocompleteComponent implements ControlValueAccessor,
setTimeout(() => {
this.assetProfileInput.nativeElement.blur();
this.assetProfileInput.nativeElement.focus();
this.ignoreClosedPanel = false;
}, 0);
}

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

@ -17,6 +17,7 @@
<input matInput type="text"
#deviceProfileInput
formControlName="deviceProfile"
[attr.aria-label]="inlineField ? ('device-profile.device-profile' | translate) : null"
(focusin)="onFocus()"
[required]="required"
(keydown)="deviceProfileEnter($event)"
@ -58,12 +59,13 @@
(closed)="onPanelClosed()"
#deviceProfileAutocomplete="matAutocomplete"
[displayWith]="displayDeviceProfileFn">
@for (deviceProfile of filteredDeviceProfiles | async; track deviceProfile) {
@let deviceProfiles = filteredDeviceProfiles | async;
@for (deviceProfile of deviceProfiles; track deviceProfile) {
<mat-option [value]="deviceProfile">
<span [innerHTML]="deviceProfile.name | highlight:searchText"></span>
</mat-option>
}
@if (!(filteredDeviceProfiles | async)?.length) {
@if (deviceProfiles && !deviceProfiles.length) {
<mat-option [value]="null" class="tb-not-found">
<div class="tb-not-found-content" (click)="$event.stopPropagation()">
@if (!textIsNotEmpty(searchText) || !addNewProfile) {

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

@ -332,6 +332,7 @@ export class DeviceProfileAutocompleteComponent implements ControlValueAccessor,
setTimeout(() => {
this.deviceProfileInput.nativeElement.blur();
this.deviceProfileInput.nativeElement.focus();
this.ignoreClosedPanel = false;
}, 0);
}

2
ui-ngx/src/app/modules/home/components/role/registration-permissions.component.html

@ -5,7 +5,7 @@
-->
<tb-group-permissions
class="flex-1"
class="flex-1 py-2 gt-sm:py-4"
[registrationPermissions]="registrationPermissions"
[active]="true"
[readonly]="disabled"

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

@ -49,7 +49,25 @@ export class IntegrationWizardDialogComponent extends
@ViewChild('addIntegrationWizardStepper', {static: true}) addIntegrationWizardStepper: MatStepper;
@ViewChild('uplinkDataConverter', {static: true}) uplinkDataConverterComponent: ConverterComponent;
@ViewChild('downlinkDataConverter') downlinkDataConverterComponent: ConverterComponent;
private _downlinkDataConverterComponent: ConverterComponent;
// The downlink step is re-created when the integration type changes, so its form is re-attached here
@ViewChild('downlinkDataConverter')
set downlinkDataConverterComponent(component: ConverterComponent) {
if (component === this._downlinkDataConverterComponent) {
return;
}
this._downlinkDataConverterComponent = component;
if (component) {
this.downlinkConverterForm.setControl('newDownlinkConverter', component.entityForm, {emitEvent: false});
this.downlinkConverterForm.get('newDownlinkConverter').disable({emitEvent: false});
}
}
get downlinkDataConverterComponent(): ConverterComponent {
return this._downlinkDataConverterComponent;
}
selectedIndex = 0;
converterType = ConverterType;
@ -216,8 +234,6 @@ export class IntegrationWizardDialogComponent extends
ngAfterViewInit() {
setTimeout(() => {
this.uplinkConverterForm.setControl('newUplinkConverter', this.uplinkDataConverterComponent.entityForm, {emitEvent: false});
this.downlinkConverterForm.setControl('newDownlinkConverter', this.downlinkDataConverterComponent.entityForm, {emitEvent: false});
this.downlinkConverterForm.get('newDownlinkConverter').disable({emitEvent: false});
}, 0);
}

39
ui-ngx/src/app/modules/home/pages/admin/resource/js-library-table-header.component.html

@ -1,21 +1,28 @@
<!--
SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
-->
<mat-form-field class="mat-block" subscriptSizing="dynamic">
<mat-label translate>javascript.script-type</mat-label>
<mat-select [ngModel]="entitiesTableConfig.componentsData.resourceSubType"
(ngModelChange)="jsResourceSubTypeChanged($event)"
placeholder="{{ 'javascript.javascript-type' | translate }}">
<mat-option value="">
{{ "javascript.all-types" | translate }}
</mat-option>
@for (jsResourceSubType of jsResourceSubTypes; track jsResourceSubType) {
<mat-option [value]="jsResourceSubType">
{{ resourceSubTypesTranslationMap.get(jsResourceSubType) | translate }}
</mat-option>
}
</mat-select>
</mat-form-field>
<tb-filter-button emptyLabel="javascript.script-filter-title"
emptyValue=""
[valueLabel]="jsResourceSubTypeLabel"
[ngModel]="entitiesTableConfig.componentsData.resourceSubType"
(ngModelChange)="jsResourceSubTypeChanged($event)">
<ng-template let-control>
<div class="tb-form-row column-xs">
<div class="fixed-title-width" translate>javascript.script-type</div>
<mat-form-field class="min-w-0 flex-1" appearance="outline" subscriptSizing="dynamic">
<mat-select [formControl]="control" [aria-label]="'javascript.script-type' | translate">
<mat-option value="">{{ 'javascript.all-types' | translate }}</mat-option>
@for (jsResourceSubType of jsResourceSubTypes; track jsResourceSubType) {
<mat-option [value]="jsResourceSubType">
{{ resourceSubTypesTranslationMap.get(jsResourceSubType) | translate }}
</mat-option>
}
</mat-select>
</mat-form-field>
</div>
</ng-template>
</tb-filter-button>

11
ui-ngx/src/app/modules/home/pages/admin/resource/js-library-table-header.component.ts

@ -1,6 +1,8 @@
// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-License-Identifier: Apache-2.0
import { Component } from '@angular/core';
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
import { Component, inject } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { EntityTableHeaderComponent } from '@home/components/entity/entity-table-header.component';
@ -18,6 +20,11 @@ export class JsLibraryTableHeaderComponent extends EntityTableHeaderComponent<Re
readonly jsResourceSubTypes: ResourceSubType[] = [ResourceSubType.EXTENSION, ResourceSubType.MODULE];
readonly resourceSubTypesTranslationMap = ResourceSubTypeTranslationMap;
private translate = inject(TranslateService);
readonly jsResourceSubTypeLabel = (resourceSubType: ResourceSubType): string =>
this.translate.instant(this.resourceSubTypesTranslationMap.get(resourceSubType) ?? resourceSubType);
constructor(protected store: Store<AppState>) {
super(store);
}

39
ui-ngx/src/app/modules/home/pages/admin/resource/resources-table-header.component.html

@ -1,21 +1,28 @@
<!--
SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
-->
<mat-form-field class="mat-block" subscriptSizing="dynamic">
<mat-label translate>resource.resource-type</mat-label>
<mat-select [ngModel]="entitiesTableConfig.componentsData.resourceType"
(ngModelChange)="resourceTypeChanged($event)"
placeholder="{{ 'resource.resource-type' | translate }}">
<mat-option value="">
{{ "resource.all-types" | translate }}
</mat-option>
@for (resourceType of resourceTypes; track resourceType) {
<mat-option [value]="resourceType">
{{ resourceTypesTranslationMap.get(resourceType) | translate }}
</mat-option>
}
</mat-select>
</mat-form-field>
<tb-filter-button emptyLabel="resource.resource-filter-title"
emptyValue=""
[valueLabel]="resourceTypeLabel"
[ngModel]="entitiesTableConfig.componentsData.resourceType"
(ngModelChange)="resourceTypeChanged($event)">
<ng-template let-control>
<div class="tb-form-row column-xs">
<div class="fixed-title-width" translate>resource.resource-type</div>
<mat-form-field class="min-w-0 flex-1" appearance="outline" subscriptSizing="dynamic">
<mat-select [formControl]="control" [aria-label]="'resource.resource-type' | translate">
<mat-option value="">{{ 'resource.all-types' | translate }}</mat-option>
@for (resourceType of resourceTypes; track resourceType) {
<mat-option [value]="resourceType">
{{ resourceTypesTranslationMap.get(resourceType) | translate }}
</mat-option>
}
</mat-select>
</mat-form-field>
</div>
</ng-template>
</tb-filter-button>

11
ui-ngx/src/app/modules/home/pages/admin/resource/resources-table-header.component.ts

@ -1,6 +1,8 @@
// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-License-Identifier: Apache-2.0
import { Component } from '@angular/core';
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
import { Component, inject } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { EntityTableHeaderComponent } from '@home/components/entity/entity-table-header.component';
@ -18,6 +20,11 @@ export class ResourcesTableHeaderComponent extends EntityTableHeaderComponent<Re
readonly resourceTypes = [ResourceType.LWM2M_MODEL, ResourceType.PKCS_12, ResourceType.JKS, ResourceType.GENERAL];
readonly resourceTypesTranslationMap = ResourceTypeTranslationMap;
private translate = inject(TranslateService);
readonly resourceTypeLabel = (resourceType: ResourceType): string =>
this.translate.instant(this.resourceTypesTranslationMap.get(resourceType) ?? resourceType);
constructor(protected store: Store<AppState>) {
super(store);
}

29
ui-ngx/src/app/modules/home/pages/asset/asset-table-header.component.html

@ -5,16 +5,25 @@
SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
-->
<div class="flex flex-row items-center justify-start">
<tb-asset-profile-autocomplete
class="min-w-0 flex-1"
subscriptSizing="dynamic"
[ngModel]="entitiesTableConfig.componentsData.assetProfileId"
(ngModelChange)="assetProfileChanged($event)"
[addNewProfile]="false"
[displayAllOnEmpty]="true"
[editProfileEnabled]="false">
</tb-asset-profile-autocomplete>
<div class="flex min-w-0 flex-row items-center justify-start">
<tb-filter-button emptyLabel="asset.asset-filter-title"
[valueLabel]="assetProfileLabel"
[ngModel]="entitiesTableConfig.componentsData.assetProfileId"
(ngModelChange)="assetProfileChanged($event)">
<ng-template let-control>
<div class="tb-form-row column-xs">
<div class="fixed-title-width" translate>asset-profile.asset-profile</div>
<tb-asset-profile-autocomplete
class="min-w-0 flex-1"
[formControl]="control"
[inlineField]="true"
[displayAllOnEmpty]="true"
[editProfileEnabled]="false"
[addNewProfile]="false">
</tb-asset-profile-autocomplete>
</div>
</ng-template>
</tb-filter-button>
<mat-slide-toggle
style="margin-left: 32px;"
[ngModel]="entitiesTableConfig.componentsData.includeCustomers"

6
ui-ngx/src/app/modules/home/pages/asset/asset-table-header.component.scss

@ -1,6 +0,0 @@
// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
:host ::ng-deep .mat-mdc-slide-toggle .mdc-label {
white-space: normal;
}

11
ui-ngx/src/app/modules/home/pages/asset/asset-table-header.component.ts

@ -1,7 +1,7 @@
// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
import { Component, OnInit } from '@angular/core';
import { Component, inject, OnInit } from '@angular/core';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { EntityTableHeaderComponent } from '../../components/entity/entity-table-header.component';
@ -10,11 +10,12 @@ import { Asset, AssetInfo } from '@shared/models/asset.models';
import { AssetProfileId } from '@shared/models/id/asset-profile-id';
import { getCurrentAuthUser } from '@core/auth/auth.selectors';
import { Authority } from '@shared/models/authority.enum';
import { AssetProfileService } from '@core/http/asset-profile.service';
import { map } from 'rxjs/operators';
@Component({
selector: 'tb-asset-table-header',
templateUrl: './asset-table-header.component.html',
styleUrls: ['asset-table-header.component.scss'],
standalone: false
})
export class AssetTableHeaderComponent extends EntityTableHeaderComponent<AssetInfo | Asset> implements OnInit {
@ -23,6 +24,12 @@ export class AssetTableHeaderComponent extends EntityTableHeaderComponent<AssetI
includeCustomersLabel: string;
private assetProfileService = inject(AssetProfileService);
readonly assetProfileLabel = (assetProfileId: AssetProfileId) =>
this.assetProfileService.getAssetProfileInfo(assetProfileId.id, {ignoreLoading: true, ignoreErrors: true})
.pipe(map(assetProfileInfo => assetProfileInfo.name));
constructor(protected store: Store<AppState>) {
super(store);
}

13
ui-ngx/src/app/modules/home/pages/device/device-table-header.component.html

@ -5,10 +5,15 @@
SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
-->
<div class="flex flex-row items-center justify-start">
<tb-device-info-filter [ngModel]="entitiesTableConfig.componentsData.deviceInfoFilter"
(ngModelChange)="deviceInfoFilterChanged($event)">
</tb-device-info-filter>
<div class="flex min-w-0 flex-row items-center justify-start">
<tb-filter-button emptyLabel="device.device-filter-title"
[valueLabel]="deviceInfoFilterLabel"
[ngModel]="entitiesTableConfig.componentsData.deviceInfoFilter"
(ngModelChange)="deviceInfoFilterChanged($event)">
<ng-template let-control>
<tb-device-info-filter [formControl]="control"></tb-device-info-filter>
</ng-template>
</tb-filter-button>
<mat-slide-toggle
style="margin-left: 32px;"
[ngModel]="entitiesTableConfig.componentsData.includeCustomers"

26
ui-ngx/src/app/modules/home/pages/device/device-table-header.component.ts

@ -1,20 +1,23 @@
// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
import { Component, OnInit } from '@angular/core';
import { Component, inject, OnInit } from '@angular/core';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { EntityTableHeaderComponent } from '../../components/entity/entity-table-header.component';
import { Device, DeviceInfo, DeviceInfoFilter } from '@app/shared/models/device.models';
import { DeviceInfo, DeviceInfoFilter } from '@app/shared/models/device.models';
import { EntityType } from '@shared/models/entity-type.models';
import { DeviceProfileId } from '@shared/models/id/device-profile-id';
import { getCurrentAuthUser } from '@core/auth/auth.selectors';
import { Authority } from '@shared/models/authority.enum';
import { DeviceProfileService } from '@core/http/device-profile.service';
import { TranslateService } from '@ngx-translate/core';
import { isDefinedAndNotNull } from '@core/utils';
import { Observable, of } from 'rxjs';
import { map } from 'rxjs/operators';
@Component({
selector: 'tb-device-table-header',
templateUrl: './device-table-header.component.html',
styleUrls: [],
standalone: false
})
export class DeviceTableHeaderComponent extends EntityTableHeaderComponent<DeviceInfo> implements OnInit {
@ -23,6 +26,19 @@ export class DeviceTableHeaderComponent extends EntityTableHeaderComponent<Devic
includeCustomersLabel: string;
private deviceProfileService = inject(DeviceProfileService);
private translate = inject(TranslateService);
readonly deviceInfoFilterLabel = (deviceInfoFilter: DeviceInfoFilter): Observable<string> => {
const stateText = isDefinedAndNotNull(deviceInfoFilter.active)
? this.translate.instant(deviceInfoFilter.active ? 'device.active' : 'device.inactive') : null;
const profileName$ = isDefinedAndNotNull(deviceInfoFilter.deviceProfileId)
? this.deviceProfileService.getDeviceProfileInfo(deviceInfoFilter.deviceProfileId.id, {ignoreLoading: true, ignoreErrors: true})
.pipe(map(deviceProfileInfo => deviceProfileInfo.name))
: of(null);
return profileName$.pipe(map(profileName => [profileName, stateText].filter(Boolean).join(', ')));
};
constructor(protected store: Store<AppState>) {
super(store);
}
@ -34,7 +50,7 @@ export class DeviceTableHeaderComponent extends EntityTableHeaderComponent<Devic
}
deviceInfoFilterChanged(deviceInfoFilter: DeviceInfoFilter) {
this.entitiesTableConfig.componentsData.deviceInfoFilter = deviceInfoFilter;
this.entitiesTableConfig.componentsData.deviceInfoFilter = deviceInfoFilter ?? {};
this.entitiesTableConfig.getTable().resetSortAndFilter(true);
}

25
ui-ngx/src/app/modules/home/pages/edge/edge-table-header.component.html

@ -5,14 +5,23 @@
SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
-->
<div class="flex flex-row items-center justify-start">
<tb-entity-subtype-select
subscriptSizing="dynamic"
[showLabel]="true"
[entityType]="entityType.EDGE"
[ngModel]="entitiesTableConfig.componentsData.edgeType"
(ngModelChange)="edgeTypeChanged($event)">
</tb-entity-subtype-select>
<div class="flex min-w-0 flex-row items-center justify-start">
<tb-filter-button emptyLabel="edge.edge-filter-title"
emptyValue=""
[ngModel]="entitiesTableConfig.componentsData.edgeType"
(ngModelChange)="edgeTypeChanged($event)">
<ng-template let-control>
<div class="tb-form-row column-xs">
<div class="fixed-title-width" translate>edge.edge-type</div>
<tb-entity-subtype-select
class="min-w-0 flex-1"
[formControl]="control"
[inlineField]="true"
[entityType]="entityType.EDGE">
</tb-entity-subtype-select>
</div>
</ng-template>
</tb-filter-button>
<mat-slide-toggle
style="margin-left: 32px;"
[ngModel]="entitiesTableConfig.componentsData.includeCustomers"

1
ui-ngx/src/app/modules/home/pages/edge/edge-table-header.component.ts

@ -13,7 +13,6 @@ import { Authority } from '@shared/models/authority.enum';
@Component({
selector: 'tb-edge-table-header',
templateUrl: './edge-table-header.component.html',
styleUrls: [],
standalone: false
})
export class EdgeTableHeaderComponent extends EntityTableHeaderComponent<EdgeInfo | Edge> implements OnInit {

26
ui-ngx/src/app/modules/home/pages/entity-view/entity-view-table-header.component.html

@ -5,15 +5,23 @@
SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
-->
<div class="flex flex-row items-center justify-start">
<tb-entity-subtype-select
class="min-w-0 flex-1"
subscriptSizing="dynamic"
[showLabel]="true"
[entityType]="entityType.ENTITY_VIEW"
[ngModel]="entitiesTableConfig.componentsData.entityViewType"
(ngModelChange)="entityViewTypeChanged($event)">
</tb-entity-subtype-select>
<div class="flex min-w-0 flex-row items-center justify-start">
<tb-filter-button emptyLabel="entity-view.entity-view-filter-title"
emptyValue=""
[ngModel]="entitiesTableConfig.componentsData.entityViewType"
(ngModelChange)="entityViewTypeChanged($event)">
<ng-template let-control>
<div class="tb-form-row column-xs">
<div class="fixed-title-width" translate>entity-view.entity-view-type</div>
<tb-entity-subtype-select
class="min-w-0 flex-1"
[formControl]="control"
[inlineField]="true"
[entityType]="entityType.ENTITY_VIEW">
</tb-entity-subtype-select>
</div>
</ng-template>
</tb-filter-button>
<mat-slide-toggle
style="margin-left: 32px;"
[ngModel]="entitiesTableConfig.componentsData.includeCustomers"

6
ui-ngx/src/app/modules/home/pages/entity-view/entity-view-table-header.component.scss

@ -1,6 +0,0 @@
// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
:host ::ng-deep .mat-mdc-slide-toggle .mdc-label {
white-space: normal;
}

1
ui-ngx/src/app/modules/home/pages/entity-view/entity-view-table-header.component.ts

@ -13,7 +13,6 @@ import { Authority } from '@shared/models/authority.enum';
@Component({
selector: 'tb-entity-view-table-header',
templateUrl: './entity-view-table-header.component.html',
styleUrls: ['./entity-view-table-header.component.scss'],
standalone: false
})
export class EntityViewTableHeaderComponent extends EntityTableHeaderComponent<EntityViewInfo | EntityView> implements OnInit {

41
ui-ngx/src/app/shared/components/button/filter-button.component.html

@ -0,0 +1,41 @@
<!--
SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
SPDX-License-Identifier: BUSL-1.1
-->
<button color="primary"
matTooltip="{{ buttonDisplayValue() }}"
matTooltipPosition="above"
mat-stroked-button
[disabled]="disabled()"
(click)="openPanel($event)">
<mat-icon>filter_list</mat-icon>{{ buttonDisplayValue() }}
</button>
<ng-template #filterPanel>
<form class="mat-content mat-padding flex flex-col" cdkTrapFocus cdkTrapFocusAutoCapture (ngSubmit)="update()">
<div class="tb-filter-button-panel-content tb-form-panel no-padding no-border outline-none" tabindex="-1" cdkFocusInitial>
<ng-container *ngTemplateOutlet="panelContent(); context: {$implicit: filterControl}"></ng-container>
</div>
<div class="tb-panel-actions flex flex-row items-center justify-end">
<button type="button"
mat-button
color="primary"
(click)="reset()">
{{ 'action.reset' | translate }}
</button>
<span class="flex-1"></span>
<button type="button"
mat-button
(click)="cancel()">
{{ 'action.cancel' | translate }}
</button>
<button type="submit"
mat-raised-button
color="primary"
[disabled]="filterControl.invalid || !isChanged()">
{{ 'action.update' | translate }}
</button>
</div>
</form>
</ng-template>

204
ui-ngx/src/app/shared/components/button/filter-button.component.ts

@ -0,0 +1,204 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
import {
ChangeDetectionStrategy,
Component,
computed,
contentChild,
DestroyRef,
ElementRef,
forwardRef,
inject,
input,
signal,
TemplateRef,
viewChild,
ViewContainerRef
} from '@angular/core';
import { ControlValueAccessor, FormControl, NG_VALUE_ACCESSOR } from '@angular/forms';
import { Overlay, OverlayConfig, OverlayRef } from '@angular/cdk/overlay';
import { TemplatePortal } from '@angular/cdk/portal';
import { FocusMonitor, InputModalityDetector } from '@angular/cdk/a11y';
import { ESCAPE, hasModifierKey } from '@angular/cdk/keycodes';
import { MatButton } from '@angular/material/button';
import { toObservable, toSignal } from '@angular/core/rxjs-interop';
import { TranslateService } from '@ngx-translate/core';
import { fromEvent, isObservable, Observable, of, Subscription } from 'rxjs';
import { catchError, filter, switchMap } from 'rxjs/operators';
import { POSITION_MAP } from '@shared/models/overlay.models';
import { isDefinedAndNotNull, isEqual, isObject } from '@core/utils';
export type FilterButtonValueLabelFn<T> = (value: T) => string | Observable<string>;
export interface FilterButtonPanelContext<T> {
$implicit: FormControl<T>;
}
/**
* Filter button for entity table headers. Shows the current filter value on the button and
* opens an overlay panel with Reset/Cancel/Update actions. The panel control is supplied
* by the host as an <ng-template let-control> bound to the provided FormControl.
*/
@Component({
selector: 'tb-filter-button',
templateUrl: './filter-button.component.html',
styleUrls: ['../../../../scss/filter-button.scss'],
changeDetection: ChangeDetectionStrategy.OnPush,
providers: [
{
provide: NG_VALUE_ACCESSOR,
useExisting: forwardRef(() => FilterButtonComponent),
multi: true
}
],
standalone: false
})
export class FilterButtonComponent<T = any> implements ControlValueAccessor {
private translate = inject(TranslateService);
private overlay = inject(Overlay);
private elementRef = inject(ElementRef);
private viewContainerRef = inject(ViewContainerRef);
private destroyRef = inject(DestroyRef);
private focusMonitor = inject(FocusMonitor);
private inputModality = inject(InputModalityDetector);
emptyLabel = input.required<string>();
valueLabel = input<FilterButtonValueLabelFn<T>>(value => String(value));
emptyValue = input<T>(null);
panelContent = contentChild.required<TemplateRef<FilterButtonPanelContext<T>>>(TemplateRef);
private panelTemplate = viewChild.required<TemplateRef<any>>('filterPanel');
private filterButton = viewChild.required(MatButton, {read: ElementRef});
disabled = signal(false);
filterControl = new FormControl<T>(null);
private value = signal<T>(null);
private valueText = toSignal(
toObservable(computed(() => ({value: this.value(), labelFn: this.valueLabel()}))).pipe(
switchMap(({value, labelFn}) => {
if (this.isEmpty(value)) {
return of(null);
}
const label = labelFn(value);
return (isObservable(label) ? label : of(label)).pipe(catchError(() => of(null)));
})
),
{initialValue: null}
);
buttonDisplayValue = computed(() => {
if (this.isEmpty(this.value())) {
return this.translate.instant(this.emptyLabel());
}
const filterTitle = this.translate.instant('filter.filter');
const valueText = this.valueText();
return valueText ? `${filterTitle}: ${valueText}` : filterTitle;
});
private overlayRef: OverlayRef;
private resizeWindows: Subscription;
private propagateChange = (_: any) => {};
constructor() {
this.destroyRef.onDestroy(() => this.closePanel(false));
}
registerOnChange(fn: any): void {
this.propagateChange = fn;
}
registerOnTouched(_fn: any): void {
}
setDisabledState(isDisabled: boolean): void {
this.disabled.set(isDisabled);
if (isDisabled) {
this.filterControl.disable({emitEvent: false});
} else {
this.filterControl.enable({emitEvent: false});
}
}
writeValue(value?: T): void {
this.value.set(this.normalize(value));
this.filterControl.setValue(this.value(), {emitEvent: false});
}
openPanel($event: Event) {
$event?.stopPropagation();
const config = new OverlayConfig({
panelClass: 'tb-filter-panel',
backdropClass: 'cdk-overlay-transparent-backdrop',
hasBackdrop: true,
maxHeight: '80vh',
height: 'min-content',
minWidth: ''
});
config.positionStrategy = this.overlay.position()
.flexibleConnectedTo(this.elementRef)
.withPositions([POSITION_MAP.bottomLeft]);
this.overlayRef = this.overlay.create(config);
this.overlayRef.backdropClick().subscribe(() => this.cancel());
this.overlayRef.keydownEvents()
.pipe(filter(event => event.keyCode === ESCAPE && !hasModifierKey(event)))
.subscribe(event => {
event.preventDefault();
this.cancel();
});
this.overlayRef.attach(new TemplatePortal(this.panelTemplate(), this.viewContainerRef));
this.resizeWindows = fromEvent(window, 'resize').subscribe(() => this.overlayRef.updatePosition());
}
cancel() {
this.filterControl.setValue(this.value(), {emitEvent: false});
this.filterControl.markAsPristine();
this.closePanel();
}
update() {
this.value.set(this.normalize(this.filterControl.value));
this.propagateChange(this.value());
this.filterControl.markAsPristine();
this.closePanel();
}
reset() {
if (!this.isEmpty(this.filterControl.value)) {
this.filterControl.setValue(this.emptyValue(), {emitEvent: false});
this.filterControl.markAsDirty();
}
}
isChanged(): boolean {
return this.filterControl.dirty && !isEqual(this.normalize(this.filterControl.value), this.value());
}
private closePanel(restoreFocus = true) {
this.resizeWindows?.unsubscribe();
this.resizeWindows = null;
if (this.overlayRef) {
this.overlayRef.dispose();
this.overlayRef = null;
if (restoreFocus) {
this.focusMonitor.focusVia(this.filterButton(), this.inputModality.mostRecentModality ?? 'program');
}
}
}
private normalize(value: T): T {
return this.isEmpty(value) ? this.emptyValue() : value;
}
private isEmpty(value: T): boolean {
if (!isDefinedAndNotNull(value) || value === '') {
return true;
}
return isObject(value) && Object.values(value).every(v => !isDefinedAndNotNull(v) || v === '');
}
}

13
ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.html

@ -1,14 +1,21 @@
<!--
SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
SPDX-License-Identifier: Apache-2.0
SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
-->
<mat-form-field [formGroup]="subTypeFormGroup" class="mat-block" subscriptSizing="{{ subscriptSizing }}">
<mat-form-field [formGroup]="subTypeFormGroup"
[class.tb-inline-field]="inlineField"
[class.flex]="inlineField"
class="mat-block"
[appearance]="inlineField ? 'outline' : 'fill'"
[subscriptSizing]="inlineField ? 'dynamic' : subscriptSizing">
@if (showLabel) {
<mat-label>{{ entitySubtypeTitle | translate }}</mat-label>
}
<mat-select [class.!hidden]="!subTypesLoaded" class="tb-entity-subtype-select" formControlName="subType">
<mat-select [class.!hidden]="!subTypesLoaded" class="tb-entity-subtype-select" formControlName="subType"
[aria-label]="showLabel ? '' : (entitySubtypeTitle | translate)">
@for (subType of subTypesOptions | async; track subType) {
<mat-option [value]="subType">
{{ displaySubTypeFn(subType) }}

9
ui-ngx/src/app/shared/components/entity/entity-subtype-select.component.ts

@ -12,6 +12,7 @@ import { EntityType } from '@app/shared/models/entity-type.models';
import { BroadcastService } from '@app/core/services/broadcast.service';
import { SubscriptSizing } from '@angular/material/form-field';
import { isNotEmptyStr } from '@core/utils';
import { coerceBoolean } from '@shared/decorators/coercion';
import { EntityService } from '@core/http/entity.service';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
@ -50,6 +51,10 @@ export class EntitySubTypeSelectComponent implements ControlValueAccessor, OnIni
@Input()
typeTranslatePrefix: string;
@Input()
@coerceBoolean()
inlineField: boolean;
entitySubtypeTitle: string;
entitySubtypeRequiredText: string;
@ -152,9 +157,9 @@ export class EntitySubTypeSelectComponent implements ControlValueAccessor, OnIni
setDisabledState(isDisabled: boolean): void {
this.disabled = isDisabled;
if (this.disabled) {
this.subTypeFormGroup.disable();
this.subTypeFormGroup.disable({emitEvent: false});
} else {
this.subTypeFormGroup.enable();
this.subTypeFormGroup.enable({emitEvent: false});
}
}

2
ui-ngx/src/app/shared/components/role/group-permissions.component.html

@ -4,7 +4,7 @@
SPDX-License-Identifier: BUSL-1.1
-->
<div class="mat-padding tb-entity-table" [class.tb-absolute-fill]="groupPermissionsMode === 'group'">
<div class="tb-entity-table" [class.mat-padding]="groupPermissionsMode === 'group'" [class.tb-absolute-fill]="groupPermissionsMode === 'group'">
<div class="tb-entity-table-content tb-outlined-border flex flex-col">
<mat-toolbar class="mat-mdc-table-toolbar" [class.!hidden]="textSearchMode || !dataSource.selection.isEmpty()">
<div class="mat-toolbar-tools">

7
ui-ngx/src/app/shared/components/time/timezone-select.component.ts

@ -1,5 +1,6 @@
// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
import { AfterViewInit, Component, forwardRef, Input, NgZone, OnInit, ViewChild } from '@angular/core';
import { ControlValueAccessor, NG_VALUE_ACCESSOR, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { MatFormFieldAppearance, SubscriptSizing } from '@angular/material/form-field';
@ -10,8 +11,7 @@ import { AppState } from '@app/core/core.state';
import { TranslateService } from '@ngx-translate/core';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { MatAutocompleteTrigger } from '@angular/material/autocomplete';
import { getDefaultTimezoneInfo, getTimezoneInfo, getTimezones, TimezoneInfo } from '@shared/models/time/time.models';
import { deepClone } from '@core/utils';
import { getTimezoneInfo, getTimezones, TimezoneInfo } from '@shared/models/time/time.models';
import { coerceBoolean } from '@shared/decorators/coercion';
import { TimeService } from '@core/services/time.service';
@ -222,6 +222,7 @@ export class TimezoneSelectComponent implements ControlValueAccessor, OnInit, Af
this.selectTimezoneFormGroup.get('timezone').patchValue('', {emitEvent: true});
setTimeout(() => {
this.timezoneInputTrigger.openPanel();
this.ignoreClosePanel = false;
}, 0);
}

6
ui-ngx/src/app/shared/shared.module.ts

@ -67,6 +67,7 @@ import { TbAnchorComponent } from '@shared/components/tb-anchor.component';
import { MillisecondsToTimeStringPipe } from '@shared/pipe/milliseconds-to-time-string.pipe';
import { TimewindowComponent } from '@shared/components/time/timewindow.component';
import { OverlayModule } from '@angular/cdk/overlay';
import { A11yModule } from '@angular/cdk/a11y';
import { TimewindowPanelComponent } from '@shared/components/time/timewindow-panel.component';
import { TimeintervalComponent } from '@shared/components/time/timeinterval.component';
import { DatetimePeriodComponent } from '@shared/components/time/datetime-period.component';
@ -160,6 +161,7 @@ import { EdgeEntityGroupListComponent } from '@shared/components/group/edge-enti
import { OtaPackageAutocompleteComponent } from '@shared/components/ota-package/ota-package-autocomplete.component';
import { MAT_DATE_LOCALE } from '@angular/material/core';
import { CopyButtonComponent } from '@shared/components/button/copy-button.component';
import { FilterButtonComponent } from '@shared/components/button/filter-button.component';
import { TogglePasswordComponent } from '@shared/components/button/toggle-password.component';
import { WidgetButtonToggleComponent } from '@shared/components/button/widget-button-toggle.component';
import { HelpPopupComponent } from '@shared/components/help-popup.component';
@ -491,6 +493,7 @@ export function MarkedOptionsFactory(markedOptionsService: MarkedOptionsService)
ShareEntityGroupComponent,
OtaPackageAutocompleteComponent,
CopyButtonComponent,
FilterButtonComponent,
TogglePasswordComponent,
WidgetButtonToggleComponent,
ProtobufContentComponent,
@ -594,6 +597,7 @@ export function MarkedOptionsFactory(markedOptionsService: MarkedOptionsService)
FormsModule,
ReactiveFormsModule,
OverlayModule,
A11yModule,
ShareButtonDirective,
HotkeyModule,
ColorPickerModule,
@ -729,6 +733,7 @@ export function MarkedOptionsFactory(markedOptionsService: MarkedOptionsService)
FormsModule,
ReactiveFormsModule,
OverlayModule,
A11yModule,
HotkeyModule,
ColorPickerModule,
NgxHmCarouselComponent,
@ -805,6 +810,7 @@ export function MarkedOptionsFactory(markedOptionsService: MarkedOptionsService)
ShareEntityGroupComponent,
OtaPackageAutocompleteComponent,
CopyButtonComponent,
FilterButtonComponent,
TogglePasswordComponent,
WidgetButtonToggleComponent,
ProtobufContentComponent,

3
ui-ngx/src/assets/locale/locale.constant-ar_AE.json

@ -2863,7 +2863,6 @@
"is-gateway": "Gateway",
"overwrite-activity-time": "استبدال وقت النشاط للجهاز المتصل",
"device-filter-title": "فلتر الجهاز",
"filter-title": "الفلتر",
"device-state": "حالة الجهاز",
"state": "الحالة",
"any": "أي",
@ -5781,7 +5780,7 @@
"opc-ua-type": "النوع",
"opc-ua-keystore-type": "النوع",
"opc-ua-keystore-type-required": "النوع مطلوب",
"opc-ua-keystore-location": "الموقع *",
"opc-ua-keystore-location": "الموقع",
"opc-ua-keystore-password": "كلمة المرور",
"opc-ua-keystore-password-required": "كلمة المرور مطلوبة",
"opc-ua-keystore-alias": "الاسم المستعار",

2
ui-ngx/src/assets/locale/locale.constant-ca_ES.json

@ -5776,7 +5776,7 @@
"opc-ua-type": "Tipus",
"opc-ua-keystore-type": "Tipus",
"opc-ua-keystore-type-required": "El tipus és obligatori",
"opc-ua-keystore-location": "Ubicació *",
"opc-ua-keystore-location": "Ubicació",
"opc-ua-keystore-password": "Contrasenya",
"opc-ua-keystore-password-required": "La contrasenya és obligatòria",
"opc-ua-keystore-alias": "Àlies",

4
ui-ngx/src/assets/locale/locale.constant-da_DK.json

@ -2837,7 +2837,6 @@
"is-gateway": "Er gateway",
"overwrite-activity-time": "Overskriv aktivitetstid for tilsluttet enhed",
"device-filter-title": "Enhedsfilter",
"filter-title": "Filter",
"device-state": "Enhedstilstand",
"state": "Tilstand",
"any": "Enhver",
@ -5745,7 +5744,7 @@
"opc-ua-type": "Type",
"opc-ua-keystore-type": "Type",
"opc-ua-keystore-type-required": "Type er påkrævet",
"opc-ua-keystore-location": "Placering *",
"opc-ua-keystore-location": "Placering",
"opc-ua-keystore-password": "Adgangskode",
"opc-ua-keystore-password-required": "Adgangskode er påkrævet",
"opc-ua-keystore-alias": "Alias",
@ -7543,7 +7542,6 @@
"drop-file": "Slip en JavaScript-fil eller klik for at vælge en fil, der skal uploades.",
"drop-resource-file-or": "Træk og slip en JavaScript-fil eller",
"javascript-library": "JavaScript-bibliotek",
"javascript-type": "JavaScript-type",
"scripts": "Scripts",
"script-type": "Scripttype",
"javascript-resource-details": "JavaScript-ressourcedetaljer",

4
ui-ngx/src/assets/locale/locale.constant-de_DE.json

@ -2835,7 +2835,6 @@
"is-gateway": "Ist Gateway",
"overwrite-activity-time": "Aktivitätszeit für verbundenes Gerät überschreiben",
"device-filter-title": "Gerätefilter",
"filter-title": "Filter",
"device-state": "Gerätestatus",
"state": "Status",
"any": "Beliebig",
@ -5743,7 +5742,7 @@
"opc-ua-type": "Typ",
"opc-ua-keystore-type": "Typ",
"opc-ua-keystore-type-required": "Typ ist erforderlich",
"opc-ua-keystore-location": "Speicherort *",
"opc-ua-keystore-location": "Speicherort",
"opc-ua-keystore-password": "Passwort",
"opc-ua-keystore-password-required": "Passwort ist erforderlich",
"opc-ua-keystore-alias": "Alias",
@ -7541,7 +7540,6 @@
"drop-file": "Legen Sie eine JavaScript-Datei ab oder klicken Sie, um eine Datei auszuwählen.",
"drop-resource-file-or": "JavaScript-Datei hierher ziehen oder",
"javascript-library": "JavaScript-Bibliothek",
"javascript-type": "JavaScript-Typ",
"scripts": "Skripte",
"script-type": "Skripttyp",
"javascript-resource-details": "Details der JavaScript-Ressource",

4
ui-ngx/src/assets/locale/locale.constant-el_GR.json

@ -2837,7 +2837,6 @@
"is-gateway": "Είναι Gateway",
"overwrite-activity-time": "Αντικατάσταση χρόνου δραστηριότητας για συνδεδεμένη συσκευή",
"device-filter-title": "Φίλτρο συσκευής",
"filter-title": "Φίλτρο",
"device-state": "Κατάσταση συσκευής",
"state": "Κατάσταση",
"any": "Οποιαδήποτε",
@ -5754,7 +5753,7 @@
"opc-ua-type": "Τύπος",
"opc-ua-keystore-type": "Τύπος",
"opc-ua-keystore-type-required": "Απαιτείται τύπος",
"opc-ua-keystore-location": "Τοποθεσία *",
"opc-ua-keystore-location": "Τοποθεσία",
"opc-ua-keystore-password": "Κωδικός πρόσβασης",
"opc-ua-keystore-password-required": "Απαιτείται κωδικός πρόσβασης",
"opc-ua-keystore-alias": "Ψευδώνυμο",
@ -7555,7 +7554,6 @@
"drop-file": "Σύρετε ένα αρχείο JavaScript ή κάντε κλικ για να επιλέξετε ένα αρχείο για μεταφόρτωση.",
"drop-resource-file-or": "Σύρετε ένα αρχείο JavaScript ή",
"javascript-library": "Βιβλιοθήκη JavaScript",
"javascript-type": "Τύπος JavaScript",
"scripts": "Σενάρια",
"script-type": "Τύπος σεναρίου",
"javascript-resource-details": "Λεπτομέρειες πόρου JavaScript",

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

@ -994,6 +994,7 @@
"delete": "Delete asset",
"asset-public": "Asset is public",
"asset-type": "Asset type",
"asset-filter-title": "Asset filter",
"asset-type-required": "Asset type is required.",
"select-asset-type": "Select asset type",
"enter-asset-type": "Enter asset profile",
@ -2863,7 +2864,6 @@
"is-gateway": "Is gateway",
"overwrite-activity-time": "Overwrite activity time for connected device",
"device-filter-title": "Device filter",
"filter-title": "Filter",
"device-state": "Device state",
"state": "State",
"any": "Any",
@ -3534,6 +3534,7 @@
"sync": "Sync Edge",
"edge-required": "Edge required",
"edge-type": "Edge type",
"edge-filter-title": "Edge filter",
"edge-type-required": "Edge type is required.",
"event-action": "Event action",
"entity-id": "Entity ID",
@ -4872,6 +4873,7 @@
"unassign-entity-views-title": "Are you sure you want to unassign { count, plural, =1 {1 entity view} other {# entity views} }?",
"unassign-entity-views-text": "After the confirmation all selected entity views will be unassigned and won't be accessible by the customer.",
"entity-view-type": "Entity view type",
"entity-view-filter-title": "Entity view filter",
"entity-view-type-required": "Entity view type is required.",
"select-entity-view-type": "Select entity view type",
"enter-entity-view-type": "Enter entity view type",
@ -5624,6 +5626,7 @@
"kpn-no-security-warning": "Requests to this endpoint are not authenticated. Add the security header generated in KPN Things.",
"customer-id": "Customer id",
"api-id": "API ID",
"api-id-required": "API ID is required.",
"azure-ca-cert": "CA certificate file",
"ca-cert": "CA certificate file",
"private-key": "Private key file",
@ -5782,7 +5785,7 @@
"opc-ua-type": "Type",
"opc-ua-keystore-type": "Type",
"opc-ua-keystore-type-required": "Type is required",
"opc-ua-keystore-location": "Location *",
"opc-ua-keystore-location": "Location",
"opc-ua-keystore-password": "Password",
"opc-ua-keystore-password-required": "Password is required",
"opc-ua-keystore-alias": "Alias",
@ -7592,6 +7595,7 @@
"resource-files": "Resource files",
"resource-library-details": "Resource details",
"resource-type": "Resource type",
"resource-filter-title": "Resource filter",
"resources-library": "Resources library",
"files": "Files",
"search": "Search resources",
@ -7635,9 +7639,9 @@
"drop-file": "Drop a JavaScript file or click to select a file to upload.",
"drop-resource-file-or": "Drag and drop a JavaScript file or",
"javascript-library": "JavaScript library",
"javascript-type": "JavaScript type",
"scripts": "Scripts",
"script-type": "Script type",
"script-filter-title": "Script filter",
"javascript-resource-details": "JavaScript resource details",
"javascript-resource-is-in-use": "JavaScript resource is used by other entities",
"javascript-resources-are-in-use": "JavaScript resources are used by other entities",

4
ui-ngx/src/assets/locale/locale.constant-es_ES.json

@ -2835,7 +2835,6 @@
"is-gateway": "Es un Gateway",
"overwrite-activity-time": "Sobrescribir tiempo de actividad del dispositivo conectado",
"device-filter-title": "Filtro de dispositivo",
"filter-title": "Filtro",
"device-state": "Estado del dispositivo",
"state": "Estado",
"any": "Cualquiera",
@ -5743,7 +5742,7 @@
"opc-ua-type": "Tipo",
"opc-ua-keystore-type": "Tipo",
"opc-ua-keystore-type-required": "Se requiere el tipo",
"opc-ua-keystore-location": "Ubicación *",
"opc-ua-keystore-location": "Ubicación",
"opc-ua-keystore-password": "Contraseña",
"opc-ua-keystore-password-required": "Se requiere la contraseña",
"opc-ua-keystore-alias": "Alias",
@ -7541,7 +7540,6 @@
"drop-file": "Suelta un archivo JavaScript o haz clic para seleccionar uno para subir.",
"drop-resource-file-or": "Arrastra y suelta un archivo JavaScript o",
"javascript-library": "Biblioteca JavaScript",
"javascript-type": "Tipo de JavaScript",
"scripts": "Scripts",
"script-type": "Tipo de script",
"javascript-resource-details": "Detalles del recurso JavaScript",

4
ui-ngx/src/assets/locale/locale.constant-fr_FR.json

@ -2835,7 +2835,6 @@
"is-gateway": "Est une Gateway",
"overwrite-activity-time": "Écraser l’heure d’activité de l’appareil connecté",
"device-filter-title": "Filtre d’appareil",
"filter-title": "Filtre",
"device-state": "État de l’appareil",
"state": "État",
"any": "N’importe quel",
@ -5743,7 +5742,7 @@
"opc-ua-type": "Type",
"opc-ua-keystore-type": "Type",
"opc-ua-keystore-type-required": "Le type est requis",
"opc-ua-keystore-location": "Emplacement *",
"opc-ua-keystore-location": "Emplacement",
"opc-ua-keystore-password": "Mot de passe",
"opc-ua-keystore-password-required": "Le mot de passe est requis",
"opc-ua-keystore-alias": "Alias",
@ -7541,7 +7540,6 @@
"drop-file": "Déposez un fichier JavaScript ou cliquez pour en sélectionner un à téléverser.",
"drop-resource-file-or": "Glissez-déposez un fichier JavaScript ou",
"javascript-library": "Bibliothèque JavaScript",
"javascript-type": "Type JavaScript",
"scripts": "Scripts",
"script-type": "Type de script",
"javascript-resource-details": "Détails de la ressource JavaScript",

4
ui-ngx/src/assets/locale/locale.constant-hi_IN.json

@ -2863,7 +2863,6 @@
"is-gateway": "Gateway है",
"overwrite-activity-time": "कनेक्टेड डिवाइस के गतिविधि समय को ओवरराइट करें",
"device-filter-title": "डिवाइस फ़िल्टर",
"filter-title": "फ़िल्टर",
"device-state": "डिवाइस स्थिति",
"state": "स्थिति",
"any": "कोई भी",
@ -5780,7 +5779,7 @@
"opc-ua-type": "प्रकार",
"opc-ua-keystore-type": "प्रकार",
"opc-ua-keystore-type-required": "प्रकार आवश्यक है",
"opc-ua-keystore-location": "स्थान *",
"opc-ua-keystore-location": "स्थान",
"opc-ua-keystore-password": "पासवर्ड",
"opc-ua-keystore-password-required": "पासवर्ड आवश्यक है",
"opc-ua-keystore-alias": "उपनाम",
@ -7581,7 +7580,6 @@
"drop-file": "JavaScript फ़ाइल ड्रॉप करें या अपलोड करने के लिए क्लिक करके फ़ाइल चुनें।",
"drop-resource-file-or": "JavaScript फ़ाइल को ड्रैग और ड्रॉप करें या",
"javascript-library": "JavaScript लाइब्रेरी",
"javascript-type": "JavaScript प्रकार",
"scripts": "स्क्रिप्ट",
"script-type": "स्क्रिप्ट प्रकार",
"javascript-resource-details": "JavaScript संसाधन विवरण",

4
ui-ngx/src/assets/locale/locale.constant-it_IT.json

@ -2835,7 +2835,6 @@
"is-gateway": "È un gateway",
"overwrite-activity-time": "Sovrascrivi tempo di attività per il dispositivo connesso",
"device-filter-title": "Filtro dispositivo",
"filter-title": "Filtro",
"device-state": "Stato dispositivo",
"state": "Stato",
"any": "Qualsiasi",
@ -5743,7 +5742,7 @@
"opc-ua-type": "Tipo",
"opc-ua-keystore-type": "Tipo",
"opc-ua-keystore-type-required": "Il tipo è obbligatorio",
"opc-ua-keystore-location": "Posizione *",
"opc-ua-keystore-location": "Posizione",
"opc-ua-keystore-password": "Password",
"opc-ua-keystore-password-required": "La password è obbligatoria",
"opc-ua-keystore-alias": "Alias",
@ -7541,7 +7540,6 @@
"drop-file": "Trascina un file JavaScript o clicca per selezionarlo da caricare.",
"drop-resource-file-or": "Trascina un file JavaScript o",
"javascript-library": "Libreria JavaScript",
"javascript-type": "Tipo JavaScript",
"scripts": "Script",
"script-type": "Tipo di script",
"javascript-resource-details": "Dettagli risorsa JavaScript",

4
ui-ngx/src/assets/locale/locale.constant-ja_JP.json

@ -2835,7 +2835,6 @@
"is-gateway": "Gateway",
"overwrite-activity-time": "接続されたデバイスのアクティビティ時刻を上書き",
"device-filter-title": "デバイスフィルター",
"filter-title": "フィルター",
"device-state": "デバイス状態",
"state": "状態",
"any": "任意",
@ -5743,7 +5742,7 @@
"opc-ua-type": "タイプ",
"opc-ua-keystore-type": "タイプ",
"opc-ua-keystore-type-required": "タイプは必須です。",
"opc-ua-keystore-location": "場所 *",
"opc-ua-keystore-location": "場所",
"opc-ua-keystore-password": "パスワード",
"opc-ua-keystore-password-required": "パスワードは必須です。",
"opc-ua-keystore-alias": "エイリアス",
@ -7541,7 +7540,6 @@
"drop-file": "JavaScriptファイルをドラッグ&ドロップするか、クリックして選択してください。",
"drop-resource-file-or": "JavaScriptファイルをドラッグ&ドロップするか",
"javascript-library": "JavaScriptライブラリ",
"javascript-type": "JavaScriptタイプ",
"scripts": "スクリプト",
"script-type": "スクリプトタイプ",
"javascript-resource-details": "JavaScriptリソースの詳細",

2
ui-ngx/src/assets/locale/locale.constant-ka_GE.json

@ -1743,7 +1743,7 @@
"opc-ua-type": "ტიპი",
"opc-ua-keystore-type": "ტიპი",
"opc-ua-keystore-type-required": "ტიპი სავალდებულოა",
"opc-ua-keystore-location": "ლოკაცია *",
"opc-ua-keystore-location": "ლოკაცია",
"opc-ua-keystore-password": "პაროლი",
"opc-ua-keystore-password-required": "პაროლი სავალდებულოა",
"opc-ua-keystore-alias": "ზედმესახელი",

4
ui-ngx/src/assets/locale/locale.constant-ko_KR.json

@ -2855,7 +2855,6 @@
"is-gateway": "Gateway 여부",
"overwrite-activity-time": "연결된 장치의 활동 시간 덮어쓰기",
"device-filter-title": "장치 필터",
"filter-title": "필터",
"device-state": "장치 상태",
"state": "상태",
"any": "전체",
@ -5772,7 +5771,7 @@
"opc-ua-type": "유형",
"opc-ua-keystore-type": "유형",
"opc-ua-keystore-type-required": "유형은 필수 항목입니다.",
"opc-ua-keystore-location": "위치 *",
"opc-ua-keystore-location": "위치",
"opc-ua-keystore-password": "비밀번호",
"opc-ua-keystore-password-required": "비밀번호는 필수 항목입니다.",
"opc-ua-keystore-alias": "별명",
@ -7655,7 +7654,6 @@
"drop-file": "JavaScript 파일을 끌어다 놓거나 클릭하여 업로드할 파일을 선택하세요.",
"drop-resource-file-or": "JavaScript 파일을 끌어다 놓거나",
"javascript-library": "JavaScript 라이브러리",
"javascript-type": "JavaScript 유형",
"scripts": "스크립트",
"script-type": "스크립트 유형",
"javascript-resource-details": "JavaScript 리소스 세부 정보",

4
ui-ngx/src/assets/locale/locale.constant-lt_LT.json

@ -2863,7 +2863,6 @@
"is-gateway": "Gateway",
"overwrite-activity-time": "Perrašyti aktyvumo laiką prijungtam įrenginiui",
"device-filter-title": "Įrenginių filtras",
"filter-title": "Filtras",
"device-state": "Įrenginio būsena",
"state": "Būsena",
"any": "Visos",
@ -5780,7 +5779,7 @@
"opc-ua-type": "Tipas",
"opc-ua-keystore-type": "Tipas",
"opc-ua-keystore-type-required": "Tipas yra privalomas",
"opc-ua-keystore-location": "Vieta *",
"opc-ua-keystore-location": "Vieta",
"opc-ua-keystore-password": "Slaptažodis",
"opc-ua-keystore-password-required": "Slaptažodis yra privalomas",
"opc-ua-keystore-alias": "Pseudonimas",
@ -7581,7 +7580,6 @@
"drop-file": "Nuvilkite JavaScript failą arba spustelėkite, kad pasirinktumėte failą, kurį norite įkelti.",
"drop-resource-file-or": "Nuvilkite JavaScript failą arba",
"javascript-library": "JavaScript biblioteka",
"javascript-type": "JavaScript tipas",
"scripts": "Skriptai",
"script-type": "Skripto tipas",
"javascript-resource-details": "JavaScript ištekliaus informacija",

2
ui-ngx/src/assets/locale/locale.constant-lv_LV.json

@ -1648,7 +1648,7 @@
"opc-ua-type": "Tips",
"opc-ua-keystore-type": "Tips",
"opc-ua-keystore-type-required": "Tips ir nepieciešams",
"opc-ua-keystore-location": "Vieta *",
"opc-ua-keystore-location": "Vieta",
"opc-ua-keystore-password": "Parole",
"opc-ua-keystore-password-required": "Parole ir nepieciešama",
"opc-ua-keystore-alias": "Segvārds",

4
ui-ngx/src/assets/locale/locale.constant-nl_BE.json

@ -2863,7 +2863,6 @@
"is-gateway": "Is gateway",
"overwrite-activity-time": "Activiteitstijd voor verbonden apparaat overschrijven",
"device-filter-title": "Apparaatfilter",
"filter-title": "Filter",
"device-state": "Apparaatstatus",
"state": "Status",
"any": "Alles",
@ -5780,7 +5779,7 @@
"opc-ua-type": "Type",
"opc-ua-keystore-type": "Type",
"opc-ua-keystore-type-required": "Type is verplicht",
"opc-ua-keystore-location": "Locatie *",
"opc-ua-keystore-location": "Locatie",
"opc-ua-keystore-password": "Wachtwoord",
"opc-ua-keystore-password-required": "Wachtwoord is verplicht",
"opc-ua-keystore-alias": "Alias",
@ -7587,7 +7586,6 @@
"drop-file": "Sleep een JavaScript-bestand hierheen of klik om een bestand te selecteren om te uploaden.",
"drop-resource-file-or": "Sleep een JavaScript-bestand hierheen of",
"javascript-library": "JavaScript-bibliotheek",
"javascript-type": "JavaScript-type",
"scripts": "Scripts",
"script-type": "Scripttype",
"javascript-resource-details": "Details van JavaScript-resource",

4
ui-ngx/src/assets/locale/locale.constant-nl_NL.json

@ -2835,7 +2835,6 @@
"is-gateway": "Is gateway",
"overwrite-activity-time": "Activiteitstijd voor verbonden apparaat overschrijven",
"device-filter-title": "Apparaatfilter",
"filter-title": "Filter",
"device-state": "Apparaatstatus",
"state": "Status",
"any": "Alles",
@ -5743,7 +5742,7 @@
"opc-ua-type": "Type",
"opc-ua-keystore-type": "Type",
"opc-ua-keystore-type-required": "Type is verplicht",
"opc-ua-keystore-location": "Locatie *",
"opc-ua-keystore-location": "Locatie",
"opc-ua-keystore-password": "Wachtwoord",
"opc-ua-keystore-password-required": "Wachtwoord is verplicht",
"opc-ua-keystore-alias": "Alias",
@ -7541,7 +7540,6 @@
"drop-file": "Sleep een JavaScript-bestand of klik om een bestand te selecteren om te uploaden.",
"drop-resource-file-or": "Sleep een JavaScript-bestand of",
"javascript-library": "JavaScript-bibliotheek",
"javascript-type": "JavaScript-type",
"scripts": "Scripts",
"script-type": "Scripttype",
"javascript-resource-details": "Details van JavaScript-bron",

4
ui-ngx/src/assets/locale/locale.constant-no_NO.json

@ -2837,7 +2837,6 @@
"is-gateway": "Er gateway",
"overwrite-activity-time": "Overstyr aktivitetstid for tilkoblet enhet",
"device-filter-title": "Enhetsfilter",
"filter-title": "Filter",
"device-state": "Enhetstilstand",
"state": "Tilstand",
"any": "Alle",
@ -5754,7 +5753,7 @@
"opc-ua-type": "Type",
"opc-ua-keystore-type": "Type",
"opc-ua-keystore-type-required": "Type er påkrevd",
"opc-ua-keystore-location": "Plassering *",
"opc-ua-keystore-location": "Plassering",
"opc-ua-keystore-password": "Passord",
"opc-ua-keystore-password-required": "Passord er påkrevd",
"opc-ua-keystore-alias": "Alias",
@ -7555,7 +7554,6 @@
"drop-file": "Slipp en JavaScript-fil eller klikk for å velge en fil for opplasting.",
"drop-resource-file-or": "Dra og slipp en JavaScript-fil eller",
"javascript-library": "JavaScript-bibliotek",
"javascript-type": "JavaScript-type",
"scripts": "Skript",
"script-type": "Skripttype",
"javascript-resource-details": "JavaScript-ressursdetaljer",

4
ui-ngx/src/assets/locale/locale.constant-pl_PL.json

@ -2863,7 +2863,6 @@
"is-gateway": "Gateway",
"overwrite-activity-time": "Zastąp czas aktywności podłączonego urządzenia",
"device-filter-title": "Filtr urządzeń",
"filter-title": "Filtr",
"device-state": "Stan urządzenia",
"state": "Stan",
"any": "Dowolny",
@ -5780,7 +5779,7 @@
"opc-ua-type": "Typ",
"opc-ua-keystore-type": "Typ",
"opc-ua-keystore-type-required": "Typ jest wymagany",
"opc-ua-keystore-location": "Lokalizacja *",
"opc-ua-keystore-location": "Lokalizacja",
"opc-ua-keystore-password": "Hasło",
"opc-ua-keystore-password-required": "Hasło jest wymagane",
"opc-ua-keystore-alias": "Alias",
@ -7581,7 +7580,6 @@
"drop-file": "Upuść plik JavaScript lub kliknij, aby wybrać plik do przesłania.",
"drop-resource-file-or": "Przeciągnij i upuść plik JavaScript lub",
"javascript-library": "Biblioteka JavaScript",
"javascript-type": "Typ JavaScript",
"scripts": "Skrypty",
"script-type": "Typ skryptu",
"javascript-resource-details": "Szczegóły skryptu JavaScript",

4
ui-ngx/src/assets/locale/locale.constant-pt_BR.json

@ -2835,7 +2835,6 @@
"is-gateway": "É gateway",
"overwrite-activity-time": "Sobrescrever tempo de atividade do dispositivo conectado",
"device-filter-title": "Filtro de dispositivo",
"filter-title": "Filtro",
"device-state": "Estado do dispositivo",
"state": "Estado",
"any": "Qualquer",
@ -5743,7 +5742,7 @@
"opc-ua-type": "Tipo",
"opc-ua-keystore-type": "Tipo",
"opc-ua-keystore-type-required": "O tipo é obrigatório",
"opc-ua-keystore-location": "Localização *",
"opc-ua-keystore-location": "Localização",
"opc-ua-keystore-password": "Senha",
"opc-ua-keystore-password-required": "A senha é obrigatória",
"opc-ua-keystore-alias": "Alias",
@ -7541,7 +7540,6 @@
"drop-file": "Solte um arquivo JavaScript ou clique para selecionar um arquivo para enviar.",
"drop-resource-file-or": "Arraste e solte um arquivo JavaScript ou",
"javascript-library": "Biblioteca JavaScript",
"javascript-type": "Tipo JavaScript",
"scripts": "Scripts",
"script-type": "Tipo de script",
"javascript-resource-details": "Detalhes do recurso JavaScript",

4
ui-ngx/src/assets/locale/locale.constant-sl_SI.json

@ -2853,7 +2853,6 @@
"is-gateway": "Je Gateway",
"overwrite-activity-time": "Prepiši čas aktivnosti za povezano napravo",
"device-filter-title": "Filter naprav",
"filter-title": "Filter",
"device-state": "Stanje naprave",
"state": "Stanje",
"any": "Vse",
@ -5770,7 +5769,7 @@
"opc-ua-type": "Vrsta",
"opc-ua-keystore-type": "Vrsta",
"opc-ua-keystore-type-required": "Vrsta je obvezna",
"opc-ua-keystore-location": "Lokacija *",
"opc-ua-keystore-location": "Lokacija",
"opc-ua-keystore-password": "Geslo",
"opc-ua-keystore-password-required": "Geslo je obvezno",
"opc-ua-keystore-alias": "Vzdevek",
@ -7653,7 +7652,6 @@
"drop-file": "Spustite datoteko JavaScript ali kliknite in izberite datoteko za nalaganje.",
"drop-resource-file-or": "Povlecite in spustite datoteko JavaScript ali",
"javascript-library": "Knjižnica JavaScript",
"javascript-type": "Vrsta skripta JavaScript",
"scripts": "Skripti",
"script-type": "Vrsta skripta",
"javascript-resource-details": "Podrobnosti vira JavaScript",

4
ui-ngx/src/assets/locale/locale.constant-tr_TR.json

@ -2837,7 +2837,6 @@
"is-gateway": "Gateway mi",
"overwrite-activity-time": "Bağlı cihaz için etkinlik zamanını üzerine yaz",
"device-filter-title": "Cihaz Filtresi",
"filter-title": "Filtre",
"device-state": "Cihaz durumu",
"state": "Durum",
"any": "Herhangi biri",
@ -5745,7 +5744,7 @@
"opc-ua-type": "Tür",
"opc-ua-keystore-type": "Tür",
"opc-ua-keystore-type-required": "Tür gereklidir",
"opc-ua-keystore-location": "Konum *",
"opc-ua-keystore-location": "Konum",
"opc-ua-keystore-password": "Parola",
"opc-ua-keystore-password-required": "Parola gereklidir",
"opc-ua-keystore-alias": "Takma ad",
@ -7543,7 +7542,6 @@
"drop-file": "Bir JavaScript dosyasını bırakın veya yüklemek için tıklayın.",
"drop-resource-file-or": "Bir JavaScript dosyasını sürükleyip bırakın ya da",
"javascript-library": "JavaScript kütüphanesi",
"javascript-type": "JavaScript türü",
"scripts": "Betikler",
"script-type": "Betik türü",
"javascript-resource-details": "JavaScript kaynağı ayrıntıları",

4
ui-ngx/src/assets/locale/locale.constant-uk_UA.json

@ -2835,7 +2835,6 @@
"is-gateway": "Це Gateway",
"overwrite-activity-time": "Перезаписати час активності для підключеного пристрою",
"device-filter-title": "Фільтр пристроїв",
"filter-title": "Фільтр",
"device-state": "Стан пристрою",
"state": "Стан",
"any": "Будь-який",
@ -5743,7 +5742,7 @@
"opc-ua-type": "Тип",
"opc-ua-keystore-type": "Тип",
"opc-ua-keystore-type-required": "Потрібно вказати тип",
"opc-ua-keystore-location": "Розташування *",
"opc-ua-keystore-location": "Розташування",
"opc-ua-keystore-password": "Пароль",
"opc-ua-keystore-password-required": "Потрібно вказати пароль",
"opc-ua-keystore-alias": "Псевдонім",
@ -7541,7 +7540,6 @@
"drop-file": "Перетягніть JavaScript файл або натисніть, щоб вибрати файл для завантаження.",
"drop-resource-file-or": "Перетягніть JavaScript файл або",
"javascript-library": "Бібліотека JavaScript",
"javascript-type": "Тип JavaScript",
"scripts": "Скрипти",
"script-type": "Тип скрипту",
"javascript-resource-details": "Деталі JavaScript ресурсу",

4
ui-ngx/src/assets/locale/locale.constant-zh_CN.json

@ -2837,7 +2837,6 @@
"is-gateway": "Gateway",
"overwrite-activity-time": "覆盖已连接设备的活动时间",
"device-filter-title": "设备过滤器",
"filter-title": "过滤器",
"device-state": "设备状态",
"state": "状态",
"any": "任意",
@ -5745,7 +5744,7 @@
"opc-ua-type": "类型",
"opc-ua-keystore-type": "类型",
"opc-ua-keystore-type-required": "类型为必填项",
"opc-ua-keystore-location": "位置 *",
"opc-ua-keystore-location": "位置",
"opc-ua-keystore-password": "密码",
"opc-ua-keystore-password-required": "密码为必填项",
"opc-ua-keystore-alias": "别名",
@ -7543,7 +7542,6 @@
"drop-file": "拖放 JavaScript 文件或点击选择要上传的文件。",
"drop-resource-file-or": "拖放 JavaScript 文件或",
"javascript-library": "JavaScript 库",
"javascript-type": "JavaScript 类型",
"scripts": "脚本",
"script-type": "脚本类型",
"javascript-resource-details": "JavaScript 资源详情",

4
ui-ngx/src/assets/locale/locale.constant-zh_TW.json

@ -1656,7 +1656,6 @@
"generate-access-token": "產生存取權杖",
"device-profile-type-list-empty": "至少應選擇一個裝置設定檔。",
"device-filter-title": "裝置篩選器",
"filter-title": "篩選器",
"device-state": "裝置狀態",
"state": "狀態",
"any": "任意",
@ -9921,7 +9920,6 @@
"drop-file": "拖放 JavaScript 檔案,或點選以選取要上傳的檔案。",
"drop-resource-file-or": "拖放 JavaScript 檔案或",
"javascript-library": "JavaScript 程式庫",
"javascript-type": "JavaScript 類型",
"scripts": "指令碼",
"script-type": "指令碼類型",
"javascript-resource-details": "JavaScript 資源詳細資料",
@ -11897,7 +11895,7 @@
"opc-ua-type": "類型",
"opc-ua-keystore-type": "類型",
"opc-ua-keystore-type-required": "類型為必填項。",
"opc-ua-keystore-location": "位置 *",
"opc-ua-keystore-location": "位置",
"opc-ua-keystore-password": "密碼",
"opc-ua-keystore-password-required": "密碼為必填項。",
"opc-ua-keystore-alias": "別名",

9
ui-ngx/src/app/modules/home/components/device/device-info-filter.component.scss → ui-ngx/src/scss/filter-button.scss

@ -1,5 +1,7 @@
// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
:host {
display: block;
overflow: hidden;
@ -21,12 +23,11 @@
}
}
::ng-deep {
.tb-device-filter-config-component {
.tb-filter-button-panel-content {
max-width: 100%;
width: 500px;
min-width: 100%;
flex: 1;
}
}
}

12
ui-ngx/yarn.lock

@ -4022,11 +4022,6 @@ deep-extend@~0.6.0:
resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==
deep-freeze-strict@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/deep-freeze-strict/-/deep-freeze-strict-1.1.1.tgz#77d0583ca24a69be4bbd9ac2fae415d55523e5b0"
integrity sha512-QemROZMM2IvhAcCFvahdX2Vbm4S/txeq5rFYU9fh4mQP79WTMW5c/HkQ2ICl1zuzcDZdPZ6zarDxQeQMsVYoNA==
deep-is@^0.1.3:
version "0.1.4"
resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831"
@ -6437,13 +6432,6 @@ negotiator@^1.0.0:
resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-1.0.0.tgz#b6c91bb47172d69f93cfd7c357bbb529019b5f6a"
integrity sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==
ngrx-store-freeze@^0.2.4:
version "0.2.4"
resolved "https://registry.yarnpkg.com/ngrx-store-freeze/-/ngrx-store-freeze-0.2.4.tgz#146687cdf7e21244eb9003c7e883f2125847076c"
integrity sha512-90awpbbMa/x2H81eWWYniyli3LJ1PZU/FaztL10d9Rp/4kw2+97pqyLjdxSPxcOv9St//m9kfuWZ7gyoVDjgcg==
dependencies:
deep-freeze-strict "^1.1.1"
ngx-captcha@^14.0.0:
version "14.0.0"
resolved "https://registry.yarnpkg.com/ngx-captcha/-/ngx-captcha-14.0.0.tgz#6595d06857f87efd954da4774f02d40e762c0d86"

Loading…
Cancel
Save