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/08/06 08:16:40 UTC
[brooklyn-ui] branch master updated (3d8f841 -> d3d9856)
This is an automated email from the ASF dual-hosted git repository.
heneveld pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-ui.git.
from 3d8f841 Merge pull request #261 from jathanasiou/fix/required-label-check
new 682a653 instead of checking `default`, make sure we convert from `default` to `defaultValue` when merging parameters
new 5b11de4 fix the "Add ''" button under Configuration which occurs if you e.g. add a parameter on an empty blueprint
new d3d9856 This closes #263
The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../app/components/providers/blueprint-service.provider.js | 2 +-
.../app/components/spec-editor/spec-editor.template.html | 4 ++--
.../app/components/util/model/entity.model.js | 14 ++++++++++++--
3 files changed, 15 insertions(+), 5 deletions(-)
[brooklyn-ui] 01/03: instead of checking `default`,
make sure we convert from `default` to `defaultValue` when merging
parameters
Posted by he...@apache.org.
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 682a6530acfc9260bc2708ea2c9a83ff2179f3c8
Author: Alex Heneveld <al...@cloudsoftcorp.com>
AuthorDate: Thu Aug 5 15:52:26 2021 +0100
instead of checking `default`, make sure we convert from `default` to `defaultValue` when merging parameters
---
.../app/components/providers/blueprint-service.provider.js | 2 +-
.../app/components/util/model/entity.model.js | 14 ++++++++++++--
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/ui-modules/blueprint-composer/app/components/providers/blueprint-service.provider.js b/ui-modules/blueprint-composer/app/components/providers/blueprint-service.provider.js
index 86547cf..c4325e2 100644
--- a/ui-modules/blueprint-composer/app/components/providers/blueprint-service.provider.js
+++ b/ui-modules/blueprint-composer/app/components/providers/blueprint-service.provider.js
@@ -445,7 +445,7 @@ function BlueprintService($log, $q, $sce, paletteApi, iconGenerator, dslService,
if (!k || !Array.isArray(k)) return false;
return k.some(isSet);
}
- const hasDefault = (typeof config.default) !== 'undefined';
+ const hasDefault = (typeof config.defaultValue) !== 'undefined';
switch (key) {
case 'Predicates.notNull()':
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 c30176a..c2446c8 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
@@ -685,7 +685,17 @@ function addConfigKeyDefinition(param, overwrite, skipUpdatesDuringBatch) {
let key = (param || {}).name;
if (!key) throw new Error("'name' field must be included when adding parameter; was", param);
- allConfig[key] = Object.assign(allConfig[key] || {}, param, overwrite ? null : allConfig[key]);
+ let paramMapped = Object.assign({}, param);
+ let configDef = allConfig[key] || {};
+ if (typeof paramMapped.default !== 'undefined') {
+ /* Annoyingly, in parameters, we call the default value "default",
+ * but in config, we call them "defaultValue";
+ * when params are merged to config we need to rename
+ */
+ paramMapped.defaultValue = paramMapped.default;
+ delete paramMapped['default'];
+ }
+ allConfig[key] = Object.assign(configDef, paramMapped, overwrite ? null : configDef);
}
if (!skipUpdatesDuringBatch) {
this.miscData.set('config', Object.values(allConfig));
@@ -1345,4 +1355,4 @@ export class EntityError extends Error {
this.stack = (new Error(message)).stack;
}
}
-}
\ No newline at end of file
+}
[brooklyn-ui] 02/03: fix the "Add ''" button under Configuration
which occurs if you e.g. add a parameter on an empty blueprint
Posted by he...@apache.org.
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 5b11de4bc0d05e9555d81c358d14f62a82667729
Author: Alex Heneveld <al...@cloudsoftcorp.com>
AuthorDate: Thu Aug 5 16:07:24 2021 +0100
fix the "Add ''" button under Configuration which occurs if you e.g. add a parameter on an empty blueprint
note you may also need to "clear filters" in the configuration section in order to see parameters, because there is no way to suggest/pin a parameter in the ui at present (so it is excluded by the default filters).
---
.../app/components/spec-editor/spec-editor.template.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.template.html b/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.template.html
index 55a4b69..8c88e5b 100644
--- a/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.template.html
+++ b/ui-modules/blueprint-composer/app/components/spec-editor/spec-editor.template.html
@@ -323,7 +323,7 @@
<div ng-if="model.miscData.get('config').length === 0">
<h4>No configuration</h4>
<p class="buttons">
- <button class="btn btn-sm btn-success" ng-click="specEditor.addConfigKey(state.config.search)" ng-if="state.config.search">
+ <button class="btn btn-sm btn-success" ng-click="specEditor.addConfigKey(state.config.search)" ng-if="state.config.search && state.config.search!=''">
<i class="fa fa-plus"></i> Add '{{state.config.search}}'
</button>
</p>
@@ -332,7 +332,7 @@
<h4>No matching configuration</h4>
<p class="buttons">
<button class="btn btn-sm btn-default" ng-if="state.config.search.length > 0" ng-click="state.config.search = ''">Clear search</button>
- <button class="btn btn-sm btn-default" ng-click="specEditor.addConfigKey(state.config.search)" ng-if="!specEditor.getConfig(state.config.search)">
+ <button class="btn btn-sm btn-default" ng-click="specEditor.addConfigKey(state.config.search)" ng-if="state.config.search && state.config.search!='' && !specEditor.getConfig(state.config.search)">
<i class="fa fa-plus"></i> Add '{{state.config.search}}'
</button>
<button class="btn btn-sm btn-success" ng-if="!state.config.filter.values.all" ng-click="state.config.filter.values.all = true">
[brooklyn-ui] 03/03: This closes #263
Posted by he...@apache.org.
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 d3d985600b082de4a2b629d9a401c2a1dbb7bcb5
Merge: 3d8f841 5b11de4
Author: Alex Heneveld <al...@cloudsoftcorp.com>
AuthorDate: Fri Aug 6 09:16:36 2021 +0100
This closes #263
.../app/components/providers/blueprint-service.provider.js | 2 +-
.../app/components/spec-editor/spec-editor.template.html | 4 ++--
.../app/components/util/model/entity.model.js | 14 ++++++++++++--
3 files changed, 15 insertions(+), 5 deletions(-)