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
ChatChannelSettingsSection component: remove hardcoded email #9826
Comments
|
Thanks for the issue! We'll take your request into consideration and follow up if we decide to tackle this issue. To our amazing contributors: issues labeled To claim an issue to work on, please leave a comment. If you've claimed the issue and need help, please ping @forem/oss and we will follow up within 3 business days. For full info on how to contribute, please check out our contributors guide. |
|
Hello there. If this issue is not taken I would like to help. |
|
I've assigned you the issue. How do you plan to tackle this? |
|
Right now email is available via rails helper email_link. These could be exposed to the Javascript side by couple of ways
We could build a Javascript (using some helper) that sets these globals that gets included in the app/views/layouts/application.html.erb
|
|
I feel like there could be a better way. any thoughts on this? |
|
My thought was to simply add the email somewhere in the DOM of the page where the chat is mounted but not sure if that's the best approach either. I remember we have a way to pass data from Rails to webpack but I don't remember where is that used and I can't find it in the docs. |
|
You can create a webpacker pack file that is an erb template. The webpack loader to do this is already in place. See https://github.com/usabilityhub/rails-erb-loader for an example of how to do this. The pack file can get the value from the Rails side and then pass it in as a prop to a component. One thing to note is that you will not be able to test this file in jest, which is why making the pack file an erb template makes the most sense. |
Describe the bug
Email yo@dev.to is hardcoded in component app/javascript/chat/ChatChannelSettings/ChatChannelSettingsSection.jsx
Expected behavior
Email should be fetched from the settings
Desktop:
The text was updated successfully, but these errors were encountered: