UI: Hide widget mobile settings for SCADA layout.
This commit is contained in:
parent
da2dd466d4
commit
fc563a189f
@ -44,6 +44,7 @@
|
||||
[dashboard]="dashboard"
|
||||
[widget]="widget"
|
||||
[hideHeader]="hideHeader"
|
||||
[scada]="data.scada"
|
||||
isAdd
|
||||
formControlName="widgetConfig">
|
||||
</tb-widget-config>
|
||||
|
||||
@ -37,6 +37,7 @@ export interface AddWidgetDialogData {
|
||||
stateController: IStateController;
|
||||
widget: Widget;
|
||||
widgetInfo: WidgetInfo;
|
||||
scada: boolean;
|
||||
}
|
||||
|
||||
@Component({
|
||||
|
||||
@ -380,6 +380,7 @@
|
||||
[widgetEditMode]="widgetEditMode"
|
||||
[widget]="editingWidget"
|
||||
[widgetLayout]="editingWidgetLayout"
|
||||
[scada]="editingLayoutCtx?.gridSettings?.layoutType === LayoutType.scada"
|
||||
(revertWidgetConfig)="onRevertWidgetEdit()"
|
||||
(applyWidgetConfig)="saveWidget()">
|
||||
</tb-edit-widget>
|
||||
|
||||
@ -1250,7 +1250,8 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
|
||||
col: 0
|
||||
};
|
||||
newWidget = this.dashboardUtils.validateAndUpdateWidget(newWidget);
|
||||
if (this.isAddingToScadaLayout()) {
|
||||
const scada = this.isAddingToScadaLayout();
|
||||
if (scada) {
|
||||
newWidget = this.dashboardUtils.prepareWidgetForScadaLayout(newWidget);
|
||||
}
|
||||
if (widgetTypeInfo.typeParameters.useCustomDatasources) {
|
||||
@ -1267,7 +1268,8 @@ export class DashboardPageComponent extends PageComponent implements IDashboardC
|
||||
aliasController: this.dashboardCtx.aliasController,
|
||||
stateController: this.dashboardCtx.stateController,
|
||||
widget: newWidget,
|
||||
widgetInfo: widgetTypeInfo
|
||||
widgetInfo: widgetTypeInfo,
|
||||
scada
|
||||
}
|
||||
}).afterClosed().subscribe((addedWidget) => {
|
||||
if (addedWidget) {
|
||||
|
||||
@ -24,6 +24,7 @@
|
||||
[dashboard]="dashboard"
|
||||
[widget]="widget"
|
||||
[hideToggleHeader]="previewMode"
|
||||
[scada]="scada"
|
||||
formControlName="widgetConfig">
|
||||
<div class="tb-widget-config-header-prefix">
|
||||
<button mat-button
|
||||
|
||||
@ -28,6 +28,7 @@ import { isDefined, isDefinedAndNotNull, isString } from '@core/utils';
|
||||
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
|
||||
import { WidgetConfigComponent } from '@home/components/widget/widget-config.component';
|
||||
import { DataKeySettingsFunction } from '@home/components/widget/config/data-keys.component.models';
|
||||
import { coerceBoolean } from '@shared/decorators/coercion';
|
||||
|
||||
@Component({
|
||||
selector: 'tb-edit-widget',
|
||||
@ -57,6 +58,10 @@ export class EditWidgetComponent extends PageComponent implements OnInit, OnChan
|
||||
@Input()
|
||||
widgetLayout: WidgetLayout;
|
||||
|
||||
@Input()
|
||||
@coerceBoolean()
|
||||
scada = false;
|
||||
|
||||
@Output()
|
||||
applyWidgetConfig = new EventEmitter<void>();
|
||||
|
||||
|
||||
@ -150,6 +150,10 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, OnDe
|
||||
@coerceBoolean()
|
||||
isAdd = false;
|
||||
|
||||
@Input()
|
||||
@coerceBoolean()
|
||||
scada = false;
|
||||
|
||||
@Input() disabled: boolean;
|
||||
|
||||
widgetConfigMode = WidgetConfigMode.advanced;
|
||||
@ -341,12 +345,14 @@ export class WidgetConfigComponent extends PageComponent implements OnInit, OnDe
|
||||
value: 'actions'
|
||||
}
|
||||
);
|
||||
this.headerOptions.push(
|
||||
{
|
||||
name: this.translate.instant('widget-config.mobile'),
|
||||
value: 'mobile'
|
||||
}
|
||||
);
|
||||
if (!this.scada) {
|
||||
this.headerOptions.push(
|
||||
{
|
||||
name: this.translate.instant('widget-config.mobile'),
|
||||
value: 'mobile'
|
||||
}
|
||||
);
|
||||
}
|
||||
if (!this.selectedOption || !this.headerOptions.find(o => o.value === this.selectedOption)) {
|
||||
this.selectedOption = this.headerOptions[0].value;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user