Skip to content

Extract model type dropdown to its own component#2833

Merged
charisk merged 1 commit intomainfrom
charisk/model-type-dropdown
Sep 20, 2023
Merged

Extract model type dropdown to its own component#2833
charisk merged 1 commit intomainfrom
charisk/model-type-dropdown

Conversation

@charisk
Copy link
Copy Markdown
Contributor

@charisk charisk commented Sep 20, 2023

This will allow us to reuse code for the new method modeling panel.

I've not added any unit tests/stories - we can do that in a separate issue.

Checklist

N/A:

  • CHANGELOG.md has been updated to incorporate all user visible changes made by this pull request.
  • Issues have been created for any UI or other user-facing changes made by this pull request.
  • [Maintainers only] If this pull request makes user-facing changes that require documentation changes, open a corresponding docs pull request in the github/codeql repo and add the ready-for-doc-review label there.

@charisk charisk requested a review from a team as a code owner September 20, 2023 08:23
input: argumentsList.length === 0 ? "Argument[this]" : "Argument[0]",
output: "ReturnValue",
kind: "value",
...modeledMethod,
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this seems a bit off - we're spreading in the middle of the object creation, which means we could lose the property values we've set above. Seems like we should move the spread operation to L45 instead (or just do assignments explicitly).

For now I wanted to make minimal changes to the logic so I've left it as is.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, let's not change this in this PR, but I agree it looks odd to do the spread in the middle of the arguments. It would be good to investigate why it is this way, but overall I'd say lets just write it all out explicitly and not use the spread.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@koesie10 any thoughts on this?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just remove this spread operator. It seems like all fields are overridden, so this doesn't add any value. We can use an object spread operator on method instead, but this can be at the end of this object.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks all - I'll crate a separate PR for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants