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.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]
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)}
+
+
+
+
+
+
+
+
+
)
}
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) => (