Browse Source

Updated translation, added helper functions, updated settings

pull/14155/head
LeoMorgan113 11 months ago
parent
commit
02bc6fd8b2
  1. 22
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-data-layer-dialog.component.html
  2. 17
      ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-data-layer-dialog.component.ts
  3. 14
      ui-ngx/src/app/shared/models/widget/maps/map.models.ts

22
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-data-layer-dialog.component.html

@ -163,6 +163,26 @@
(keyEdit)="editKey('circleKey')" (keyEdit)="editKey('circleKey')"
formControlName="circleKey"> formControlName="circleKey">
</tb-data-key-input> </tb-data-key-input>
<tb-data-key-input
*ngIf="dataLayerType === 'polylines'"
inlineField="false"
appearance="outline"
subscriptSizing="fixed"
label="{{ 'widgets.maps.data-layer.polyline.polyline-key' | translate }}"
required
requiredText="widgets.maps.data-layer.polyline.polyline-key-required"
[datasourceType]="dataLayerFormGroup.get('dsType').value"
[entityAliasId]="dataLayerFormGroup.get('dsEntityAliasId').value"
[deviceId]="dataLayerFormGroup.get('dsDeviceId').value"
[aliasController]="context.aliasController"
[widgetType]="widgetType.latest"
[dataKeyType]="context.functionsOnly ? DataKeyType.function : null"
[dataKeyTypes]="[DataKeyType.attribute, DataKeyType.timeseries]"
[callbacks]="context.callbacks"
[generateKey]="context.generateDataKey"
(keyEdit)="editKey('polylineKey')"
formControlName="polylineKey">
</tb-data-key-input>
<tb-data-keys <tb-data-keys
formControlName="additionalDataKeys" formControlName="additionalDataKeys"
appearance="outline" appearance="outline"
@ -370,6 +390,8 @@
</ng-template> </ng-template>
</mat-expansion-panel> </mat-expansion-panel>
</div> </div>
</ng-container>
<ng-container *ngIf="['trips', 'polylines'].includes(dataLayerType)">
<div class="tb-form-panel tb-slide-toggle stroked"> <div class="tb-form-panel tb-slide-toggle stroked">
<mat-expansion-panel class="tb-settings" [expanded]="dataLayerFormGroup.get('showPoints').value" <mat-expansion-panel class="tb-settings" [expanded]="dataLayerFormGroup.get('showPoints').value"
[disabled]="!dataLayerFormGroup.get('showPoints').value"> [disabled]="!dataLayerFormGroup.get('showPoints').value">

17
ui-ngx/src/app/modules/home/components/widget/lib/settings/common/map/map-data-layer-dialog.component.ts

@ -306,18 +306,19 @@ export class MapDataLayerDialogComponent extends DialogComponent<MapDataLayerDia
this.dialogTitle = 'widgets.maps.data-layer.polyline.polyline-configuration'; this.dialogTitle = 'widgets.maps.data-layer.polyline.polyline-configuration';
this.dataLayerEditTitle = 'widgets.maps.data-layer.polyline.edit'; this.dataLayerEditTitle = 'widgets.maps.data-layer.polyline.edit';
this.dataLayerFormGroup.addControl('polylineKey', this.fb.control(polylineShapeDataLayer.polylineKey, Validators.required)); this.dataLayerFormGroup.addControl('polylineKey', this.fb.control(polylineShapeDataLayer.polylineKey, Validators.required));
this.dataLayerFormGroup.addControl('usePathDecorator', this.fb.control(polylineShapeDataLayer.usePathDecorator)); // this.dataLayerFormGroup.addControl('usePathDecorator', this.fb.control(polylineShapeDataLayer.usePathDecorator));
this.dataLayerFormGroup.addControl('pathDecoratorSymbol', this.fb.control(polylineShapeDataLayer.pathDecoratorSymbol, Validators.required)); // this.dataLayerFormGroup.addControl('pathDecoratorSymbol', this.fb.control(polylineShapeDataLayer.pathDecoratorSymbol, Validators.required));
this.dataLayerFormGroup.addControl('pathDecoratorSymbolSize', this.fb.control(polylineShapeDataLayer.pathDecoratorSymbolSize, [Validators.required, Validators.min(0)])); // this.dataLayerFormGroup.addControl('pathDecoratorSymbolSize', this.fb.control(polylineShapeDataLayer.pathDecoratorSymbolSize, [Validators.required, Validators.min(0)]));
this.dataLayerFormGroup.addControl('pathDecoratorSymbolColor', this.fb.control(polylineShapeDataLayer.pathDecoratorSymbolColor)); // this.dataLayerFormGroup.addControl('pathDecoratorSymbolColor', this.fb.control(polylineShapeDataLayer.pathDecoratorSymbolColor));
this.dataLayerFormGroup.addControl('pathDecoratorOffset', this.fb.control(polylineShapeDataLayer.pathDecoratorOffset, [Validators.required, Validators.min(0)])); // this.dataLayerFormGroup.addControl('pathDecoratorOffset', this.fb.control(polylineShapeDataLayer.pathDecoratorOffset, [Validators.required, Validators.min(0)]));
this.dataLayerFormGroup.addControl('pathEndDecoratorOffset', this.fb.control(polylineShapeDataLayer.pathEndDecoratorOffset, [Validators.required, Validators.min(0)])); // this.dataLayerFormGroup.addControl('pathEndDecoratorOffset', this.fb.control(polylineShapeDataLayer.pathEndDecoratorOffset, [Validators.required, Validators.min(0)]));
this.dataLayerFormGroup.addControl('pathDecoratorRepeat', this.fb.control(polylineShapeDataLayer.pathDecoratorRepeat, [Validators.required, Validators.min(0)])); // this.dataLayerFormGroup.addControl('pathDecoratorRepeat', this.fb.control(polylineShapeDataLayer.pathDecoratorRepeat, [Validators.required, Validators.min(0)]));
this.dataLayerFormGroup.addControl('showPoints', this.fb.control(polylineShapeDataLayer.showPoints)); this.dataLayerFormGroup.addControl('showPoints', this.fb.control(polylineShapeDataLayer.showPoints));
this.dataLayerFormGroup.addControl('pointSize', this.fb.control(polylineShapeDataLayer.pointSize, [Validators.required, Validators.min(0)])); this.dataLayerFormGroup.addControl('pointSize', this.fb.control(polylineShapeDataLayer.pointSize, [Validators.required, Validators.min(0)]));
this.dataLayerFormGroup.addControl('pointColor', this.fb.control(polylineShapeDataLayer.pointColor, Validators.required)); this.dataLayerFormGroup.addControl('pointColor', this.fb.control(polylineShapeDataLayer.pointColor, Validators.required));
this.dataLayerFormGroup.addControl('pointTooltip', this.fb.control(polylineShapeDataLayer.pointTooltip)); this.dataLayerFormGroup.addControl('pointTooltip', this.fb.control(polylineShapeDataLayer.pointTooltip));
merge(this.dataLayerFormGroup.get('usePathDecorator').valueChanges, merge(
// this.dataLayerFormGroup.get('usePathDecorator').valueChanges,
this.dataLayerFormGroup.get('showPoints').valueChanges).pipe( this.dataLayerFormGroup.get('showPoints').valueChanges).pipe(
takeUntilDestroyed(this.destroyRef) takeUntilDestroyed(this.destroyRef)
).subscribe(() => ).subscribe(() =>

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

@ -687,13 +687,13 @@ export const defaultBasePolylinesDataLayerSettings = (mapType: MapType): Partial
type: DataLayerColorType.constant, type: DataLayerColorType.constant,
color: '#3388ff', color: '#3388ff',
}, },
usePathDecorator: false, // usePathDecorator: false,
pathDecoratorSymbol: PathDecoratorSymbol.arrowHead, // pathDecoratorSymbol: PathDecoratorSymbol.arrowHead,
pathDecoratorSymbolSize: 10, // pathDecoratorSymbolSize: 10,
pathDecoratorSymbolColor: '#307FE5', // pathDecoratorSymbolColor: '#307FE5',
pathDecoratorOffset: 20, // pathDecoratorOffset: 20,
pathEndDecoratorOffset: 20, // pathEndDecoratorOffset: 20,
pathDecoratorRepeat: 20, // pathDecoratorRepeat: 20,
showPoints: false, showPoints: false,
pointSize: 10, pointSize: 10,
pointColor: { pointColor: {

Loading…
Cancel
Save