Skip to content

Commit

Permalink
Remove Description from Edit Image Metadata
Browse files Browse the repository at this point in the history
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 283b38e)
  • Loading branch information
xtmprsqzntwlfb authored and darmach committed May 25, 2023
1 parent 2b7a182 commit 00046ed
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -41,6 +42,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();

Expand Down

0 comments on commit 00046ed

Please sign in to comment.