Browse Source

Merge pull request #14868 from thingsboard/rc

Merge rc to master
pull/14886/head
Vladyslav Prykhodko 6 months ago
committed by GitHub
parent
commit
381e60977d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 11
      ui-ngx/patches/@angular+compiler+18.2.13.patch
  2. 2
      ui-ngx/src/app/modules/home/components/widget/config/basic/button/segmented-button-basic-config.component.html
  3. 48
      ui-ngx/src/app/modules/home/components/widget/config/basic/button/segmented-button-basic-config.component.ts
  4. 2
      ui-ngx/src/app/modules/home/components/widget/lib/settings/button/segmented-button-widget-settings.component.html
  5. 49
      ui-ngx/src/app/modules/home/components/widget/lib/settings/button/segmented-button-widget-settings.component.ts
  6. 13
      ui-ngx/src/app/modules/home/components/widget/lib/settings/control/send-rpc-widget-settings.component.html
  7. 4
      ui-ngx/src/app/modules/home/components/widget/lib/settings/control/send-rpc-widget-settings.component.ts
  8. 2
      ui-ngx/src/app/shared/models/constants.ts

11
ui-ngx/patches/@angular+compiler+18.2.13.patch

@ -1,5 +1,5 @@
diff --git a/node_modules/@angular/compiler/fesm2022/compiler.mjs b/node_modules/@angular/compiler/fesm2022/compiler.mjs diff --git a/node_modules/@angular/compiler/fesm2022/compiler.mjs b/node_modules/@angular/compiler/fesm2022/compiler.mjs
index a00b189..260e7be 100755 index a00b189..58896de 100755
--- a/node_modules/@angular/compiler/fesm2022/compiler.mjs --- a/node_modules/@angular/compiler/fesm2022/compiler.mjs
+++ b/node_modules/@angular/compiler/fesm2022/compiler.mjs +++ b/node_modules/@angular/compiler/fesm2022/compiler.mjs
@@ -18631,6 +18631,7 @@ function SECURITY_SCHEMA() { @@ -18631,6 +18631,7 @@ function SECURITY_SCHEMA() {
@ -86,3 +86,12 @@ index a00b189..260e7be 100755
]); ]);
registerContext(SecurityContext.RESOURCE_URL, [ registerContext(SecurityContext.RESOURCE_URL, [
'applet|code', 'applet|code',
@@ -18659,6 +18729,8 @@ function SECURITY_SCHEMA() {
'object|codebase',
'object|data',
'script|src',
+ 'script|href',
+ 'script|xlink:href',
]);
}
return _SECURITY_SCHEMA;

2
ui-ngx/src/app/modules/home/components/widget/config/basic/button/segmented-button-basic-config.component.html

@ -126,7 +126,6 @@
subscriptSizing="dynamic" subscriptSizing="dynamic"
[predefinedValuesButton]="true" [predefinedValuesButton]="true"
[predefinedValues]="predefinedValues" [predefinedValues]="predefinedValues"
[disabled]="!segmentedButtonWidgetConfigForm.get('leftAppearance').get('showLabel').value"
placeholderText="{{ 'widget-config.set' | translate }}" placeholderText="{{ 'widget-config.set' | translate }}"
formControlName="label" formControlName="label"
></tb-string-pattern-autocomplete> ></tb-string-pattern-autocomplete>
@ -164,7 +163,6 @@
subscriptSizing="dynamic" subscriptSizing="dynamic"
[predefinedValuesButton]="true" [predefinedValuesButton]="true"
[predefinedValues]="predefinedValues" [predefinedValues]="predefinedValues"
[disabled]="!segmentedButtonWidgetConfigForm.get('rightAppearance').get('showLabel').value"
placeholderText="{{ 'widget-config.set' | translate }}" placeholderText="{{ 'widget-config.set' | translate }}"
formControlName="label" formControlName="label"
></tb-string-pattern-autocomplete> ></tb-string-pattern-autocomplete>

48
ui-ngx/src/app/modules/home/components/widget/config/basic/button/segmented-button-basic-config.component.ts

@ -142,4 +142,52 @@ export class SegmentedButtonBasicConfigComponent extends BasicWidgetConfigCompon
return this.widgetConfig; return this.widgetConfig;
} }
protected validatorTriggers(): string[] {
return ['appearance.leftAppearance.showLabel', 'appearance.leftAppearance.showIcon', 'appearance.rightAppearance.showLabel', 'appearance.rightAppearance.showIcon',];
}
protected updateValidators(emitEvent: boolean) {
const showLeftLabel: boolean = this.segmentedButtonWidgetConfigForm.get('appearance.leftAppearance.showLabel').value;
const showRightLabel: boolean = this.segmentedButtonWidgetConfigForm.get('appearance.rightAppearance.showLabel').value;
const showLeftIcon: boolean = this.segmentedButtonWidgetConfigForm.get('appearance.leftAppearance.showIcon').value;
const showRightIcon: boolean = this.segmentedButtonWidgetConfigForm.get('appearance.rightAppearance.showIcon').value;
if (showLeftLabel) {
this.segmentedButtonWidgetConfigForm.get('appearance.leftAppearance.label').enable({emitEvent});
this.segmentedButtonWidgetConfigForm.get('appearance.leftAppearance.labelFont').enable({emitEvent});
} else {
this.segmentedButtonWidgetConfigForm.get('appearance.leftAppearance.label').disable({emitEvent});
this.segmentedButtonWidgetConfigForm.get('appearance.leftAppearance.labelFont').disable({emitEvent});
}
if (showRightLabel) {
this.segmentedButtonWidgetConfigForm.get('appearance.rightAppearance.label').enable({emitEvent});
this.segmentedButtonWidgetConfigForm.get('appearance.rightAppearance.labelFont').enable({emitEvent});
} else {
this.segmentedButtonWidgetConfigForm.get('appearance.rightAppearance.label').disable({emitEvent});
this.segmentedButtonWidgetConfigForm.get('appearance.rightAppearance.labelFont').disable({emitEvent});
}
if (showLeftIcon) {
this.segmentedButtonWidgetConfigForm.get('appearance.leftAppearance.icon').enable({emitEvent});
this.segmentedButtonWidgetConfigForm.get('appearance.leftAppearance.iconSize').enable({emitEvent});
this.segmentedButtonWidgetConfigForm.get('appearance.leftAppearance.iconSizeUnit').enable({emitEvent});
} else {
this.segmentedButtonWidgetConfigForm.get('appearance.leftAppearance.icon').disable({emitEvent});
this.segmentedButtonWidgetConfigForm.get('appearance.leftAppearance.iconSize').disable({emitEvent});
this.segmentedButtonWidgetConfigForm.get('appearance.leftAppearance.iconSizeUnit').disable({emitEvent});
}
if (showRightIcon) {
this.segmentedButtonWidgetConfigForm.get('appearance.rightAppearance.icon').enable({emitEvent});
this.segmentedButtonWidgetConfigForm.get('appearance.rightAppearance.iconSize').enable({emitEvent});
this.segmentedButtonWidgetConfigForm.get('appearance.rightAppearance.iconSizeUnit').enable({emitEvent});
} else {
this.segmentedButtonWidgetConfigForm.get('appearance.rightAppearance.icon').disable({emitEvent});
this.segmentedButtonWidgetConfigForm.get('appearance.rightAppearance.iconSize').disable({emitEvent});
this.segmentedButtonWidgetConfigForm.get('appearance.rightAppearance.iconSizeUnit').disable({emitEvent});
}
}
} }

2
ui-ngx/src/app/modules/home/components/widget/lib/settings/button/segmented-button-widget-settings.component.html

@ -117,7 +117,6 @@
brackets="curly" brackets="curly"
subscriptSizing="dynamic" subscriptSizing="dynamic"
predefinedValuesButton="true" predefinedValuesButton="true"
[disabled]="!segmentedButtonWidgetSettingsForm.get('leftAppearance').get('showLabel').value"
[predefinedValues]="predefinedValues" [predefinedValues]="predefinedValues"
placeholderText="{{ 'widget-config.set' | translate }}" placeholderText="{{ 'widget-config.set' | translate }}"
formControlName="label" formControlName="label"
@ -155,7 +154,6 @@
brackets="curly" brackets="curly"
subscriptSizing="dynamic" subscriptSizing="dynamic"
predefinedValuesButton="true" predefinedValuesButton="true"
[disabled]="!segmentedButtonWidgetSettingsForm.get('rightAppearance').get('showLabel').value"
[predefinedValues]="predefinedValues" [predefinedValues]="predefinedValues"
placeholderText="{{ 'widget-config.set' | translate }}" placeholderText="{{ 'widget-config.set' | translate }}"
formControlName="label" formControlName="label"

49
ui-ngx/src/app/modules/home/components/widget/lib/settings/button/segmented-button-widget-settings.component.ts

@ -38,6 +38,7 @@ import {
WidgetButtonToggleState, WidgetButtonToggleState,
widgetButtonToggleStatesTranslations widgetButtonToggleStatesTranslations
} from '@home/components/widget/lib/button/segmented-button-widget.models'; } from '@home/components/widget/lib/button/segmented-button-widget.models';
import { ValueCardLayout } from '@home/components/widget/lib/cards/value-card-widget.models';
@Component({ @Component({
selector: 'tb-segmented-button-widget-settings', selector: 'tb-segmented-button-widget-settings',
@ -139,4 +140,52 @@ export class SegmentedButtonWidgetSettingsComponent extends WidgetSettingsCompon
}) })
}); });
} }
protected validatorTriggers(): string[] {
return ['appearance.leftAppearance.showLabel', 'appearance.leftAppearance.showIcon', 'appearance.rightAppearance.showLabel', 'appearance.rightAppearance.showIcon',];
}
protected updateValidators(emitEvent: boolean) {
const showLeftLabel: boolean = this.segmentedButtonWidgetSettingsForm.get('appearance.leftAppearance.showLabel').value;
const showRightLabel: boolean = this.segmentedButtonWidgetSettingsForm.get('appearance.rightAppearance.showLabel').value;
const showLeftIcon: boolean = this.segmentedButtonWidgetSettingsForm.get('appearance.leftAppearance.showIcon').value;
const showRightIcon: boolean = this.segmentedButtonWidgetSettingsForm.get('appearance.rightAppearance.showIcon').value;
if (showLeftLabel) {
this.segmentedButtonWidgetSettingsForm.get('appearance.leftAppearance.label').enable({emitEvent});
this.segmentedButtonWidgetSettingsForm.get('appearance.leftAppearance.labelFont').enable({emitEvent});
} else {
this.segmentedButtonWidgetSettingsForm.get('appearance.leftAppearance.label').disable({emitEvent});
this.segmentedButtonWidgetSettingsForm.get('appearance.leftAppearance.labelFont').disable({emitEvent});
}
if (showRightLabel) {
this.segmentedButtonWidgetSettingsForm.get('appearance.rightAppearance.label').enable({emitEvent});
this.segmentedButtonWidgetSettingsForm.get('appearance.rightAppearance.labelFont').enable({emitEvent});
} else {
this.segmentedButtonWidgetSettingsForm.get('appearance.rightAppearance.label').disable({emitEvent});
this.segmentedButtonWidgetSettingsForm.get('appearance.rightAppearance.labelFont').disable({emitEvent});
}
if (showLeftIcon) {
this.segmentedButtonWidgetSettingsForm.get('appearance.leftAppearance.icon').enable({emitEvent});
this.segmentedButtonWidgetSettingsForm.get('appearance.leftAppearance.iconSize').enable({emitEvent});
this.segmentedButtonWidgetSettingsForm.get('appearance.leftAppearance.iconSizeUnit').enable({emitEvent});
} else {
this.segmentedButtonWidgetSettingsForm.get('appearance.leftAppearance.icon').disable({emitEvent});
this.segmentedButtonWidgetSettingsForm.get('appearance.leftAppearance.iconSize').disable({emitEvent});
this.segmentedButtonWidgetSettingsForm.get('appearance.leftAppearance.iconSizeUnit').disable({emitEvent});
}
if (showRightIcon) {
this.segmentedButtonWidgetSettingsForm.get('appearance.rightAppearance.icon').enable({emitEvent});
this.segmentedButtonWidgetSettingsForm.get('appearance.rightAppearance.iconSize').enable({emitEvent});
this.segmentedButtonWidgetSettingsForm.get('appearance.rightAppearance.iconSizeUnit').enable({emitEvent});
} else {
this.segmentedButtonWidgetSettingsForm.get('appearance.rightAppearance.icon').disable({emitEvent});
this.segmentedButtonWidgetSettingsForm.get('appearance.rightAppearance.iconSize').disable({emitEvent});
this.segmentedButtonWidgetSettingsForm.get('appearance.rightAppearance.iconSizeUnit').disable({emitEvent});
}
}
} }

13
ui-ngx/src/app/modules/home/components/widget/lib/settings/control/send-rpc-widget-settings.component.html

@ -18,15 +18,10 @@
<section class="tb-widget-settings flex flex-col" [formGroup]="sendRpcWidgetSettingsForm"> <section class="tb-widget-settings flex flex-col" [formGroup]="sendRpcWidgetSettingsForm">
<fieldset class="fields-group"> <fieldset class="fields-group">
<legend class="group-title" translate>widgets.rpc.common-settings</legend> <legend class="group-title" translate>widgets.rpc.common-settings</legend>
<tb-string-pattern-autocomplete class="mat-block flex-1" <mat-form-field class="mat-block flex-1">
brackets="curly" <mat-label translate>widgets.rpc.widget-title</mat-label>
predefinedValuesButton="true" <input matInput formControlName="title">
label="{{'widgets.rpc.common-settings' | translate }}" </mat-form-field>
[disabled]="!sendRpcWidgetSettingsForm.get('showLabel').value"
[predefinedValues]="predefinedValues"
placeholderText="{{ 'widgets.rpc.widget-title' | translate }}"
formControlName="title"
></tb-string-pattern-autocomplete>
<mat-form-field class="mat-block flex-1"> <mat-form-field class="mat-block flex-1">
<mat-label translate>widgets.rpc.button-label</mat-label> <mat-label translate>widgets.rpc.button-label</mat-label>
<input matInput formControlName="buttonText"> <input matInput formControlName="buttonText">

4
ui-ngx/src/app/modules/home/components/widget/lib/settings/control/send-rpc-widget-settings.component.ts

@ -15,7 +15,7 @@
/// ///
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { WidgetSettings, WidgetSettingsComponent, widgetTitleAutocompleteValues } from '@shared/models/widget.models'; import { WidgetSettings, WidgetSettingsComponent } from '@shared/models/widget.models';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state'; import { AppState } from '@core/core.state';
@ -32,8 +32,6 @@ export class SendRpcWidgetSettingsComponent extends WidgetSettingsComponent {
contentTypes = ContentType; contentTypes = ContentType;
predefinedValues = widgetTitleAutocompleteValues;
constructor(protected store: Store<AppState>, constructor(protected store: Store<AppState>,
private fb: UntypedFormBuilder) { private fb: UntypedFormBuilder) {
super(store); super(store);

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

@ -217,7 +217,7 @@ export const HelpLinks = {
mobileQrCode: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/ui/mobile-qr-code/`, mobileQrCode: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/ui/mobile-qr-code/`,
calculatedField: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/calculated-fields/`, calculatedField: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/calculated-fields/`,
aiModels: `${helpBaseUrl}/docs${docPlatformPrefix}/samples/analytics/ai-models/`, aiModels: `${helpBaseUrl}/docs${docPlatformPrefix}/samples/analytics/ai-models/`,
apiKeys: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/ui/api-keys`, apiKeys: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/security/api-keys/`,
timewindowSettings: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/dashboards/#time-window`, timewindowSettings: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/dashboards/#time-window`,
trendzSettings: `${helpBaseUrl}/docs/trendz/`, trendzSettings: `${helpBaseUrl}/docs/trendz/`,
alarmRules: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/alarm-rules/`, alarmRules: `${helpBaseUrl}/docs${docPlatformPrefix}/user-guide/alarm-rules/`,

Loading…
Cancel
Save