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

Support keyword replacement for custom prompts when using the directory format #963

Conversation

jacobwood091
Copy link
Contributor

🔧 Changes

This updates the prompt parser for the directory structure to support dynamic keyword replacement within the template file of a custom prompt partial. This was already handled by the basic mechanism for handling YAML, but not the other way around.

📚 References

Addresses #962

🔬 Testing

  1. Create a custom prompt partial with a given keyword:
<!-- resources/prompts/partials/signup/signup/form-content-end.html -->
<div>Hello, ##SOME_KEYWORD##</div>
  1. Deploy it, having configured the respective keyword mapping:

In your config:

{
  "SOME_KEYWORD": "world"
}
a0deploy import -c=config.json --input_file=resources

I tend to deploy using the method exported from the module, so the above may need adjustment to compensate for use of the CLI.

  1. Fetch the content of the prompt partial from Auth0. The expectation is:
<div>Hello, world!</div>

📝 Checklist

  • All new/changed/fixed functionality is covered by tests (or N/A)
  • (N/A) I have added documentation for all new/changed functionality (or N/A)

@jacobwood091 jacobwood091 requested a review from a team as a code owner October 9, 2024 21:37
@kushalshit27
Copy link
Contributor

kushalshit27 commented Oct 14, 2024

@jacobwood091
Thank you for submitting this PR! I really appreciate the time and effort you put into it. The code looks good overall.

I do have a suggestions for improvement:

  • add new tests for keyword replacement for prompts

Thank you again for your contribution!

Once you make these changes, I’ll be happy to merge your PR!

@jacobwood091 jacobwood091 force-pushed the support-keyword-replacement-for-partials branch from 855518f to 9c6e414 Compare October 14, 2024 18:21
@kushalshit27
Copy link
Contributor

Thank you for your excellent work on this PR! 🚀 If you have further suggestions, feel free to share.

@kushalshit27 kushalshit27 merged commit 45bc0cd into auth0:master Oct 15, 2024
8 of 9 checks passed
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.

2 participants