Browse Source

Merge branch 'rc' of github.com:thingsboard/thingsboard into rc

pull/13138/head
Igor Kulikov 1 year ago
parent
commit
5c8309819e
  1. 5
      common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/UserFields.java
  2. 3
      common/version-control/src/main/java/org/thingsboard/server/service/sync/vc/GitRepository.java
  3. 1
      ui-ngx/src/app/modules/home/components/calculated-fields/components/debug-dialog/calculated-field-debug-dialog.component.html
  4. 2
      ui-ngx/src/app/modules/home/components/calculated-fields/components/debug-dialog/calculated-field-debug-dialog.component.ts
  5. 4
      ui-ngx/src/app/modules/home/components/calculated-fields/components/dialog/calculated-field-dialog.component.html
  6. 2
      ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html
  7. 1
      ui-ngx/src/app/modules/home/components/entity/debug/entity-debug-settings-button.component.html
  8. 2
      ui-ngx/src/app/modules/home/components/event/event-table-config.ts
  9. 22
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/color-settings-panel.component.ts
  10. 9
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/data-layer-color-settings-panel.component.ts
  11. 4
      ui-ngx/src/app/modules/home/pages/mobile/common/editor-panel.component.ts
  12. 50
      ui-ngx/src/app/shared/import-export/import-dialog.component.html
  13. 2
      ui-ngx/src/app/shared/models/tenant.model.ts
  14. 3
      ui-ngx/src/assets/locale/locale.constant-en_US.json

5
common/data/src/main/java/org/thingsboard/server/common/data/edqs/fields/UserFields.java

@ -35,6 +35,11 @@ public class UserFields extends AbstractEntityFields {
private String phone; private String phone;
private String additionalInfo; private String additionalInfo;
@Override
public String getName() {
return super.getEmail();
}
public UserFields(UUID id, long createdTime, UUID tenantId, UUID customerId, public UserFields(UUID id, long createdTime, UUID tenantId, UUID customerId,
Long version, String firstName, String lastName, String email, Long version, String firstName, String lastName, String email,
String phone, JsonNode additionalInfo) { String phone, JsonNode additionalInfo) {

3
common/version-control/src/main/java/org/thingsboard/server/service/sync/vc/GitRepository.java

@ -42,7 +42,6 @@ import org.eclipse.jgit.diff.RawText;
import org.eclipse.jgit.diff.RawTextComparator; import org.eclipse.jgit.diff.RawTextComparator;
import org.eclipse.jgit.errors.LargeObjectException; import org.eclipse.jgit.errors.LargeObjectException;
import org.eclipse.jgit.errors.RepositoryNotFoundException; import org.eclipse.jgit.errors.RepositoryNotFoundException;
import org.eclipse.jgit.errors.TransportException;
import org.eclipse.jgit.lib.Constants; import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId; import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader; import org.eclipse.jgit.lib.ObjectLoader;
@ -158,7 +157,7 @@ public class GitRepository {
return repository; return repository;
} catch (RepositoryNotFoundException e) { } catch (RepositoryNotFoundException e) {
log.warn("{} not a git repository, reinitializing", directory); log.warn("{} not a git repository, reinitializing", directory);
} catch (TransportException e) { } catch (org.eclipse.jgit.errors.TransportException | org.eclipse.jgit.api.errors.TransportException e) {
if (StringUtils.containsIgnoreCase(e.getMessage(), "missing commit")) { if (StringUtils.containsIgnoreCase(e.getMessage(), "missing commit")) {
log.warn("Couldn't fetch {} due to {}, reinitializing", directory, e.getMessage()); log.warn("Couldn't fetch {} due to {}, reinitializing", directory, e.getMessage());
} else { } else {

1
ui-ngx/src/app/modules/home/components/calculated-fields/components/debug-dialog/calculated-field-debug-dialog.component.html

@ -33,7 +33,6 @@
[defaultEventType]="DebugEventType.DEBUG_CALCULATED_FIELD" [defaultEventType]="DebugEventType.DEBUG_CALCULATED_FIELD"
[active]="true" [active]="true"
[entityId]="data.value.id" [entityId]="data.value.id"
[functionTestButtonLabel]="'common.test-function' | translate"
(debugEventSelected)="onDebugEventSelected($event)" (debugEventSelected)="onDebugEventSelected($event)"
/> />
</div> </div>

2
ui-ngx/src/app/modules/home/components/calculated-fields/components/debug-dialog/calculated-field-debug-dialog.component.ts

@ -55,8 +55,8 @@ export class CalculatedFieldDebugDialogComponent extends DialogComponent<Calcula
} }
ngAfterViewInit(): void { ngAfterViewInit(): void {
this.eventsTable.entitiesTable.cellActionDescriptors[0].isEnabled = (event => this.data.value.type === CalculatedFieldType.SCRIPT && !!(event as Event).body.arguments);
this.eventsTable.entitiesTable.updateData(); this.eventsTable.entitiesTable.updateData();
this.eventsTable.entitiesTable.cellActionDescriptors[0].isEnabled = (event => this.data.value.type === CalculatedFieldType.SCRIPT && !!(event as Event).body.arguments)
} }
cancel(): void { cancel(): void {

4
ui-ngx/src/app/modules/home/components/calculated-fields/components/dialog/calculated-field-dialog.component.html

@ -110,7 +110,7 @@
<div toolbarPrefixButton class="tb-primary-background tbel-script-lang-chip">{{ 'api-usage.tbel' | translate }}</div> <div toolbarPrefixButton class="tb-primary-background tbel-script-lang-chip">{{ 'api-usage.tbel' | translate }}</div>
<button toolbarSuffixButton <button toolbarSuffixButton
mat-icon-button mat-icon-button
matTooltip="{{ 'common.test-function' | translate }}" matTooltip="{{ 'calculated-fields.test-script-function' | translate }}"
matTooltipPosition="above" matTooltipPosition="above"
class="tb-mat-32" class="tb-mat-32"
[disabled]="configFormGroup.get('arguments').invalid" [disabled]="configFormGroup.get('arguments').invalid"
@ -123,7 +123,7 @@
type="button" type="button"
(click)="onTestScript()" (click)="onTestScript()"
[disabled]="configFormGroup.get('arguments').invalid"> [disabled]="configFormGroup.get('arguments').invalid">
{{ 'common.test-function' | translate }} {{ 'calculated-fields.test-script-function' | translate }}
</button> </button>
</div> </div>
</div> </div>

2
ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-page.component.html

@ -365,7 +365,7 @@
<mat-icon>close</mat-icon></button> <mat-icon>close</mat-icon></button>
</section> </section>
<section *ngIf="!embedded" data-html2canvas-ignore class="tb-powered-by-footer" [style.color]="dashboard.configuration.settings.titleColor"> <section *ngIf="!embedded" data-html2canvas-ignore class="tb-powered-by-footer" [style.color]="dashboard.configuration.settings.titleColor">
<span>Powered by <a href="https://thingsboard.io" target="_blank">Thingsboard v.{{ thingsboardVersion }}</a></span> <span>Powered by <a href="https://thingsboard.io" target="_blank">ThingsBoard v.{{ thingsboardVersion }}</a></span>
</section> </section>
</mat-drawer-content> </mat-drawer-content>
<mat-drawer class="tb-details-drawer" <mat-drawer class="tb-details-drawer"

1
ui-ngx/src/app/modules/home/components/entity/debug/entity-debug-settings-button.component.html

@ -16,6 +16,7 @@
--> -->
<button mat-stroked-button <button mat-stroked-button
type="button"
class="tb-rounded-btn w-36 flex-1" class="tb-rounded-btn w-36 flex-1"
color="primary" color="primary"
#matButton #matButton

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

@ -462,7 +462,7 @@ export class EventTableConfig extends EntityTableConfig<Event, TimePageLink> {
break; break;
case DebugEventType.DEBUG_CALCULATED_FIELD: case DebugEventType.DEBUG_CALCULATED_FIELD:
this.cellActionDescriptors.push({ this.cellActionDescriptors.push({
name: this.translate.instant('common.test-with-this-message', {test: this.translate.instant(this.testButtonLabel)}), name: this.translate.instant('calculated-fields.test-with-this-message'),
icon: 'bug_report', icon: 'bug_report',
isEnabled: () => true, isEnabled: () => true,
onAction: (_, entity) => this.debugEventSelected.next(entity.body) onAction: (_, entity) => this.debugEventSelected.next(entity.body)

22
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/color-settings-panel.component.ts

@ -110,8 +110,28 @@ export class ColorSettingsPanelComponent extends PageComponent implements OnInit
this.colorSettingsFormGroup.get('type').valueChanges.pipe( this.colorSettingsFormGroup.get('type').valueChanges.pipe(
takeUntilDestroyed(this.destroyRef) takeUntilDestroyed(this.destroyRef)
).subscribe(() => { ).subscribe(() => {
this.updateValidators();
setTimeout(() => {this.popover?.updatePosition();}, 0); setTimeout(() => {this.popover?.updatePosition();}, 0);
}); });
this.updateValidators();
}
updateValidators() {
const type: ColorType = this.colorSettingsFormGroup.get('type').value;
this.colorSettingsFormGroup.get('gradient').disable({emitEvent: false});
this.colorSettingsFormGroup.get('rangeList').disable({emitEvent: false});
this.colorSettingsFormGroup.get('colorFunction').disable({emitEvent: false});
switch (type) {
case ColorType.gradient:
this.colorSettingsFormGroup.get('gradient').enable({emitEvent: false});
break;
case ColorType.range:
this.colorSettingsFormGroup.get('rangeList').enable({emitEvent: false});
break;
case ColorType.function:
this.colorSettingsFormGroup.get('colorFunction').enable({emitEvent: false});
break;
}
} }
copyColorSettings(comp: ColorSettingsComponent) { copyColorSettings(comp: ColorSettingsComponent) {
@ -131,7 +151,7 @@ export class ColorSettingsPanelComponent extends PageComponent implements OnInit
} }
applyColorSettings() { applyColorSettings() {
const colorSettings = this.colorSettingsFormGroup.value; const colorSettings: ColorSettings = this.colorSettingsFormGroup.getRawValue();
this.colorSettingsApplied.emit(colorSettings); this.colorSettingsApplied.emit(colorSettings);
} }

9
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/data-layer-color-settings-panel.component.ts

@ -101,7 +101,7 @@ export class DataLayerColorSettingsPanelComponent extends PageComponent implemen
} }
applyColorSettings() { applyColorSettings() {
const colorSettings: DataLayerColorSettings = this.colorSettingsFormGroup.value; const colorSettings: DataLayerColorSettings = this.colorSettingsFormGroup.getRawValue();
this.colorSettingsApplied.emit(colorSettings); this.colorSettingsApplied.emit(colorSettings);
} }
@ -122,8 +122,15 @@ export class DataLayerColorSettingsPanelComponent extends PageComponent implemen
const type: DataLayerColorType = this.colorSettingsFormGroup.get('type').value; const type: DataLayerColorType = this.colorSettingsFormGroup.get('type').value;
if (type === DataLayerColorType.range) { if (type === DataLayerColorType.range) {
this.colorSettingsFormGroup.get('rangeKey').enable({emitEvent: false}); this.colorSettingsFormGroup.get('rangeKey').enable({emitEvent: false});
this.colorSettingsFormGroup.get('range').enable({emitEvent: false});
} else { } else {
this.colorSettingsFormGroup.get('rangeKey').disable({emitEvent: false}); this.colorSettingsFormGroup.get('rangeKey').disable({emitEvent: false});
this.colorSettingsFormGroup.get('range').disable({emitEvent: false});
}
if (type === DataLayerColorType.function) {
this.colorSettingsFormGroup.get('colorFunction').enable({emitEvent: false});
} else {
this.colorSettingsFormGroup.get('colorFunction').disable({emitEvent: false});
} }
} }
} }

4
ui-ngx/src/app/modules/home/pages/mobile/common/editor-panel.component.ts

@ -47,10 +47,10 @@ export class EditorPanelComponent implements OnInit {
tinyMceOptions: Partial<EditorOptions> = { tinyMceOptions: Partial<EditorOptions> = {
base_url: '/assets/tinymce', base_url: '/assets/tinymce',
suffix: '.min', suffix: '.min',
plugins: ['lists'], plugins: ['link', 'table', 'image', 'imagetools', 'lists'],
menubar: 'edit insert view format', menubar: 'edit insert view format',
toolbar: ['fontfamily fontsize | bold italic underline strikethrough forecolor backcolor', toolbar: ['fontfamily fontsize | bold italic underline strikethrough forecolor backcolor',
'alignleft aligncenter alignright alignjustify | bullist'], 'alignleft aligncenter alignright alignjustify | bullist | link table image'],
toolbar_mode: 'sliding', toolbar_mode: 'sliding',
height: 400, height: 400,
autofocus: false, autofocus: false,

50
ui-ngx/src/app/shared/import-export/import-dialog.component.html

@ -28,32 +28,30 @@
<mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async"> <mat-progress-bar color="warn" mode="indeterminate" *ngIf="isLoading$ | async">
</mat-progress-bar> </mat-progress-bar>
<div mat-dialog-content> <div mat-dialog-content>
<fieldset [disabled]="isLoading$ | async"> <div class="flex flex-1 flex-col">
<div class="flex flex-1 flex-col"> <tb-toggle-select *ngIf="enableImportFromContent"
<tb-toggle-select *ngIf="enableImportFromContent" class="flex-1"
class="flex-1" formControlName="importType">
formControlName="importType"> <tb-toggle-option value="file">{{ importFileLabel | translate }}</tb-toggle-option>
<tb-toggle-option value="file">{{ importFileLabel | translate }}</tb-toggle-option> <tb-toggle-option value="content">{{ importContentLabel | translate }}</tb-toggle-option>
<tb-toggle-option value="content">{{ importContentLabel | translate }}</tb-toggle-option> </tb-toggle-select>
</tb-toggle-select> <tb-file-input *ngIf="importFormGroup.get('importType').value === 'file'"
<tb-file-input *ngIf="importFormGroup.get('importType').value === 'file'" [contentConvertFunction]="loadDataFromJsonContent"
[contentConvertFunction]="loadDataFromJsonContent" [existingFileName]="currentFileName"
[existingFileName]="currentFileName" (fileNameChanged)="currentFileName = $event"
(fileNameChanged)="currentFileName = $event" formControlName="fileContent"
formControlName="fileContent" required
required label="{{importFileLabel | translate}}"
label="{{importFileLabel | translate}}" dropLabel="{{ 'import.drop-json-file-or' | translate }}"
dropLabel="{{ 'import.drop-json-file-or' | translate }}" accept=".json,application/json"
accept=".json,application/json" allowedExtensions="json">
allowedExtensions="json"> </tb-file-input>
</tb-file-input> <tb-json-object-edit *ngIf="importFormGroup.get('importType').value === 'content'"
<tb-json-object-edit *ngIf="importFormGroup.get('importType').value === 'content'" formControlName="jsonContent"
formControlName="jsonContent" jsonRequired
jsonRequired label="{{ importContentLabel | translate }}">
label="{{ importContentLabel | translate }}"> </tb-json-object-edit>
</tb-json-object-edit> </div>
</div>
</fieldset>
</div> </div>
<div mat-dialog-actions class="flex items-center justify-end"> <div mat-dialog-actions class="flex items-center justify-end">
<button mat-button color="primary" <button mat-button color="primary"

2
ui-ngx/src/app/shared/models/tenant.model.ts

@ -137,7 +137,7 @@ export function createTenantProfileConfiguration(type: TenantProfileType): Tenan
maxSms: 0, maxSms: 0,
smsEnabled: true, smsEnabled: true,
maxCreatedAlarms: 0, maxCreatedAlarms: 0,
maxDebugModeDurationMinutes: 0, maxDebugModeDurationMinutes: 15,
tenantServerRestLimitsConfiguration: '', tenantServerRestLimitsConfiguration: '',
customerServerRestLimitsConfiguration: '', customerServerRestLimitsConfiguration: '',
maxWsSessionsPerTenant: 0, maxWsSessionsPerTenant: 0,

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

@ -1059,6 +1059,7 @@
"delete-text": "Be careful, after the confirmation the calculated field and all related data will become unrecoverable.", "delete-text": "Be careful, after the confirmation the calculated field and all related data will become unrecoverable.",
"delete-multiple-title": "Are you sure you want to delete { count, plural, =1 {1 calculated field} other {# calculated fields} }?", "delete-multiple-title": "Are you sure you want to delete { count, plural, =1 {1 calculated field} other {# calculated fields} }?",
"delete-multiple-text": "Be careful, after the confirmation all selected calculated fields will be removed and all related data will become unrecoverable.", "delete-multiple-text": "Be careful, after the confirmation all selected calculated fields will be removed and all related data will become unrecoverable.",
"test-with-this-message": "Test with this message",
"hint": { "hint": {
"arguments-simple-with-rolling": "Simple type calculated field should not contain keys with time series rolling type.", "arguments-simple-with-rolling": "Simple type calculated field should not contain keys with time series rolling type.",
"arguments-empty": "Arguments should not be empty.", "arguments-empty": "Arguments should not be empty.",
@ -1121,8 +1122,6 @@
"documentation": "Documentation", "documentation": "Documentation",
"time-left": "{{time}} left", "time-left": "{{time}} left",
"output": "Output", "output": "Output",
"test-function": "Test function",
"test-with-this-message": "{{test}} with this message",
"suffix": { "suffix": {
"s": "s", "s": "s",
"ms": "ms" "ms": "ms"

Loading…
Cancel
Save