-
-
Notifications
You must be signed in to change notification settings - Fork 145
Fix template edit link #130
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 template edit link #130
Conversation
| let params = getOwner(this).lookup('route:application').paramsFor('docs.api.class'); | ||
| let klass = dasherize(params.class_id.replace(/-.+$/g, '')); | ||
| let path = `pods/${path}`; | ||
| if (path === 'docs/api/item') { |
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.
docs/api/class was what the original documentation had, but no longer matches what the guide suggests.
| import { computed } from '@ember/object'; | ||
| import appFiles from 'ember-cli-addon-docs/app-files'; | ||
| import { dasherize } from '@ember/string'; | ||
| import addonFiles from 'ember-cli-addon-docs/addon-files'; |
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.
Needed to add the logic to also expose the addon tree contents, otherwise you had to really guess a lot about what the current URL on Github would be. At least now we have a reference of the actual files to try and match against.
|
|
||
| if (path === 'docs/api/class') { | ||
| let params = getOwner(this).lookup('route:application').paramsFor('docs.api.class'); | ||
| let klass = dasherize(params.class_id.replace(/-.+$/g, '')); |
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.
class_id is no longer what the catch-all param for the route is called.
| if (path === 'docs/api/class') { | ||
| let params = getOwner(this).lookup('route:application').paramsFor('docs.api.class'); | ||
| let klass = dasherize(params.class_id.replace(/-.+$/g, '')); | ||
| let path = `pods/${path}`; |
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.
As before, remove the assumption that the files are within pods
|
Not sure if these changes will be compatible with every addon, but it's a step toward the right direction I think. |
|
Sweet. Will try in Storefront soon and see how it works. We should beef up addon docs' test coverage soon |
podsdirectory)docs.api.classroute and updates them to usedocs.api.item