-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add support of environment variable for tab & group #3112
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few comments for your feedback.
packages/node_modules/@node-red/editor-client/src/js/ui/workspaces.js
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment, I'm not sure the approach to getting a Group setting is right - the logic is outside of Flow.js. It feels to me like Flow should own that logic.
At the moment we have getSetting(name)
on the Flow object. That gets you the setting for the flow (or returns the process.env
value).
From an API design, I think it would be cleaner to have something like getNodeSetting(node,name)
that does the work to check if the node is in a group, handle nested groups, and then fallback to getSetting(name)
.
But that is a piece of refactoring I'm happy to make later, if we're happy with the overall functionality.
* @param {String} key | ||
* @return {Object} result containinig val property or null | ||
*/ | ||
getFlowSetting(name) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We already have getSetting
defined on the Flow
object. Why have you separated this out? I can see getSetting
now calls this function - but I cannot see it being called from anywhere else.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Merged them, as there is no particular reason for them to be separated.
Can you retarget this for the As part of the Flow Testing requirement to be able to add custom edit panes to the dialogs, I've been working on a refactoring of |
Retargeted to |
I assume you are happy for me to merge this PR? It is still in draft state. |
Yes. Of course. I am happy that you will merge this PR. |
Merged as part of #3130 |
Proposed changes
This draft PR adds support of environment variable definition feature to tabs and groups.
(design note: node-red/designs#56)
[test Flow]
Checklist
grunt
to verify the unit tests pass