Skip to content
This repository was archived by the owner on May 14, 2025. It is now read-only.

Commit e988396

Browse files
BoykoAlexghillert
authored andcommitted
Adopt scriptable-transform tooltip to properties prefix
1 parent 01aab15 commit e988396

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

ui/app/scripts/stream/services/render-service.js

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,21 @@ define(function(require) {
473473
});
474474

475475
scope.isCode = function(key) {
476-
return scope.schema && scope.schema[key] && typeof scope.schema[key].contentType === 'string';
476+
if (scope.schema) {
477+
// Key is a property name, properties are indexed by ids of a form <prefix><name>
478+
var prefix = '';
479+
var ids = scope.keys(scope.schema);
480+
// Check if property is a property name, i.e. . char is a delimiter between prefixes
481+
if (key.lastIndexOf('.') < 0 && ids.length) {
482+
var propertyId = ids[0];
483+
var idx = propertyId.lastIndexOf('.');
484+
if (idx >= 0) {
485+
prefix = propertyId.substring(0, idx + 1);
486+
}
487+
}
488+
var id = prefix + key;
489+
return scope.schema[id] && typeof scope.schema[id].contentType === 'string';
490+
}
477491
};
478492

479493
scope.getPropertyValue = function(key) {

0 commit comments

Comments
 (0)