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