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

fix(code-editor): allow creating hooks with hook type as name #11698

Merged
merged 3 commits into from
Apr 6, 2022

Conversation

laurentlp
Copy link
Contributor

@laurentlp laurentlp commented Apr 5, 2022

This PR adds the possibility to create a hook with the name of the hook type. Before this change, the resulting filename would be .js since we were removing the hook type from its name (not sure why as there seems to be no impact of doing so).

e.g. Creating an after_incoming_middleware hook named: after_incoming_middleware.js

Closes botpress/v12#1580

@linear
Copy link

linear bot commented Apr 5, 2022

DEV-2202 [BUG] Creating a hook named as its type does not work (botpress/botpress botpress/v12#1580)

Describe the bug
When adding a new hook, if you name it with the same name as the type of hook it is, it will result in a file named .js

To Reproduce

simplescreenrecorder-2021-12-21_16.17.52.mp4

Expected behavior
We should be able to name an after_incoming_middleware hook after_incoming_middleware.js without problem

botpress/borpress botpress/v12#1580 by @ laurentlp

@allardy
Copy link
Member

allardy commented Apr 5, 2022

It lets you create a file with the name, but it will not let you open it
image

Actually prevents you from editing any existing hook

@laurentlp
Copy link
Contributor Author

laurentlp commented Apr 6, 2022

Actually prevents you from editing any existing hook

@allardy Good catch, it should be fixed now!

Copy link
Contributor

@samuelmasse samuelmasse left a comment

Choose a reason for hiding this comment

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

LGTM

@laurentlp laurentlp merged commit fd96a81 into master Apr 6, 2022
@laurentlp laurentlp deleted the dev-2202-bug-creating-a-hook-named-as-its-type branch April 6, 2022 16:31
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.

[BUG] Creating a hook named as its type does not work
3 participants