Skip to content
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

feat: Add parameterization rule custom code UI #344

Merged
merged 10 commits into from
Nov 18, 2024

Conversation

e-fisher
Copy link
Collaborator

@e-fisher e-fisher commented Nov 11, 2024

Description

Add ability to use custom code in parameterization rules. The editor will include read-only function definition to reflect how the snippet will look in the script. In the future, this could be extended to pass arguments to parameterization function (query params, body, headers) and show inline types in the snippet editor.

How to Test

  • Create a parameterization rule with custom code, verify parameterized value in script and validator
  • Verify it's not possible to edit anything other than contents of the wrapper function

Checklist

  • I have performed a self-review of my code.
  • I have added tests for my changes.
  • I have run linter locally (npm run lint) and all checks pass.
  • I have run tests locally (npm test) and all tests pass.
  • I have commented on my code, particularly in hard-to-understand areas.

Screenshots (if appropriate):

CleanShot 2024-11-11 at 17 11 56

Related PR(s)/Issue(s)

@e-fisher e-fisher force-pushed the feat/parameterization-code-ui branch from de79513 to b6894bc Compare November 15, 2024 12:10
@e-fisher e-fisher marked this pull request as ready for review November 15, 2024 12:11
@e-fisher e-fisher requested a review from a team as a code owner November 15, 2024 12:11
@e-fisher e-fisher requested review from going-confetti and Llandy3d and removed request for a team November 15, 2024 12:11
Copy link
Member

@Llandy3d Llandy3d left a comment

Choose a reason for hiding this comment

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

Reviewing from the functionality standpoint, it works really well! 🚀 🚀 🚀

It's nice that we can showcase the encasing function in such a native way to the editor 🚀 🙌

Copy link
Collaborator

@cristianoventura cristianoventura left a comment

Choose a reason for hiding this comment

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

Nicely done! 👏

@@ -0,0 +1,59 @@
declare module 'constrained-editor-plugin' {
Copy link
Collaborator

Choose a reason for hiding this comment

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

😮 Are they accepting contributions?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The repository doesn't look active lately 😞 But we have already been using this in GCk6 and had types defined there

@e-fisher e-fisher merged commit 04ff607 into main Nov 18, 2024
2 checks passed
@e-fisher e-fisher deleted the feat/parameterization-code-ui branch November 18, 2024 07:55
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