diff --git a/graph/client/src/app/app.tsx b/graph/client/src/app/app.tsx
index 176498dc885158..d66004056ed971 100644
--- a/graph/client/src/app/app.tsx
+++ b/graph/client/src/app/app.tsx
@@ -1,4 +1,4 @@
-import { themeInit } from './theme-resolver';
+import { themeInit } from '@nx/ui-theme';
import { rankDirInit } from './rankdir-resolver';
import { RouterProvider } from 'react-router-dom';
import { getRouter } from './get-router';
diff --git a/graph/client/src/app/machines/graph.service.ts b/graph/client/src/app/machines/graph.service.ts
index b067b5158efb5e..19476497d51fdf 100644
--- a/graph/client/src/app/machines/graph.service.ts
+++ b/graph/client/src/app/machines/graph.service.ts
@@ -1,7 +1,7 @@
import { GraphService } from '@nx/graph/ui-graph';
-import { selectValueByThemeStatic } from '../theme-resolver';
import { getProjectGraphDataService } from '../hooks/get-project-graph-data-service';
import { getEnvironmentConfig } from '@nx/graph/shared';
+import { selectValueByThemeStatic } from '@nx/ui-theme';
let graphService: GraphService;
diff --git a/graph/client/src/app/shell.tsx b/graph/client/src/app/shell.tsx
index 66aa63a6c15dbe..41a162184a304e 100644
--- a/graph/client/src/app/shell.tsx
+++ b/graph/client/src/app/shell.tsx
@@ -7,7 +7,7 @@ import classNames from 'classnames';
import { DebuggerPanel } from './ui-components/debugger-panel';
import { getGraphService } from './machines/graph.service';
import { Outlet, useNavigate, useParams } from 'react-router-dom';
-import { ThemePanel } from './feature-projects/panels/theme-panel';
+import { getSystemTheme, Theme, ThemePanel } from '@nx/ui-theme';
import { Dropdown } from '@nx/graph/ui-components';
import { useCurrentPath } from './hooks/use-current-path';
import { ExperimentalFeature } from './ui-components/experimental-feature';
@@ -31,6 +31,13 @@ export function Shell(): JSX.Element {
const environment = useEnvironmentConfig();
const environmentConfig = useEnvironmentConfig();
+ function onThemeChange(theme: Theme) {
+ if (theme !== 'system') {
+ graphService.theme = theme;
+ } else {
+ graphService.theme = getSystemTheme();
+ }
+ }
const navigate = useNavigate();
const currentPath = useCurrentPath();
@@ -71,7 +78,7 @@ export function Shell(): JSX.Element {
}
return (
- <>
+
@@ -202,6 +209,6 @@ export function Shell(): JSX.Element {
- >
+
);
}
diff --git a/graph/client/src/index.html b/graph/client/src/index.html
index 63a22e07a22ba5..e223588ff7b238 100644
--- a/graph/client/src/index.html
+++ b/graph/client/src/index.html
@@ -1,5 +1,5 @@
-
+
Nx Workspace Project Graph
@@ -25,9 +25,7 @@
-
-
+
+
diff --git a/graph/project-details/src/lib/project-details-page.tsx b/graph/project-details/src/lib/project-details-page.tsx
index c1e66eb8292a30..634034b66ff214 100644
--- a/graph/project-details/src/lib/project-details-page.tsx
+++ b/graph/project-details/src/lib/project-details-page.tsx
@@ -1,8 +1,10 @@
/* eslint-disable @nx/enforce-module-boundaries */
// nx-ignore-next-line
import { ProjectGraphProjectNode } from '@nx/devkit';
-import { useRouteLoaderData } from 'react-router-dom';
+import { Link, useRouteLoaderData } from 'react-router-dom';
import ProjectDetails from './project-details';
+import { useEnvironmentConfig, useRouteConstructor } from '@nx/graph/shared';
+import { ThemePanel } from '@nx/ui-theme';
export function ProjectDetailsPage() {
const { project, sourceMap } = useRouteLoaderData(
@@ -12,5 +14,49 @@ export function ProjectDetailsPage() {
sourceMap: Record;
};
- return ProjectDetails({ project, sourceMap });
+ const environment = useEnvironmentConfig()?.environment;
+
+ const routeConstructor = useRouteConstructor();
+
+ return (
+
+ {environment !== 'nx-console' ? (
+
+ ) : null}
+
+
+ );
}
diff --git a/graph/project-details/src/lib/project-details.tsx b/graph/project-details/src/lib/project-details.tsx
index d11dd7c0b39e1f..42e8affe7c97da 100644
--- a/graph/project-details/src/lib/project-details.tsx
+++ b/graph/project-details/src/lib/project-details.tsx
@@ -12,7 +12,6 @@ import {
useEnvironmentConfig,
useRouteConstructor,
} from '@nx/graph/shared';
-import PropertyRenderer from './property-renderer';
import Target from './target';
export interface ProjectDetailsProps {
@@ -30,7 +29,12 @@ export function ProjectDetails({
const environment = useEnvironmentConfig()?.environment;
const externalApiService = getExternalApiService();
const navigate = useNavigate();
- const routeContructor = useRouteConstructor();
+ const routeConstructor = useRouteConstructor();
+
+ const displayType =
+ projectData.projectType &&
+ projectData.projectType?.charAt(0)?.toUpperCase() +
+ projectData.projectType?.slice(1);
const viewInProjectGraph = () => {
if (environment === 'nx-console') {
@@ -41,25 +45,40 @@ export function ProjectDetails({
},
});
} else {
- navigate(routeContructor(`/projects/${encodeURIComponent(name)}`, true));
+ navigate(routeConstructor(`/projects/${encodeURIComponent(name)}`, true));
}
};
return (
-
-
- {name}{' '}
-
-
-
- {root}{' '}
- {projectData.tags?.map((tag) => (
-
{tag}
- ))}
-
+ <>
+
-
-
Targets
+
Targets
+
{Object.entries(projectData.targets ?? {}).map(
([targetName, target]) => {
const props = {
@@ -68,30 +87,16 @@ export function ProjectDetails({
targetConfiguration: target,
sourceMap,
};
- return ;
+ return (
+ -
+
+
+ );
}
)}
-
- {Object.entries(projectData).map(([key, value]) => {
- if (
- key === 'targets' ||
- key === 'root' ||
- key === 'name' ||
- key === '$schema' ||
- key === 'tags' ||
- key === 'files' ||
- key === 'sourceRoot'
- )
- return undefined;
-
- return PropertyRenderer({
- propertyKey: key,
- propertyValue: value,
- sourceMap,
- });
- })}
+
-
+ >
);
}
diff --git a/graph/project-details/src/lib/target.tsx b/graph/project-details/src/lib/target.tsx
index 917e5437212a65..f52dfa269dd4b7 100644
--- a/graph/project-details/src/lib/target.tsx
+++ b/graph/project-details/src/lib/target.tsx
@@ -120,72 +120,49 @@ export function Target({
: true);
return (
-
- {/* header */}
-
-
- {targetName}{' '}
-
- {targetConfiguration?.command ??
- targetConfiguration.options?.command ??
- targetConfiguration.executor}
-
-
-
- {
- e.stopPropagation();
- viewInTaskGraph();
- }}
- >
-
- {environment === 'nx-console' && (
-
- {
- e.stopPropagation();
- runTarget();
- }}
- />
-
- )}
+
+
+
{/* body */}
{!collapsed && (
-
+
{targetConfiguration.inputs && (
<>
Inputs
-
+
{targetConfiguration.inputs.map((input) => (
- {input.toString()}
))}
@@ -194,8 +171,8 @@ export function Target({
)}
{targetConfiguration.outputs && (
<>
- Outputs
-
+ Outputs
+
{targetConfiguration.outputs?.map((output) => (
- {output.toString()}
)) ?? no outputs}
@@ -204,8 +181,8 @@ export function Target({
)}
{targetConfiguration.dependsOn && (
<>
- Depends On
-