[metadata] Add read-only mode to properties
@@ -46,17 +46,26 @@ const TEMPLATE = `
<!-- ko ifnot: loading -->
<!-- ko ifnot: editMode -->
+ <!-- ko ifnot: window.HAS_READ_ONLY_CATALOG -->
<div class="hue-nav-properties" data-bind="click: startEdit, visibleOnHover: { selector: '.editable-inline-action' }">
- <!-- ko ifnot: properties().length -->
+ <!-- ko if: !properties().length -->
<div class="hue-nav-properties-empty">${I18n('Add properties...')}</div>
<!-- /ko -->
<!-- ko foreach: properties -->
<div class="hue-nav-property"><div class="hue-nav-property-key" data-bind="text: key, attr: { 'title': key }"></div><div class="hue-nav-property-value" data-bind="text: value, attr: { 'title': value }"></div></div>
<!-- /ko -->
- <div class="editable-inline-action" title="${I18n(
- 'Edit'
- )}"><a href="javascript: void(0);" data-bind="click: startEdit"><i class="fa fa-pencil"></i></a></div>
+ <div class="editable-inline-action" title="${I18n('Edit')}"><a href="javascript: void(0);" data-bind="click: startEdit"><i class="fa fa-pencil"></i></a></div>
</div>
+ <!-- /ko -->
+
+ <!-- ko if: window.HAS_READ_ONLY_CATALOG && properties().length -->
+ <div class="hue-nav-properties">
+ <!-- ko foreach: properties -->
+ <div class="hue-nav-property"><div class="hue-nav-property-key" data-bind="text: key, attr: { 'title': key }"></div><div class="hue-nav-property-value" data-bind="text: value, attr: { 'title': value }"></div></div>
+ <!-- /ko -->
+ </div>
+ <!-- /ko -->
+
<!-- /ko -->
<!-- ko if: editMode -->
<div class="hue-nav-properties hue-nav-properties-edit">
@@ -160,6 +169,9 @@ class NavProperties {
}
startEdit() {
+ if (window.HAS_READ_ONLY_CATALOG) {
+ return;
+ }
const self = this;
const editProperties = [];
self.properties().forEach(property => {
