-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
feat(scaffolder/next): Markdown text output #17641
feat(scaffolder/next): Markdown text output #17641
Conversation
Signed-off-by: Zander Franks <zander@zanderf.net>
Signed-off-by: Zander Franks <zander@zanderf.net>
Signed-off-by: Zander Franks <zander@zanderf.net>
Changed Packages
|
Uffizzi Preview |
Signed-off-by: Zander Franks <zander@zanderf.net>
Signed-off-by: Zander Franks <zander@zanderf.net>
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.
Nice! thanks for this! Looking great. Just a few comments here!
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.
I wonder if we can get some tests for this too?
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.
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.
You could try using renderInTestApp
instead, and look for some examples with having entityRouteRef
being used in mountedRoutes
i think it is.
Something like this should work:
backstage/packages/app/src/components/home/templates/DefaultTemplate.stories.tsx
Lines 111 to 138 in 7eaf2e0
wrapInTestApp( | |
<> | |
<TestApiProvider | |
apis={[ | |
[stackOverflowApiRef, mockStackOverflowApi], | |
[catalogApiRef, mockCatalogApi], | |
[starredEntitiesApiRef, starredEntitiesApi], | |
[searchApiRef, { query: () => Promise.resolve({ results: [] }) }], | |
[ | |
configApiRef, | |
new ConfigReader({ | |
stackoverflow: { | |
baseUrl: 'https://api.stackexchange.com/2.2', | |
}, | |
}), | |
], | |
]} | |
> | |
<Story /> | |
</TestApiProvider> | |
</>, | |
{ | |
mountedRoutes: { | |
'/hello-company': searchPlugin.routes.root, | |
'/catalog/:namespace/:kind/:name': entityRouteRef, | |
}, | |
}, | |
), |
The mountedRoutes
part is important with the entityRouteRef
.
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.
Thanks, this works! I've written a small test for DefaultTemplateOutputs
. Let me know what you think! I couldn't think of an intuitive way to dynamically test the body of text outputs because of Markdown -- we could fix this by hard-coding test cases instead of reading from the output
object.
Signed-off-by: Zander Franks <zander@zanderf.net>
Signed-off-by: Zander <me@zanderf.net>
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.
Just a comment about what to do with the build failure.
text: | ||
- title: More information | ||
content: | | ||
Access the \[remote repository\](${{ steps['publish'].output.remoteUrl }}). |
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.
Hmm I think that this example isn't compatible with our tooling which checks that all links are valid. Might be a little bug there. I wonder if we can just do simpler example here for now so we can get this in the release and we can take a look at that bug which is making this fail at a later date.
Signed-off-by: Zander Franks <zander@zanderf.net>
Nice thanks! |
Thank you for contributing to Backstage! The changes in this pull request will be part of the |
Hey, I just made a Pull Request!
This PR adds support for
text
outputs on templates inscaffolder/next
. Addresses #17596.They appear like
link
outputs, but can be clicked to reveal a box that renders theircontent
as Markdown.✔️ Checklist
Signed-off-by
line in the message. (more info)