Fix disable on condition and errors displaying
This commit is contained in:
parent
6f2c1deca8
commit
25a6927b6e
@ -198,7 +198,7 @@ function MultipleInputWidgetController($q, $scope, $translate, attributeService,
|
||||
var datasource = vm.datasources[0];
|
||||
if (datasource.type === types.datasourceType.entity) {
|
||||
for (var i = 0; i < datasource.dataKeys.length; i++) {
|
||||
if ((datasource.entityType !== types.entityType.device) && (datasource.dataKeys[i].settings.dataKeyType !== 'server')) {
|
||||
if ((datasource.entityType !== types.entityType.device) && (datasource.dataKeys[i].settings.dataKeyType == 'shared')) {
|
||||
vm.isAllParametersValid = false;
|
||||
}
|
||||
vm.data.push(datasource.dataKeys[i]);
|
||||
@ -234,6 +234,7 @@ function MultipleInputWidgetController($q, $scope, $translate, attributeService,
|
||||
currentValue: value,
|
||||
originalValue: value
|
||||
};
|
||||
}
|
||||
|
||||
if (vm.data[i].settings.isEditable === 'editable' && vm.data[i].settings.disabledOnDataKey) {
|
||||
var conditions = data.filter((item) => {
|
||||
@ -251,7 +252,6 @@ function MultipleInputWidgetController($q, $scope, $translate, attributeService,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function updateWidgetDisplaying() {
|
||||
vm.changeAlignment = (vm.ctx.$container[0].offsetWidth < 620);
|
||||
|
||||
@ -34,6 +34,7 @@
|
||||
|
||||
md-switch {
|
||||
margin-top: 20px;
|
||||
white-space: normal;
|
||||
}
|
||||
|
||||
.md-icon-button md-icon {
|
||||
|
||||
@ -16,8 +16,8 @@
|
||||
|
||||
-->
|
||||
<form class="tb-multiple-input" name="multipleInputForm" ng-submit="vm.save()" novalidate autocomplete="off">
|
||||
<div style="padding: 0 8px; margin: auto 0;">
|
||||
<div ng-show="vm.entityDetected" layout="row" layout-wrap ng-class="{'vertical-alignment': vm.isVerticalAlignment || vm.changeAlignment}">
|
||||
<div style="padding: 0 8px;" ng-if="vm.entityDetected && vm.isAllParametersValid">
|
||||
<div layout="row" layout-wrap ng-class="{'vertical-alignment': vm.isVerticalAlignment || vm.changeAlignment}">
|
||||
<div ng-repeat="key in vm.data" ng-style="{'width': (vm.isVerticalAlignment || vm.changeAlignment) ? '100%' : vm.inputWidthSettings}">
|
||||
<div class="input-field" ng-if="(key.settings.dataKeyValueType === 'string') && !key.settings.dataKeyHidden">
|
||||
<md-input-container class="md-block">
|
||||
@ -129,14 +129,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center; font-size: 18px; color: #a0a0a0;" ng-hide="vm.entityDetected">
|
||||
{{ 'widgets.input-widgets.no-entity-selected' | translate }}
|
||||
</div>
|
||||
<div style="text-align: center; font-size: 18px; color: #a0a0a0;" ng-show="vm.entityDetected && !vm.isAllParametersValid">
|
||||
{{ 'widgets.input-widgets.not-allowed-entity' | translate }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="md-padding" layout="row" layout-align="end center" ng-if="vm.entityDetected && vm.settings.showActionButtons">
|
||||
<md-button class="md-primary" ng-click="vm.discardAll()" style="max-height: 50px; margin-right:20px;" ng-disabled="!multipleInputForm.$dirty">
|
||||
{{ 'action.undo' | translate }}
|
||||
@ -146,4 +138,13 @@
|
||||
{{ 'action.save' | translate }}
|
||||
</md-button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tb-multiple-input__errors" layout="column" layout-align="center center" style="height: 100%;" ng-if="!vm.entityDetected || !vm.isAllParametersValid">
|
||||
<div style="text-align: center; font-size: 18px; color: #a0a0a0;" ng-hide="vm.entityDetected">
|
||||
{{ 'widgets.input-widgets.no-entity-selected' | translate }}
|
||||
</div>
|
||||
<div style="text-align: center; font-size: 18px; color: #a0a0a0;" ng-show="vm.entityDetected && !vm.isAllParametersValid">
|
||||
{{ 'widgets.input-widgets.not-allowed-entity' | translate }}
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user