summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTatiana Ovchinnikova <t.v.ovtchinnikova@gmail.com>2023-04-25 15:17:43 -0500
committerTatiana Ovchinnikova <t.v.ovtchinnikova@gmail.com>2023-05-05 18:24:42 +0000
commitc10e381f428a3c77ee11a2a5c14dca2c3e439eea (patch)
treee91c6ce339fae7e01aa437b08ee8c63f2aa92eda
parent87a86f5873844ce5265fd2796bdecd6b9b2224f9 (diff)
downloadhorizon-c10e381f428a3c77ee11a2a5c14dca2c3e439eea.tar.gz
Remove Description from Edit Image Metadata
Image description can be edited through Edit Image -> Image Detail, however it also appears as a property in Edit Image -> Metadata when the description is not empty. It's confusing to have it in two sections of one dialog form, and moreover, the Image Detail field always overwrites the Metadata field. This patch removes Description from Edit Metadata. Closes-Bug: #2017698 Change-Id: I041948b4b71f00894f03cc30cfa4592df4a100c3 (cherry picked from commit 283b38e4f10b14c61dff42936c80ae3987f017cf)
-rw-r--r--horizon/static/framework/widgets/metadata/tree/metadata-tree-item.controller.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/horizon/static/framework/widgets/metadata/tree/metadata-tree-item.controller.js b/horizon/static/framework/widgets/metadata/tree/metadata-tree-item.controller.js
index 6234699db..d1d546eb2 100644
--- a/horizon/static/framework/widgets/metadata/tree/metadata-tree-item.controller.js
+++ b/horizon/static/framework/widgets/metadata/tree/metadata-tree-item.controller.js
@@ -17,6 +17,7 @@
'use strict';
var READONLY_PROPERTIES = ['os_hash_algo', 'os_hash_value'];
+ var DUPLICATE_PROPERTIES = ['description'];
angular
.module('horizon.framework.widgets.metadata.tree')
@@ -40,6 +41,11 @@
ctrl.item.leaf.required = false;
}
+ if ('item' in ctrl && 'leaf' in ctrl.item &&
+ DUPLICATE_PROPERTIES.includes(ctrl.item.leaf.name)) {
+ delete ctrl.item;
+ }
+
if ('item' in ctrl && 'leaf' in ctrl.item && ctrl.item.leaf.type === 'array') {
ctrl.values = ctrl.item.leaf.items.enum.filter(filter).sort();