Merge branch 'develop/3.6' of github.com:thingsboard/thingsboard into develop/3.6

This commit is contained in:
Igor Kulikov 2023-09-19 18:04:45 +03:00
commit d479bca638
15 changed files with 34 additions and 17 deletions

View File

@ -23,6 +23,7 @@
}
.tb-form-settings {
display: flex;
flex-direction: column;
gap: 16px;
padding-top: 0;

View File

@ -632,6 +632,10 @@
*ngIf="gatewayConfigGroup.get('thingsboard.checkingDeviceActivity.inactivityTimeoutSeconds').hasError('min')">
{{ 'gateway.inactivity-timeout-seconds-min' | translate }}
</mat-error>
<mat-error
*ngIf="gatewayConfigGroup.get('thingsboard.checkingDeviceActivity.inactivityTimeoutSeconds').hasError('pattern')">
{{ 'gateway.inactivity-timeout-seconds-pattern' | translate }}
</mat-error>
<mat-icon matIconSuffix style="cursor:pointer;"
matTooltip="{{ 'gateway.hints.inactivity-timeout' | translate }}">info_outlined
</mat-icon>
@ -647,6 +651,10 @@
*ngIf="gatewayConfigGroup.get('thingsboard.checkingDeviceActivity.inactivityCheckPeriodSeconds').hasError('min')">
{{ 'gateway.inactivity-check-period-seconds-min' | translate }}
</mat-error>
<mat-error
*ngIf="gatewayConfigGroup.get('thingsboard.checkingDeviceActivity.inactivityCheckPeriodSeconds').hasError('pattern')">
{{ 'gateway.inactivity-check-period-seconds-pattern' | translate }}
</mat-error>
<mat-icon matIconSuffix style="cursor:pointer;"
matTooltip="{{ 'gateway.hints.inactivity-period' | translate }}">info_outlined
</mat-icon>

View File

@ -70,6 +70,16 @@
justify-content: flex-end;
flex: 1;
}
mat-form-field {
mat-error {
display: none !important;
}
mat-error:first-child {
display: block !important;
}
}
}
:host ::ng-deep {

View File

@ -108,8 +108,8 @@ export class GatewayConfigurationComponent implements OnInit {
handleDeviceRenaming: [true, []],
checkingDeviceActivity: this.fb.group({
checkDeviceInactivity: [false, []],
inactivityTimeoutSeconds: [200, [Validators.min(1), Validators.pattern(/^[^.\s]+$/)]],
inactivityCheckPeriodSeconds: [500, [Validators.min(1), Validators.pattern(/^[^.\s]+$/)]]
inactivityTimeoutSeconds: [200, [Validators.min(1), Validators.pattern(/^-?[0-9]+$/)]],
inactivityCheckPeriodSeconds: [500, [Validators.min(1), Validators.pattern(/^-?[0-9]+$/)]]
}),
security: this.fb.group({
type: [SecurityTypes.ACCESS_TOKEN, [Validators.required]],
@ -187,8 +187,8 @@ export class GatewayConfigurationComponent implements OnInit {
checkingDeviceActivityGroup.get('checkDeviceInactivity').valueChanges.subscribe(enabled => {
checkingDeviceActivityGroup.updateValueAndValidity();
if (enabled) {
checkingDeviceActivityGroup.get('inactivityTimeoutSeconds').setValidators([Validators.min(1), Validators.required]);
checkingDeviceActivityGroup.get('inactivityCheckPeriodSeconds').setValidators([Validators.min(1), Validators.required]);
checkingDeviceActivityGroup.get('inactivityTimeoutSeconds').setValidators([Validators.min(1), Validators.required, Validators.pattern(/^-?[0-9]+$/)]);
checkingDeviceActivityGroup.get('inactivityCheckPeriodSeconds').setValidators([Validators.min(1), Validators.required, Validators.pattern(/^-?[0-9]+$/)]);
} else {
checkingDeviceActivityGroup.get('inactivityTimeoutSeconds').clearValidators();
checkingDeviceActivityGroup.get('inactivityCheckPeriodSeconds').clearValidators();

View File

@ -486,6 +486,6 @@ export class GatewayConnectorComponent extends PageComponent implements AfterVie
const connectorName = attribute.key;
const connector = this.subscription && this.subscription.data
.find(data => data && data.dataKey.name === `${connectorName}_ERRORS_COUNT`);
return (connector && this.activeConnectors.includes(connectorName)) ? connector.data[0][1] : 'Inactive';
return (connector && this.activeConnectors.includes(connectorName)) ? (connector.data[0][1] || 0) : 'Inactive';
}
}

View File

@ -124,7 +124,7 @@ export const GatewayConnectorDefaultTypesTranslates = new Map<string, string>([
['ftp', 'FTP'],
['socket', 'SOCKET'],
['xmpp', 'XMPP'],
['ocpp', 'OCCP'],
['ocpp', 'OCPP'],
['custom', 'CUSTOM']
]);

View File

@ -29,7 +29,7 @@
</mat-progress-bar>
<div mat-dialog-content>
<mat-horizontal-stepper linear #createNotification
[labelPosition]="(stepperLabelPosition | async)"
labelPosition="bottom"
[orientation]="(stepperOrientation | async)"
(selectionChange)="changeStep($event)">
<ng-template matStepperIcon="edit">

View File

@ -63,7 +63,6 @@ export class SentNotificationDialogComponent extends
@ViewChild('createNotification', {static: true}) createNotification: MatStepper;
stepperOrientation: Observable<StepperOrientation>;
stepperLabelPosition: Observable<'bottom' | 'end'>;
isAdd = true;
entityType = EntityType;
@ -102,9 +101,6 @@ export class SentNotificationDialogComponent extends
this.stepperOrientation = this.breakpointObserver.observe(MediaBreakpoints['gt-sm'])
.pipe(map(({matches}) => matches ? 'horizontal' : 'vertical'));
this.stepperLabelPosition = this.breakpointObserver.observe(MediaBreakpoints['gt-md'])
.pipe(map(({matches}) => matches ? 'end' : 'bottom'));
this.notificationRequestForm = this.fb.group({
useTemplate: [false],
templateId: [{value: null, disabled: true}, Validators.required],

View File

@ -29,7 +29,7 @@
</mat-progress-bar>
<div mat-dialog-content>
<mat-horizontal-stepper linear #notificationTemplateStepper
[labelPosition]="(stepperLabelPosition | async)"
labelPosition="bottom"
[orientation]="(stepperOrientation | async)"
(selectionChange)="changeStep($event)">
<ng-template matStepperIcon="edit">

View File

@ -54,7 +54,6 @@ export class TemplateNotificationDialogComponent
@ViewChild('notificationTemplateStepper', {static: true}) notificationTemplateStepper: MatStepper;
stepperOrientation: Observable<StepperOrientation>;
stepperLabelPosition: Observable<'bottom' | 'end'>;
dialogTitle = 'notification.edit-notification-template';
@ -82,9 +81,6 @@ export class TemplateNotificationDialogComponent
this.stepperOrientation = this.breakpointObserver.observe(MediaBreakpoints['gt-sm'])
.pipe(map(({matches}) => matches ? 'horizontal' : 'vertical'));
this.stepperLabelPosition = this.breakpointObserver.observe(MediaBreakpoints['gt-md'])
.pipe(map(({matches}) => matches ? 'end' : 'bottom'));
if (isDefinedAndNotNull(this.data?.predefinedType)) {
this.hideSelectType = true;
this.templateNotificationForm.get('notificationType').setValue(this.data.predefinedType, {emitEvent: false});

View File

@ -173,6 +173,7 @@
}
.mat-drawer-content.tb-rulechain-graph-content {
overflow: hidden;
z-index: 0;
.tb-rulechain-graph {
z-index: 0;
overflow: auto;

View File

@ -172,6 +172,7 @@ export class WidgetsBundleWidgetsComponent extends PageComponent implements OnIn
this.widgetsService.updateWidgetsBundleWidgetTypes(this.widgetsBundle.id.id, widgetTypeIds).subscribe(() => {
this.isDirty = false;
this.editMode = false;
this.addMode = false;
});
}

View File

@ -34,6 +34,7 @@
<div #toggleHelpTextButton
(click)="toggleHelp()">
<button mat-button
type="button"
color="primary"
class="tb-help-popup-text-button"
[class]="{'mat-mdc-outlined-button mdc-button--outlined': popoverVisible && popoverReady,

View File

@ -2703,9 +2703,11 @@
"inactivity-check-period-seconds": "Inactivity check period (in sec)",
"inactivity-check-period-seconds-required": "Inactivity check period is required",
"inactivity-check-period-seconds-min": "Inactivity check period can not be less then 1",
"inactivity-check-period-seconds-pattern": "Inactivity check period is not valid",
"inactivity-timeout-seconds": "Inactivity timeout (in sec)",
"inactivity-timeout-seconds-required": "Inactivity timeout is required",
"inactivity-timeout-seconds-min": "Inactivity timeout can not be less then 1",
"inactivity-timeout-seconds-pattern": "Inactivity timeout is not valid",
"json-parse": "Not valid JSON.",
"json-required": "Field cannot be empty.",
"logs": {
@ -2855,6 +2857,7 @@
"password": "MQTT password for the gateway form ThingsBoard server",
"ca-cert": "Path to CA certificate file",
"date-form": "Date format in log message",
"data-folder": "Path to folder, that will contains data (Relative or Absolute)",
"log-format": "Log message format",
"remote-log": "Enables remote logging and logs reading from the gateway",
"backup-count": "If backup count is > 0, when a rollover is done, no more than backup count files are kept - the oldest ones are deleted",