Skip to content

Commit

Permalink
move argo workflows to ci/cd tab. remove unused components (#37)
Browse files Browse the repository at this point in the history
Signed-off-by: Manabu McCloskey <[email protected]>
  • Loading branch information
nabuskey authored Sep 19, 2024
1 parent 5f3a54f commit e8b8483
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 65 deletions.
59 changes: 5 additions & 54 deletions packages/app/src/components/catalog/EntityPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,8 @@ import {
} from '@backstage/plugin-api-docs';
import {
EntityAboutCard,
EntityDependsOnComponentsCard,
EntityDependsOnResourcesCard,
EntityHasComponentsCard,
EntityHasResourcesCard,
EntityHasSubcomponentsCard,
EntityHasSystemsCard,
EntityLayout,
EntityLinksCard,
Expand All @@ -28,10 +25,6 @@ import {
hasRelationWarnings,
EntityRelationWarning,
} from '@backstage/plugin-catalog';
import {
isGithubActionsAvailable,
EntityGithubActionsContent,
} from '@backstage-community/plugin-github-actions';
import {
EntityUserProfileCard,
EntityGroupProfileCard,
Expand All @@ -58,15 +51,15 @@ import {
import { TechDocsAddons } from '@backstage/plugin-techdocs-react';
import { ReportIssue } from '@backstage/plugin-techdocs-module-addons-contrib';

import { EntityKubernetesContent } from '@backstage/plugin-kubernetes';
import { EntityKubernetesContent, isKubernetesAvailable } from '@backstage/plugin-kubernetes';

import {
EntityArgoCDOverviewCard,
isArgocdAvailable
} from '@roadiehq/backstage-plugin-argo-cd';

import {
EntityArgoWorkflowsOverviewCard, EntityArgoWorkflowsTemplateOverviewCard,
EntityArgoWorkflowsOverviewCard,
isArgoWorkflowsAvailable,
} from '@internal/plugin-argo-workflows';
import {ApacheSparkPage, isApacheSparkAvailable} from "@internal/plugin-apache-spark";
Expand All @@ -81,11 +74,9 @@ const techdocsContent = (
);

const cicdContent = (
// This is an example of how you can implement your company's logic in entity page.
// You can for example enforce that all components of type 'service' should use GitHubActions
<EntitySwitch>
<EntitySwitch.Case if={isGithubActionsAvailable}>
<EntityGithubActionsContent />
<EntitySwitch.Case if={e => isArgoWorkflowsAvailable(e)}>
<EntityArgoWorkflowsOverviewCard title="Workflows"/>
</EntitySwitch.Case>

<EntitySwitch.Case>
Expand Down Expand Up @@ -148,16 +139,6 @@ const overviewContent = (
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
<EntitySwitch>
<EntitySwitch.Case if={e => isArgoWorkflowsAvailable(e)}>
<Grid item md={6}>
<EntityArgoWorkflowsOverviewCard />
</Grid>
<Grid item md={6}>
<EntityArgoWorkflowsTemplateOverviewCard />
</Grid>
</EntitySwitch.Case>
</EntitySwitch>
<EntitySwitch>
<EntitySwitch.Case if={e => isTerraformAvailable(e)}>
<Grid item md={6}>
Expand All @@ -168,14 +149,9 @@ const overviewContent = (
<Grid item md={6} xs={12}>
<EntityCatalogGraphCard variant="gridItem" height={400} />
</Grid>

<Grid item md={4} xs={12}>
<EntityLinksCard />
</Grid>
<Grid item md={8} xs={12}>
<EntityHasSubcomponentsCard variant="gridItem" />
</Grid>

</Grid>
);

Expand All @@ -189,7 +165,7 @@ const serviceEntityPage = (
{cicdContent}
</EntityLayout.Route>

<EntityLayout.Route path="/kubernetes" title="Kubernetes">
<EntityLayout.Route path="/kubernetes" title="Kubernetes" if={e => isKubernetesAvailable(e)}>
<EntityKubernetesContent refreshIntervalMs={30000} />
</EntityLayout.Route>

Expand All @@ -208,17 +184,6 @@ const serviceEntityPage = (
</Grid>
</EntityLayout.Route>

<EntityLayout.Route path="/dependencies" title="Dependencies">
<Grid container spacing={3} alignItems="stretch">
<Grid item md={6}>
<EntityDependsOnComponentsCard variant="gridItem" />
</Grid>
<Grid item md={6}>
<EntityDependsOnResourcesCard variant="gridItem" />
</Grid>
</Grid>
</EntityLayout.Route>

<EntityLayout.Route path="/docs" title="Docs">
{techdocsContent}
</EntityLayout.Route>
Expand All @@ -235,17 +200,6 @@ const websiteEntityPage = (
{cicdContent}
</EntityLayout.Route>

<EntityLayout.Route path="/dependencies" title="Dependencies">
<Grid container spacing={3} alignItems="stretch">
<Grid item md={6}>
<EntityDependsOnComponentsCard variant="gridItem" />
</Grid>
<Grid item md={6}>
<EntityDependsOnResourcesCard variant="gridItem" />
</Grid>
</Grid>
</EntityLayout.Route>

<EntityLayout.Route path="/docs" title="Docs">
{techdocsContent}
</EntityLayout.Route>
Expand Down Expand Up @@ -296,9 +250,6 @@ const apiPage = (
<Grid item md={6} xs={12}>
<EntityCatalogGraphCard variant="gridItem" height={400} />
</Grid>
<Grid item md={4} xs={12}>
<EntityLinksCard />
</Grid>
<Grid container item md={12}>
<Grid item md={6}>
<EntityProvidingComponentsCard />
Expand Down
20 changes: 10 additions & 10 deletions plugins/argo-workflows/src/components/Overview/Overview.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from "react";
import React from 'react';
import {
Header,
HeaderLabel,
Expand All @@ -7,12 +7,12 @@ import {
ContentHeader,
SupportButton,
InfoCard,
} from "@backstage/core-components";
import { Grid } from "@material-ui/core";
import { OverviewTable } from "../WorkflowOverview/WorkflowOverview";
import { useEntity } from "@backstage/plugin-catalog-react";
import { isArgoWorkflowsAvailable } from "../../plugin";
import { WorkflowTemplateTable } from "../WorkflowTemplateOverview/WorkflowTemplateOverview";
} from '@backstage/core-components';
import { Grid } from '@material-ui/core';
import { OverviewTable } from '../WorkflowOverview/WorkflowOverview';
import { useEntity } from '@backstage/plugin-catalog-react';
import { isArgoWorkflowsAvailable } from '../../plugin';
import { WorkflowTemplateTable } from '../WorkflowTemplateOverview/WorkflowTemplateOverview';

export const ArgoWorkflowsOverviewPage = () => (
<Page themeId="tool">
Expand All @@ -33,11 +33,11 @@ export const ArgoWorkflowsOverviewPage = () => (
</Page>
);

export const ArgoWorkflowsOverviewCard = () => {
export const ArgoWorkflowsOverviewCard = (props: { title?: string }) => {
const { entity } = useEntity();
if (isArgoWorkflowsAvailable(entity)) {
return (
<InfoCard {...{ title: "Argo Workflows" }}>
<InfoCard {...{ title: props.title ?? 'Argo Workflows' }}>
<OverviewTable />
</InfoCard>
);
Expand All @@ -49,7 +49,7 @@ export const ArgoWorkflowsTemplatesOverviewCard = () => {
const { entity } = useEntity();
if (isArgoWorkflowsAvailable(entity)) {
return (
<InfoCard {...{ title: "Argo Workflows Templates" }}>
<InfoCard {...{ title: 'Argo Workflows Templates' }}>
<WorkflowTemplateTable />
</InfoCard>
);
Expand Down
2 changes: 1 addition & 1 deletion plugins/argo-workflows/src/components/Overview/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ export {
ArgoWorkflowsOverviewPage,
ArgoWorkflowsOverviewCard,
ArgoWorkflowsTemplatesOverviewCard,
} from "./Overview";
} from './Overview';

0 comments on commit e8b8483

Please sign in to comment.