-
Notifications
You must be signed in to change notification settings - Fork 71
Fixes datasource generation with community connector #180
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
Conversation
Community connectors are not listed in availableConnectors, causing the following when a user chooses 'other' and enters a community connector: ERROR Cannot read property 'package' of undefined Fix makes function return when this is the case, allowing generator to proceed creating skeleton record in datasources.json
Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test." |
@amuramoto Your PR is failing on Travis, can you check it out? |
@superkhau Tests appear to be failing due to PR #173 which is still under review |
@amuramoto Cool, I'll leave this one for @bajtos to review as he is more familiar with this module. It LGTM, but can't really tell with Travis not passing. |
@amuramoto Can you add a unit test to verify your changes? |
@@ -198,6 +198,7 @@ module.exports = yeoman.generators.Base.extend({ | |||
|
|||
installConnector: function() { | |||
var connector = this.availableConnectors[this.connector]; | |||
if (!connector) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When we don't have any information about the custom connector selected for a new datasource, then I think we should assume the package name is same as the connector name and run npm install {this.connector}
.
@amuramoto @superkhau @ritch @raymondfeng Thoughts?
@amuramoto thank you for the pull request, this is indeed a bug that needs to be fixed! I left a comment above, I think we should take a different approach. Also please add a unit-test to verify your change and prevent regressions in the future, see these two existing tests for inspiration: generator-loopback/test/datasource.test.js Lines 45 to 81 in 8fbdb0d
For posterity, the failing CI build is not waiting for #173, but for fixing our dependencies, per
|
Closing in favour of #199 |
Community connectors are not listed in availableConnectors, causing the following when a user chooses 'other' and enters a community connector:
ERROR Cannot read property 'package' of undefined
Fix makes function return when this is the case, allowing generator to proceed creating skeleton record in datasources.json