Browse Source

Merge branch 'feature/lts-4.4/iot-hub-lorawan' into merge/iot-hub-device-update-reinstall-into-4.4.1

pull/16627/head
dshvaika 3 weeks ago
parent
commit
41ffc700bf
  1. 6
      application/src/main/java/org/thingsboard/server/service/device/DeviceBulkImportService.java
  2. 37
      application/src/test/java/org/thingsboard/server/controller/DeviceControllerTest.java
  3. 1
      common/data/src/main/java/org/thingsboard/server/common/data/sync/ie/importing/csv/BulkImportColumnType.java
  4. 1
      ui-ngx/angular.json
  5. 1
      ui-ngx/package.json
  6. 32
      ui-ngx/src/app/app.component.ts
  7. 4
      ui-ngx/src/app/modules/home/components/attribute/attribute-table.component.html
  8. 12
      ui-ngx/src/app/modules/home/components/event/event-table-config.ts
  9. 2
      ui-ngx/src/app/modules/home/components/integration/configuration/chirp-stack-integration-form/chirp-stack-integration-form.component.html
  10. 4
      ui-ngx/src/app/modules/home/components/integration/configuration/coap-integration-form/coap-integration-form.component.html
  11. 2
      ui-ngx/src/app/modules/home/components/integration/configuration/http-integration-form/http-integration-form.component.html
  12. 2
      ui-ngx/src/app/modules/home/components/integration/configuration/kpn-integration-form/kpn-integration-form.component.html
  13. 2
      ui-ngx/src/app/modules/home/components/integration/configuration/loriot-integration-form/loriot-integration-form.component.html
  14. 2
      ui-ngx/src/app/modules/home/components/integration/configuration/particle-integration-form/particle-integration-form.component.html
  15. 2
      ui-ngx/src/app/modules/home/components/integration/configuration/thing-park-integration-form/thing-park-integration-form.component.html
  16. 2
      ui-ngx/src/app/modules/home/components/relation/relation-table.component.html
  17. 4
      ui-ngx/src/app/modules/home/components/role/registration-permissions.component.scss
  18. 4
      ui-ngx/src/app/modules/home/components/router-tabs.component.html
  19. 21
      ui-ngx/src/app/modules/home/components/router-tabs.component.ts
  20. 3
      ui-ngx/src/app/modules/home/components/vc/entity-versions-table.component.html
  21. 14
      ui-ngx/src/app/modules/home/components/widget/lib/cards/aggregated-value-card-widget.component.ts
  22. 14
      ui-ngx/src/app/modules/home/components/widget/lib/cards/value-card-widget.component.ts
  23. 9
      ui-ngx/src/app/modules/home/components/widget/lib/chart/latest-chart.ts
  24. 8
      ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart-widget.component.ts
  25. 2
      ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart.models.ts
  26. 12
      ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart.ts
  27. 14
      ui-ngx/src/app/modules/home/components/widget/lib/indicator/signal-strength-widget.component.ts
  28. 11
      ui-ngx/src/app/modules/home/components/widget/lib/legend.component.ts
  29. 15
      ui-ngx/src/app/modules/home/components/widget/lib/maps/data-layer/markers-data-layer.ts
  30. 1
      ui-ngx/src/app/modules/home/components/widget/lib/maps/geo-map.ts
  31. 1
      ui-ngx/src/app/modules/home/components/widget/lib/maps/image-map.ts
  32. 22
      ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet/leaflet-tb.ts
  33. 27
      ui-ngx/src/app/modules/home/components/widget/lib/maps/map.ts
  34. 3
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/set-value-action-settings-panel.component.html
  35. 3
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/set-value-action-settings-panel.component.ts
  36. 3
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/set-value-action-settings.component.ts
  37. 10
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-settings.component.html
  38. 4
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-settings.component.ts
  39. 4
      ui-ngx/src/app/modules/home/components/wizard/integration-wizard-dialog.component.html
  40. 19
      ui-ngx/src/app/modules/home/dialogs/home-dialogs.service.ts
  41. 45
      ui-ngx/src/app/modules/home/pages/admin/admin-routing.module.ts
  42. 1
      ui-ngx/src/app/modules/home/pages/admin/mail-server.component.html
  43. 67
      ui-ngx/src/app/modules/home/pages/admin/mail-server.component.ts
  44. 4
      ui-ngx/src/app/modules/home/pages/admin/oauth2/domains/domain.component.html
  45. 14
      ui-ngx/src/app/modules/home/pages/admin/self-registration.component.html
  46. 4
      ui-ngx/src/app/modules/home/pages/admin/self-registration.component.scss
  47. 30
      ui-ngx/src/app/modules/home/pages/admin/sms-provider.component.ts
  48. 4
      ui-ngx/src/app/modules/home/pages/custom-translation/translation-map-table.component.html
  49. 13
      ui-ngx/src/app/modules/home/pages/dashboard/dashboard-group-config.factory.ts
  50. 24
      ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts
  51. 4
      ui-ngx/src/app/modules/home/pages/integration/integration.component.html
  52. 6
      ui-ngx/src/app/modules/home/pages/mobile/applications/mobile-app-table-config.resolver.ts
  53. 33
      ui-ngx/src/app/modules/home/pages/mobile/qr-code-widget/mobile-qr-code-widget-settings-routing.module.ts
  54. 17
      ui-ngx/src/app/modules/home/pages/mobile/qr-code-widget/mobile-qr-code-widget-settings.component.ts
  55. 7
      ui-ngx/src/app/modules/home/pages/notification/settings/notification-settings-routing.modules.ts
  56. 6
      ui-ngx/src/app/modules/home/pages/ota-update/ota-update-table-config.resolve.ts
  57. 2
      ui-ngx/src/app/modules/home/pages/profile/profile-routing.module.ts
  58. 5
      ui-ngx/src/app/modules/home/pages/security/security-routing.module.ts
  59. 1
      ui-ngx/src/app/modules/home/pages/user/activation-link-dialog.component.html
  60. 2
      ui-ngx/src/app/shared/components/button/copy-button.component.scss
  61. 2
      ui-ngx/src/app/shared/components/popover.component.scss
  62. 2
      ui-ngx/src/app/shared/components/role/group-permissions.component.html
  63. 13
      ui-ngx/src/app/shared/components/user-menu.component.html
  64. 31
      ui-ngx/src/app/shared/components/user-menu.component.scss
  65. 13
      ui-ngx/src/app/shared/components/user-menu.component.ts
  66. 2
      ui-ngx/src/app/shared/import-export/import-dialog-csv.component.ts
  67. 2
      ui-ngx/src/app/shared/import-export/import-export.models.ts
  68. 10
      ui-ngx/src/app/shared/import-export/table-columns-assignment.component.html
  69. 18
      ui-ngx/src/app/shared/import-export/table-columns-assignment.component.ts
  70. 63
      ui-ngx/src/app/shared/models/widget-settings.models.ts
  71. 2
      ui-ngx/src/app/shared/models/widget.models.ts
  72. 8
      ui-ngx/src/app/shared/models/widget/maps/map.models.ts
  73. 22
      ui-ngx/src/app/shared/pipe/date-ago.pipe.ts
  74. 1
      ui-ngx/src/assets/locale/locale.constant-ar_AE.json
  75. 1
      ui-ngx/src/assets/locale/locale.constant-ca_ES.json
  76. 1
      ui-ngx/src/assets/locale/locale.constant-cs_CZ.json
  77. 1
      ui-ngx/src/assets/locale/locale.constant-da_DK.json
  78. 1
      ui-ngx/src/assets/locale/locale.constant-de_DE.json
  79. 1
      ui-ngx/src/assets/locale/locale.constant-el_GR.json
  80. 9
      ui-ngx/src/assets/locale/locale.constant-en_US.json
  81. 1
      ui-ngx/src/assets/locale/locale.constant-es_ES.json
  82. 1
      ui-ngx/src/assets/locale/locale.constant-fr_FR.json
  83. 1
      ui-ngx/src/assets/locale/locale.constant-hi_IN.json
  84. 1
      ui-ngx/src/assets/locale/locale.constant-it_IT.json
  85. 1
      ui-ngx/src/assets/locale/locale.constant-ja_JP.json
  86. 7787
      ui-ngx/src/assets/locale/locale.constant-ko_KR.json
  87. 9591
      ui-ngx/src/assets/locale/locale.constant-lt_LT.json
  88. 16358
      ui-ngx/src/assets/locale/locale.constant-nl_BE.json
  89. 1
      ui-ngx/src/assets/locale/locale.constant-nl_NL.json
  90. 1
      ui-ngx/src/assets/locale/locale.constant-no_NO.json
  91. 12785
      ui-ngx/src/assets/locale/locale.constant-pl_PL.json
  92. 1
      ui-ngx/src/assets/locale/locale.constant-pt_BR.json
  93. 1
      ui-ngx/src/assets/locale/locale.constant-sl_SI.json
  94. 1
      ui-ngx/src/assets/locale/locale.constant-tr_TR.json
  95. 1
      ui-ngx/src/assets/locale/locale.constant-uk_UA.json
  96. 1
      ui-ngx/src/assets/locale/locale.constant-zh_CN.json
  97. 1
      ui-ngx/src/assets/locale/locale.constant-zh_TW.json
  98. 2
      ui-ngx/src/scss/constants.scss
  99. 7
      ui-ngx/src/typings/leaflet-extend-tb.d.ts
  100. 5
      ui-ngx/yarn.lock

6
application/src/main/java/org/thingsboard/server/service/device/DeviceBulkImportService.java

@ -11,6 +11,7 @@ import lombok.SneakyThrows;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.stereotype.Service;
import org.thingsboard.common.util.JacksonUtil;
import org.thingsboard.server.common.data.DataConstants;
import org.thingsboard.server.common.data.Device;
import org.thingsboard.server.common.data.DeviceProfile;
import org.thingsboard.server.common.data.DeviceProfileProvisionType;
@ -89,7 +90,10 @@ public class DeviceBulkImportService extends AbstractBulkImportService<Device> {
additionalInfo.set("description", new TextNode(value));
break;
case IS_GATEWAY:
additionalInfo.set("gateway", BooleanNode.valueOf(Boolean.parseBoolean(value)));
additionalInfo.set(DataConstants.GATEWAY_PARAMETER, BooleanNode.valueOf(Boolean.parseBoolean(value)));
break;
case OVERWRITE_ACTIVITY_TIME:
additionalInfo.set(DataConstants.OVERWRITE_ACTIVITY_TIME_PARAMETER, BooleanNode.valueOf(Boolean.parseBoolean(value)));
break;
}
device.setAdditionalInfo(additionalInfo);

37
application/src/test/java/org/thingsboard/server/controller/DeviceControllerTest.java

@ -1404,6 +1404,43 @@ public class DeviceControllerTest extends AbstractControllerTest {
assertThat(retrieved.get().getStrValue()).isNotPresent();
}
@Test
public void testBulkImportDeviceWithOverwriteActivityTime() throws Exception {
String deviceName = "some_device";
String deviceType = "some_type";
BulkImportRequest request = new BulkImportRequest();
request.setFile(String.format("NAME,TYPE,OVERWRITE_ACTIVITY_TIME\n%s,%s,true", deviceName, deviceType));
BulkImportRequest.Mapping mapping = new BulkImportRequest.Mapping();
BulkImportRequest.ColumnMapping name = new BulkImportRequest.ColumnMapping();
name.setType(BulkImportColumnType.NAME);
BulkImportRequest.ColumnMapping type = new BulkImportRequest.ColumnMapping();
type.setType(BulkImportColumnType.TYPE);
BulkImportRequest.ColumnMapping overwriteActivityTime = new BulkImportRequest.ColumnMapping();
overwriteActivityTime.setType(BulkImportColumnType.OVERWRITE_ACTIVITY_TIME);
List<BulkImportRequest.ColumnMapping> columns = new ArrayList<>();
columns.add(name);
columns.add(type);
columns.add(overwriteActivityTime);
mapping.setColumns(columns);
mapping.setDelimiter(',');
mapping.setUpdate(true);
mapping.setHeader(true);
request.setMapping(mapping);
BulkImportResult<Device> result = doPostWithTypedResponse("/api/device/bulk_import", request, new TypeReference<>() {});
Assert.assertEquals(1, result.getCreated().get());
Assert.assertEquals(0, result.getErrors().get());
Assert.assertTrue(result.getErrorsList().isEmpty());
Device savedDevice = doGet("/api/tenant/devices?deviceName=" + deviceName, Device.class);
Assert.assertNotNull(savedDevice);
Assert.assertNotNull(savedDevice.getAdditionalInfo());
Assert.assertTrue(savedDevice.getAdditionalInfo().get("overwriteActivityTime").asBoolean());
}
@Test
public void testSaveDeviceWithOutdatedVersion() throws Exception {
Device device = createDevice("Device v1.0");

1
common/data/src/main/java/org/thingsboard/server/common/data/sync/ie/importing/csv/BulkImportColumnType.java

@ -36,6 +36,7 @@ public enum BulkImportColumnType {
SNMP_VERSION,
SNMP_COMMUNITY_STRING,
IS_GATEWAY,
OVERWRITE_ACTIVITY_TIME,
DESCRIPTION,
EDGE_LICENSE_KEY,
CLOUD_ENDPOINT,

1
ui-ngx/angular.json

@ -133,6 +133,7 @@
"node_modules/tooltipster/dist/css/plugins/tooltipster/sideTip/themes/tooltipster-sideTip-shadow.min.css",
"node_modules/jstree-bootstrap-theme/dist/themes/proton/style.min.css",
"node_modules/leaflet/dist/leaflet.css",
"node_modules/leaflet-gesture-handling/dist/leaflet-gesture-handling.css",
"src/app/modules/home/components/widget/lib/maps/map.scss",
"src/app/modules/home/components/widget/lib/maps-legacy/markers.scss",
"src/app/modules/home/components/widget/lib/home-page/home-page.scss",

1
ui-ngx/package.json

@ -73,6 +73,7 @@
"jstree-bootstrap-theme": "^1.0.1",
"jszip": "^3.10.2",
"leaflet": "1.9.4",
"leaflet-gesture-handling": "1.2.2",
"leaflet-polylinedecorator": "1.6.0",
"leaflet-providers": "4.0.0",
"leaflet.gridlayer.googlemutant": "0.15.0",

32
ui-ngx/src/app/app.component.ts

@ -14,7 +14,7 @@ import { LocalStorageService } from '@core/local-storage/local-storage.service';
import { DomSanitizer } from '@angular/platform-browser';
import { MatIconRegistry } from '@angular/material/icon';
import { getCurrentAuthState, selectUserReady } from '@core/auth/auth.selectors';
import { filter, skip, tap } from 'rxjs/operators';
import { filter, skip, switchMap, take, takeWhile, tap } from 'rxjs/operators';
import { AuthService } from '@core/auth/auth.service';
import { DashboardReportService } from '@core/http/dashboard-report.service';
import { DevelopmentService } from '@core/http/development.service';
@ -25,6 +25,9 @@ import { initCustomJQueryEvents } from '@shared/models/jquery-event.models';
import { TranslateDefaultLoader } from '@core/translate/translate-default-loader';
import { SystemSetupService } from '@core/http/system-setup.service';
import { SystemSetupState } from '@shared/models/system-setup.models';
import { NavigationEnd, NavigationError, Router } from '@angular/router';
import { ToastNotificationService } from '@core/services/toast-notification.service';
import { NotificationMessage } from '@core/notification/notification.models';
@Component({
selector: 'tb-root',
@ -43,7 +46,9 @@ export class AppComponent {
private authService: AuthService,
private reportService: DashboardReportService,
private developmentService: DevelopmentService,
private systemSetupService: SystemSetupService) {
private systemSetupService: SystemSetupService,
private router: Router,
private toastNotificationService: ToastNotificationService) {
if (!env.production) {
console.log(`ThingsBoard Version: ${env.tbVersion}`);
@ -85,6 +90,29 @@ export class AppComponent {
});
this.routeAuthenticationChangesWhileSetupIsIncomplete();
this.gotoDefaultPlaceOnInitialNavigationError();
}
private gotoDefaultPlaceOnInitialNavigationError() {
const pendingNotifications: NotificationMessage[] = [];
this.toastNotificationService.getNotification().pipe(
takeWhile(() => !this.router.navigated)
).subscribe((notification) => pendingNotifications.push(notification));
this.router.events.pipe(
filter((event) => event instanceof NavigationError && !this.router.navigated),
take(1),
switchMap(() => {
this.authService.gotoDefaultPlace(getCurrentAuthState(this.store).isAuthenticated);
return this.router.events.pipe(
filter((event) => event instanceof NavigationEnd),
take(1)
);
})
).subscribe(() => {
setTimeout(() => {
pendingNotifications.forEach((notification) => this.toastNotificationService.dispatchNotification(notification));
});
});
}
/**

4
ui-ngx/src/app/modules/home/components/attribute/attribute-table.component.html

@ -179,7 +179,7 @@
tooltipText="{{ 'attribute.copy-key' | translate }}"
tooltipPosition="above"
icon="content_copy"
[style]="{padding: '4px', 'font-size': '16px', color: 'rgba(0,0,0,.87)'}"
[style]="{padding: '4px', 'font-size': '16px'}"
>
</tb-copy-button>
</div>
@ -201,7 +201,7 @@
tooltipText="{{ 'attribute.copy-value' | translate }}"
tooltipPosition="above"
icon="content_copy"
[style]="{padding: '4px', 'font-size': '16px', color: 'rgba(0,0,0,.87)'}"
[style]="{padding: '4px', 'font-size': '16px'}"
>
</tb-copy-button>
}

12
ui-ngx/src/app/modules/home/components/event/event-table-config.ts

@ -344,8 +344,7 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
icon: 'content_paste',
style: {
padding: '4px',
'font-size': '16px',
color: 'rgba(0,0,0,.87)'
'font-size': '16px'
},
isEnabled: () => true,
onAction: ($event, entity) => entity.body.entityId,
@ -362,8 +361,7 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
icon: 'content_paste',
style: {
padding: '4px',
'font-size': '16px',
color: 'rgba(0,0,0,.87)'
'font-size': '16px'
},
isEnabled: () => true,
onAction: ($event, entity) => entity.body.msgId,
@ -449,8 +447,7 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
icon: 'content_copy',
style: {
padding: '4px',
'font-size': '16px',
color: 'rgba(0,0,0,.87)'
'font-size': '16px'
},
isEnabled: () => true,
onAction: ($event, entity) => entity.body.entityId,
@ -469,8 +466,7 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
icon: 'content_copy',
style: {
padding: '4px',
'font-size': '16px',
color: 'rgba(0,0,0,.87)'
'font-size': '16px'
},
isEnabled: (entity) => !!entity.body.msgId,
onAction: (_, entity) => entity.body.msgId,

2
ui-ngx/src/app/modules/home/components/integration/configuration/chirp-stack-integration-form/chirp-stack-integration-form.component.html

@ -24,7 +24,7 @@
<mat-label translate>integration.http-endpoint</mat-label>
<input matInput formControlName="httpEndpoint">
</mat-form-field>
<button mat-icon-button ngxClipboard type="button" color="primary"
<button mat-icon-button ngxClipboard type="button"
(cbOnSuccess)="onHttpEndpointCopied()"
[cbContent]="chirpStackIntegrationConfigForm.get('httpEndpoint').value"
matTooltip="{{'integration.copy-http-endpoint-url' | translate }}">

4
ui-ngx/src/app/modules/home/components/integration/configuration/coap-integration-form/coap-integration-form.component.html

@ -51,7 +51,7 @@
<mat-label translate>integration.coap-endpoint</mat-label>
<input matInput formControlName="coapEndpoint">
</mat-form-field>
<button mat-icon-button ngxClipboard type="button" color="primary"
<button mat-icon-button ngxClipboard type="button"
(cbOnSuccess)="onCoapEndpointCopied()"
[cbContent]="coapIntegrationConfigForm.get('coapEndpoint').value"
matTooltip="{{'integration.copy-coap-endpoint-url' | translate }}">
@ -65,7 +65,7 @@
<mat-label translate>integration.coap-dtls-endpoint</mat-label>
<input matInput formControlName="dtlsCoapEndpoint">
</mat-form-field>
<button mat-icon-button ngxClipboard type="button" color="primary"
<button mat-icon-button ngxClipboard type="button"
(cbOnSuccess)="onDtlsCoapEndpointCopied()"
[cbContent]="coapIntegrationConfigForm.get('dtlsCoapEndpoint').value"
matTooltip="{{'integration.copy-coap-dtls-endpoint-url' | translate }}">

2
ui-ngx/src/app/modules/home/components/integration/configuration/http-integration-form/http-integration-form.component.html

@ -24,7 +24,7 @@
<mat-label translate>integration.http-endpoint</mat-label>
<input matInput formControlName="httpEndpoint">
</mat-form-field>
<button mat-icon-button ngxClipboard type="button" color="primary"
<button mat-icon-button ngxClipboard type="button"
(cbOnSuccess)="onHttpEndpointCopied()"
[cbContent]="baseHttpIntegrationConfigForm.get('httpEndpoint').value"
matTooltip="{{'integration.copy-http-endpoint-url' | translate }}">

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

@ -24,7 +24,7 @@
<mat-label translate>integration.http-endpoint</mat-label>
<input matInput formControlName="httpEndpoint">
</mat-form-field>
<button mat-icon-button ngxClipboard type="button" color="primary"
<button mat-icon-button ngxClipboard type="button"
(cbOnSuccess)="onHttpEndpointCopied()"
[cbContent]="kpnIntegrationConfigForm.get('httpEndpoint').value"
matTooltip="{{'integration.copy-http-endpoint-url' | translate }}">

2
ui-ngx/src/app/modules/home/components/integration/configuration/loriot-integration-form/loriot-integration-form.component.html

@ -24,7 +24,7 @@
<mat-label translate>integration.http-endpoint</mat-label>
<input matInput formControlName="httpEndpoint">
</mat-form-field>
<button mat-icon-button ngxClipboard type="button" color="primary"
<button mat-icon-button ngxClipboard type="button"
(cbOnSuccess)="onHttpEndpointCopied()"
[cbContent]="loriotIntegrationConfigForm.get('httpEndpoint').value"
matTooltip="{{'integration.copy-http-endpoint-url' | translate }}">

2
ui-ngx/src/app/modules/home/components/integration/configuration/particle-integration-form/particle-integration-form.component.html

@ -24,7 +24,7 @@
<mat-label translate>integration.http-endpoint</mat-label>
<input matInput formControlName="httpEndpoint">
</mat-form-field>
<button mat-icon-button ngxClipboard type="button" color="primary"
<button mat-icon-button ngxClipboard type="button"
(cbOnSuccess)="onHttpEndpointCopied()"
[cbContent]="particleIntegrationConfigForm.get('httpEndpoint').value"
matTooltip="{{'integration.copy-http-endpoint-url' | translate }}">

2
ui-ngx/src/app/modules/home/components/integration/configuration/thing-park-integration-form/thing-park-integration-form.component.html

@ -24,7 +24,7 @@
<mat-label translate>integration.http-endpoint</mat-label>
<input matInput formControlName="httpEndpoint">
</mat-form-field>
<button mat-icon-button ngxClipboard type="button" color="primary"
<button mat-icon-button ngxClipboard type="button"
(cbOnSuccess)="onHttpEndpointCopied()"
[cbContent]="thingParkConfigForm.get('httpEndpoint').value"
matTooltip="{{'integration.copy-http-endpoint-url' | translate }}">

2
ui-ngx/src/app/modules/home/components/relation/relation-table.component.html

@ -108,7 +108,7 @@
tooltipText="{{ 'relation.copy-type' | translate }}"
tooltipPosition="above"
icon="content_copy"
[style]="{padding: '4px', 'font-size': '16px', color: 'rgba(0,0,0,.87)'}"
[style]="{padding: '4px', 'font-size': '16px'}"
>
</tb-copy-button>
</div>

4
ui-ngx/src/app/modules/home/components/role/registration-permissions.component.scss

@ -2,8 +2,4 @@
// SPDX-License-Identifier: BUSL-1.1
:host {
display: flex;
max-height: 380px;
tb-group-permissions {
height: auto;
}
}

4
ui-ngx/src/app/modules/home/components/router-tabs.component.html

@ -22,9 +22,9 @@
#rla="routerLinkActive"
mat-tab-link
[active]="rla.isActive">
@if (tab.outlinedIcon !== null) {
@if (tab.outlinedIcon) {
<tb-icon class="tb-mat-18">{{tab.outlinedIcon}}</tb-icon>
} @else if (tab.icon !== null) {
} @else if (tab.icon) {
<tb-icon class="tb-mat-18">{{tab.icon}}</tb-icon>
}
<span>{{ tab.customTranslate ? (tab.name | customTranslate) : (tab.name | translate) }}</span>

21
ui-ngx/src/app/modules/home/components/router-tabs.component.ts

@ -9,7 +9,7 @@ import { ActivatedRoute, NavigationEnd, Router } from '@angular/router';
import { MenuService } from '@core/services/menu.service';
import { distinctUntilChanged, filter, map, mergeMap, startWith, take } from 'rxjs/operators';
import { merge, Observable } from 'rxjs';
import { MenuSection } from '@core/services/menu.models';
import { MenuSection, menuSectionMap } from '@core/services/menu.models';
import { ActiveComponentService } from '@core/services/active-component.service';
import { TbAnchorComponent } from '@shared/components/tb-anchor.component';
import { getCurrentAuthUser } from '@core/auth/auth.selectors';
@ -130,13 +130,18 @@ export class RouterTabsComponent extends PageComponent implements OnInit {
}
});
if (children.length) {
return children.map(tab => ({
id: tab.component?.name ?? tab.path,
type: 'link',
name: tab.data?.breadcrumb?.label ?? '',
icon: tab.data?.breadcrumb?.icon ?? '',
path: `${sectionPath}/${tab.path}`
}));
return children.map(tab => {
const breadcrumb = tab.data?.breadcrumb;
const section = breadcrumb?.menuId ? menuSectionMap.get(breadcrumb.menuId) : null;
return {
id: tab.component?.name ?? tab.path,
type: 'link',
name: section?.name ?? breadcrumb?.label ?? '',
icon: section?.icon ?? breadcrumb?.icon ?? '',
outlinedIcon: section?.outlinedIcon ?? breadcrumb?.icon ?? '',
path: `${sectionPath}/${tab.path}`
};
});
}
return [];
}

3
ui-ngx/src/app/modules/home/components/vc/entity-versions-table.component.html

@ -101,8 +101,7 @@
icon="content_paste"
[style]="{
padding: '4px',
'font-size': '16px',
color: 'rgba(0,0,0,.87)'
'font-size': '16px'
}">
</tb-copy-button>
</mat-cell>

14
ui-ngx/src/app/modules/home/components/widget/lib/cards/aggregated-value-card-widget.component.ts

@ -1,9 +1,11 @@
// 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,
ChangeDetectorRef,
Component,
DestroyRef,
ElementRef,
Input,
OnDestroy,
@ -12,6 +14,7 @@ import {
TemplateRef,
ViewChild
} from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import {
aggregatedValueCardDefaultSettings,
AggregatedValueCardKeyPosition,
@ -107,7 +110,8 @@ export class AggregatedValueCardWidgetComponent implements OnInit, AfterViewInit
constructor(private imagePipe: ImagePipe,
private sanitizer: DomSanitizer,
private renderer: Renderer2,
private cd: ChangeDetectorRef) {
private cd: ChangeDetectorRef,
private destroyRef: DestroyRef) {
}
ngOnInit(): void {
@ -154,6 +158,12 @@ export class AggregatedValueCardWidgetComponent implements OnInit, AfterViewInit
this.dateStyle = textStyle(this.settings.dateFont);
this.dateColor = this.settings.dateColor;
if (this.showDate) {
this.dateFormat.formattedUpdated?.pipe(
takeUntilDestroyed(this.destroyRef)
).subscribe(() => this.cd.detectChanges());
}
this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer);
this.overlayStyle = overlayStyle(this.settings.background.overlay);
this.padding = this.settings.background.overlay.enabled ? undefined : this.settings.padding;

14
ui-ngx/src/app/modules/home/components/widget/lib/cards/value-card-widget.component.ts

@ -1,9 +1,11 @@
// 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,
ChangeDetectorRef,
Component,
DestroyRef,
ElementRef,
Input,
OnDestroy,
@ -12,6 +14,7 @@ import {
TemplateRef,
ViewChild
} from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { WidgetContext } from '@home/models/widget-component.models';
import { isDefinedAndNotNull } from '@core/utils';
import {
@ -94,7 +97,8 @@ export class ValueCardWidgetComponent implements OnInit, AfterViewInit, OnDestro
private sanitizer: DomSanitizer,
private renderer: Renderer2,
private widgetComponent: WidgetComponent,
private cd: ChangeDetectorRef) {
private cd: ChangeDetectorRef,
private destroyRef: DestroyRef) {
}
ngOnInit(): void {
@ -125,6 +129,12 @@ export class ValueCardWidgetComponent implements OnInit, AfterViewInit, OnDestro
this.dateStyle = textStyle(this.settings.dateFont);
this.dateColor = ColorProcessor.fromSettings(this.settings.dateColor);
if (this.showDate) {
this.dateFormat.formattedUpdated?.pipe(
takeUntilDestroyed(this.destroyRef)
).subscribe(() => this.cd.detectChanges());
}
this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer);
this.overlayStyle = overlayStyle(this.settings.background.overlay);
this.padding = this.settings.background.overlay.enabled ? undefined : this.settings.padding;

9
ui-ngx/src/app/modules/home/components/widget/lib/chart/latest-chart.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 { ECharts, echartsModule, EChartsOption } from '@home/components/widget/lib/chart/echarts-widget.models';
import {
LatestChartDataItem,
@ -12,7 +13,7 @@ import { DeepPartial } from '@shared/models/common';
import { Renderer2 } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { isDefinedAndNotNull, isNumeric, mergeDeep } from '@core/utils';
import { DataKey } from '@shared/models/widget.models';
import { compareLegendDataKeys, DataKey } from '@shared/models/widget.models';
import * as echarts from 'echarts/core';
import { CallbackDataParams } from 'echarts/types/dist/shared';
import { SVG, Svg } from '@svgdotjs/svg.js';
@ -103,9 +104,9 @@ export abstract class TbLatestChart<S extends LatestChartSettings> {
}
}
if (this.settings.sortSeries) {
this.dataItems.sort((a, b) => a.dataKey.label.localeCompare(b.dataKey.label));
this.dataItems.sort((a, b) => compareLegendDataKeys(a.dataKey, b.dataKey));
if (this.settings.showLegend) {
this.legendItems.sort((a, b) => a.label.localeCompare(b.label));
this.legendItems.sort((a, b) => compareLegendDataKeys(a.dataKey, b.dataKey));
}
}
this.showTotalValueInLegend = this.settings.showLegend && !this.settings.showTotal && this.settings.legendShowTotal;

8
ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart-widget.component.ts

@ -23,7 +23,7 @@ import { Observable } from 'rxjs';
import { backgroundStyle, ComponentStyle, overlayStyle, textStyle } from '@shared/models/widget-settings.models';
import { ImagePipe } from '@shared/pipe/image.pipe';
import { DomSanitizer } from '@angular/platform-browser';
import { LegendConfig, LegendData, LegendKey, LegendPosition } from '@shared/models/widget.models';
import { compareLegendDataKeys, LegendConfig, LegendData, LegendKey, LegendPosition } from '@shared/models/widget.models';
import { TbTimeSeriesChart } from '@home/components/widget/lib/chart/time-series-chart';
import {
timeSeriesChartWidgetDefaultSettings,
@ -100,7 +100,7 @@ export class TimeSeriesChartWidgetComponent implements ChartWidgetComponent, OnI
this.legendConfig = this.settings.legendConfig;
this.legendKeys = this.legendData.keys;
if (this.legendConfig.sortDataKeys) {
this.legendKeys = this.legendData.keys.sort((key1, key2) => key1.dataKey.label.localeCompare(key2.dataKey.label));
this.legendKeys = this.legendData.keys.sort((key1, key2) => compareLegendDataKeys(key1.dataKey, key2.dataKey));
}
this.legendKeys.forEach(legendKey => {
legendKey.dataKey.settings = mergeDeep<TimeSeriesChartKeySettings>({} as TimeSeriesChartKeySettings,
@ -129,7 +129,9 @@ export class TimeSeriesChartWidgetComponent implements ChartWidgetComponent, OnI
}
ngAfterViewInit() {
this.timeSeriesChart = new TbTimeSeriesChart(this.ctx, this.settings, this.chartShape.nativeElement, this.renderer);
this.timeSeriesChart = new TbTimeSeriesChart(this.ctx,
{...this.settings, sortSeries: this.showLegend && this.legendConfig.sortDataKeys},
this.chartShape.nativeElement, this.renderer);
this.ctx.widgetActions = this.timeSeriesChart.getWidgetActions();
}

2
ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart.models.ts

@ -689,6 +689,7 @@ export interface TimeSeriesChartSettings extends TimeSeriesChartTooltipWidgetSet
dataZoom: boolean;
dataZoomUpdateTimewindow: boolean;
stack: boolean;
sortSeries: boolean;
grid: TimeSeriesChartGridSettings;
yAxes: TimeSeriesChartYAxes;
xAxis: TimeSeriesChartXAxisSettings;
@ -705,6 +706,7 @@ export const timeSeriesChartDefaultSettings: TimeSeriesChartSettings = {
dataZoom: true,
dataZoomUpdateTimewindow: false,
stack: false,
sortSeries: false,
grid: mergeDeep({} as TimeSeriesChartGridSettings,
timeSeriesChartGridDefaultSettings),
yAxes: {

12
ui-ngx/src/app/modules/home/components/widget/lib/chart/time-series-chart.ts

@ -55,7 +55,14 @@ import {
isString,
mergeDeep
} from '@core/utils';
import { DataKey, Datasource, DatasourceType, FormattedData, widgetType } from '@shared/models/widget.models';
import {
compareLegendDataKeys,
DataKey,
Datasource,
DatasourceType,
FormattedData,
widgetType
} from '@shared/models/widget.models';
import * as echarts from 'echarts/core';
import { CallbackDataParams, PiecewiseVisualMapOption } from 'echarts/types/dist/shared';
import { Renderer2 } from '@angular/core';
@ -507,6 +514,9 @@ export class TbTimeSeriesChart {
}
}
}
if (this.settings.sortSeries) {
this.dataItems.sort((a, b) => compareLegendDataKeys(a.dataKey, b.dataKey));
}
}
private setupThresholds(): void {

14
ui-ngx/src/app/modules/home/components/widget/lib/indicator/signal-strength-widget.component.ts

@ -1,9 +1,11 @@
// 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,
ChangeDetectorRef,
Component,
DestroyRef,
ElementRef,
Input,
OnDestroy,
@ -13,6 +15,7 @@ import {
ViewChild,
ViewEncapsulation
} from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { WidgetContext } from '@home/models/widget-component.models';
import {
backgroundStyle,
@ -122,7 +125,8 @@ export class SignalStrengthWidgetComponent implements OnInit, OnDestroy, AfterVi
private sanitizer: DomSanitizer,
private translate: TranslateService,
private renderer: Renderer2,
private cd: ChangeDetectorRef) {
private cd: ChangeDetectorRef,
private destroyRef: DestroyRef) {
}
ngOnInit(): void {
@ -135,6 +139,9 @@ export class SignalStrengthWidgetComponent implements OnInit, OnDestroy, AfterVi
this.dateFormat = DateFormatProcessor.fromSettings(this.ctx.$injector, this.settings.dateFormat);
this.dateStyle = textStyle(this.settings.dateFont);
this.dateStyle.color = this.settings.dateColor;
this.dateFormat.formattedUpdated?.pipe(
takeUntilDestroyed(this.destroyRef)
).subscribe(() => this.cd.detectChanges());
}
this.noSignalRssiValue = this.settings.noSignalRssiValue ?? -100;
@ -170,6 +177,9 @@ export class SignalStrengthWidgetComponent implements OnInit, OnDestroy, AfterVi
this.tooltipDateStyle = textStyle(this.settings.tooltipDateFont);
this.tooltipDateStyle.color = this.settings.tooltipDateColor;
this.tooltipDateLabelStyle = {...this.tooltipDateStyle, ...this.tooltipDateLabelStyle};
this.tooltipDateFormat.formattedUpdated?.pipe(
takeUntilDestroyed(this.destroyRef)
).subscribe(() => this.cd.detectChanges());
}
this.backgroundStyle$ = backgroundStyle(this.settings.background, this.imagePipe, this.sanitizer);

11
ui-ngx/src/app/modules/home/components/widget/lib/legend.component.ts

@ -2,7 +2,14 @@
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';
import { LegendConfig, LegendData, LegendDirection, LegendKey, LegendPosition } from '@shared/models/widget.models';
import {
compareLegendDataKeys,
LegendConfig,
LegendData,
LegendDirection,
LegendKey,
LegendPosition
} from '@shared/models/widget.models';
import { UtilsService } from '@core/services/utils.service';
@Component({
@ -56,7 +63,7 @@ export class LegendComponent implements OnInit {
try {
let keys = this.legendData.keys;
if (this.legendConfig.sortDataKeys) {
keys = this.legendData.keys.sort((key1, key2) => key1.dataKey.label.localeCompare(key2.dataKey.label));
keys = this.legendData.keys.sort((key1, key2) => compareLegendDataKeys(key1.dataKey, key2.dataKey));
}
return keys.filter(legendKey => this.legendData.keys[legendKey.dataIndex].dataKey.inLegend);
} catch (e) {}

15
ui-ngx/src/app/modules/home/components/widget/lib/maps/data-layer/markers-data-layer.ts

@ -409,7 +409,8 @@ class TbMarkerDataLayerItem extends TbLatestDataLayerItem<MarkersDataLayerSettin
this.marker = L.marker(location, {
tbMarkerData: data,
snapIgnore: !this.dataLayer.isSnappable(),
bubblingMouseEvents: !this.dataLayer.isEditMode()
bubblingMouseEvents: !this.dataLayer.isEditMode(),
pane: this.dataLayer.getMarkersPane()
});
this.updateMarkerIcon(data, dsData);
return this.marker;
@ -562,10 +563,20 @@ export class TbMarkersDataLayer extends TbLatestMapDataLayer<MarkersDataLayerSet
private markersClusterContainer: L.MarkerClusterGroup;
private clusterMarkerColorFunction: CompiledTbFunction<ClusterMarkerColorFunction>;
private readonly markersPane: string;
constructor(protected map: TbMap<any>,
inputSettings: MarkersDataLayerSettings) {
inputSettings: MarkersDataLayerSettings,
markersLayerIndex: number) {
super(map, inputSettings);
this.markersPane = map.getMarkersPane(markersLayerIndex);
if (this.markersClusterContainer) {
L.Util.setOptions(this.markersClusterContainer, {clusterPane: this.markersPane});
}
}
public getMarkersPane(): string {
return this.markersPane;
}
public dataLayerType(): MapDataLayerType {

1
ui-ngx/src/app/modules/home/components/widget/lib/maps/geo-map.ts

@ -41,6 +41,7 @@ export class TbGeoMap extends TbMap<GeoMapSettings> {
protected createMap(): Observable<L.Map> {
const map = L.map(this.mapElement, {
...this.gestureHandlingMapOptions,
scrollWheelZoom: this.settings.zoomActions.includes(MapZoomAction.scroll),
doubleClickZoom: this.settings.zoomActions.includes(MapZoomAction.doubleClick),
zoomControl: this.settings.zoomActions.includes(MapZoomAction.controlButtons),

1
ui-ngx/src/app/modules/home/components/widget/lib/maps/image-map.ts

@ -201,6 +201,7 @@ export class TbImageMap extends TbMap<ImageMapSettings> {
if (!this.map && this.imageLayerData.aspect > 0) {
const center = this.pointToLatLng(this.width / 2, this.height / 2);
this.map = L.map(this.mapElement, {
...this.gestureHandlingMapOptions,
scrollWheelZoom: this.settings.zoomActions.includes(MapZoomAction.scroll),
doubleClickZoom: this.settings.zoomActions.includes(MapZoomAction.doubleClick),
zoomControl: this.settings.zoomActions.includes(MapZoomAction.controlButtons),

22
ui-ngx/src/app/modules/home/components/widget/lib/maps/leaflet/leaflet-tb.ts

@ -1,8 +1,10 @@
// 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 L, { TB } from 'leaflet';
import { guid, isDefinedAndNotNull, isNotEmptyStr } from '@core/utils';
import 'leaflet-providers';
import { GestureHandling } from 'leaflet-gesture-handling';
import { Map as MapLibreGLMap, setWorkerUrl } from 'maplibre-gl';
import '@geoman-io/leaflet-geoman-free';
import 'leaflet.markercluster';
@ -14,6 +16,24 @@ import { WEBGL_ERROR_EVENT } from '@shared/models/widget/maps/map.models';
L.MarkerCluster = L.MarkerCluster.mergeOptions({ pmIgnore: true });
const gestureProto = GestureHandling.prototype as any;
const originalHandleScroll = gestureProto._handleScroll;
gestureProto._enableInteractions = function(this: any) {
this._map.dragging.enable();
if (this._map.options.scrollWheelZoom) {
this._map.scrollWheelZoom.enable();
}
if (this._map.tap) {
this._map.tap.enable();
}
};
gestureProto._handleScroll = function(this: any, e: Event) {
if (!this._map.options.scrollWheelZoom) {
return;
}
originalHandleScroll.call(this, e);
};
L.Map.addInitHook(function () {
this._patterns = {};
});

27
ui-ngx/src/app/modules/home/components/widget/lib/maps/map.ts

@ -9,6 +9,7 @@ import {
mapDataLayerTypes,
MapScale,
MapType,
markersPaneZIndex,
mergeMapDatasources,
parseCenterPosition,
TbCircleData,
@ -76,6 +77,8 @@ import TooltipPositioningSide = JQueryTooltipster.TooltipPositioningSide;
type TooltipInstancesData = { root: HTMLElement, instances: ITooltipsterInstance[] };
const GESTURE_HANDLING_DURATION = 2000;
export abstract class TbMap<S extends BaseMapSettings> {
protected settings: S;
@ -262,7 +265,7 @@ export abstract class TbMap<S extends BaseMapSettings> {
this.latestDataLayers = [];
this.tripDataLayers = [];
if (this.settings.markers) {
const markersDataLayers = this.settings.markers.map(settings => new TbMarkersDataLayer(this, settings));
const markersDataLayers = this.settings.markers.map((settings, i) => new TbMarkersDataLayer(this, settings, i));
this.dataLayers.push(...markersDataLayers);
this.latestDataLayers.push(...markersDataLayers);
}
@ -1141,6 +1144,20 @@ export abstract class TbMap<S extends BaseMapSettings> {
protected abstract fitBounds(bounds: L.LatLngBounds): void;
protected get gestureHandlingMapOptions(): Pick<L.MapOptions, 'gestureHandling' | 'gestureHandlingOptions'> {
return {
gestureHandling: this.settings.useGestureHandling,
gestureHandlingOptions: {
duration: GESTURE_HANDLING_DURATION,
text: {
touch: this.ctx.translate.instant('widgets.maps.control.gesture-handling-touch'),
scroll: this.ctx.translate.instant('widgets.maps.control.gesture-handling-scroll'),
scrollMac: this.ctx.translate.instant('widgets.maps.control.gesture-handling-scroll-mac'),
}
}
};
}
protected doSetupControls(): Observable<any> {
return of(null);
}
@ -1204,6 +1221,14 @@ export abstract class TbMap<S extends BaseMapSettings> {
}
}
public getMarkersPane(markersLayerIndex: number): string {
const name = `tb-markers-pane-${markersLayerIndex}`;
if (!this.map.getPane(name)) {
this.map.createPane(name).style.zIndex = String(markersPaneZIndex(markersLayerIndex));
}
return name;
}
public storeShapePattern(patternId: string, pattern: L.TB.Pattern): void {
pattern.addTo(this.map);
this.shapePatternStorage[patternId] = {

3
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/set-value-action-settings-panel.component.html

@ -1,7 +1,8 @@
<!--
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
-->
<div class="tb-action-settings-panel" [formGroup]="setValueSettingsFormGroup">

3
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/set-value-action-settings-panel.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 { Component, DestroyRef, EventEmitter, Input, OnInit, Output, ViewEncapsulation } from '@angular/core';
import { PageComponent } from '@shared/components/page.component';
import { TbPopoverComponent } from '@shared/components/popover.component';

3
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/action/set-value-action-settings.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 {
ChangeDetectorRef,
Component,

10
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-settings.component.html

@ -1,7 +1,8 @@
<!--
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
-->
<ng-container [formGroup]="mapSettingsFormGroup">
@ -106,6 +107,13 @@
}
</mat-chip-listbox>
</div>
<div class="tb-form-row space-between column-xs">
<div tb-hint-tooltip-icon="{{ 'widgets.maps.control.gesture-handling-hint' | translate }}" translate>widgets.maps.control.gesture-handling</div>
<tb-toggle-select formControlName="useGestureHandling">
<tb-toggle-option [value]="false">{{ 'widgets.maps.control.gesture-handling-default' | translate }}</tb-toggle-option>
<tb-toggle-option [value]="true">{{ 'widgets.maps.control.gesture-handling-cooperative' | translate }}</tb-toggle-option>
</tb-toggle-select>
</div>
<div class="tb-form-row space-between column-lt-md">
<div translate>widgets.maps.control.scale</div>
<mat-chip-listbox multiple formControlName="scales">

4
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-settings.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 { Component, DestroyRef, forwardRef, Input, OnChanges, OnInit, SimpleChanges } from '@angular/core';
import {
ControlValueAccessor,
@ -136,6 +137,7 @@ export class MapSettingsComponent implements OnInit, ControlValueAccessor, Valid
additionalDataSources: [null, []],
controlsPosition: [null, []],
zoomActions: [null, []],
useGestureHandling: [null, []],
scales: [null, []],
dragModeButton: [null, []],
fitMapBounds: [null, []],

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

@ -195,7 +195,7 @@
<mat-label translate>integration.integration-key</mat-label>
<input matInput formControlName="routingKey">
</mat-form-field>
<button mat-icon-button ngxClipboard type="button" color="primary"
<button mat-icon-button ngxClipboard type="button"
(cbOnSuccess)="onIntegrationInfoCopied('key')"
[cbContent]="integrationConfigurationForm.get('routingKey').value"
matTooltip="{{'integration.copy-integration-key' | translate}}">
@ -207,7 +207,7 @@
<mat-label translate>integration.integration-secret</mat-label>
<input matInput formControlName="secret">
</mat-form-field>
<button mat-icon-button ngxClipboard type="button" color="primary"
<button mat-icon-button ngxClipboard type="button"
(cbOnSuccess)="onIntegrationInfoCopied('secret')"
[cbContent]="integrationConfigurationForm.get('secret').value"
matTooltip="{{'integration.copy-integration-secret' | translate}}">

19
ui-ngx/src/app/modules/home/dialogs/home-dialogs.service.ts

@ -36,6 +36,11 @@ import {
EntityGroupWizardDialogData,
EntityGroupWizardDialogResult
} from '@home/components/wizard/entity-group-wizard-dialog.component';
import { DashboardInfo } from '@shared/models/dashboard.models';
import {
DashboardInfoDialogData,
ImportDashboardFileDialogComponent
} from '@home/pages/dashboard/import-dashboard-file-dialog.component';
@Injectable()
export class HomeDialogsService {
@ -136,6 +141,20 @@ export class HomeDialogsService {
}).afterClosed();
}
public importDashboardFile($event: Event, dashboard: DashboardInfo): Observable<boolean> {
if ($event) {
$event.stopPropagation();
}
return this.dialog.open<ImportDashboardFileDialogComponent, DashboardInfoDialogData,
boolean>(ImportDashboardFileDialogComponent, {
disableClose: true,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
data: {
dashboard
}
}).afterClosed();
}
public selectOwner($event: Event, selectOwnerTitle: string, confirmSelectTitle: string,
placeholderText: string, notFoundText: string, requiredText: string,
onOwnerSelected?: (targetOwnerId: EntityId) => Observable<boolean>,

45
ui-ngx/src/app/modules/home/pages/admin/admin-routing.module.ts

@ -20,7 +20,13 @@ import { GeneralSettingsComponent } from '@home/pages/admin/general-settings.com
import { SecuritySettingsComponent } from '@modules/home/pages/admin/security-settings.component';
import { MailTemplatesComponent } from '@home/pages/admin/mail-templates.component';
import { forkJoin, mergeMap, Observable, of } from 'rxjs';
import { MailTemplatesSettings } from '@shared/models/settings.models';
import {
AdminSettings,
MailConfigTemplate,
MailServerSettings,
MailTemplatesSettings,
SmsProviderConfiguration
} from '@shared/models/settings.models';
import { WhiteLabelingComponent } from '@home/pages/admin/white-labeling.component';
import { SelfRegistrationComponent } from '@home/pages/admin/self-registration.component';
import { HomeSettingsComponent } from '@home/pages/admin/home-settings.component';
@ -59,6 +65,8 @@ import { AuthService } from '@core/auth/auth.service';
import { AppState } from '@core/core.state';
import { Store } from '@ngrx/store';
import { ActionUpdateLicenseParams } from '@core/auth/auth.actions';
import { NotificationService } from '@core/http/notification.service';
import { NotificationSettings } from '@shared/models/notification.models';
export const subscriptionInfoResolver: ResolveFn<SubscriptionInfo> = (
route: ActivatedRouteSnapshot,
@ -112,6 +120,35 @@ export const mailTemplateSettingsResolver: ResolveFn<MailTemplatesSettings> = (
wl = inject(WhiteLabelingService)
): Observable<MailTemplatesSettings> => wl.getMailTemplates(true);
export const mailServerSettingsResolver: ResolveFn<{
loginProcessingUrl: string;
mailConfigTemplate: Array<MailConfigTemplate>;
adminSettings: AdminSettings<MailServerSettings>;
}> = (
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
adminService = inject(AdminService)
) => forkJoin({
loginProcessingUrl: adminService.getLoginProcessingUrl(),
mailConfigTemplate: adminService.getMailConfigTemplate(),
adminSettings: adminService.getAdminSettings<MailServerSettings>('mail')
});
export const notificationsSettingsResolver: ResolveFn<{
notificationSettings: NotificationSettings;
smsProviderSettings: AdminSettings<SmsProviderConfiguration>;
}> = (
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
adminService = inject(AdminService),
notificationService = inject(NotificationService)
) => forkJoin({
notificationSettings: notificationService.getNotificationSettings(),
smsProviderSettings: adminService.getAdminSettings<SmsProviderConfiguration>('sms', false, {ignoreErrors: true}).pipe(
catchError(() => of({key: 'sms', jsonValue: null} as AdminSettings<SmsProviderConfiguration>))
)
});
export const scadaSymbolResolver: ResolveFn<ScadaSymbolData> =
(route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
@ -332,6 +369,9 @@ const routes: Routes = [
breadcrumb: {
menuId: MenuId.mail_server
}
},
resolve: {
mailServerSettings: mailServerSettingsResolver
}
},
{
@ -344,6 +384,9 @@ const routes: Routes = [
breadcrumb: {
menuId: MenuId.notification_settings
}
},
resolve: {
notificationsSettings: notificationsSettingsResolver
}
},
{

1
ui-ngx/src/app/modules/home/pages/admin/mail-server.component.html

@ -321,7 +321,6 @@
<input matInput formControlName="redirectUri" readonly>
<tb-copy-button
matSuffix
color="primary"
[copyText]="mailSettings.get('redirectUri').value"
tooltipText="{{ 'admin.oauth2.copy-redirect-uri' | translate }}"
tooltipPosition="above"

67
ui-ngx/src/app/modules/home/pages/admin/mail-server.component.ts

@ -25,10 +25,11 @@ import { AuthUser } from '@shared/models/user.model';
import { Authority } from '@shared/models/authority.enum';
import { UserPermissionsService } from '@core/http/user-permissions.service';
import { Operation, Resource } from '@shared/models/security.models';
import { forkJoin, Subject } from 'rxjs';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { DomainSchema, domainSchemaTranslations, } from '@shared/models/oauth2.models';
import { WINDOW } from '@core/services/window.service';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'tb-mail-server',
@ -132,6 +133,7 @@ export class MailServerComponent extends PageComponent implements OnInit, OnDest
private adminService: AdminService,
private translate: TranslateService,
private userPermissionsService: UserPermissionsService,
private route: ActivatedRoute,
public fb: FormBuilder,
@Inject(WINDOW) private window: Window) {
super(store);
@ -141,40 +143,35 @@ export class MailServerComponent extends PageComponent implements OnInit, OnDest
this.buildMailServerSettingsForm();
this.domainFormConfiguration();
forkJoin({
loginProcessingUrl: this.adminService.getLoginProcessingUrl(),
mailConfigTemplate: this.adminService.getMailConfigTemplate(),
adminSettings: this.adminService.getAdminSettings<MailServerSettings>('mail')
}).subscribe((data) => {
this.loginProcessingUrl = data.loginProcessingUrl;
this.initTemplates(data.mailConfigTemplate);
this.adminSettings = data.adminSettings;
if (this.adminSettings.jsonValue && isString(this.adminSettings.jsonValue.enableTls)) {
this.adminSettings.jsonValue.enableTls = (this.adminSettings.jsonValue.enableTls as any) === 'true';
}
if (!this.adminSettings.jsonValue.providerId) {
this.adminSettings.jsonValue.providerId = 'CUSTOM';
}
this.mailSettings.reset(this.adminSettings.jsonValue, {emitEvent: false});
if (this.isTenantAdmin()) {
this.mailSettings.get('useSystemMailSettings').setValue(
isDefined(this.adminSettings.jsonValue.useSystemMailSettings) ?
this.adminSettings.jsonValue.useSystemMailSettings : true, {emitEvent: false}
);
}
this.updateValidators();
this.enableTls(this.adminSettings.jsonValue.enableTls);
this.helpLink = this.templates.get(this.adminSettings.jsonValue.providerId)?.helpLink || null;
this.enableProxyChanged();
if (this.adminSettings.jsonValue.enableOauth2) {
this.enableOauth2(!!this.adminSettings.jsonValue.enableOauth2);
this.enableProviderTenantIdChanged(this.adminSettings.jsonValue.providerId);
this.parseUrl(this.adminSettings.jsonValue.redirectUri);
this.mailSettings.get('redirectUri').patchValue(this.adminSettings.jsonValue.redirectUri, {emitEvent: false});
} else {
this.mailSettings.get('enableOauth2').patchValue(false, {emitEvent: false});
}
})
const data = this.route.snapshot.data.mailServerSettings;
this.loginProcessingUrl = data.loginProcessingUrl;
this.initTemplates(data.mailConfigTemplate);
this.adminSettings = data.adminSettings;
if (this.adminSettings.jsonValue && isString(this.adminSettings.jsonValue.enableTls)) {
this.adminSettings.jsonValue.enableTls = (this.adminSettings.jsonValue.enableTls as any) === 'true';
}
if (!this.adminSettings.jsonValue.providerId) {
this.adminSettings.jsonValue.providerId = 'CUSTOM';
}
this.mailSettings.reset(this.adminSettings.jsonValue, {emitEvent: false});
if (this.isTenantAdmin()) {
this.mailSettings.get('useSystemMailSettings').setValue(
isDefined(this.adminSettings.jsonValue.useSystemMailSettings) ?
this.adminSettings.jsonValue.useSystemMailSettings : true, {emitEvent: false}
);
}
this.updateValidators();
this.enableTls(this.adminSettings.jsonValue.enableTls);
this.helpLink = this.templates.get(this.adminSettings.jsonValue.providerId)?.helpLink || null;
this.enableProxyChanged();
if (this.adminSettings.jsonValue.enableOauth2) {
this.enableOauth2(!!this.adminSettings.jsonValue.enableOauth2);
this.enableProviderTenantIdChanged(this.adminSettings.jsonValue.providerId);
this.parseUrl(this.adminSettings.jsonValue.redirectUri);
this.mailSettings.get('redirectUri').patchValue(this.adminSettings.jsonValue.redirectUri, {emitEvent: false});
} else {
this.mailSettings.get('enableOauth2').patchValue(false, {emitEvent: false});
}
}
ngOnDestroy() {

4
ui-ngx/src/app/modules/home/pages/admin/oauth2/domains/domain.component.html

@ -1,7 +1,8 @@
<!--
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
-->
<section class="tb-form-panel no-gap no-border" [class.no-padding]="isAdd" [formGroup]="entityForm">
@ -33,7 +34,6 @@
<tb-copy-button
matSuffix
miniButton="false"
color="primary"
[copyText]="redirectURI()"
tooltipText="{{ 'admin.oauth2.copy-redirect-uri' | translate }}"
tooltipPosition="above"

14
ui-ngx/src/app/modules/home/pages/admin/self-registration.component.html

@ -135,24 +135,24 @@
</fieldset>
<fieldset class="fields-group">
<legend class="group-title" translate>self-registration.privacy-policy-text</legend>
<div class="mat-content flex flex-col">
<mat-slide-toggle formControlName="showPrivacyPolicy">
<div class="flex flex-col gap-2">
<mat-slide-toggle class="pt-2" formControlName="showPrivacyPolicy">
{{ 'self-registration.show-privacy-policy' | translate }}
</mat-slide-toggle>
<div class="tb-privacy-policy mat-elevation-z1">
<div class="tb-privacy-policy">
<editor [init]="hugeRteOptions" id="privacy-policy"
formControlName="privacyPolicy">
</editor>
</div>
</div>
</fieldset>
<fieldset class="fields-group" style="margin-top: 20px">
<fieldset class="fields-group">
<legend class="group-title" translate>self-registration.terms-of-use-text</legend>
<div class="mat-content flex flex-col">
<mat-slide-toggle formControlName="showTermsOfUse">
<div class="flex flex-col gap-2">
<mat-slide-toggle class="pt-2" formControlName="showTermsOfUse">
{{ 'self-registration.show-terms-of-use' | translate }}
</mat-slide-toggle>
<div class="tb-terms-of-use mat-elevation-z1">
<div class="tb-terms-of-use">
<editor [init]="hugeRteOptions" id="terms-of-use"
formControlName="termsOfUse">
</editor>

4
ui-ngx/src/app/modules/home/pages/admin/self-registration.component.scss

@ -11,7 +11,9 @@
}
.tb-privacy-policy, .tb-terms-of-use {
min-height: 380px;
padding: 10px 2px;
}
tb-registration-permissions {
height: 380px;
}
}

30
ui-ngx/src/app/modules/home/pages/admin/sms-provider.component.ts

@ -19,6 +19,7 @@ import { getCurrentAuthUser } from '@core/auth/auth.selectors';
import { Operation, Resource } from '@shared/models/security.models';
import { UserPermissionsService } from '@core/http/user-permissions.service';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'tb-sms-provider',
@ -42,30 +43,17 @@ export class SmsProviderComponent extends PageComponent implements HasConfirmFor
private notificationService: NotificationService,
private dialog: MatDialog,
private userPermissionsService: UserPermissionsService,
private route: ActivatedRoute,
public fb: FormBuilder,
private destroyRef: DestroyRef) {
super(store);
this.buildSmsProviderForm();
this.buildGeneralServerSettingsForm();
this.notificationService.getNotificationSettings().subscribe(
(settings) => {
this.notificationSettings = settings;
this.setNotificationSettings(this.notificationSettings);
}
);
this.adminService.getAdminSettings<SmsProviderConfiguration>('sms', false, {ignoreErrors: true}).subscribe({
next: adminSettings => {
this.adminSettings = adminSettings;
this.setSmsProviderSettings(this.adminSettings.jsonValue);
},
error: () => {
this.adminSettings = {
key: 'sms',
jsonValue: null
};
this.setSmsProviderSettings(this.adminSettings.jsonValue);
}
});
const data = this.route.snapshot.data.notificationsSettings;
this.notificationSettings = data.notificationSettings;
this.setNotificationSettings(this.notificationSettings);
this.adminSettings = data.smsProviderSettings;
this.setSmsProviderSettings(this.adminSettings.jsonValue);
}
private setSmsProviderSettings(smsProviderConfiguration: SmsProviderConfiguration) {
@ -193,7 +181,9 @@ export class SmsProviderComponent extends PageComponent implements HasConfirmFor
if(this.readonly) {
this.notificationSettingsForm.disable({emitEvent: false});
} else {
this.isLoading$.subscribe((isLoading) => {
this.isLoading$.pipe(
takeUntilDestroyed(this.destroyRef)
).subscribe((isLoading) => {
if (isLoading) {
this.notificationSettingsForm.disable({emitEvent: false});
} else {

4
ui-ngx/src/app/modules/home/pages/custom-translation/translation-map-table.component.html

@ -74,7 +74,7 @@
tooltipText="{{ 'custom-translation.copy-term-key' | translate }}"
tooltipPosition="above"
icon="content_copy"
[style]="{padding: '4px', 'font-size': '16px', color: 'rgba(0,0,0,.87)'}"
[style]="{padding: '4px', 'font-size': '16px'}"
>
</tb-copy-button>
</div>
@ -93,7 +93,7 @@
tooltipText="{{ 'custom-translation.copy-original-text' | translate }}"
tooltipPosition="above"
icon="content_copy"
[style]="{padding: '4px', 'font-size': '16px', color: 'rgba(0,0,0,.87)'}"
[style]="{padding: '4px', 'font-size': '16px'}"
>
</tb-copy-button>
}

13
ui-ngx/src/app/modules/home/pages/dashboard/dashboard-group-config.factory.ts

@ -253,6 +253,16 @@ export class DashboardGroupConfigFactory implements EntityGroupStateConfigFactor
});
}
importDashboardFile($event: Event, dashboard: DashboardInfo, config: GroupEntityTableConfig<DashboardInfo>) {
this.homeDialogs.importDashboardFile($event, dashboard).subscribe(
(res) => {
if (res) {
config.updateData();
}
}
);
}
manageOwnerAndGroups($event: Event, dashboard: DashboardInfo, config: GroupEntityTableConfig<DashboardInfo>) {
this.homeDialogs.manageOwnerAndGroups($event, dashboard).subscribe(
(res) => {
@ -272,6 +282,9 @@ export class DashboardGroupConfigFactory implements EntityGroupStateConfigFactor
case 'export':
this.exportDashboard(action.event, action.entity);
return true;
case 'import':
this.importDashboardFile(action.event, action.entity, config);
return true;
case 'manageOwnerAndGroups':
this.manageOwnerAndGroups(action.event, action.entity, config);
return true;

24
ui-ngx/src/app/modules/home/pages/dashboard/dashboards-table-config.resolver.ts

@ -45,10 +45,6 @@ import {
EntityAliasesDialogData
} from '@home/components/alias/entity-aliases-dialog.component';
import { MatDialog } from '@angular/material/dialog';
import {
DashboardInfoDialogData,
ImportDashboardFileDialogComponent
} from "@home/pages/dashboard/import-dashboard-file-dialog.component";
import { UserPermissionsService } from '@core/http/user-permissions.service';
import { Operation, Resource } from '@shared/models/security.models';
import { DashboardUtilsService } from '@core/services/dashboard-utils.service';
@ -289,18 +285,14 @@ export class DashboardsTableConfigResolver {
this.importExport.exportDashboard(dashboard.id.id);
}
importDashboardFile($event: Event, dashboard: DashboardInfo) {
if ($event) {
$event.stopPropagation();
}
return this.dialog.open<ImportDashboardFileDialogComponent, DashboardInfoDialogData,
boolean>(ImportDashboardFileDialogComponent, {
disableClose: true,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
data: {
dashboard
importDashboardFile($event: Event, dashboard: DashboardInfo, config: EntityTableConfig<DashboardInfo>) {
this.homeDialogs.importDashboardFile($event, dashboard).subscribe(
(res) => {
if (res) {
config.updateData();
}
}
}).afterClosed();
);
}
manageOwnerAndGroups($event: Event, dashboard: DashboardInfo, config: EntityTableConfig<DashboardInfo>) {
@ -322,7 +314,7 @@ export class DashboardsTableConfigResolver {
this.exportDashboard(action.event, action.entity);
return true;
case 'import':
this.importDashboardFile(action.event, action.entity);
this.importDashboardFile(action.event, action.entity, config);
return true;
case 'manageOwnerAndGroups':
this.manageOwnerAndGroups(action.event, action.entity, config);

4
ui-ngx/src/app/modules/home/pages/integration/integration.component.html

@ -134,7 +134,7 @@
<mat-label translate>integration.integration-key</mat-label>
<input matInput formControlName="routingKey">
</mat-form-field>
<button mat-icon-button ngxClipboard type="button" color="primary"
<button mat-icon-button ngxClipboard type="button"
(cbOnSuccess)="onIntegrationInfoCopied('key')"
[cbContent]="entityForm?.get('routingKey').value"
matTooltip="{{'integration.copy-integration-key' | translate}}">
@ -146,7 +146,7 @@
<mat-label translate>integration.integration-secret</mat-label>
<input matInput formControlName="secret">
</mat-form-field>
<button mat-icon-button ngxClipboard type="button" color="primary"
<button mat-icon-button ngxClipboard type="button"
(cbOnSuccess)="onIntegrationInfoCopied('secret')"
[cbContent]="entityForm?.get('secret').value"
matTooltip="{{'integration.copy-integration-secret' | translate}}">

6
ui-ngx/src/app/modules/home/pages/mobile/applications/mobile-app-table-config.resolver.ts

@ -66,8 +66,7 @@ export class MobileAppTableConfigResolver {
icon: 'content_copy',
style: {
padding: '4px',
'font-size': '16px',
color: 'rgba(0,0,0,.54)'
'font-size': '16px'
},
isEnabled: (entity) => !!entity.pkgName,
onAction: (_$event, entity) => entity.pkgName,
@ -82,8 +81,7 @@ export class MobileAppTableConfigResolver {
icon: 'content_copy',
style: {
padding: '4px',
'font-size': '16px',
color: 'rgba(0,0,0,.54)'
'font-size': '16px'
},
isEnabled: (entity) => !!entity.appSecret,
onAction: (_$event, entity) => entity.appSecret,

33
ui-ngx/src/app/modules/home/pages/mobile/qr-code-widget/mobile-qr-code-widget-settings-routing.module.ts

@ -1,13 +1,37 @@
// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-License-Identifier: Apache-2.0
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
import { inject, NgModule } from '@angular/core';
import { ActivatedRouteSnapshot, ResolveFn, RouterModule, RouterStateSnapshot, Routes } from '@angular/router';
import { Authority } from '@shared/models/authority.enum';
import { MenuId } from '@core/services/menu.models';
import {
MobileQrCodeWidgetSettingsComponent
} from '@home/pages/mobile/qr-code-widget/mobile-qr-code-widget-settings.component';
import { ConfirmOnExitGuard } from '@core/guards/confirm-on-exit.guard';
import { forkJoin, of } from 'rxjs';
import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state';
import { getCurrentAuthUser } from '@core/auth/auth.selectors';
import { MobileApplicationService } from '@core/http/mobile-application.service';
import { WhiteLabelingService } from '@core/http/white-labeling.service';
import { QrCodeSettings } from '@shared/models/mobile-app.models';
import { LoginWhiteLabelingParams } from '@shared/models/white-labeling.models';
export const qrCodeWidgetSettingsResolver: ResolveFn<{
mobileAppSettings: QrCodeSettings;
loginWhiteLabelParams: LoginWhiteLabelingParams;
}> = (
route: ActivatedRouteSnapshot,
state: RouterStateSnapshot,
store = inject(Store<AppState>),
mobileAppService = inject(MobileApplicationService),
wl = inject(WhiteLabelingService)
) => forkJoin({
mobileAppSettings: mobileAppService.getMobileAppSettings(),
loginWhiteLabelParams: getCurrentAuthUser(store).authority === Authority.TENANT_ADMIN ?
wl.getCurrentLoginWhiteLabelParams() : of(null as LoginWhiteLabelingParams)
});
export const qrCodeWidgetRoutes: Routes = [
{
@ -20,6 +44,9 @@ export const qrCodeWidgetRoutes: Routes = [
breadcrumb: {
menuId: MenuId.mobile_qr_code_widget
}
},
resolve: {
qrCodeWidgetSettings: qrCodeWidgetSettingsResolver
}
}
];

17
ui-ngx/src/app/modules/home/pages/mobile/qr-code-widget/mobile-qr-code-widget-settings.component.ts

@ -16,7 +16,7 @@ import { Authority } from '@shared/models/authority.enum';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { Operation, Resource } from '@shared/models/security.models';
import { UserPermissionsService } from '@core/http/user-permissions.service';
import { WhiteLabelingService } from '@core/http/white-labeling.service';
import { ActivatedRoute } from '@angular/router';
@Component({
selector: 'tb-mobile-qr-code-widget',
@ -55,15 +55,8 @@ export class MobileQrCodeWidgetSettingsComponent extends PageComponent implement
private mobileAppService: MobileApplicationService,
private fb: FormBuilder,
private userPermissionsService: UserPermissionsService,
private wl: WhiteLabelingService) {
private route: ActivatedRoute) {
super(store);
this.mobileAppService.getMobileAppSettings()
.subscribe(settings => this.processMobileAppSettings(settings));
if(this.isTenantAdmin()) {
this.wl.getCurrentLoginWhiteLabelParams().subscribe(value => this.setBaseURL = !!value.baseUrl);
}
if (this.readonly) {
this.mobileAppSettingsForm.disable()
} else {
@ -142,6 +135,12 @@ export class MobileQrCodeWidgetSettingsComponent extends PageComponent implement
}
});
}
const data = this.route.snapshot.data.qrCodeWidgetSettings;
if (this.isTenantAdmin()) {
this.setBaseURL = !!data.loginWhiteLabelParams.baseUrl;
}
this.processMobileAppSettings(data.mobileAppSettings);
}
public isTenantAdmin(): boolean {

7
ui-ngx/src/app/modules/home/pages/notification/settings/notification-settings-routing.modules.ts

@ -1,9 +1,10 @@
// 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 { Routes } from '@angular/router';
import { ConfirmOnExitGuard } from '@core/guards/confirm-on-exit.guard';
import { Authority } from '@shared/models/authority.enum';
import { inject, NgModule } from '@angular/core';
import { inject } from '@angular/core';
import { NotificationSettingsComponent } from '@home/pages/notification/settings/notification-settings.component';
import { NotificationService } from '@core/http/notification.service';
@ -17,7 +18,7 @@ export const notificationUserSettingsRoutes: Routes = [
title: 'account.notification-settings',
breadcrumb: {
label: 'account.notification-settings',
icon: 'settings'
icon: 'mdi:cog-outline'
}
},
resolve: {

6
ui-ngx/src/app/modules/home/pages/ota-update/ota-update-table-config.resolve.ts

@ -65,8 +65,7 @@ export class OtaUpdateTableConfigResolve {
icon: 'content_paste',
style: {
padding: '4px',
'font-size': '16px',
color: 'rgba(0,0,0,.87)'
'font-size': '16px'
},
isEnabled: (otaPackage) => !!otaPackage.url,
onAction: (_$event, entity) => entity.url,
@ -86,8 +85,7 @@ export class OtaUpdateTableConfigResolve {
icon: 'content_paste',
style: {
padding: '4px',
'font-size': '16px',
color: 'rgba(0,0,0,.87)'
'font-size': '16px'
},
isEnabled: (otaPackage) => !!otaPackage.checksum,
onAction: (_$event, entity) => entity.checksum,

2
ui-ngx/src/app/modules/home/pages/profile/profile-routing.module.ts

@ -48,7 +48,7 @@ export const profileRoutes: Routes = [
title: 'profile.profile',
breadcrumb: {
label: 'profile.profile',
icon: 'account_circle'
icon: 'mdi:account-circle-outline'
}
},
resolve: {

5
ui-ngx/src/app/modules/home/pages/security/security-routing.module.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 { Injectable, NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
@ -49,7 +50,7 @@ export const securityRoutes: Routes = [
title: 'security.security',
breadcrumb: {
label: 'security.security',
icon: 'lock'
icon: 'mdi:lock-outline'
}
},
resolve: {

1
ui-ngx/src/app/modules/home/pages/user/activation-link-dialog.component.html

@ -27,7 +27,6 @@
<div class="flex flex-row items-center justify-start">
<pre class="tb-highlight flex-1"><code>{{ activationLink }}</code></pre>
<button mat-icon-button
color="primary"
ngxClipboard
cbContent="{{ activationLink }}"
(cbOnSuccess)="onActivationLinkCopied()"

2
ui-ngx/src/app/shared/components/button/copy-button.component.scss

@ -14,7 +14,7 @@
color: #00C851 !important;
}
&:hover{
.mat-icon{
.mat-mdc-icon-button:not(:disabled) .mat-icon:not(.copied){
color: var(--tb-primary-500) !important;
}
}

2
ui-ngx/src/app/shared/components/popover.component.scss

@ -1,12 +1,12 @@
// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
@import '../../../scss/constants';
@import '../../../scss/mixins';
$popover-arrow-width: 6;
$popover-distance: $popover-arrow-width + 4;
$zindex-popover: 1030;
$popover-bg: #fff;
$border-radius-base: 6px;
$popover-close-button-size: 30px;
$box-shadow-base: 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 6px 16px 0 rgba(0, 0, 0, 0.08),

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

@ -73,7 +73,7 @@
</button>
</div>
</mat-toolbar>
<div [class.flex-1]="groupPermissionsMode === 'group'" class="table-container">
<div class="table-container flex-1">
<table mat-table [dataSource]="dataSource"
matSort [matSortActive]="pageLink.sortOrder.property" [matSortDirection]="pageLink.sortDirection()" matSortDisableClear>
<ng-container matColumnDef="select" sticky>

13
ui-ngx/src/app/shared/components/user-menu.component.html

@ -40,14 +40,15 @@
@if (collapsed) {
@let fullName = userFullName$ | async;
@if (fullName?.length > 0) {
<div class="tb-user-name">
{{ fullName }}
</div>
<div tbTruncateWithTooltip class="tb-user-name">{{ fullName }}</div>
}
}
<div class="tb-user-email">
{{ userEmail$ | async }}
</div>
@if (userEmail$ | async; as email) {
<div class="tb-user-email">
<span class="tb-email-local" [tbTruncateWithTooltip]="email.full">{{ email.local }}</span>
<span class="tb-email-domain" [tbTruncateWithTooltip]="email.full">{{ email.domain }}</span>
</div>
}
</div>
<button mat-button (click)="menuPopoverFull?.hide(); menuPopoverIcon?.hide(); openAccount()">
<tb-icon matButtonIcon>mdi:account-circle-outline</tb-icon>

31
ui-ngx/src/app/shared/components/user-menu.component.scss

@ -90,6 +90,7 @@ tb-user-menu {
.tb-user-menu-items {
min-width: 250px;
max-width: 320px;
display: flex;
flex-direction: column;
.tb-user-menu-header {
@ -102,17 +103,35 @@ tb-user-menu {
font-size: 14px;
font-weight: 600;
color: rgba(0, 0, 0, 0.87);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.tb-user-email {
display: flex;
font-size: 13px;
line-height: 16px;
color: rgba(0,0,0,0.6);
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
.tb-email-local, .tb-email-domain {
flex: 2 1 0;
min-width: 0;
max-width: max-content;
}
@supports (container-type: scroll-state) {
.tb-email-local {
container-type: scroll-state;
text-overflow: clip !important;
}
@container scroll-state(scrollable: inline-end) {
.tb-email-local::after {
content: "…";
position: sticky;
right: 0;
padding-left: 0.6em;
background: linear-gradient(to right, transparent, $popover-bg 0.6em);
}
}
}
.tb-email-domain {
flex-grow: 3;
}
}
.mat-mdc-button {
&:hover {

13
ui-ngx/src/app/shared/components/user-menu.component.ts

@ -58,7 +58,7 @@ export class UserMenuComponent {
userEmail$ = this.store.pipe(
select(selectUserDetails),
map((user) => user?.email)
map((user) => this.splitEmail(user?.email))
);
constructor(private store: Store<AppState>,
@ -118,6 +118,17 @@ export class UserMenuComponent {
}
}
private splitEmail(email: string): {full: string; local: string; domain: string} {
if (!email) {
return null;
}
const atIndex = email.lastIndexOf('@');
if (atIndex <= 0) {
return {full: email, local: email, domain: ''};
}
return {full: email, local: email.substring(0, atIndex), domain: email.substring(atIndex)};
}
openAccount(): void {
this.menuClicked.emit();
this.router.navigate(['account']);

2
ui-ngx/src/app/shared/import-export/import-dialog-csv.component.ts

@ -123,7 +123,7 @@ export class ImportDialogCsvComponent extends DialogComponent<ImportDialogCsvCom
ngAfterViewInit() {
let columns = this.columnsAssignmentComponent.columnTypes;
if (this.entityType === EntityType.DEVICE) {
columns = columns.concat(this.columnsAssignmentComponent.columnDeviceCredentials);
columns = columns.concat(this.columnsAssignmentComponent.columnDeviceCredentials, this.columnsAssignmentComponent.columnDeviceGateway);
}
this.allowAssignColumn = columns.map(column => column.value);
}

2
ui-ngx/src/app/shared/import-export/import-export.models.ts

@ -58,6 +58,7 @@ export enum ImportEntityColumnType {
snmpVersion = 'SNMP_VERSION',
snmpCommunityString = 'SNMP_COMMUNITY_STRING',
isGateway = 'IS_GATEWAY',
overwriteActivityTime = 'OVERWRITE_ACTIVITY_TIME',
description = 'DESCRIPTION',
edgeLicenseKey = 'EDGE_LICENSE_KEY',
cloudEndpoint = 'CLOUD_ENDPOINT',
@ -95,6 +96,7 @@ export const importEntityColumnTypeTranslations = new Map<ImportEntityColumnType
[ImportEntityColumnType.snmpVersion, 'import.column-type.snmp.version'],
[ImportEntityColumnType.snmpCommunityString, 'import.column-type.snmp.community-string'],
[ImportEntityColumnType.isGateway, 'import.column-type.isgateway'],
[ImportEntityColumnType.overwriteActivityTime, 'device.overwrite-activity-time'],
[ImportEntityColumnType.description, 'import.column-type.description'],
[ImportEntityColumnType.edgeLicenseKey, 'import.column-type.edge-license-key'],
[ImportEntityColumnType.cloudEndpoint, 'import.column-type.cloud-endpoint'],

10
ui-ngx/src/app/shared/import-export/table-columns-assignment.component.html

@ -1,7 +1,8 @@
<!--
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
-->
<table mat-table [dataSource]="dataSource">
@ -34,6 +35,13 @@
</mat-option>
}
</mat-optgroup>
<mat-optgroup label="{{ 'import.gateway' | translate }}">
@for (gatewayColumn of columnDeviceGateway; track gatewayColumn) {
<mat-option [value]="gatewayColumn.value" [disabled]="gatewayColumn.disabled">
{{ columnTypesTranslations.get(gatewayColumn.value) | translate }}
</mat-option>
}
</mat-optgroup>
}
</mat-select>
</mat-cell>

18
ui-ngx/src/app/shared/import-export/table-columns-assignment.component.ts

@ -47,6 +47,8 @@ export class TableColumnsAssignmentComponent implements OnInit, ControlValueAcce
columnDeviceCredentials: AssignmentColumnType[] = [];
columnDeviceGateway: AssignmentColumnType[] = [];
columnTypesTranslations = importEntityColumnTypeTranslations;
readonly entityTypeDevice = EntityType.DEVICE;
@ -76,8 +78,11 @@ export class TableColumnsAssignmentComponent implements OnInit, ControlValueAcce
this.columnTypes.push(
{ value: ImportEntityColumnType.sharedAttribute },
{ value: ImportEntityColumnType.serverAttribute },
{ value: ImportEntityColumnType.timeseries },
{ value: ImportEntityColumnType.isGateway }
{ value: ImportEntityColumnType.timeseries }
);
this.columnDeviceGateway.push(
{ value: ImportEntityColumnType.isGateway },
{ value: ImportEntityColumnType.overwriteActivityTime }
);
this.columnDeviceCredentials.push(
{ value: ImportEntityColumnType.accessToken },
@ -155,12 +160,9 @@ export class TableColumnsAssignmentComponent implements OnInit, ControlValueAcce
this.columnTypes.find((columnType) => columnType.value === ImportEntityColumnType.description).disabled = isSelectDescription;
if (this.entityType === EntityType.DEVICE) {
const isSelectGateway = this.columns.findIndex((column) => column.type === ImportEntityColumnType.isGateway) > -1;
const isGatewayColumnType = this.columnTypes.find((columnType) => columnType.value === ImportEntityColumnType.isGateway);
if (isGatewayColumnType) {
isGatewayColumnType.disabled = isSelectGateway;
}
this.columnDeviceGateway.forEach((columnType) => {
columnType.disabled = this.columns.findIndex(column => column.type === columnType.value) > -1;
});
this.columnDeviceCredentials.forEach((columnCredential) => {
columnCredential.disabled = this.columns.findIndex(column => column.type === columnCredential.value) > -1;

63
ui-ngx/src/app/shared/models/widget-settings.models.ts

@ -21,15 +21,15 @@ import {
TargetDeviceType,
widgetType
} from '@shared/models/widget.models';
import { EventEmitter, Injector } from '@angular/core';
import { EventEmitter, Injector, NgZone } from '@angular/core';
import { DatePipe } from '@angular/common';
import { DateAgoPipe } from '@shared/pipe/date-ago.pipe';
import { DateAgoPipe, nextAgoChangeDelay } from '@shared/pipe/date-ago.pipe';
import { TranslateService } from '@ngx-translate/core';
import { AlarmFilterConfig } from '@shared/models/query/query.models';
import { AlarmSearchStatus } from '@shared/models/alarm.models';
import { EMPTY, Observable, of } from 'rxjs';
import { BehaviorSubject, EMPTY, Observable, of, Subscription, timer } from 'rxjs';
import { ImagePipe } from '@shared/pipe/image.pipe';
import { map } from 'rxjs/operators';
import { distinctUntilChanged, filter, map, share, switchMap } from 'rxjs/operators';
import { DomSanitizer } from '@angular/platform-browser';
import {
AVG_MONTH,
@ -845,6 +845,8 @@ export abstract class DateFormatProcessor {
protected settings: DateFormatSettings) {
}
formattedUpdated?: Observable<void>;
abstract update(ts: string | number | Date, interval?: Interval): string;
}
@ -874,29 +876,58 @@ export class LastUpdateAgoDateFormatProcessor extends DateFormatProcessor {
private dateAgoPipe: DateAgoPipe;
private translate: TranslateService;
private ngZone: NgZone;
private readonly ts$ = new BehaviorSubject<number>(null);
readonly formattedUpdated: Observable<void> = this.ts$.pipe(
distinctUntilChanged(),
switchMap(ts => this.agoTicks(ts)),
map(() => this.format(this.ts$.value)),
filter(text => text !== this.formatted),
map(text => {
this.formatted = text;
}),
share()
);
constructor(protected $injector: Injector,
protected settings: DateFormatSettings) {
super($injector, settings);
this.dateAgoPipe = $injector.get(DateAgoPipe);
this.translate = $injector.get(TranslateService);
this.ngZone = $injector.get(NgZone);
}
update(ts: string| number | Date): string {
if (ts) {
const agoText = this.dateAgoPipe.transform(ts, {applyAgo: true, short: true, textPart: true});
if (this.settings.hideLastUpdatePrefix) {
this.formatted = agoText;
} else {
this.formatted = this.translate.instant('date.last-update-n-ago-text',
{agoText});
}
} else {
this.formatted = '&nbsp;';
}
update(ts: string | number | Date): string {
this.ts$.next(ts ? +new Date(ts) : null);
this.formatted = ts ? this.format(ts) : '&nbsp;';
return this.formatted;
}
private format(ts: string | number | Date): string {
const agoText = this.dateAgoPipe.transform(ts, {applyAgo: true, short: true, textPart: true});
return this.settings.hideLastUpdatePrefix
? agoText
: this.translate.instant('date.last-update-n-ago-text', {agoText});
}
private agoTicks(ts: number): Observable<void> {
return new Observable<void>(subscriber => {
let tick: Subscription;
const schedule = () => {
const delay = nextAgoChangeDelay(ts);
if (delay !== null) {
tick = timer(delay).subscribe(() => {
subscriber.next();
schedule();
});
}
};
this.ngZone.runOutsideAngular(schedule);
return () => tick?.unsubscribe();
});
}
}
export class AutoDateFormatProcessor extends DateFormatProcessor {

2
ui-ngx/src/app/shared/models/widget.models.ts

@ -321,6 +321,8 @@ export const legendPositionTranslationMap = new Map<LegendPosition, string>(
]
);
export const compareLegendDataKeys = (a: DataKey, b: DataKey): number => a.label.localeCompare(b.label);
export interface LegendConfig {
position: LegendPosition;
direction?: LegendDirection;

8
ui-ngx/src/app/shared/models/widget/maps/map.models.ts

@ -32,6 +32,12 @@ import { MarkerIconContainer, MarkerShape } from '@shared/models/widget/maps/mar
import { ColorRange, DateFormatSettings, simpleDateFormat } from '@shared/models/widget-settings.models';
import _ from 'lodash';
const LEAFLET_SHADOW_PANE_Z_INDEX = 500;
const LEAFLET_MARKER_PANE_Z_INDEX = 600;
export const markersPaneZIndex = (markersLayerIndex: number): number =>
Math.max(LEAFLET_SHADOW_PANE_Z_INDEX + 1, LEAFLET_MARKER_PANE_Z_INDEX - 1 - markersLayerIndex);
export enum MapType {
geoMap = 'geoMap',
image = 'image'
@ -863,6 +869,7 @@ export interface BaseMapSettings {
additionalDataSources: AdditionalMapDataSourceSettings[];
controlsPosition: MapControlsPosition;
zoomActions: MapZoomAction[];
useGestureHandling: boolean;
scales: MapScale[];
dragModeButton: boolean;
fitMapBounds: boolean;
@ -888,6 +895,7 @@ export const defaultBaseMapSettings: BaseMapSettings = {
additionalDataSources: [],
controlsPosition: MapControlsPosition.topleft,
zoomActions: [MapZoomAction.scroll, MapZoomAction.doubleClick, MapZoomAction.controlButtons],
useGestureHandling: false,
scales: [],
dragModeButton: false,
fitMapBounds: true,

22
ui-ngx/src/app/shared/pipe/date-ago.pipe.ts

@ -25,6 +25,26 @@ const intervalsLong = {
seconds: SECOND
};
const JUST_NOW_THRESHOLD = 29 * SECOND;
export const nextAgoChangeDelay = (ts: number): number | null => {
if (!Number.isFinite(ts)) {
return null;
}
const age = Date.now() - ts;
if (age < JUST_NOW_THRESHOLD) {
return Math.min(JUST_NOW_THRESHOLD - age, DAY);
}
let largerUnit = Infinity;
for (const unit of Object.values(intervals)) {
if (age >= unit) {
return Math.min(unit - age % unit, largerUnit - age, DAY);
}
largerUnit = unit;
}
return null;
};
@Pipe({
name: 'dateAgo',
standalone: false
@ -42,7 +62,7 @@ export class DateAgoPipe implements PipeTransform {
const long = !!args?.long;
const textPart = !!args?.textPart;
const ms = Math.floor((+new Date() - +new Date(value)));
if (ms < 29 * SECOND) { // less than 30 seconds ago will show as 'Just now'
if (ms < JUST_NOW_THRESHOLD) {
return this.translate.instant(textPart ? 'timewindow.just-now-lower' : 'timewindow.just-now');
}
let counter;

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

@ -3362,7 +3362,6 @@
"community-string": "سلسلة المجتمع SNMP"
},
"isgateway": "هل هو بوابة",
"activity-time-from-gateway-device": "وقت النشاط من جهاز البوابة",
"description": "الوصف",
"edge-license-key": "مفتاح الترخيص",
"cloud-endpoint": "نقطة نهاية السحابة",

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

@ -2821,7 +2821,6 @@
"lwm2m-server-public-key-id": "ID o clau pública del servidor LwM2M"
},
"isgateway": "Es Gateway",
"activity-time-from-gateway-device": "Data d'activitat des del dispositiu gateway",
"description": "Descripció",
"edge-license-key": "Clau de llicència",
"cloud-endpoint": "Punt final del núvol",

1
ui-ngx/src/assets/locale/locale.constant-cs_CZ.json

@ -2133,7 +2133,6 @@
"entity-field": "Pole entity",
"access-token": "Přístupový token",
"isgateway": "Je bránou",
"activity-time-from-gateway-device": "Čas aktivity ze zařízení brány",
"description": "Popis",
"edge-license-key": "Licenční klíč",
"cloud-endpoint": "Cloud Endpoint",

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

@ -5426,7 +5426,6 @@
"community-string": "SNMP-community-streng"
},
"isgateway": "Er Gateway",
"activity-time-from-gateway-device": "Aktivitetstid fra gateway-enhed",
"description": "Beskrivelse",
"edge-license-key": "Licensnøgle",
"cloud-endpoint": "Cloud Endpoint",

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

@ -5424,7 +5424,6 @@
"community-string": "SNMP-Community-String"
},
"isgateway": "Ist Gateway",
"activity-time-from-gateway-device": "Aktivitätszeit vom Gateway-Gerät",
"description": "Beschreibung",
"edge-license-key": "Lizenzschlüssel",
"cloud-endpoint": "Cloud-Endpunkt",

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

@ -5426,7 +5426,6 @@
"community-string": "Community string SNMP"
},
"isgateway": "Είναι Gateway",
"activity-time-from-gateway-device": "Χρόνος δραστηριότητας από συσκευή Gateway",
"description": "Περιγραφή",
"edge-license-key": "Κλειδί άδειας χρήσης",
"cloud-endpoint": "Τελικό σημείο Cloud",

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

@ -5409,6 +5409,7 @@
"column-example": "Example value data",
"column-key": "Attribute/telemetry key",
"credentials": "Credentials",
"gateway": "Gateway",
"csv-delimiter": "CSV delimiter",
"csv-first-line-header": "First line contains column names",
"csv-update-data": "Update attributes/telemetry",
@ -5452,7 +5453,6 @@
"community-string": "SNMP community string"
},
"isgateway": "Is Gateway",
"activity-time-from-gateway-device": "Activity time from gateway device",
"description": "Description",
"edge-license-key": "License Key",
"cloud-endpoint": "Cloud Endpoint",
@ -12681,6 +12681,13 @@
"zoom-scroll": "Scroll",
"zoom-double-click": "Double click",
"zoom-control-buttons": "Control buttons",
"gesture-handling": "Gesture handling",
"gesture-handling-hint": "Defines how the map reacts while users scroll the page. 'Default' - the mouse wheel zooms the map and one finger moves it. 'Cooperative' - the page keeps scrolling; hold Ctrl/⌘ while scrolling to zoom the map, and use two fingers to move it on touch devices.",
"gesture-handling-default": "Default",
"gesture-handling-cooperative": "Cooperative",
"gesture-handling-touch": "Use two fingers to move the map",
"gesture-handling-scroll": "Use Ctrl + scroll to zoom the map",
"gesture-handling-scroll-mac": "Use ⌘ + scroll to zoom the map",
"scale": "Scale",
"scale-metric": "Metric",
"scale-imperial": "Imperial",

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

@ -5424,7 +5424,6 @@
"community-string": "Cadena de comunidad SNMP"
},
"isgateway": "Es Gateway",
"activity-time-from-gateway-device": "Hora de actividad desde dispositivo Gateway",
"description": "Descripción",
"edge-license-key": "Clave de licencia",
"cloud-endpoint": "Endpoint de la nube",

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

@ -5424,7 +5424,6 @@
"community-string": "Chaîne de communauté SNMP"
},
"isgateway": "Est une Gateway",
"activity-time-from-gateway-device": "Heure d’activité depuis l’appareil Gateway",
"description": "Description",
"edge-license-key": "Clé de licence",
"cloud-endpoint": "Point de terminaison Cloud",

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

@ -5452,7 +5452,6 @@
"community-string": "SNMP कम्युनिटी स्ट्रिंग"
},
"isgateway": "Gateway है",
"activity-time-from-gateway-device": "Gateway डिवाइस से गतिविधि समय",
"description": "विवरण",
"edge-license-key": "Edge लाइसेंस कुंजी",
"cloud-endpoint": "क्लाउड एंडपॉइंट",

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

@ -5424,7 +5424,6 @@
"community-string": "Stringa community SNMP"
},
"isgateway": "È un gateway",
"activity-time-from-gateway-device": "Orario attività dal dispositivo gateway",
"description": "Descrizione",
"edge-license-key": "Chiave licenza",
"cloud-endpoint": "Endpoint cloud",

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

@ -5424,7 +5424,6 @@
"community-string": "SNMPコミュニティ文字列"
},
"isgateway": "Gatewayかどうか",
"activity-time-from-gateway-device": "Gatewayデバイスからの活動時間",
"description": "説明",
"edge-license-key": "ライセンスキー",
"cloud-endpoint": "クラウドエンドポイント",

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

File diff suppressed because it is too large

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

File diff suppressed because it is too large

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

File diff suppressed because it is too large

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

@ -5424,7 +5424,6 @@
"community-string": "SNMP community string"
},
"isgateway": "Is Gateway",
"activity-time-from-gateway-device": "Activiteitstijd van gatewayapparaat",
"description": "Beschrijving",
"edge-license-key": "Licentiesleutel",
"cloud-endpoint": "Cloud endpoint",

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

@ -5426,7 +5426,6 @@
"community-string": "SNMP-fellesskapsstreng"
},
"isgateway": "Er gateway",
"activity-time-from-gateway-device": "Aktivitetstid fra gateway-enhet",
"description": "Beskrivelse",
"edge-license-key": "Lisensnøkkel",
"cloud-endpoint": "Cloud-endepunkt",

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

File diff suppressed because it is too large

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

@ -5424,7 +5424,6 @@
"community-string": "String de comunidade SNMP"
},
"isgateway": "É Gateway",
"activity-time-from-gateway-device": "Tempo de atividade do dispositivo gateway",
"description": "Descrição",
"edge-license-key": "Chave de licença",
"cloud-endpoint": "Cloud Endpoint",

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

@ -5442,7 +5442,6 @@
"community-string": "Niz skupnosti SNMP"
},
"isgateway": "Je Gateway",
"activity-time-from-gateway-device": "Čas aktivnosti iz naprave Gateway",
"description": "Opis",
"edge-license-key": "Licenčni ključ",
"cloud-endpoint": "Končna točka v oblaku",

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

@ -5426,7 +5426,6 @@
"community-string": "SNMP topluluk dizesi"
},
"isgateway": "Gateway mi",
"activity-time-from-gateway-device": "Gateway cihazından etkinlik zamanı",
"description": "Açıklama",
"edge-license-key": "Lisans Anahtarı",
"cloud-endpoint": "Bulut Uç Noktası",

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

@ -5424,7 +5424,6 @@
"community-string": "Рядок спільноти SNMP"
},
"isgateway": "Це Gateway",
"activity-time-from-gateway-device": "Час активності з пристрою Gateway",
"description": "Опис",
"edge-license-key": "Ліцензійний ключ",
"cloud-endpoint": "Кінцева точка хмари",

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

@ -5426,7 +5426,6 @@
"community-string": "SNMP 团体字符串"
},
"isgateway": "是否为 Gateway",
"activity-time-from-gateway-device": "来自 Gateway 设备的活动时间",
"description": "描述",
"edge-license-key": "许可证密钥",
"cloud-endpoint": "Cloud Endpoint",

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

@ -3299,7 +3299,6 @@
"lwm2m-server-public-key-id": "LwM2M 伺服器公鑰或識別碼"
},
"isgateway": "是否為 Gateway",
"activity-time-from-gateway-device": "來自 Gateway 裝置的活動時間",
"description": "描述",
"routing-key": "Edge 金鑰",
"secret": "Edge 密鑰",

2
ui-ngx/src/scss/constants.scss

@ -20,4 +20,6 @@ $mat-gt-xxl: "screen and (min-width: 2448px)";
$mat-gt-xl: "screen and (min-width: 1920px)";
$mat-md-lg: "screen and (min-width: 960px) and (max-width: 1819px)";
$popover-bg: #fff;
$sidenav-anim-timing: 400ms cubic-bezier(0.25, 0.8, 0.25, 1);

7
ui-ngx/src/typings/leaflet-extend-tb.d.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 { FormattedData } from '@shared/models/widget.models';
import L from 'leaflet';
import { Map as MapLibreGLMap, MapOptions as MapLibreGLMapOptions } from 'maplibre-gl';
@ -8,6 +9,10 @@ import { MatIconRegistry } from '@angular/material/icon';
// redeclare module, maintains compatibility with @types/leaflet
declare module 'leaflet' {
interface MapOptions {
gestureHandling?: boolean;
gestureHandlingOptions?: { duration?: number; text?: { touch?: string; scroll?: string; scrollMac?: string } };
}
interface MarkerOptions {
tbMarkerData?: FormattedData<TbMapDatasource>;
}

5
ui-ngx/yarn.lock

@ -5895,6 +5895,11 @@ lazystream@^1.0.0:
dependencies:
readable-stream "^2.0.5"
leaflet-gesture-handling@1.2.2:
version "1.2.2"
resolved "https://registry.yarnpkg.com/leaflet-gesture-handling/-/leaflet-gesture-handling-1.2.2.tgz#ea10afb94f2d477d77d47beb21e409ed327df07a"
integrity sha512-Blf5V4PoNphWkzL7Y1qge+Spkd4OCQ2atjwUNhMhLIcjKzPcBH++x/lwOinaR9jSqLWqJ6oKYO8d0XdTffy4hQ==
leaflet-polylinedecorator@1.6.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/leaflet-polylinedecorator/-/leaflet-polylinedecorator-1.6.0.tgz#9ef79fd1b5302d67b72efe959a8ecd2553f27266"

Loading…
Cancel
Save