You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2021/05/31 14:46:36 UTC
[brooklyn-ui] 01/02: add tags to model used in composer
This is an automated email from the ASF dual-hosted git repository.
heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-ui.git
commit 69fee1bf051f00003968d5474162e641dc31285f
Author: Alex Heneveld <al...@cloudsoftcorp.com>
AuthorDate: Mon May 31 14:58:48 2021 +0100
add tags to model used in composer
---
.../blueprint-composer/app/components/util/model/entity.model.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/ui-modules/blueprint-composer/app/components/util/model/entity.model.js b/ui-modules/blueprint-composer/app/components/util/model/entity.model.js
index ad8bd6f..a62374f 100644
--- a/ui-modules/blueprint-composer/app/components/util/model/entity.model.js
+++ b/ui-modules/blueprint-composer/app/components/util/model/entity.model.js
@@ -25,9 +25,10 @@ const FIRST_MEMBERSPEC_REGEX = /^(\w+\.)*first[mM]ember[sS]pec$/;
// TODO ideally we'd just look at type EntitySpec, not key name, but for now look at keyname, anything ending memberSpec
const ANY_MEMBERSPEC_REGEX = /^(\w+\.)*(\w*)[mM]ember[sS]pec$/;
const RESERVED_KEY_REGEX = /(^children$|^services$|^locations?$|^brooklyn\.config$|^brooklyn\.parameters$|^brooklyn\.enrichers$|^brooklyn\.policies$)/;
-const FIELD = {
+export const FIELD = {
SERVICES: 'services', CHILDREN: 'brooklyn.children', CONFIG: 'brooklyn.config', PARAMETERS: 'brooklyn.parameters', LOCATION: 'location',
POLICIES: 'brooklyn.policies', ENRICHERS: 'brooklyn.enrichers', INITIALIZERS: 'brooklyn.initializers', TYPE: 'type', NAME: 'name', ID: 'id',
+ TAGS: 'brooklyn.tags',
// This field is not part of the Brooklyn blueprint spec but used to store information about the composer, e.g. X,Y coordinates, virtual items, etc
COMPOSER_META: 'brooklyn.composer.metadata'
};
@@ -1098,6 +1099,9 @@ function setEntityFromJson(incomingModel, setChildren = true) {
if (composerMetadata.hasOwnProperty('virtualType')) {
self.addMetadata(FIELD.TYPE, composerMetadata.virtualType);
}
+ if (composerMetadata.hasOwnProperty('tags')) {
+ self.addMetadata(FIELD.TAGS, composerMetadata.virtualType);
+ }
break;
default:
self.addMetadata(key, incomingModel[key]);