algairim commented on a change in pull request #222:
URL: https://github.com/apache/brooklyn-ui/pull/222#discussion_r650823484
##########
File path:
ui-modules/blueprint-composer/app/components/providers/blueprint-service.provider.js
##########
@@ -230,7 +230,7 @@ function BlueprintService($log, $q, $sce, paletteApi,
iconGenerator, dslService,
}
function lookup(entity, id, any = false) {
- if (entity._id === id) {
+ if ((entity._id === id) || (entity.id === id)) {
Review comment:
Looks like this lookup is designed for internal `entity._id` only.
internal ID is always randomly generated at instantiation of the entity object
when `entity.id` is a public value, it is optional and usually is null until
assigned. Check if `entity.id` is not `null` first - `... || (entity.id &&
entity.id === id)`, and then compare with the supplied parameter. I wondering
if @ahgittin remembers the history and purpose if this `lookup`. Would be great
to add some JSdoc to clarify.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]