Skip to content

Commit

Permalink
fix(orchestrator): add links to workflows in the workflow list (janus…
Browse files Browse the repository at this point in the history
  • Loading branch information
jkilzi authored and caponetto committed Jan 11, 2024
1 parent 7fbe8cd commit 6581bcc
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
6 changes: 5 additions & 1 deletion plugins/orchestrator/src/components/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
executeWorkflowRouteRef,
newWorkflowRef,
nextExecuteWorkflowRouteRef,
nextOrchestratorRootRouteRef,
workflowDefinitionsRouteRef,
workflowInstanceRouteRef,
workflowInstancesRouteRef,
Expand Down Expand Up @@ -49,7 +50,10 @@ export const Router = () => {
path={executeWorkflowRouteRef.path}
element={<ExecuteWorkflowPage />}
/>
<Route path="/next/*" element={<OrchestratorPageNext />} />
<Route
path={nextOrchestratorRootRouteRef.path}
element={<OrchestratorPageNext />}
/>
<Route
path={nextExecuteWorkflowRouteRef.path}
element={<ExecuteWorkflowPageNext />}
Expand Down
23 changes: 20 additions & 3 deletions plugins/orchestrator/src/components/next/WorkflowsTable.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import React, { useCallback, useEffect, useMemo, useState } from 'react';
import { useNavigate } from 'react-router-dom';

import { Table, TableColumn, TableProps } from '@backstage/core-components';
import {
Link,
Table,
TableColumn,
TableProps,
} from '@backstage/core-components';
import { useApi, useRouteRef } from '@backstage/core-plugin-api';

import DeleteForever from '@material-ui/icons/DeleteForever';
Expand Down Expand Up @@ -115,7 +120,19 @@ export const WorkflowsTable = ({ items }: WorkflowsTableProps) => {

const columns = useMemo<TableColumn<FormattedWorkflowOverview>[]>(
() => [
{ title: 'Name', field: 'name' },
{
title: 'Name',
render: rowData => (
<Link
to={definitionLink({
workflowId: rowData.id,
format: rowData.format,
})}
>
{rowData.name}
</Link>
),
},
{ title: 'Last run', field: 'lastTriggered' },
{
title: 'Last run status',
Expand All @@ -127,7 +144,7 @@ export const WorkflowsTable = ({ items }: WorkflowsTableProps) => {
{ title: 'Avg. duration', field: 'avgDuration' },
{ title: 'Description', field: 'description' },
],
[],
[definitionLink],
);

const options = useMemo<TableProps['options']>(
Expand Down
4 changes: 2 additions & 2 deletions plugins/orchestrator/src/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ export const executeWorkflowRouteRef = createSubRouteRef({
path: '/workflows/:workflowId/execute',
});

export const orchestratorRootNextRouteRef = createSubRouteRef({
export const nextOrchestratorRootRouteRef = createSubRouteRef({
id: 'orchestrator/next',
parent: orchestratorRootRouteRef,
path: '/next',
path: '/next/*',
});

export const nextExecuteWorkflowRouteRef = createSubRouteRef({
Expand Down

0 comments on commit 6581bcc

Please sign in to comment.