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 additionalInfo;
@Override
public String getName() {
return super.getEmail();
}
public UserFields(UUID id, long createdTime, UUID tenantId, UUID customerId,
Long version, String firstName, String lastName, String email,
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.errors.LargeObjectException;
import org.eclipse.jgit.errors.RepositoryNotFoundException;
import org.eclipse.jgit.errors.TransportException;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.lib.ObjectLoader;
@ -158,7 +157,7 @@ public class GitRepository {
return repository;
} catch (RepositoryNotFoundException e) {
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")) {
log.warn("Couldn't fetch {} due to {}, reinitializing", directory, e.getMessage());
} 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"
[active]="true"
[entityId]="data.value.id"
[functionTestButtonLabel]="'common.test-function' | translate"
(debugEventSelected)="onDebugEventSelected($event)"
/>
</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 {
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.cellActionDescriptors[0].isEnabled = (event => this.data.value.type === CalculatedFieldType.SCRIPT && !!(event as Event).body.arguments)
}
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>
<button toolbarSuffixButton
mat-icon-button
matTooltip="{{ 'common.test-function' | translate }}"
matTooltip="{{ 'calculated-fields.test-script-function' | translate }}"
matTooltipPosition="above"
class="tb-mat-32"
[disabled]="configFormGroup.get('arguments').invalid"
@ -123,7 +123,7 @@
type="button"
(click)="onTestScript()"
[disabled]="configFormGroup.get('arguments').invalid">
{{ 'common.test-function' | translate }}
{{ 'calculated-fields.test-script-function' | translate }}
</button>
</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>
</section>
<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>
</mat-drawer-content>
<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
type="button"
class="tb-rounded-btn w-36 flex-1"
color="primary"
#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;
case DebugEventType.DEBUG_CALCULATED_FIELD:
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',
isEnabled: () => true,
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(
takeUntilDestroyed(this.destroyRef)
).subscribe(() => {
this.updateValidators();
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) {
@ -131,7 +151,7 @@ export class ColorSettingsPanelComponent extends PageComponent implements OnInit
}
applyColorSettings() {
const colorSettings = this.colorSettingsFormGroup.value;
const colorSettings: ColorSettings = this.colorSettingsFormGroup.getRawValue();
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() {
const colorSettings: DataLayerColorSettings = this.colorSettingsFormGroup.value;
const colorSettings: DataLayerColorSettings = this.colorSettingsFormGroup.getRawValue();
this.colorSettingsApplied.emit(colorSettings);
}
@ -122,8 +122,15 @@ export class DataLayerColorSettingsPanelComponent extends PageComponent implemen
const type: DataLayerColorType = this.colorSettingsFormGroup.get('type').value;
if (type === DataLayerColorType.range) {
this.colorSettingsFormGroup.get('rangeKey').enable({emitEvent: false});
this.colorSettingsFormGroup.get('range').enable({emitEvent: false});
} else {
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> = {
base_url: '/assets/tinymce',
suffix: '.min',
plugins: ['lists'],
plugins: ['link', 'table', 'image', 'imagetools', 'lists'],
menubar: 'edit insert view format',
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',
height: 400,
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>
<div mat-dialog-content>
<fieldset [disabled]="isLoading$ | async">
<div class="flex flex-1 flex-col">
<tb-toggle-select *ngIf="enableImportFromContent"
class="flex-1"
formControlName="importType">
<tb-toggle-option value="file">{{ importFileLabel | translate }}</tb-toggle-option>
<tb-toggle-option value="content">{{ importContentLabel | translate }}</tb-toggle-option>
</tb-toggle-select>
<tb-file-input *ngIf="importFormGroup.get('importType').value === 'file'"
[contentConvertFunction]="loadDataFromJsonContent"
[existingFileName]="currentFileName"
(fileNameChanged)="currentFileName = $event"
formControlName="fileContent"
required
label="{{importFileLabel | translate}}"
dropLabel="{{ 'import.drop-json-file-or' | translate }}"
accept=".json,application/json"
allowedExtensions="json">
</tb-file-input>
<tb-json-object-edit *ngIf="importFormGroup.get('importType').value === 'content'"
formControlName="jsonContent"
jsonRequired
label="{{ importContentLabel | translate }}">
</tb-json-object-edit>
</div>
</fieldset>
<div class="flex flex-1 flex-col">
<tb-toggle-select *ngIf="enableImportFromContent"
class="flex-1"
formControlName="importType">
<tb-toggle-option value="file">{{ importFileLabel | translate }}</tb-toggle-option>
<tb-toggle-option value="content">{{ importContentLabel | translate }}</tb-toggle-option>
</tb-toggle-select>
<tb-file-input *ngIf="importFormGroup.get('importType').value === 'file'"
[contentConvertFunction]="loadDataFromJsonContent"
[existingFileName]="currentFileName"
(fileNameChanged)="currentFileName = $event"
formControlName="fileContent"
required
label="{{importFileLabel | translate}}"
dropLabel="{{ 'import.drop-json-file-or' | translate }}"
accept=".json,application/json"
allowedExtensions="json">
</tb-file-input>
<tb-json-object-edit *ngIf="importFormGroup.get('importType').value === 'content'"
formControlName="jsonContent"
jsonRequired
label="{{ importContentLabel | translate }}">
</tb-json-object-edit>
</div>
</div>
<div mat-dialog-actions class="flex items-center justify-end">
<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,
smsEnabled: true,
maxCreatedAlarms: 0,
maxDebugModeDurationMinutes: 0,
maxDebugModeDurationMinutes: 15,
tenantServerRestLimitsConfiguration: '',
customerServerRestLimitsConfiguration: '',
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-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.",
"test-with-this-message": "Test with this message",
"hint": {
"arguments-simple-with-rolling": "Simple type calculated field should not contain keys with time series rolling type.",
"arguments-empty": "Arguments should not be empty.",
@ -1121,8 +1122,6 @@
"documentation": "Documentation",
"time-left": "{{time}} left",
"output": "Output",
"test-function": "Test function",
"test-with-this-message": "{{test}} with this message",
"suffix": {
"s": "s",
"ms": "ms"

Loading…
Cancel
Save