From 1d746a0ebdfc7ef8be59a968cc6ecdebc81391fb Mon Sep 17 00:00:00 2001 From: RemiBonnet Date: Tue, 26 May 2026 13:32:03 +0200 Subject: [PATCH 1/3] feat(argocd): enhance environment and service list + settings - Added tests to display warnings for redeploy and deploy actions when ArgoCD services are present. - Updated the environment action toolbar to disable deletion for ArgoCD environments and provide appropriate tooltips. - Introduced a new hook for unlinking ArgoCD destination cluster mappings and integrated it into the settings component. - Refactored service list to include detailed git repository information and actions for ArgoCD services --- .../environment-action-toolbar.spec.tsx | 85 +++++++++- .../environment-action-toolbar.tsx | 52 ++++++- .../environment-section.spec.tsx | 8 + .../environment-section.tsx | 7 +- .../lib/domains-organizations-data-access.ts | 15 ++ .../organizations/feature/src/index.ts | 1 + ...link-argocd-destination-cluster-mapping.ts | 23 +++ .../settings-argocd-integration.spec.tsx | 67 +++++++- .../settings-argocd-integration.tsx | 44 +++++- .../argocd-service-list.spec.tsx | 103 +++++++++++- .../argocd-service-list.tsx | 146 +++++++++++++++--- .../service-header/service-header.spec.tsx | 9 +- package.json | 2 +- yarn.lock | 10 +- 14 files changed, 523 insertions(+), 49 deletions(-) create mode 100644 libs/domains/organizations/feature/src/lib/hooks/use-unlink-argocd-destination-cluster-mapping/use-unlink-argocd-destination-cluster-mapping.ts diff --git a/libs/domains/environments/feature/src/lib/environment-action-toolbar/environment-action-toolbar.spec.tsx b/libs/domains/environments/feature/src/lib/environment-action-toolbar/environment-action-toolbar.spec.tsx index 252a3bda1cb..6e62a3cae29 100644 --- a/libs/domains/environments/feature/src/lib/environment-action-toolbar/environment-action-toolbar.spec.tsx +++ b/libs/domains/environments/feature/src/lib/environment-action-toolbar/environment-action-toolbar.spec.tsx @@ -1,10 +1,10 @@ -import type { ReactNode } from 'react' +import type { ForwardedRef, ReactNode } from 'react' import { applicationFactoryMock, environmentFactoryMock } from '@qovery/shared/factories' import { renderWithProviders, screen } from '@qovery/shared/util-tests' import { EnvironmentActionToolbar } from './environment-action-toolbar' const mockEnvironment = environmentFactoryMock(1)[0] -const mockServices = applicationFactoryMock(3) +let mockServices: unknown[] = applicationFactoryMock(3) const mockDeployEnvironment = jest.fn() const mockDeleteEnvironment = jest.fn() const mockNavigate = jest.fn() @@ -36,7 +36,18 @@ jest.mock('@tanstack/react-router', () => ({ useNavigate: () => mockNavigate, useLocation: () => ({ pathname: '/', search: '' }), useRouter: () => ({ buildLocation: () => ({ href: '/' }) }), - Link: ({ children, ...props }: { children?: ReactNode; [key: string]: unknown }) => {children}, + Link: jest + .requireActual('react') + .forwardRef( + ( + { children, ...props }: { children?: ReactNode; [key: string]: unknown }, + ref: ForwardedRef + ) => ( + + {children} + + ) + ), })) jest.mock('@qovery/shared/ui', () => ({ @@ -95,6 +106,7 @@ describe('EnvironmentActionToolbar', () => { state: 'DEPLOYED', deployment_status: 'OUT_OF_DATE', } + mockServices = applicationFactoryMock(3) mockVariables = [ { key: 'QOVERY_KUBERNETES_NAMESPACE_NAME', @@ -137,6 +149,54 @@ describe('EnvironmentActionToolbar', () => { expect(mockOpenModalConfirmation).not.toHaveBeenCalled() }) + it('should display an ArgoCD warning on redeploy when the environment contains ArgoCD services', async () => { + mockServices = [ + applicationFactoryMock(1)[0], + { + id: 'argocd-service-1', + name: 'ArgoCD service', + service_type: 'ARGOCD_APP', + serviceType: 'ARGOCD_APP', + }, + ] + + const { userEvent } = renderWithProviders() + + await userEvent.click(screen.getByLabelText(/manage deployment/i)) + await userEvent.hover(screen.getByLabelText(/argocd deployment information/i)) + + expect(await screen.findAllByText('Environment has changed and needs to be applied')).toHaveLength(2) + expect( + await screen.findAllByText('Redeploy will only target Qovery created services and not ArgoCD imported ones.') + ).toHaveLength(2) + }) + + it('should display an ArgoCD warning on deploy when the environment contains ArgoCD services', async () => { + mockDeploymentStatus = { + state: 'READY', + deployment_status: 'OUT_OF_DATE', + } + mockServices = [ + applicationFactoryMock(1)[0], + { + id: 'argocd-service-1', + name: 'ArgoCD service', + service_type: 'ARGOCD_APP', + serviceType: 'ARGOCD_APP', + }, + ] + + const { userEvent } = renderWithProviders() + + await userEvent.click(screen.getByLabelText(/manage deployment/i)) + await userEvent.hover(screen.getByLabelText(/argocd deployment information/i)) + + expect(await screen.findAllByText('Environment has changed and needs to be applied')).toHaveLength(2) + expect( + await screen.findAllByText('Redeploy will only target Qovery created services and not ArgoCD imported ones.') + ).toHaveLength(2) + }) + it('should keep a confirmation modal for stop', async () => { const { userEvent } = renderWithProviders() @@ -207,4 +267,23 @@ describe('EnvironmentActionToolbar', () => { expect(screen.getByText('Namespace ID')).toBeInTheDocument() expect(screen.getByText('z1234567-env-name')).toBeInTheDocument() }) + + it('should disable ArgoCD environment deletion', async () => { + const { userEvent } = renderWithProviders( + + ) + + await userEvent.click(screen.getByLabelText(/other actions/i)) + + const deleteEnvironmentItem = screen.getByRole('menuitem', { name: /delete environment/i }) + expect(deleteEnvironmentItem).toHaveAttribute('aria-disabled', 'true') + + await userEvent.hover(screen.getByText('Delete environment')) + + expect( + await screen.findByRole('tooltip', { + name: 'ArgoCD environment can only be deleted by revoking the integration', + }) + ).toBeInTheDocument() + }) }) diff --git a/libs/domains/environments/feature/src/lib/environment-action-toolbar/environment-action-toolbar.tsx b/libs/domains/environments/feature/src/lib/environment-action-toolbar/environment-action-toolbar.tsx index 468d478758f..f2815796460 100644 --- a/libs/domains/environments/feature/src/lib/environment-action-toolbar/environment-action-toolbar.tsx +++ b/libs/domains/environments/feature/src/lib/environment-action-toolbar/environment-action-toolbar.tsx @@ -8,6 +8,7 @@ import { } from 'qovery-typescript-axios' import { useState } from 'react' import { match } from 'ts-pattern' +import { isArgoCd } from '@qovery/domains/services/data-access' // eslint-disable-next-line @nx/enforce-module-boundaries import { useServices } from '@qovery/domains/services/feature' import { useVariables } from '@qovery/domains/variables/feature' @@ -76,6 +77,24 @@ export function MenuManageDeployment({ // XXX: Required to display a warning for managed Database // https://qovery.atlassian.net/jira/software/projects/FRT/boards/23?selectedIssue=FRT-1416 const { data: services = [] } = useServices({ environmentId: environment.id }) + const hasArgoCdServices = services.some(isArgoCd) + + const argoCdDeploymentTooltipContent = ( + + {displayYellowColor ? Environment has changed and needs to be applied : null} + Redeploy will only target Qovery created services and not ArgoCD imported ones. + + ) + + const tooltipDeployWithArgoCdServices = hasArgoCdServices ? ( + + + + + + ) : ( + tooltipEnvironmentNeedUpdate + ) const mutationDeploy = () => deployEnvironment({ @@ -182,7 +201,7 @@ export function MenuManageDeployment({ >
Deploy - {tooltipEnvironmentNeedUpdate} + {tooltipDeployWithArgoCdServices}
)} @@ -194,7 +213,7 @@ export function MenuManageDeployment({ >
Redeploy - {tooltipEnvironmentNeedUpdate} + {tooltipDeployWithArgoCdServices}
)} @@ -244,10 +263,12 @@ export function MenuManageDeployment({ export function MenuOtherActions({ state, environment, + isArgoCdEnvironment = false, variant = 'default', }: { state: StateEnum environment: Environment + isArgoCdEnvironment?: boolean variant?: ActionToolbarVariant }) { const [isActionsOpen, setIsActionsOpen] = useState(false) @@ -386,9 +407,17 @@ export function MenuOtherActions({ {isDeleteAvailable(state) && ( <> - } onSelect={mutationDeleteEnvironment}> - Delete environment - + {isArgoCdEnvironment ? ( + } disabled> + + Delete environment + + + ) : ( + } onSelect={mutationDeleteEnvironment}> + Delete environment + + )} )} @@ -398,10 +427,15 @@ export function MenuOtherActions({ export interface EnvironmentActionToolbarProps { environment: Environment + isArgoCdEnvironment?: boolean variant?: ActionToolbarVariant } -export function EnvironmentActionToolbar({ environment, variant = 'default' }: EnvironmentActionToolbarProps) { +export function EnvironmentActionToolbar({ + environment, + isArgoCdEnvironment = false, + variant = 'default', +}: EnvironmentActionToolbarProps) { const { data: countServices, isFetched: isFetchedServices } = useServiceCount({ environmentId: environment.id }) const { data: deploymentStatus } = useDeploymentStatus({ environmentId: environment.id }) @@ -434,7 +468,11 @@ export function EnvironmentActionToolbar({ environment, variant = 'default' }: E - + )} diff --git a/libs/domains/environments/feature/src/lib/environments-table/environment-section/environment-section.spec.tsx b/libs/domains/environments/feature/src/lib/environments-table/environment-section/environment-section.spec.tsx index e9861b3a96f..17ce8bfebbf 100644 --- a/libs/domains/environments/feature/src/lib/environments-table/environment-section/environment-section.spec.tsx +++ b/libs/domains/environments/feature/src/lib/environments-table/environment-section/environment-section.spec.tsx @@ -54,9 +54,15 @@ const overview: EnvironmentOverviewResponse = { describe('EnvironmentSection', () => { beforeEach(() => { + jest.useFakeTimers() jest.clearAllMocks() }) + afterEach(() => { + jest.clearAllTimers() + jest.useRealTimers() + }) + it('should navigate to the environment when clicking the row', async () => { const { userEvent } = renderWithProviders( @@ -120,5 +126,7 @@ describe('EnvironmentSection', () => { ) expect(screen.getByText('ArgoCD')).toBeInTheDocument() + const manageDeploymentButton = screen.getByRole('button', { name: /manage deployment/i }) + expect(manageDeploymentButton).toBeEnabled() }) }) diff --git a/libs/domains/environments/feature/src/lib/environments-table/environment-section/environment-section.tsx b/libs/domains/environments/feature/src/lib/environments-table/environment-section/environment-section.tsx index ddc0f72950f..a2e34bcf581 100644 --- a/libs/domains/environments/feature/src/lib/environments-table/environment-section/environment-section.tsx +++ b/libs/domains/environments/feature/src/lib/environments-table/environment-section/environment-section.tsx @@ -16,9 +16,9 @@ const { Table } = TablePrimitives const gridLayoutClassName = 'grid w-full grid-cols-[minmax(280px,2fr)_minmax(220px,1.4fr)_minmax(240px,1.2fr)_minmax(140px,1fr)_96px]' -function DisabledManageDeploymentButton() { +function DisabledManageDeploymentButton({ tooltip }: { tooltip: string }) { return ( - +
+ ))} @@ -230,6 +249,10 @@ function ArgoCdIntegrationCard({ integration, onEdit, onDelete, onLinkCluster }: onOpenChange={setIsUnlinkedSectionOpen} hasBottomBorder={false} > +

+ Unlinked clusters are clusters detected by ArgoCD that are not yet associated with a cluster in Qovery. + Add the cluster to Qovery, then link it here to display the applications running on it. +

{integration.unlinked_clusters.map((cluster) => (
([]) useEffect(() => { @@ -412,6 +436,23 @@ function SettingsArgoCdIntegrationContent() { }) } + const unlinkCluster = async (integrationId: string, cluster: ArgoCdLinkedClusterDetails) => { + const integration = integrationsState.find(({ credentials_id }) => credentials_id === integrationId) + + if (!integration) { + return + } + + await unlinkArgoCdDestinationClusterMapping({ + organizationId, + argoCdDestinationClusterMappingRequest: { + agent_cluster_id: integration.agent_cluster_id, + argocd_cluster_url: cluster.argocd_cluster_url, + cluster_id: null, + }, + }) + } + if (integrationsState.length === 0) { return ( ))}
diff --git a/libs/domains/services/feature/src/lib/argocd-service-list/argocd-service-list.spec.tsx b/libs/domains/services/feature/src/lib/argocd-service-list/argocd-service-list.spec.tsx index 39d08ccdbdc..efc4646076b 100644 --- a/libs/domains/services/feature/src/lib/argocd-service-list/argocd-service-list.spec.tsx +++ b/libs/domains/services/feature/src/lib/argocd-service-list/argocd-service-list.spec.tsx @@ -1,4 +1,5 @@ import { type ArgocdAppResponse, type Environment } from 'qovery-typescript-axios' +import type { ForwardedRef, ReactNode } from 'react' import { renderWithProviders, screen } from '@qovery/shared/util-tests' import { ArgoCdServiceList } from './argocd-service-list' @@ -14,6 +15,52 @@ jest.mock('../hooks/use-argocd-services/use-argocd-services', () => ({ useArgoCdServices: (params: unknown) => mockUseArgoCdServices(params), })) +jest.mock('@qovery/shared/ui', () => { + const React = jest.requireActual('react') + const actual = jest.requireActual('@qovery/shared/ui') + + return { + ...actual, + Link: React.forwardRef( + ( + { + children, + as, + color, + iconOnly, + params, + size, + to, + variant, + ...props + }: { + children?: ReactNode + as?: string + color?: string + iconOnly?: boolean + params?: Record + size?: string + to?: string + variant?: string + [key: string]: unknown + }, + ref: ForwardedRef + ) => { + const href = Object.entries(params ?? {}).reduce( + (path, [key, value]) => path.replace(`$${key}`, value), + to ?? '' + ) + + return ( + + {children} + + ) + } + ), + } +}) + const environment = { id: 'env-1', name: 'Environment', @@ -29,17 +76,29 @@ const services = [ { id: 'service-1', name: 'Argo service', - source_repo_url: 'https://github.com/qovery/service', + git_repository: { + provider: 'GITHUB', + owner: 'qovery', + name: 'qovery/service', + url: 'https://github.com/qovery/service', + branch: 'env/refs/merge', + }, + manifest_revision: '313a525a4ad53b37f0b33f81282c52fef5f8e7d8', last_synced_at: '2026-05-05T10:00:00.000Z', }, ] as ArgocdAppResponse[] describe('ArgoCdServiceList', () => { beforeEach(() => { + jest.useFakeTimers() jest.clearAllMocks() mockUseArgoCdServices.mockReturnValue({ data: services }) }) + afterEach(() => { + jest.useRealTimers() + }) + it('should navigate to the service overview when clicking the row', async () => { const { userEvent } = renderWithProviders() @@ -59,8 +118,48 @@ describe('ArgoCdServiceList', () => { it('should not navigate to the service overview when clicking the repository link', async () => { const { userEvent } = renderWithProviders() - await userEvent.click(screen.getByRole('link', { name: /github\.com\/qovery\/service/i })) + await userEvent.click(screen.getByRole('link', { name: /qovery\/service/i })) expect(mockNavigate).not.toHaveBeenCalled() }) + + it('should not navigate to the service overview when clicking the branch link', async () => { + const { userEvent } = renderWithProviders() + + await userEvent.click(screen.getByRole('link', { name: /env\/refs\/merge/i })) + + expect(mockNavigate).not.toHaveBeenCalled() + }) + + it('should render git target version information', () => { + renderWithProviders() + + expect(screen.getByText('Target version')).toBeInTheDocument() + expect(screen.getByRole('link', { name: /qovery\/service/i })).toHaveAttribute( + 'href', + 'https://github.com/qovery/service' + ) + expect(screen.getByRole('link', { name: /env\/refs\/merge/i })).toHaveAttribute( + 'href', + 'https://github.com/qovery/service/tree/env/refs/merge/' + ) + expect(screen.getByRole('button', { name: /313a525/i })).toBeInTheDocument() + }) + + it('should render ArgoCD service actions', async () => { + const { userEvent } = renderWithProviders() + + expect(screen.getByText('Actions')).toBeInTheDocument() + expect(screen.getByRole('link', { name: /service logs for argo service/i })).toHaveAttribute( + 'href', + '/organization/org-1/project/project-1/environment/env-1/service/service-1/service-logs' + ) + + await userEvent.click(screen.getByRole('button', { name: /other actions for argo service/i })) + + expect(screen.getByRole('menuitem', { name: /see manifest/i })).toHaveAttribute( + 'href', + '/organization/org-1/project/project-1/environment/env-1/service/service-1/manifest' + ) + }) }) diff --git a/libs/domains/services/feature/src/lib/argocd-service-list/argocd-service-list.tsx b/libs/domains/services/feature/src/lib/argocd-service-list/argocd-service-list.tsx index 1e3b905553a..4ee925a1bd3 100644 --- a/libs/domains/services/feature/src/lib/argocd-service-list/argocd-service-list.tsx +++ b/libs/domains/services/feature/src/lib/argocd-service-list/argocd-service-list.tsx @@ -1,32 +1,33 @@ import { useNavigate } from '@tanstack/react-router' -import { type ArgocdAppResponse, type Environment } from 'qovery-typescript-axios' +import { type Environment } from 'qovery-typescript-axios' import { type KeyboardEvent, type MouseEvent, useMemo } from 'react' import { IconEnum } from '@qovery/shared/enums' -import { Badge, ExternalLink, Heading, Icon, Section, TablePrimitives, Tooltip } from '@qovery/shared/ui' +import { + Badge, + Button, + CopyToClipboard, + DropdownMenu, + ExternalLink, + Heading, + Icon, + Link, + Section, + TablePrimitives, + Tooltip, +} from '@qovery/shared/ui' import { timeAgo } from '@qovery/shared/util-dates' +import { buildGitProviderUrl } from '@qovery/shared/util-git' import { useArgoCdServices } from '../hooks/use-argocd-services/use-argocd-services' const { Table } = TablePrimitives -const tableGridLayoutClassName = 'grid w-full grid-cols-[minmax(280px,1.7fr)_minmax(220px,1fr)_minmax(280px,1.1fr)]' +const tableGridLayoutClassName = + 'grid w-full grid-cols-[minmax(280px,1.7fr)_minmax(220px,1fr)_minmax(280px,1.1fr)_minmax(112px,112px)]' export interface ArgoCdServiceListProps { environment: Environment } -const getRepositoryLabel = (service: ArgocdAppResponse) => { - if (!service.source_repo_url) { - return null - } - - try { - const url = new URL(service.source_repo_url) - return `${url.hostname}${url.pathname}` - } catch { - return service.source_repo_url - } -} - export function ArgoCdServiceList({ environment }: ArgoCdServiceListProps) { const navigate = useNavigate() const environmentId = environment.id @@ -86,15 +87,19 @@ export function ArgoCdServiceList({ environment }: ArgoCdServiceListProps) { Last operation - + Target version + + Actions + {services.map((service) => { - const repositoryLabel = getRepositoryLabel(service) + const gitRepository = service.git_repository + const manifestRevision = service.manifest_revision return ( - +
- {repositoryLabel ? ( + {gitRepository ? (
+ + + + {gitRepository.name} + + +
+ ) : null} + {gitRepository?.branch && gitRepository.url ? ( +
- - {repositoryLabel} + + {gitRepository.branch}
) : null}
+ {manifestRevision ? ( + + + + ) : null} +
+ + +
+ + + + + + + + + + + + } asChild> + + See manifest + + + + +
) diff --git a/libs/domains/services/feature/src/lib/service-overview/service-header/service-header.spec.tsx b/libs/domains/services/feature/src/lib/service-overview/service-header/service-header.spec.tsx index 481db2fafec..21cdda39ea3 100644 --- a/libs/domains/services/feature/src/lib/service-overview/service-header/service-header.spec.tsx +++ b/libs/domains/services/feature/src/lib/service-overview/service-header/service-header.spec.tsx @@ -59,8 +59,13 @@ const services = { name: 'kube-dns-prod', description: '', icon_uri: 'app://qovery-console/argocd', - source_repo_url: 'https://github.com/Qovery/kube-dns.git', - source_target_revision: 'main', + git_repository: { + provider: 'GITHUB', + owner: 'Qovery', + url: 'https://github.com/Qovery/kube-dns.git', + name: 'Qovery/kube-dns', + branch: 'main', + }, }, } diff --git a/package.json b/package.json index f53ad666a68..58da4134334 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "mermaid": "11.6.0", "monaco-editor": "0.53.0", "posthog-js": "1.345.1", - "qovery-typescript-axios": "1.1.889", + "qovery-typescript-axios": "1.1.890", "react": "18.3.1", "react-country-flag": "3.0.2", "react-datepicker": "4.12.0", diff --git a/yarn.lock b/yarn.lock index a93e00edf0b..e9210bb09db 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6369,7 +6369,7 @@ __metadata: prettier: 3.2.5 prettier-plugin-tailwindcss: 0.5.14 pretty-quick: 4.0.0 - qovery-typescript-axios: 1.1.889 + qovery-typescript-axios: 1.1.890 qovery-ws-typescript-axios: 0.1.586 react: 18.3.1 react-country-flag: 3.0.2 @@ -26327,12 +26327,12 @@ __metadata: languageName: node linkType: hard -"qovery-typescript-axios@npm:1.1.889": - version: 1.1.889 - resolution: "qovery-typescript-axios@npm:1.1.889" +"qovery-typescript-axios@npm:1.1.890": + version: 1.1.890 + resolution: "qovery-typescript-axios@npm:1.1.890" dependencies: axios: 1.15.2 - checksum: 4feb2907a88f82ed65c822bb223a5baa3ac8e9b4164c6ab7a11d1efe8acbc69681770a09aaa0c34eb5ea353bcc27e6c1b04b067e3070272d10c1bd41d294183b + checksum: d8cda480b364b6261bc24162627f8bcc7ed1a5230aea9f9a322d0c2bd0fcf829e9337f417111a1e215fe4ce8e9669e1bf7a266e9cc4b84f6da5d08c21cec068a languageName: node linkType: hard From 2ea2410ccdf3e2636e4bf5cc33d7e95757f4a99d Mon Sep 17 00:00:00 2001 From: RemiBonnet Date: Tue, 26 May 2026 13:32:04 +0200 Subject: [PATCH 2/3] fix(argocd): refactor unlinking logic - Updated qovery-typescript-axios to version 1.1.891 in package.json and yarn.lock. - Refactored unlinkArgoCdDestinationClusterMapping function to accept agentClusterId and argocdClusterUrl directly. - Updated related tests to reflect changes in the unlinking logic. --- .../lib/domains-organizations-data-access.ts | 14 +++++---- .../settings-argocd-integration.spec.tsx | 7 ++--- .../settings-argocd-integration.tsx | 31 +++++++++---------- package.json | 2 +- yarn.lock | 10 +++--- 5 files changed, 31 insertions(+), 33 deletions(-) diff --git a/libs/domains/organizations/data-access/src/lib/domains-organizations-data-access.ts b/libs/domains/organizations/data-access/src/lib/domains-organizations-data-access.ts index 73724b90338..8af6f5aee41 100644 --- a/libs/domains/organizations/data-access/src/lib/domains-organizations-data-access.ts +++ b/libs/domains/organizations/data-access/src/lib/domains-organizations-data-access.ts @@ -436,16 +436,18 @@ export const mutations = { }, async unlinkArgoCdDestinationClusterMapping({ organizationId, - argoCdDestinationClusterMappingRequest, + agentClusterId, + argocdClusterUrl, }: { organizationId: string - argoCdDestinationClusterMappingRequest: Omit & { - cluster_id: null - } + agentClusterId: string + argocdClusterUrl: string }) { - const response = await argoCdApi.saveArgoCdDestinationClusterMapping( + const response = await argoCdApi.deleteArgoCdDestinationClusterMapping( organizationId, - argoCdDestinationClusterMappingRequest as unknown as ArgoCdDestinationClusterMappingRequest + agentClusterId, + argocdClusterUrl, + { headers: { 'Content-Type': 'application/json' } } ) return response.data }, diff --git a/libs/domains/organizations/feature/src/lib/settings-argocd-integration/settings-argocd-integration.spec.tsx b/libs/domains/organizations/feature/src/lib/settings-argocd-integration/settings-argocd-integration.spec.tsx index 6eb3ea4deb6..b6d94d71515 100644 --- a/libs/domains/organizations/feature/src/lib/settings-argocd-integration/settings-argocd-integration.spec.tsx +++ b/libs/domains/organizations/feature/src/lib/settings-argocd-integration/settings-argocd-integration.spec.tsx @@ -145,11 +145,8 @@ describe('SettingsArgoCdIntegration', () => { expect(mockUnlinkArgoCdDestinationClusterMapping).toHaveBeenCalledWith({ organizationId: 'org-1', - argoCdDestinationClusterMappingRequest: { - agent_cluster_id: 'cluster-1', - argocd_cluster_url: 'https://kubernetes.default.svc', - cluster_id: null, - }, + agentClusterId: 'cluster-1', + argocdClusterUrl: 'https://kubernetes.default.svc', }) }) diff --git a/libs/domains/organizations/feature/src/lib/settings-argocd-integration/settings-argocd-integration.tsx b/libs/domains/organizations/feature/src/lib/settings-argocd-integration/settings-argocd-integration.tsx index 2044a2a0b01..2c42272ec67 100644 --- a/libs/domains/organizations/feature/src/lib/settings-argocd-integration/settings-argocd-integration.tsx +++ b/libs/domains/organizations/feature/src/lib/settings-argocd-integration/settings-argocd-integration.tsx @@ -9,7 +9,7 @@ import { import { type ReactNode, Suspense, useEffect, useMemo, useState } from 'react' import { useDeleteArgoCdCredentials } from '@qovery/domains/clusters/feature' import { SettingsHeading } from '@qovery/shared/console-shared' -import { Badge, Button, EmptyState, Icon, Link, ModalConfirmation, Section, useModal } from '@qovery/shared/ui' +import { Badge, Button, EmptyState, Icon, Link, ModalConfirmation, Section, Tooltip, useModal } from '@qovery/shared/ui' import { timeAgo } from '@qovery/shared/util-dates' import { useDocumentTitle } from '@qovery/shared/util-hooks' import { useOrganizationArgoCdIntegrations } from '../hooks/use-organization-argocd-integrations/use-organization-argocd-integrations' @@ -224,16 +224,18 @@ function ArgoCdIntegrationCard({
- + + + ))} @@ -445,11 +447,8 @@ function SettingsArgoCdIntegrationContent() { await unlinkArgoCdDestinationClusterMapping({ organizationId, - argoCdDestinationClusterMappingRequest: { - agent_cluster_id: integration.agent_cluster_id, - argocd_cluster_url: cluster.argocd_cluster_url, - cluster_id: null, - }, + agentClusterId: integration.agent_cluster_id, + argocdClusterUrl: cluster.argocd_cluster_url, }) } diff --git a/package.json b/package.json index 58da4134334..e00f5ef069a 100644 --- a/package.json +++ b/package.json @@ -75,7 +75,7 @@ "mermaid": "11.6.0", "monaco-editor": "0.53.0", "posthog-js": "1.345.1", - "qovery-typescript-axios": "1.1.890", + "qovery-typescript-axios": "1.1.891", "react": "18.3.1", "react-country-flag": "3.0.2", "react-datepicker": "4.12.0", diff --git a/yarn.lock b/yarn.lock index e9210bb09db..1fcdd2d0273 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6369,7 +6369,7 @@ __metadata: prettier: 3.2.5 prettier-plugin-tailwindcss: 0.5.14 pretty-quick: 4.0.0 - qovery-typescript-axios: 1.1.890 + qovery-typescript-axios: 1.1.891 qovery-ws-typescript-axios: 0.1.586 react: 18.3.1 react-country-flag: 3.0.2 @@ -26327,12 +26327,12 @@ __metadata: languageName: node linkType: hard -"qovery-typescript-axios@npm:1.1.890": - version: 1.1.890 - resolution: "qovery-typescript-axios@npm:1.1.890" +"qovery-typescript-axios@npm:1.1.891": + version: 1.1.891 + resolution: "qovery-typescript-axios@npm:1.1.891" dependencies: axios: 1.15.2 - checksum: d8cda480b364b6261bc24162627f8bcc7ed1a5230aea9f9a322d0c2bd0fcf829e9337f417111a1e215fe4ce8e9669e1bf7a266e9cc4b84f6da5d08c21cec068a + checksum: 6903edb42bb9a4146123e26e8fd0d36a0375c44d0479eb758ccf26a3531013def7a390f9c07a705d3203e64b06e18fb967eeaa314cad0803f7719fcbb97dd49f languageName: node linkType: hard From 81c9b5797acc047c3e6f616430bd38dbdabd0ef9 Mon Sep 17 00:00:00 2001 From: RemiBonnet Date: Tue, 26 May 2026 13:32:05 +0200 Subject: [PATCH 3/3] refactor(argocd): simplify conditional rendering in ArgoCdServiceList --- .../src/lib/argocd-service-list/argocd-service-list.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/domains/services/feature/src/lib/argocd-service-list/argocd-service-list.tsx b/libs/domains/services/feature/src/lib/argocd-service-list/argocd-service-list.tsx index 4ee925a1bd3..7f7a1f899e3 100644 --- a/libs/domains/services/feature/src/lib/argocd-service-list/argocd-service-list.tsx +++ b/libs/domains/services/feature/src/lib/argocd-service-list/argocd-service-list.tsx @@ -138,7 +138,7 @@ export function ArgoCdServiceList({ environment }: ArgoCdServiceListProps) {
- {gitRepository ? ( + {gitRepository && (
- ) : null} + )} {gitRepository?.branch && gitRepository.url ? (
@@ -177,7 +177,7 @@ export function ArgoCdServiceList({ environment }: ArgoCdServiceListProps) {
) : null}
- {manifestRevision ? ( + {manifestRevision && (