From 7ab03f04a75c0cbf7bf7396da20cf02e0aa32902 Mon Sep 17 00:00:00 2001 From: RemiBonnet Date: Fri, 27 Mar 2026 13:32:10 +0100 Subject: [PATCH 1/3] feat(cluster-header-logs): add execution_id, version and cluster_id --- .../cluster/$clusterId/cluster-logs.tsx | 9 +- .../cluster-header-logs.tsx | 110 +++++++++++------- 2 files changed, 75 insertions(+), 44 deletions(-) diff --git a/apps/console-v5/src/routes/_authenticated/organization/$organizationId/cluster/$clusterId/cluster-logs.tsx b/apps/console-v5/src/routes/_authenticated/organization/$organizationId/cluster/$clusterId/cluster-logs.tsx index 2b325dd28f0..d03ef86bed0 100644 --- a/apps/console-v5/src/routes/_authenticated/organization/$organizationId/cluster/$clusterId/cluster-logs.tsx +++ b/apps/console-v5/src/routes/_authenticated/organization/$organizationId/cluster/$clusterId/cluster-logs.tsx @@ -47,8 +47,13 @@ function RouteComponent() { ) : isLogsFetched && logs.length > 0 ? ( <> -
- +
+
diff --git a/libs/domains/clusters/feature/src/lib/cluster-logs/cluster-header-logs/cluster-header-logs.tsx b/libs/domains/clusters/feature/src/lib/cluster-logs/cluster-header-logs/cluster-header-logs.tsx index d48992643bc..7049ac14473 100644 --- a/libs/domains/clusters/feature/src/lib/cluster-logs/cluster-header-logs/cluster-header-logs.tsx +++ b/libs/domains/clusters/feature/src/lib/cluster-logs/cluster-header-logs/cluster-header-logs.tsx @@ -1,16 +1,17 @@ import download from 'downloadjs' -import { type ClusterLogs } from 'qovery-typescript-axios' +import { type Cluster, type ClusterLogs, type ClusterStatus } from 'qovery-typescript-axios' import { type RefObject } from 'react' -import { Button, Icon } from '@qovery/shared/ui' +import { Badge, Button, Icon, Tooltip } from '@qovery/shared/ui' +import { trimId } from '@qovery/shared/util-js' export interface ClusterHeaderLogsProps { + cluster: Cluster + clusterStatus: ClusterStatus refScrollSection: RefObject data: ClusterLogs[] } -export function ClusterHeaderLogs(props: ClusterHeaderLogsProps) { - const { refScrollSection, data } = props - +export function ClusterHeaderLogs({ cluster, clusterStatus, refScrollSection, data }: ClusterHeaderLogsProps) { const downloadJSON = () => { download(JSON.stringify(data), `data-${Date.now()}.json`, 'text/json;charset=utf-8') } @@ -26,44 +27,69 @@ export function ClusterHeaderLogs(props: ClusterHeaderLogsProps) { } } + const lastExecutionId = clusterStatus.last_execution_id ?? '' + return ( - <> - - - - +
+
+ + Cluster version: {cluster.version}
+ Cluster ID: {cluster.id} + + } + > + + {cluster.version} + +
+ Execution id: {lastExecutionId}}> + + + {trimId(lastExecutionId)} + + +
+
+ + + +
+
) } From a7a5a752c6219197f128c65642c5f3fe60b2e18c Mon Sep 17 00:00:00 2001 From: RemiBonnet Date: Fri, 27 Mar 2026 14:03:06 +0100 Subject: [PATCH 2/3] refactor(environment-deployment-list): simplify Table.Row component by removing click and keyboard event handlers --- .../environment-deployment-list.tsx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/libs/domains/environments/feature/src/lib/environment-deployment-list/environment-deployment-list.tsx b/libs/domains/environments/feature/src/lib/environment-deployment-list/environment-deployment-list.tsx index 87eceb0a716..7f4fbab30fb 100644 --- a/libs/domains/environments/feature/src/lib/environment-deployment-list/environment-deployment-list.tsx +++ b/libs/domains/environments/feature/src/lib/environment-deployment-list/environment-deployment-list.tsx @@ -20,6 +20,9 @@ import { } from 'qovery-typescript-axios' import { Fragment, useCallback, useMemo, useState } from 'react' import { P, match } from 'ts-pattern' +// This import introduces a circular dependency with @qovery/shared/devops-copilot/feature. +// Keep in mind for future refactoring if possible. +// eslint-disable-next-line @nx/enforce-module-boundaries import { DevopsCopilotTroubleshootTrigger } from '@qovery/shared/devops-copilot/feature' import { IconEnum } from '@qovery/shared/enums' import { ENVIRONMENT_LOGS_URL, ENVIRONMENT_STAGES_URL } from '@qovery/shared/routes' @@ -494,15 +497,7 @@ export function EnvironmentDeploymentList() { {table.getRowModel().rows.map((row) => ( - handleRowClick(row)} - onKeyDown={(e) => { - if (e.key === 'Enter') handleRowClick(row) - }} - tabIndex={0} - role="link" - className="h-[68px] divide-x divide-neutral hover:cursor-pointer hover:bg-surface-neutral-subtle focus:bg-surface-neutral-subtle" - > + {row.getVisibleCells().map((cell) => ( Date: Fri, 27 Mar 2026 14:12:36 +0100 Subject: [PATCH 3/3] refactor(cluster-header-logs): update test props to include cluster status and remove redundant definitions --- .../cluster-header-logs.spec.tsx | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/libs/domains/clusters/feature/src/lib/cluster-logs/cluster-header-logs/cluster-header-logs.spec.tsx b/libs/domains/clusters/feature/src/lib/cluster-logs/cluster-header-logs/cluster-header-logs.spec.tsx index 45d86f6d78a..ab7dd21458a 100644 --- a/libs/domains/clusters/feature/src/lib/cluster-logs/cluster-header-logs/cluster-header-logs.spec.tsx +++ b/libs/domains/clusters/feature/src/lib/cluster-logs/cluster-header-logs/cluster-header-logs.spec.tsx @@ -1,6 +1,7 @@ import download from 'downloadjs' +import { ClusterStateEnum } from 'qovery-typescript-axios' import { type RefObject } from 'react' -import { clusterLogFactoryMock } from '@qovery/shared/factories' +import { clusterFactoryMock, clusterLogFactoryMock } from '@qovery/shared/factories' import { renderWithProviders, screen } from '@qovery/shared/util-tests' import ClusterHeaderLogs, { type ClusterHeaderLogsProps } from './cluster-header-logs' @@ -15,24 +16,28 @@ const refScrollSection: RefObject = { describe('ClusterHeaderLogs', () => { const baseData = clusterLogFactoryMock(2, false) + const props: ClusterHeaderLogsProps = { + cluster: clusterFactoryMock(1)[0], + clusterStatus: { + cluster_id: '1', + status: ClusterStateEnum.DEPLOYED, + last_execution_id: '1', + is_deployed: true, + }, + refScrollSection: refScrollSection, + data: baseData, + } + beforeEach(() => { jest.clearAllMocks() }) it('should render successfully', () => { - const props: ClusterHeaderLogsProps = { - refScrollSection: refScrollSection, - data: baseData, - } const { baseElement } = renderWithProviders() expect(baseElement).toBeTruthy() }) it('should trigger scroll up on click', async () => { - const props: ClusterHeaderLogsProps = { - refScrollSection: refScrollSection, - data: baseData, - } const { userEvent } = renderWithProviders() const scrollUpButton = screen.getByTestId('scroll-up-button') @@ -41,10 +46,6 @@ describe('ClusterHeaderLogs', () => { }) it('should trigger scroll down on click', async () => { - const props: ClusterHeaderLogsProps = { - refScrollSection: refScrollSection, - data: baseData, - } const { userEvent } = renderWithProviders() const scrollDownButton = screen.getByTestId('scroll-down-button') @@ -53,10 +54,6 @@ describe('ClusterHeaderLogs', () => { }) it('should trigger download on click', async () => { - const props: ClusterHeaderLogsProps = { - refScrollSection: refScrollSection, - data: baseData, - } const { userEvent } = renderWithProviders() const buttons = screen.getAllByRole('button') const downloadButton = buttons[2]