Give meaningful names to elements of Arrays
Also make some changes to Mistral schema. Change-Id: Id9efcd9b7d12697c68226fa104545cf737d62679
This commit is contained in:
parent
0b57e9f29f
commit
27cc3b4525
@ -106,7 +106,7 @@ $(function() {
|
||||
var length = item.length(),
|
||||
subItem = item.get(length-1),
|
||||
nameEntity = extractNameSubItem(subItem),
|
||||
label = 'Element #'+length,
|
||||
label = extractBaseName(subItem, 'Element') + '#' + length,
|
||||
$childLabel = createNewLabel(label).append($removeAction);
|
||||
|
||||
if ( nameEntity ) {
|
||||
@ -156,6 +156,11 @@ $(function() {
|
||||
return item.instanceof(Barricade.Container) && item.get('name');
|
||||
}
|
||||
|
||||
function extractBaseName(item, defaultBaseName) {
|
||||
defaultBaseName = defaultBaseName || 'Element';
|
||||
return item.name || defaultBaseName;
|
||||
}
|
||||
|
||||
function drawFluidContainerNode($label, item) {
|
||||
var $item = $('<div class="inner-node"></div>'),
|
||||
labelId = $label.attr('id'),
|
||||
|
29
js/schema.js
29
js/schema.js
@ -105,9 +105,14 @@
|
||||
|
||||
'name': {'@type': String},
|
||||
'parameters': {
|
||||
'@type': Object,
|
||||
'@required': false,
|
||||
'?': {'@type': String}
|
||||
'@type': Array,
|
||||
'*': {
|
||||
'@class': Barricade.Primitive.extend({
|
||||
'name': 'Parameter'
|
||||
}, {
|
||||
'@type': String
|
||||
})
|
||||
}
|
||||
},
|
||||
'publish': {
|
||||
'@type': String,
|
||||
@ -235,9 +240,15 @@
|
||||
'@default': 'direct'
|
||||
},
|
||||
'parameters': {
|
||||
'@type': Object,
|
||||
'@type': Array,
|
||||
'@required': false,
|
||||
'?': {'@type': String}
|
||||
'*': {
|
||||
'@class': Barricade.Primitive.extend({
|
||||
'name': 'Primitive'
|
||||
}, {
|
||||
'@type': String
|
||||
})
|
||||
}
|
||||
},
|
||||
'output': {
|
||||
'@type': String,
|
||||
@ -260,15 +271,15 @@
|
||||
'@required': false
|
||||
},
|
||||
'actions': {
|
||||
'@type': Array,
|
||||
'@type': Object,
|
||||
'@required': false,
|
||||
'*': {
|
||||
'?': {
|
||||
'@class': types.Mistral.Action
|
||||
}
|
||||
},
|
||||
'workflows': {
|
||||
'@type': Array,
|
||||
'*': {
|
||||
'@type': Object,
|
||||
'?': {
|
||||
'@class': types.Mistral.Workflow
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user