Skip to content

Commit

Permalink
fix toolbar width
Browse files Browse the repository at this point in the history
  • Loading branch information
LiorSoffer committed Dec 16, 2024
1 parent 89012f6 commit 3277e4f
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ import { Grid } from '@material-ui/core';

import { workflowRouteRef } from '../../routes';
import { EditorViewKind, WorkflowEditor } from '../WorkflowEditor';
import WorkflowDefinitionDetailsCard from './WorkflowDefinitionDetailsCard';
import WorkflowDefinitionDetailsCard from './WorkflowDetailsCard';

interface Props {
loading: boolean;
workflowOverviewDTO: any;
}

export const WorkflowDefinitionViewerPage = ({
export const WorkflowDetailsTabContent = ({
loading,
workflowOverviewDTO,
}: Props) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ import {
orchestratorWorkflowUseSpecificPermission,
} from '@red-hat-developer-hub/backstage-plugin-orchestrator-common';

import { orchestratorApiRef } from '../api';
import { usePermissionArrayDecision } from '../hooks/usePermissionArray';
import { workflowRouteRef, workflowRunsRouteRef } from '../routes';
import { BaseOrchestratorPage } from './BaseOrchestratorPage';
import { WorkflowDefinitionViewerPage } from './WorkflowDefinitionViewerPage';
import { ExecuteWorkflowButton } from './WorkflowPageTabContent';
import { WorkflowRunsTabContent } from './WorkflowRunsTabContent';
import { orchestratorApiRef } from '../../api';
import { usePermissionArrayDecision } from '../../hooks/usePermissionArray';
import { workflowRouteRef, workflowRunsRouteRef } from '../../routes';
import { BaseOrchestratorPage } from '../BaseOrchestratorPage';
import { WorkflowRunsTabContent } from '../WorkflowRunsTabContent';
import { WorkflowDetailsTabContent } from './WorkflowDetailsTabContent';
import { WorkflowPageTabContent } from './WorkflowPageTabContent';

export const WorkflowPage = () => {
const { workflowId } = useRouteRefParams(workflowRouteRef);
Expand All @@ -56,33 +56,34 @@ export const WorkflowPage = () => {
title={workflowOverviewDTO?.data.name || workflowId}
type="Workflows"
typeLink="/orchestrator"
noPadding
>
<TabbedLayout>
<TabbedLayout.Route path="/" title="Workflow details">
<ExecuteWorkflowButton
<WorkflowPageTabContent
error={error}
loadingPermission={loadingPermission}
loading={loading}
canRun={canRun}
>
<WorkflowDefinitionViewerPage
<WorkflowDetailsTabContent
loading={loading}
workflowOverviewDTO={workflowOverviewDTO}
/>
</ExecuteWorkflowButton>
</WorkflowPageTabContent>
</TabbedLayout.Route>
<TabbedLayout.Route
path={workflowRunsRouteRef.path.split('/').pop() || 'runs'}
title="Workflow runs"
>
<ExecuteWorkflowButton
<WorkflowPageTabContent
error={error}
loadingPermission={loadingPermission}
loading={loading}
canRun={canRun}
>
<WorkflowRunsTabContent />
</ExecuteWorkflowButton>
</WorkflowPageTabContent>
</TabbedLayout.Route>
</TabbedLayout>
</BaseOrchestratorPage>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { useRouteRef, useRouteRefParams } from '@backstage/core-plugin-api';
import { Button, Grid, Tooltip } from '@material-ui/core';
import { Skeleton } from '@material-ui/lab';

import { executeWorkflowRouteRef, workflowRouteRef } from '../routes';
import { executeWorkflowRouteRef, workflowRouteRef } from '../../routes';

interface Props {
error: Error | undefined;
Expand All @@ -32,7 +32,7 @@ interface Props {
children: ReactNode;
}

export const ExecuteWorkflowButton = ({
export const WorkflowPageTabContent = ({
error,
loadingPermission,
loading,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { WorkflowDefinitionViewerPage } from './WorkflowDefinitionViewerPage';
export { WorkflowPage } from './WorkflowPage';
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,14 @@ export const WorkflowRunsTabContent = () => {
),
sorting: false,
},
{
title: 'Workflow name',
field: 'name',
},
...(workflowId
? []
: [
{
title: 'Workflow name',
field: 'name',
},
]),
{
title: 'Status',
field: 'status',
Expand All @@ -114,7 +118,7 @@ export const WorkflowRunsTabContent = () => {
{ title: 'Started', field: 'started', defaultSort: 'desc' },
{ title: 'Duration', field: 'duration' },
],
[workflowInstanceLink],
[workflowInstanceLink, workflowId],
);

const filteredData = React.useMemo(
Expand Down
3 changes: 2 additions & 1 deletion workspaces/orchestrator/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"packages/*/src",
"plugins/*/src",
"plugins/*/dev",
"plugins/*/migrations"
"plugins/*/migrations",
"plugins/orchestrator/src/components/WorkflowDefinitionViewerPage/.tsx"
],
"files": ["node_modules/@backstage/cli/asset-types/asset-types.d.ts"],
"exclude": ["node_modules"],
Expand Down

0 comments on commit 3277e4f

Please sign in to comment.