Open piatkiewicz opened 2 months ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
You probably didn't want to copy the routes and translations. My initial suspicion here is that by copying the routes you ended up with duplicate "twins" of the route refs. Your copy of the page didn't find a populated version of its shadow twin (which makes the button disappear), while the original route ref is the one that actually was populated.
π Description
I'm trying to customize catalog look. Inspired by documentation I copied the code from backstage/plugins/catalog/src/components/CatalogPage/DefaultCatalogPage.tsx and checked that into my app, but after that
CreateButton
disappears.Logic in DefaultCatalogPage looks like this:
and inside
CreateButton
ifcreateComponentLink
is falsy then it's not getting generated.createComponentLink
is defined few lines before, like that:For some reason when you import CatalogIndexPage from
@backstage/plugin-catalog
it shows the button, but not when imported from local.Exact reproduction steps are:
src/components/CatalogPage/DefaultCatalogPage.tsx
,src/translation.ts
,src/routes.ts
from plugins/catalog into your codespace@backstage/plugin-catalog
package.<DefaultCatalogPage />
on the/catalog
routeI know I can hardcode
const createComponentLink = () => '/create'
as a workaround and then CreateButton appears, but would like to understand why not initially.π Expected behavior
CreateButton should stil be shown
π Actual Behavior with Screenshots
described above
π Reproduction steps
described above
π Provide the context for the Bug.
No response
π₯οΈ Your Environment
backstage 1.29.2
π Have you spent some time to check if this bug has been raised before?
π’ Have you read the Code of Conduct?
Are you willing to submit PR?
No, but I'm happy to collaborate on a PR with someone else