-
Notifications
You must be signed in to change notification settings - Fork 193
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
Implement editing / saving multiple modeled methods from the model editor #2952
Implement editing / saving multiple modeled methods from the model editor #2952
Conversation
: viewState.showMultipleModels | ||
? modeledMethodsProp | ||
: modeledMethodsProp.slice(0, 1), |
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.
Nested ternaries are quite hard to read. Could you extract this somehow, for example by lifting the modeledMethodsProp.length === 0
check out of this ternary and moving it before the ternary?
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.
Yep, I agree it's not the prettiest and clearest. I'll extract the whole thing to a method perhaps. The main reason for it being one ternary is so we can keep the variable as a const
, so that's why I'm suggesting something other than splitting into two steps.
Existing tests are now fixed. I'll look at adding some more for |
I've added a couple more tests of |
Switches to using
SetMultipleModeledMethodsMessage
inFromModelEditorMessage
, and therefore allows editing and saving multiple modeled methods in the model editor.The only tricky bit was constructing the
onChange
handlers for the input components. That bit could use some scrutiny when reviewing.Tested locally and appears to be working correctly, both when the feature flag is disabled and enabled.
Checklist
ready-for-doc-review
label there.