diff --git a/.changeset/brave-eggs-rush.md b/.changeset/brave-eggs-rush.md new file mode 100644 index 0000000000..8e1a7ca86d --- /dev/null +++ b/.changeset/brave-eggs-rush.md @@ -0,0 +1,6 @@ +--- +'@backstage/core-components': patch +--- + +Change the styling of the `` to have more contrast in light +mode. Nodes now have a design similar to material UI buttons. diff --git a/.changeset/ten-dolls-ring.md b/.changeset/ten-dolls-ring.md new file mode 100644 index 0000000000..8142d1f3c8 --- /dev/null +++ b/.changeset/ten-dolls-ring.md @@ -0,0 +1,6 @@ +--- +'@backstage/plugin-explore': patch +--- + +Make styling of groups tab in the explore page use the Backstage theme instead +of hard coded colors. Change the layout to be full screen. diff --git a/packages/core-components/src/components/DependencyGraph/DefaultNode.tsx b/packages/core-components/src/components/DependencyGraph/DefaultNode.tsx index 69269d687d..8feca43e9a 100644 --- a/packages/core-components/src/components/DependencyGraph/DefaultNode.tsx +++ b/packages/core-components/src/components/DependencyGraph/DefaultNode.tsx @@ -21,11 +21,11 @@ import { RenderNodeProps } from './types'; const useStyles = makeStyles((theme: BackstageTheme) => ({ node: { - fill: theme.palette.background.paper, - stroke: theme.palette.border, + fill: theme.palette.primary.light, + stroke: theme.palette.primary.light, }, text: { - fill: theme.palette.textContrast, + fill: theme.palette.primary.contrastText, }, })); diff --git a/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx b/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx index c865920e7d..49a9481b15 100644 --- a/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx +++ b/plugins/explore/src/components/GroupsExplorerContent/GroupsDiagram.tsx @@ -15,49 +15,59 @@ */ import { + GroupEntity, + parseEntityRef, RELATION_CHILD_OF, stringifyEntityRef, - parseEntityRef, - GroupEntity, } from '@backstage/catalog-model'; -import { - catalogApiRef, - entityRouteRef, - getEntityRelations, - formatEntityRefTitle, -} from '@backstage/plugin-catalog-react'; -import { makeStyles, Typography } from '@material-ui/core'; -import ZoomOutMap from '@material-ui/icons/ZoomOutMap'; -import React from 'react'; -import { useAsync } from 'react-use'; -import { BackstageTheme } from '@backstage/theme'; - import { DependencyGraph, DependencyGraphTypes, + Link, Progress, ResponseErrorPanel, - Link, } from '@backstage/core-components'; -import { useApi, useRouteRef, configApiRef } from '@backstage/core-plugin-api'; +import { configApiRef, useApi, useRouteRef } from '@backstage/core-plugin-api'; +import { + catalogApiRef, + entityRouteRef, + formatEntityRefTitle, + getEntityRelations, +} from '@backstage/plugin-catalog-react'; +import { BackstageTheme } from '@backstage/theme'; +import { makeStyles, Typography, useTheme } from '@material-ui/core'; +import ZoomOutMap from '@material-ui/icons/ZoomOutMap'; +import classNames from 'classnames'; +import React from 'react'; +import { useAsync } from 'react-use'; const useStyles = makeStyles((theme: BackstageTheme) => ({ + graph: { + flex: 1, + minHeight: 0, + }, organizationNode: { - fill: 'coral', - stroke: theme.palette.border, + fill: theme.palette.secondary.light, + stroke: theme.palette.secondary.light, }, groupNode: { - fill: 'yellowgreen', - stroke: theme.palette.border, + fill: theme.palette.primary.light, + stroke: theme.palette.primary.light, }, centeredContent: { - padding: '10px', + padding: theme.spacing(1), height: '100%', display: 'flex', alignItems: 'center', justifyContent: 'center', color: 'black', }, + textOrganization: { + color: theme.palette.secondary.contrastText, + }, + textGroup: { + color: theme.palette.primary.contrastText, + }, textWrapper: { display: '-webkit-box', WebkitBoxOrient: 'vertical', @@ -70,14 +80,10 @@ const useStyles = makeStyles((theme: BackstageTheme) => ({ }, })); -const dimensions = { - nodeWidth: 180, - nodeHeight: 90, - nodeCornerRadius: 20, - nodeAligmentShift: 5, -}; - function RenderNode(props: DependencyGraphTypes.RenderNodeProps) { + const nodeWidth = 180; + const nodeHeight = 60; + const theme = useTheme(); const classes = useStyles(); const catalogEntityRoute = useRouteRef(entityRouteRef); @@ -85,18 +91,22 @@ function RenderNode(props: DependencyGraphTypes.RenderNodeProps) { return ( {props.node.name} - +
-
{props.node.name}
+
+ {props.node.name} +
@@ -108,9 +118,9 @@ function RenderNode(props: DependencyGraphTypes.RenderNodeProps) { return ( {props.node.name} @@ -122,12 +132,11 @@ function RenderNode(props: DependencyGraphTypes.RenderNodeProps) { name: ref.name, })} > - +
-
{props.node.name}
+
+ {props.node.name} +
@@ -146,6 +155,7 @@ export function GroupsDiagram() { }>(); const edges = new Array<{ from: string; to: string; label: string }>(); + const classes = useStyles(); const configApi = useApi(configApiRef); const catalogApi = useApi(catalogApiRef); const organizationName = @@ -218,6 +228,7 @@ export function GroupsDiagram() { nodeMargin={10} direction={DependencyGraphTypes.Direction.RIGHT_LEFT} renderNode={RenderNode} + className={classes.graph} /> { + const classes = useStyles(); + return ( - + Explore your groups.