only render property editor readonly mode if the property editor supports it

This commit is contained in:
Mads Rasmussen
2022-06-22 14:53:42 +02:00
parent 8fe2f7e036
commit 16ae85f2db
3 changed files with 8 additions and 7 deletions

View File

@@ -16,10 +16,10 @@
<umb-property-editor
model="property"
preview="propertyEditorDisabled(property) && allowUpdate"
preview="(propertyEditorDisabled(property) && allowUpdate) || (!allowUpdate && !property.supportsReadOnly)"
allow-unlock="allowUpdate && allowEditInvariantFromNonDefault"
on-unlock="unlockInvariantValue(property)"
ng-attr-readonly="{{!allowUpdate || undefined}}">
ng-attr-readonly="{{(property.supportsReadOnly && !allowUpdate) || undefined}}">
</umb-property-editor>
</umb-property>
@@ -48,10 +48,10 @@
<umb-property-editor
model="property"
preview="propertyEditorDisabled(property) && allowUpdate"
preview="(propertyEditorDisabled(property) && allowUpdate) || (!allowUpdate && !property.supportsReadOnly)"
on-unlock="unlockInvariantValue(property)"
allow-unlock="allowUpdate && allowEditInvariantFromNonDefault"
ng-attr-readonly="{{!allowUpdate || undefined}}">
ng-attr-readonly="{{(property.supportsReadOnly && !allowUpdate) || undefined}}">
</umb-property-editor>
</umb-property>

View File

@@ -17,8 +17,8 @@
<umb-property-editor
model="property"
preview="vm.model.variants.length > 1 && !activeVariant.language.isDefault && !property.culture && !property.unlockInvariantValue"
ng-attr-readonly="{{!vm.allowUpdate || undefined}}">
preview="(vm.model.variants.length > 1 && !activeVariant.language.isDefault && !property.culture && !property.unlockInvariantValue) || (!vm.allowUpdate && !property.supportsReadOnly)"
ng-attr-readonly="{{(!vm.allowUpdate && property.supportsReadOnly) || undefined}}">
</umb-property-editor>
</umb-property>

View File

@@ -10,7 +10,8 @@
<umb-property-editor
model="property"
ng-attr-readonly="{{ readonly || undefined }}">
preview="readonly && !property.supportsReadOnly"
ng-attr-readonly="{{(readonly && property.supportsReadOnly) || undefined }}">
</umb-property-editor>
</umb-property>