Skip to content

Commit

Permalink
Chore: fix example entityPage and add env details to readme (#82)
Browse files Browse the repository at this point in the history
* fix example entityPage and add env details to readme
  • Loading branch information
ItamarMalka authored Jan 7, 2025
1 parent 1ee3008 commit 10065fc
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
6 changes: 5 additions & 1 deletion packages/app/src/components/catalog/EntityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ const entityWarningContent = (
const overviewContent = (
<>
{entityWarningContent}
<Env0EnvironmentDetailsCard />
<EntitySwitch>
<EntitySwitch.Case if={entity => isEnv0Available(entity)}>
<Env0EnvironmentDetailsCard />
</EntitySwitch.Case>
</EntitySwitch>
</>
);

Expand Down
19 changes: 15 additions & 4 deletions plugins/backstage-plugin-env0/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ yarn --cwd packages/app add @env0/backstage-plugin-env0
```tsx
// In packages/app/src/components/catalog/EntityPage.tsx
import {
env0TabComponent,
isenv0Available,
env0EnvironmentDetailsCard,
Env0TabComponent,
isEnv0Available,
Env0EnvironmentDetailsCard,
} from '@env0/backstage-plugin-env0';
```

Expand All @@ -42,7 +42,18 @@ import {
<Env0TabComponent />
</EntityLayout.Route>
```
### 3. Provide the env0 proxy configuration in `app-config.yaml`:

### 3. Add the env0 details component to `EntityPage.tsx`:
#### Add the env0 details component to the `overviewPage` constant:
```tsx
// In packages/app/src/components/catalog/EntityPage.tsx
<EntitySwitch>
<EntitySwitch.Case if={entity => isEnv0Available(entity)}>
<Env0EnvironmentDetailsCard />
</EntitySwitch.Case>
</EntitySwitch>
```
### 4. Provide the env0 proxy configuration in `app-config.yaml`:
```yaml
proxy:
'/env0':
Expand Down

0 comments on commit 10065fc

Please sign in to comment.