Bazaar: Added 'isBazaarAvailable' helper
The EntityBazaarInfoCard shows the bazaar data for components that have a bazaar item linked. The isBazaarAvailable helper makes it possible to only include the EntityBazaarInfoCard for components that actually have a bazaar project linked. Closes #15013 Signed-off-by: Niklas Aronsson <niklasar@axis.com>
This commit is contained in:
@@ -49,17 +49,20 @@ Add a **Bazaar icon** to the Sidebar to easily access the Bazaar. In `packages/a
|
||||
Add a **Bazaar card** to the overview tab on the `packages/app/src/components/catalog/EntityPage.tsx` add:
|
||||
|
||||
```diff
|
||||
+ import { EntityBazaarInfoCard } from '@backstage/plugin-bazaar';
|
||||
+ import { EntityBazaarInfoCard, isBazaarAvailable } from '@backstage/plugin-bazaar';
|
||||
|
||||
const overviewContent = (
|
||||
|
||||
<Grid item md={8} xs={12}>
|
||||
<EntityAboutCard variant="gridItem" />
|
||||
</Grid>
|
||||
|
||||
+ <Grid item sm={6}>
|
||||
+ <EntityBazaarInfoCard />
|
||||
+ </Grid>
|
||||
+ <EntitySwitch>
|
||||
+ <EntitySwitch.Case if={isBazaarAvailable}>
|
||||
+ <Grid item sm={6}>
|
||||
+ <EntityBazaarInfoCard />
|
||||
+ </Grid>
|
||||
+ </EntitySwitch.Case>
|
||||
+ </EntitySwitch>
|
||||
|
||||
{/* ...other entity-cards */}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user